ca.uhn.hl7v2.llp
Class LowerLayerProtocol

java.lang.Object
  extended by ca.uhn.hl7v2.llp.LowerLayerProtocol
Direct Known Subclasses:
MinLowerLayerProtocol

public abstract class LowerLayerProtocol
extends java.lang.Object

Represents a particular "lower layer protocol" over which HL7 messages can be sent. An example is the "minimal lower layer protocol" defines in the HL7 implementation guide (appendix C) - this is implemented by the class MinLowerLayerProtocol. Implementations should call the static method logCharacterReceived() when a character is read from a remote system. This method may or may not log receipt, as configured (see docs for this method).

Author:
Bryan Tripp

Constructor Summary
protected LowerLayerProtocol()
          Creates a new LowerLayerProtocol.
 
Method Summary
abstract  HL7Reader getReader(java.io.InputStream in)
          Returns an HL7Reader that implements message reading according to this protocol.
abstract  HL7Writer getWriter(java.io.OutputStream out)
          Returns an HL7Writer that implements message writing according to this protocol.
static void logCharacterReceived(int c)
          Logs the fact that a character has been received, if configured to do so.
static LowerLayerProtocol makeLLP()
          Returns a particular implementation of LowerLayerProtocol.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

LowerLayerProtocol

protected LowerLayerProtocol()
Creates a new LowerLayerProtocol.

Method Detail

makeLLP

public static LowerLayerProtocol makeLLP()
Returns a particular implementation of LowerLayerProtocol. Currently MinLowerLayerProtocol is the default and there are no other options ... the idea is that this will eventually be configurable.


getReader

public abstract HL7Reader getReader(java.io.InputStream in)
                             throws LLPException
Returns an HL7Reader that implements message reading according to this protocol.

Throws:
LLPException

getWriter

public abstract HL7Writer getWriter(java.io.OutputStream out)
                             throws LLPException
Returns an HL7Writer that implements message writing according to this protocol.

Throws:
LLPException

logCharacterReceived

public static void logCharacterReceived(int c)
Logs the fact that a character has been received, if configured to do so. This is a debuging feature. This is enabled by setting the system property ca.uhn.hl7v2.llp.logBytesRead=TRUE (before LowerLayerProtocol is instantiated). A message is written to standard out for each character. THIS IS VERY SLOW and should normally be turned off.



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