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

import java.io.IOException;

import javax.xml.stream.XMLStreamException;

import cdac.medinfo.sdk.hl7282.baselibs.segments.FHS;
import cdac.medinfo.sdk.hl7282.baselibs.segments.FTS;
import cdac.medinfo.sdk.hl7282.commoninterface.IHL7Stream;
import cdac.medinfo.sdk.hl7282.commoninterface.ISingleCollection;
import cdac.medinfo.sdk.hl7282.exceptions.BatchException;



/**
 * The IHL7BatchFile interface should be implemented by HL7 Batch file class.
 */
public interface IHL7BatchFile
{
	/**
	 * Gets the batch file header.
	 * @return the batch file header
	 */
	public FHS getBatchFileHeader(); 
	

	/**
	 * Sets the batch file header.
	 * @param objBatchFileHeader the new batch file header
	 */
	public void setBatchFileHeader(FHS objBatchFileHeader) ;
	

	/**
	 * Gets the batch file trailer.
	 * @return the batch file trailer
	 */
	public FTS getBatchFileTrailer() ;
	

	/**
	 * Sets the batch file trailer.
	 * @param objBatchFileTrailer the new batch file trailer
	 */
	public void setBatchFileTrailer(FTS objBatchFileTrailer) ;

	/**
	 * Gets the HL7Batch collection.
	 * @return the HL7Batch collection
	 */
	public ISingleCollection<IHL7Batch> getHL7BatchCollection() ;

	/**
	 * Sets the HL7Batch collection.
	 * @param objHL7BatchCollection the new HL7Batch collection
	 */
	public void setHL7BatchCollection(ISingleCollection<IHL7Batch> objHL7BatchCollection);
	
	/**
	 * Validates HL7 Batch objects.
	 * @return true - if successful
	 * 		   false - otherwise
	 * @throws BatchException Thrown when Batch validation fails.
	 */
	public boolean validate()throws BatchException ;// should throw InvalidBatchException Actually
	
	/**
	 * Serializes Batch File Information in the form of XML.
	 * @return String - Returns Batch File in XML format 
	 * @throws IOException
	 * @throws XMLStreamException
	 */
	public String writeBatchFileToXML_v2() throws IOException, XMLStreamException;
	
	/**
	 * Serializes Batch File Information in the form of XML.
	 * @param strFilePath Destination file path
	 * @throws IOException
	 * @throws XMLStreamException
	 */
	public void writeBatchFileToXML_v2(String strFilePath) throws IOException, XMLStreamException;


}
