package com.eactive.eai.adapter.socket2.protocol.admin;

import com.eactive.eai.adapter.EAIException;
import com.eactive.eai.adapter.socket2.config.SocketAdapterContext;
import com.eactive.eai.adapter.socket2.protocol.TcpAdapterServer;
import com.eactive.eai.adapter.socket2.protocol.fixedheader.codec.FixedHeaderCodecFactory;
import org.apache.mina.filter.codec.ProtocolCodecFilter;


public class AdminServer extends TcpAdapterServer {
	public AdminServer(SocketAdapterContext context) throws Exception {
		super(context);
		
		context.setLlFieldType("BIN");
		context.setLlFieldOffset(0);
		context.setLlFieldLength(2);
		context.setLlFieldInclude("N");
		context.setLlInclude("N");
		
		this.handler = new AdminHandler(this);
		config.getFilterChain().addFirst("codec", new ProtocolCodecFilter(new FixedHeaderCodecFactory(this)));
	}

	public Object sendMessage(Object message) throws EAIException {
		throw new EAIException("[Admin Server] not supported function");
	}
}
