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

import com.eactive.eai.adapter.socket2.config.SocketAdapterContext;
import com.eactive.eai.adapter.socket2.protocol.TcpAdapterClient;
import com.eactive.eai.adapter.socket2.protocol.cert.codec.CertCodecFactory;
import com.eactive.eai.adapter.socket2.protocol.cert.handshake.CertClientFilter;
import org.apache.mina.filter.codec.ProtocolCodecFilter;


public class CertClient extends TcpAdapterClient {

	public CertClient(SocketAdapterContext context) throws Exception {
		super(context);
		this.handler = new CertHandler(this);		

		config.getFilterChain().addFirst("codec", new ProtocolCodecFilter(new CertCodecFactory(this)));
		config.getFilterChain().addAfter("codec", "cert", new CertClientFilter(this));
	}
}
