package cdac.medinfo.sdk.hl7282.hl7net.upperlayer;

import cdac.medinfo.sdk.hl7282.commoninterface.ISegmentSet;


/**
 * IProcessHandler provides user with methods like OnMessageReceive,OnConnect
 * these methods should be implemented by user to perform required Operations on received messages.
 */
public interface IProcessHandler 
{
	/**
	 * Invoked when Message is received from remote system.
	 * @param objClientSession - object of ClientSession 
	 */
	public void OnMessageReceive(ClientSession objClientSession);
	
	
	/**
	 * Invoked when BatchFile is received from remote system.
	 * @param objClientSession - object of ClientSession
	 */
	public void OnBatchFileReceive(ClientSession objClientSession);
	
	
	/**
	 * Invoked when Client is connected.
	 * @param objClientSession - session of remote end
	 */
	public void OnConnect(ClientSession objClientSession);
	
	/**
	 * Invoked when SDK is not able to parse received message.
	 * @param objClientSession - object of ClientSession
	 */
	public void OnErrorReceive(ClientSession objClientSession);
	
	
	/**
	 * Invoked when exception is raised.
	 * @param ex Exception raised
	 * @param buffer data containing error
	 * 
	 */
	public void onException(Exception ex,byte[] buffer);
	
	/**
	 * Invoked when exception is raised.
	 * @param ex Exception raised
	 * @param ISegmentSet - object of ISegment
	 */
	public void onException(Exception ex,ISegmentSet objISegmentSet);
	
	/**
	 * Closes the Connection.
	 * @param objClientSession object of Client Session.
	 */
	public void onClose(ClientSession objClientSession);
	
}
