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

import java.io.IOException;

import cdac.medinfo.sdk.hl7282.baselibs.messages.LocalExtensionAgent;

/**
 * The IBufferReceiver interface should be implemented by any class 
 * whose instances are intended to get notified when Data is received from remote end. 
 * The class must define the overloaded onMessageBufferReceived methods for Message Stream,Batch and BatchFile.  
 */
public interface IBufferReceiver 
{
	/**
	 * Gets automatically invoked when Message is received from remote system.
	 * @param buffer message stream received in form of byte array
	 * @return boolean - status indicating reception of Message buffer from remote end.
	 * @throws IOException  Signals that an IO Exception has occurred.  
	 */
	boolean onMessageBufferReceived(byte arrByte[]) throws IOException;
	
	/**
	 * Sets LocalExtensionAgent to process locally extended segments
	 * @param objAgent instance of LocalExtensionAgent
	 */
	void setLocalExtensionAgent(LocalExtensionAgent objAgent);

	/**
	 * Retrieves instance of LocalExtensionAgent.
	 * @return LocalExtensionAgent - instance of LocalExtensionAgent
	 */
	LocalExtensionAgent getLocalExtensionAgent();
}
