package com.eactive.eai.adapter.socket2.protocol.xecure.welcome.codec;

import com.eactive.eai.adapter.socket2.protocol.ISocketAdapter;
import org.apache.mina.filter.codec.ProtocolCodecFactory;
import org.apache.mina.filter.codec.ProtocolDecoder;
import org.apache.mina.filter.codec.ProtocolEncoder;

public class XecureWelcomeCodecFactory implements ProtocolCodecFactory {
	private ProtocolEncoder encoder;
	private ProtocolDecoder decoder;
	private ISocketAdapter adapter;

	
	public XecureWelcomeCodecFactory(ISocketAdapter adapter) {
		encoder = new XecureWelcomeEncoder(adapter);
		decoder = new XecureWelcomeDecoder(adapter);
		this.adapter = adapter;
		if(this.adapter != null) {
			this.adapter.getUptime();
		}
	}

	public ProtocolDecoder getDecoder() throws Exception {
		return decoder;
	}

	public ProtocolEncoder getEncoder() throws Exception {
		return encoder;
	}
}
