001/*
002 * Created on 16-Apr-2004
003 */
004package ca.uhn.hl7v2.protocol;
005
006import java.util.List;
007
008/**
009 * The operational context of a <code>Processor</code>.  This defines 
010 * certain resources that are not part of the <code>Processor</code>, 
011 * but are needed in order to implement it, and may vary between  
012 * deployments.  
013 * 
014 * @author <a href="mailto:bryan.tripp@uhn.on.ca">Bryan Tripp</a>
015 * @version $Revision: 1.1 $ updated on $Date: 2007-02-19 02:24:38 $ by $Author: jamesagnew $
016 */
017public interface ProcessorContext {
018
019    /**
020     * @return the router that directs unsolicited inbound messages to 
021     *      the appropriate <code>Application</code>  
022     */
023    public ApplicationRouter getRouter();
024
025    /**
026     * @return the object responsible for transport of remotely initiated message 
027     *      exchanges (normally with a remote server)
028     */    
029    public TransportLayer getRemotelyDrivenTransportLayer();
030    
031    
032    /**
033     * @return the object responsible for transport of locally initiated message 
034     *      exchanges (normally with a remote server)
035     */    
036    public TransportLayer getLocallyDrivenTransportLayer();
037
038    /**
039     * @return the validators that determine whether a message can be 
040     *      accepted for routing to the appropriate application 
041     */    
042    public AcceptValidator[] getValidators();
043    
044    /**
045     * Adds a new validator to the list of those returned by 
046     * <code>getValidators()</code>.  
047     *  
048     * @param theValidator the validator to add 
049     */
050    public void addValidator(AcceptValidator theValidator);    
051    
052    /**
053     * @return a store for messages while they are being routed to the 
054     *      appropriate application 
055     */
056    public SafeStorage getSafeStorage();
057    
058    /**
059     * Returns the list of fields that are to be included as metadata whenever a <code>Message</code>
060     * is converted to a <code>Transportable</code>.  Each field is a String <code>Terser</code>
061     * path.  
062     *  
063     * @param theMetadataFields list of <code>Terser</code> paths of metadata fields 
064     */
065    public List<String> getMetadataFields();
066    
067}