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

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


/**
 * IServerQueryCancellation is the interface for Sending Responses and Receiving Queries.
 * The class that is interested in Sending Responses and Receiving Queries implements this interface,
 * This interface tells about the canceled responses and query id for which 
 * no action is performed(i.e Unprocessed Queries).  
 */
public interface IServerQueryCancellation 
{
	/**
	 * Keeps track for the Responses which are Send by Server.
	 * @param objSegmentSet Object of Segment Set which send by Server.
	 * @return this will return true in case of Response is canceled or Invalid Response.
	 */
	public boolean processSend(ISegmentSet objSegmentSet);
	
	/**
	 * Keep track for the Queries which are received by server.
	 * @param objSegmentSet Object of Segment Set received by server.
	 * @return true if received query is valid QCN_J01.
	 * else canceled query is received one more time.
	 */
	public boolean processReceive(ISegmentSet objSegmentSet);
	
	/**
	 * Get all the canceled responses for which user will not generate response for it.
	 * @return ISingleCollection<String> collection of Query id.
	 */
	public ISingleCollection<String> getCancelledResponses();
}
