/*******************************************************************************
 *  Copyright 2017-2018 Centre for Development of Advanced Computing(C-DAC), Pune
 *  
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *  
 *   http://www.apache.org/licenses/LICENSE-2.0
 *  
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 *******************************************************************************/
package cdac.medinfo.sdk.dcm30_04.services.dimsecommons;

import java.io.IOException;

import cdac.medinfo.sdk.dcm30_04.services.association.IDIMSEAssociation;

// TODO: Auto-generated Javadoc
/**
 * The Interface IMessageListenser needs to be implemented by all classes which provides final processing of DIMSE Responses.
 */
public interface IMessageListener 
{
	
	/**
	 * Process the message when a ServiceMessage Arrival event is triggered.
	 * 
	 * @param objResponseEvent instance of ServiceMessageEvent
	 * 
	 * @throws IOException Signals that an I/O exception has occurred.
	 */
	public void receiveMessage(ServiceMessageEvent objResponseEvent) throws IOException;

	/**
	 * Sends the DicomMessage.
	 * 
	 * @param objDicomMessge instance of DicomMessage
	 * 
	 * @return boolean - shows status True if successfully sent else False.
	 * 
	 * @throws IOException Signals that an I/O exception has occurred.
	 */
	public boolean sendMessage(DicomMessage objDicomMessge) throws IOException;

	/**
	 * Sets the Association Status.
	 * 
	 * @param status boolean value show Association Status.
	 */
	void setAssociationStatus(boolean status);

	/**
	 * Sets last received DimseAssociation which also specifies current status of association.
	 * 
	 * @param objIDIMSEAssociation instance of IDIMSEAssociation
	 */
	void setDIMSEAssociation(IDIMSEAssociation objIDIMSEAssociation);
}
