/*******************************************************************************
 *  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 cdac.medinfo.sdk.dcm30_04.commoninterface.IDataSet;
import cdac.medinfo.sdk.dcm30_04.services.dicomnetcommons.SourceException;
import cdac.medinfo.sdk.dcm30_04.utils.ISingleCollection;

/**
 * The interface IDataSource needs to be implemented by all the classes which works as a Source of Data.
 * The implementor should provide mechanism to find and retrieve the Data.     
 */
public interface IDataSource 
{
	/**
	 * Depending on the keys in the IDataSet it finds the matching DataSets and returns status.
	 * According to the matched DataSets populate the collection taken as out parameter.
	 * @param objDicomMessage instance of DicomMessage
	 * @param objRstDataCollection collection of Resultant DataSet
	 * @return short - shows status value which will be used in generation of response
	 * 					Refer EnumImplOpsStatus for supported response status values.
	 */
	short find(DicomMessage objDicomMessage, ISingleCollection<IDataSet> objRstDataCollection) throws SourceException;;
	
	/**
	 * Depending on the keys in the DCMQuery model it finds the matching DataSets and returns status.
	 * According to the matched sets populates the collection of DCMResultSet taken as out parameter.
	 * @param objRstQueryModel the resultant query model containing the matched attributes.
	 * @param objQueryModel the object query model
	 * @return short - shows status value which will be used in generation of response
	 * 					Refer EnumImplOpsStatus for supported response status values.
	 * false - if no matches are found.
	 */
	short find(IQueryModel objQueryModel, IQueryModel objRstQueryModel);


	/**
	 * Depending on the keys in the IDataSet it finds the matching DataSets.
	 * According to the matched DataSets populate the collection taken as out parameter.
	 * @param objIDataSet
	 * @param objRstDataCollection
	 * @return short - shows status value which will be used in generation of response
	 * 					Refer EnumImplOpsStatus for supported response status values.
	 */
	short retrieve(DicomMessage objDicomMessage, ISingleCollection<IDataSet> objRstDataCollection) throws SourceException;
	
	/**
	 * Depending on the keys in the DCMQuery model it finds the matching DataSets and returns status.
	 * According to the matched sets populates the resultant Query Model taken as out parameter.
	 * @param objRstQueryModel the resultant query model containing the matched attributes.
	 * @param objQueryModel the object of query model
	 * @return short - shows status value which will be used in generation of response
	 * 					Refer EnumImplOpsStatus for supported response status values.
	 * false - if no matches are found.
	 */
	short retrieve(IQueryModel objQueryModel, IQueryModel objRstQueryModel);
}
