com.merge.HL7
Class HL7SocketConfiguration

java.lang.Object
  extended by com.merge.HL7.HL7SocketConfiguration
Direct Known Subclasses:
HL7ReceiverConfiguration, HL7TransmitterConfiguration

public class HL7SocketConfiguration
extends java.lang.Object

The HL7SocketConfiguration class contains communication configuration for HL7 message receivers and transmitters.

The fields of this class are initialized either from a configuration file, from a Properties object, from values directly passed to one of the constructors or from the toolkit properties.

The following properties are recognized:

See Also:
HL7Receiver

Field Summary
 int autoSenseInterval
          Specifies the time interval, in milliseconds, to wait for the Receive End Sequence marker when receiving messages.
 boolean autoSenseReceiveEndSequence
          This field indicates whether the toolkit will detect a different Receive End Sequence value by waiting for autoSenseInterval milliseconds for the specified Receive End Sequence.
 java.lang.String characterEncoding
          The Java character set to use for encoding messages sent and decoding messages received.
 HL7Formatter formatter
          An HL7Formatter instance used to format received and sent raw data.
 java.lang.String hostName
          The Socket's host name.
 int portNumber
          The socket port number.
 java.lang.String receiveEndSequence
          Specifies the Receive End Sequence, the sequence of bytes that mark the end of an HL7 data unit when receiving.
 int receiveTimeout
          The socket's receive inactivity timeout in seconds.
 int sendPacingInterval
          Specifies the minimum amount of time in milliseconds between two sent messages on the same connection.
 int sendTimeout
          The socket's send inactivity timeout specified in seconds.
 java.lang.String transmitEndSequence
          Specifies the Transmit End Sequence, the sequence of bytes that mark the end of an HL7 transmission.
 java.lang.String transmitStartSequence
          Specifies the Transmit Start Sequence, the sequence of bytes that mark the beginning of an HL7 transmission.
 
Constructor Summary
HL7SocketConfiguration()
          Initializes a new HL7 socket configuration object using values from the toolkit properties.
HL7SocketConfiguration(java.util.Properties props)
          Initializes a new HL7 socket configuration object using values read from a Properties object.
HL7SocketConfiguration(java.lang.String configFile)
          Initializes a new HL7 socket configuration object using values read from a configuration file.
HL7SocketConfiguration(java.lang.String hostName, int port)
          Initializes a new HL7 socket configuration object using the specified host name and port number.
 
Method Summary
 java.lang.String toString()
          Provides the description of the fields in this socket configuration object.
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

hostName

public final java.lang.String hostName
The Socket's host name. The default host name is "localhost".


portNumber

public final int portNumber
The socket port number. The default port number is 2301.


sendTimeout

public final int sendTimeout
The socket's send inactivity timeout specified in seconds. The default timeout is 10 seconds.


receiveTimeout

public final int receiveTimeout
The socket's receive inactivity timeout in seconds. The default inactivity timeout is 60 seconds.


transmitStartSequence

public final java.lang.String transmitStartSequence
Specifies the Transmit Start Sequence, the sequence of bytes that mark the beginning of an HL7 transmission. The format of this field is "b1b2...bn", where b1, b2 ... bn are the two digit hexadecimal representation of the each byte value in the sequence, e.g. "0B0D1C". The default Transmit Start sequence is "0B".


transmitEndSequence

public final java.lang.String transmitEndSequence
Specifies the Transmit End Sequence, the sequence of bytes that mark the end of an HL7 transmission. The format of this field is "b1b2...bn", where b1, b2 ... bn are the two digit hexadecimal representation of the each byte value in the sequence, e.g. "0B0D1C". The default Transmit End sequence is "1C0D".


receiveEndSequence

public final java.lang.String receiveEndSequence
Specifies the Receive End Sequence, the sequence of bytes that mark the end of an HL7 data unit when receiving. The format of this field is "b1b2...bn", where b1, b2 ... bn are the two digit hexadecimal representation of the each byte value in the sequence, e.g. "0B0D1C". The default Receive End Sequence is "1C0D".


autoSenseInterval

public final int autoSenseInterval
Specifies the time interval, in milliseconds, to wait for the Receive End Sequence marker when receiving messages. If this interval expires and the autoSenseReceiveEndSequence field is true the toolkit will consider the received message complete.

The receive timeout interval must be greater than the auto sense interval.

The default auto sense interval is 2000 (2 seconds).


autoSenseReceiveEndSequence

public final boolean autoSenseReceiveEndSequence
This field indicates whether the toolkit will detect a different Receive End Sequence value by waiting for autoSenseInterval milliseconds for the specified Receive End Sequence. The default is false.


sendPacingInterval

public final int sendPacingInterval
Specifies the minimum amount of time in milliseconds between two sent messages on the same connection. The default send pacing interval is 0 milliseconds and the maximum value is 60 seconds.


formatter

public final HL7Formatter formatter
An HL7Formatter instance used to format received and sent raw data. If a formatter is not specified the toolkit uses its internal formatter.


characterEncoding

public final java.lang.String characterEncoding
The Java character set to use for encoding messages sent and decoding messages received. The values of MSH.18/20 are independent of this field. Canonical name for java.nio API should be used. The default value of this field is an empty string, meaning that the JVM default character set will be used.

Constructor Detail

HL7SocketConfiguration

public HL7SocketConfiguration()
Initializes a new HL7 socket configuration object using values from the toolkit properties. If a value is not specified in the toolkit properties, the default value is used instead.


HL7SocketConfiguration

public HL7SocketConfiguration(java.lang.String hostName,
                              int port)
Initializes a new HL7 socket configuration object using the specified host name and port number. Other values are read from the toolkit properties. If a value is not specified in the toolkit properties, the default value is used instead.

Parameters:
hostName - The socket's host name.
port - The port number to listen on or connect to.
Throws:
HL7Exception - If the parameters or configuration fail validation.

HL7SocketConfiguration

public HL7SocketConfiguration(java.lang.String configFile)
Initializes a new HL7 socket configuration object using values read from a configuration file. The configuration file is in the format required by the Properties class. Values that are not specified in the configuration file are read from the toolkit properties or if missing from the toolkit properties the default values are used

See the class description for a list of property names.

Parameters:
configFile - The path to the configuration file.
Throws:
HL7Exception - If the parameters or configuration fail validation.

HL7SocketConfiguration

public HL7SocketConfiguration(java.util.Properties props)
Initializes a new HL7 socket configuration object using values read from a Properties object. Values that are not specified in the provided Properties object are read from the toolkit properties or if missing from the toolkit properties the default values are used.

See the class description for a list of property names.

Parameters:
props - A Properties object containing socket configuration values.
Throws:
HL7Exception - If the parameters or configuration fail validation.
Method Detail

toString

public java.lang.String toString()
Provides the description of the fields in this socket configuration object.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this instance.

Copyright © 2009 Merge Healthcare Inc. All Rights Reserved.