View Javadoc
1   /*
2    * Created on 16-Apr-2004
3    */
4   package ca.uhn.hl7v2.protocol;
5   
6   import ca.uhn.hl7v2.HL7Exception;
7   
8   /**
9    * Represents a persistent store for incoming messages.  Messages 
10   * may be stored here before an accept ACK is returned.  The local
11   * side of the interface then takes on responsibility for delivering 
12   * the message to the application.  
13   * 
14   * @author <a href="mailto:bryan.tripp@uhn.on.ca">Bryan Tripp</a>
15   * @version $Revision: 1.1 $ updated on $Date: 2007-02-19 02:24:38 $ by $Author: jamesagnew $
16   */
17  public interface SafeStorage {
18  
19      /**
20       * Stores a message so that it can be reliably retrieved and sent to 
21       * the proper application, even if this service is restarted in the mean
22       * time.
23       *  
24       * @param theMessage the message to store 
25       * @throws HL7Exception if there is some problem accessing the store
26       */
27      void store(Transportable theMessage) throws HL7Exception;
28      
29      /**
30       * If the given message exists in the store, it is removed.
31       *   
32       * @param theMessage the message to discard
33       */
34      void discard(Transportable theMessage);
35      
36      /**
37       * Returns all messages that have been stored.  The store retains a copy 
38       * of each one until discard() is called.  This method would be called 
39       * after the HL7 server is restarted.
40       *      
41       * @return all messages in the store
42       */
43      Transportable[] restore();
44      
45  }