package com.eactive.eai.adapter.listener;

import java.util.concurrent.ConcurrentHashMap;

public class ListenerUtil {
	private static ConcurrentHashMap<String, String> listenerMap = new ConcurrentHashMap<>();
	static {
		listenerMap.put("HTC-I", "com.eactive.eai.adapter.http.dynamic.HttpAdapterListener");
		listenerMap.put("HTT-O", "com.eactive.eai.adapter.http.client.HttpClientAdapterListener");
		listenerMap.put("RST-O", "com.eactive.eai.adapter.http.client.HttpClientAdapterListener");
		listenerMap.put("NET-I", "com.eactive.eai.adapter.socket2.SocketAdapterListener");
		listenerMap.put("NET-O", "com.eactive.eai.adapter.socket2.SocketAdapterListener");
		listenerMap.put("WBT-I", "com.eactive.eai.adapter.webt.WebTAsyncServerAdapterListener");
		listenerMap.put("WBT-O", "com.eactive.eai.adapter.webt.WebTClientAdapterListener");
		listenerMap.put("AMQ-I", "com.eactive.eai.adapter.amq.AMQAdapterListener");
		listenerMap.put("AMQ-O", "com.eactive.eai.adapter.amq.AMQAdapterListener");
		listenerMap.put("DBQ-I", "com.eactive.eai.adapter.db.sql.DBInboudSqlAdapterListener");
		listenerMap.put("WSK-I", "com.eactive.eai.adapter.websocket.WebSocketAdapterListener");
	}

	private ListenerUtil() {
		super();
	}

	public static String getDefaultListenerClass(String adapterType, String ioType) {
		String listenerClass = null;
		String key = adapterType + "-" + ioType;
		listenerClass = listenerMap.get(key);
		return listenerClass;
	}
}
