ca.uhn.hl7v2.protocol
Interface TransportLayer

All Known Implementing Classes:
AbstractJMSTransport, AbstractTransport, JMSQueueTransport, JMSTopicTransport, JMSTransport, MLLPTransport, URLTransport

public interface TransportLayer

Encapsulates the transport layer of a connection to another HL7 server. This is the layer responsible for sending and receiving message strings. The underlying protocol used is implementation dependent, that is there may be transport layers that are implemented over email, or JMS, or HTTP.

Version:
$Revision: 1.1 $ updated on $Date: 2007/02/19 02:24:38 $ by $Author: jamesagnew $
Author:
Bryan Tripp

Method Summary
 void connect()
          Initializes a connection to the remote server.
 void disconnect()
          Drops any existing connection to the remote server.
 java.util.Map getCommonMetadata()
           
 boolean isConnected()
           
 Transportable receive()
          Gets the next message from the remote system.
 void send(Transportable theMessage)
          Sends a message to a remote HL7 service.
 

Method Detail

send

void send(Transportable theMessage)
          throws TransportException
Sends a message to a remote HL7 service.

Parameters:
theMessage - the message to send
Throws:
TransportException

receive

Transportable receive()
                      throws TransportException
Gets the next message from the remote system. This call blocks until the next message is available.

Returns:
the next available message
Throws:
TransportException

getCommonMetadata

java.util.Map getCommonMetadata()
Returns:
metadata to be added to the metadata of all incoming messages. This provides a way of associating connection information with incoming messages (eg the IP address of the remote server).

connect

void connect()
             throws TransportException
Initializes a connection to the remote server. This can be called after an exception is encountered, to refresh a dead connection.

Throws:
TransportException

isConnected

boolean isConnected()
Returns:
true if connect() has completed successfully. Note that true may be returned even if a connection is dead (ie the implementation need not test a connection during this call) but should return false if connect() has not been called, or if connect() has been called and is pending.

disconnect

void disconnect()
                throws TransportException
Drops any existing connection to the remote server.

Throws:
TransportException


Copyright © 2001-2011 University Health Network. All Rights Reserved.