Sun Adapter for TCP/IP HL7

com.stc.connector.tcpip.ext.msg
Class MessageInfo

java.lang.Object
  extended by com.stc.connector.tcpip.ext.msg.MessageInfo
All Implemented Interfaces:
MessageInfoInterface

public class MessageInfo
extends java.lang.Object
implements MessageInfoInterface

This class represents the message configuration information.

Version:
cvs revision: $Revision: 1.14 $ Last Modified: $Date: 2008/04/10 06:21:38 $
Author:
Harry Liu

Field Summary
static java.lang.String version
           
 
Constructor Summary
MessageInfo()
          Constructor
MessageInfo(com.stc.connector.framework.util.ConfigurationHelper aConfiguration)
          Constructor for MessageInfo.
 
Method Summary
 int getBytesToRead()
          Returns the value of bytesToRead.
 java.lang.String getCustomEnvelopedClassName()
          Returns the customEnvelopedClassName.
 java.lang.String getCustomerDefinedProperty()
          Returns the customerDefinedProperty.
 java.lang.String getEnvelopeType()
          Returns the envelopeType.
 char getIgnoreUntilChar()
          Returns the ignoreUntilChar.
 com.stc.connector.framework.util.ConfigurationHelper getInitPropertiesInfo()
          Returns the initial configuration.
 java.lang.String getNumericRepresentation()
          Returns the numericRepresentation.
 char getStoreUntilChar()
          Returns the storeUntilChar.
 int getWidthOfLength()
          Returns the widthOfLength.
 boolean isBeginEndMarkedMsg()
          Checks whether the envelope type is BeginEndMarked.
 boolean isCustomEnvelopedMsg()
          Checks whether the envelope type is Custom (user-defined).
 boolean isEndMarkedMsg()
          Checks whether the envelope type is EndMarked.
 boolean isFixedLengthMsg()
          Checks whether the envelope type is FixedLength.
 boolean isLengthPrefixedMsg()
          Checks whether the envelope type is LengthPrefixed.
 boolean isMarkedAndFixedMsg()
          Checks whether the envelope type is MarkedAndFixed.
 boolean isNumericRepDecimal()
          Checks whether the NumericRep is Decimal.
 boolean isNumericRepHexadecimal()
          Checks whether the NumericRep is Hexadecimal.
 boolean isNumericRepNetworkLong()
          Checks whether the NumericRep Network Long.
 boolean isNumericRepNetworkShort()
          Checks whether the NumericRep is Network Short.
 boolean isNumericRepOctal()
          Checks whether the NumericRep is Octal.
 boolean isPerActiveConnectionMsg()
          Checks whether the envelope type is PerActiveConnection.
 void setBytesToRead(int bytesToRead)
          Sets the bytesToRead.
 void setCustomEnvelopedClassName(java.lang.String customEnvelopedClassName)
          Sets the customEnvelopedClassName.
 void setCustomerDefinedProperty(java.lang.String customerDefinedProperty)
          Sets the customerDefinedProperty.
 void setEnvelopeType(java.lang.String envelopeType)
          Sets the envelopeType.
 void setIgnoreUntilChar(char ignoreUntilChar)
          Sets the ignoreUntilChar.
 void setNumericRepresentation(java.lang.String numericRepresentation)
          Sets the numericRepresentation.
 void setStoreUntilChar(char storeUntilChar)
          Sets the storeUntilChar.
 void setWidthOfLength(int widthOfLength)
          Sets the widthOfLength.
 void validate()
          Validates the message configuration settings.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

version

public static final java.lang.String version
See Also:
Constant Field Values
Constructor Detail

MessageInfo

public MessageInfo()
            throws TCPIPApplicationException
Constructor

Throws:
TCPIPApplicationException - on error

MessageInfo

public MessageInfo(com.stc.connector.framework.util.ConfigurationHelper aConfiguration)
            throws TCPIPApplicationException
Constructor for MessageInfo.

Parameters:
aConfiguration - STCPropertiesInfo instance
Throws:
TCPIPApplicationException - on error
Method Detail

getBytesToRead

public int getBytesToRead()
Returns the value of bytesToRead.

Specified by:
getBytesToRead in interface MessageInfoInterface
Returns:
The value of bytesToRead.

getEnvelopeType

public java.lang.String getEnvelopeType()
Returns the envelopeType.

Specified by:
getEnvelopeType in interface MessageInfoInterface
Returns:
the envelopeType.

getCustomEnvelopedClassName

public java.lang.String getCustomEnvelopedClassName()
Returns the customEnvelopedClassName. It will be used when the users want to define their own enveloped message style.

Specified by:
getCustomEnvelopedClassName in interface MessageInfoInterface
Returns:
the customEnvelopedClassName.

getCustomerDefinedProperty

public java.lang.String getCustomerDefinedProperty()
Returns the customerDefinedProperty. It would contain a list of user-defined parameters and it is up to the user to parse this in user's customized envelope message implementation.

Specified by:
getCustomerDefinedProperty in interface MessageInfoInterface
Returns:
the customerDefinedProperty.

getIgnoreUntilChar

public char getIgnoreUntilChar()
Returns the ignoreUntilChar.

Specified by:
getIgnoreUntilChar in interface MessageInfoInterface
Returns:
the ignoreUntilChar.

getNumericRepresentation

public java.lang.String getNumericRepresentation()
Returns the numericRepresentation.

Specified by:
getNumericRepresentation in interface MessageInfoInterface
Returns:
the numericRepresentation.

getStoreUntilChar

public char getStoreUntilChar()
Returns the storeUntilChar.

Specified by:
getStoreUntilChar in interface MessageInfoInterface
Returns:
the storeUntilChar.

getWidthOfLength

public int getWidthOfLength()
Returns the widthOfLength.

Specified by:
getWidthOfLength in interface MessageInfoInterface
Returns:
the widthOfLength.

getInitPropertiesInfo

public com.stc.connector.framework.util.ConfigurationHelper getInitPropertiesInfo()
Returns the initial configuration.

Returns:
ConfigurationHelper

isNumericRepDecimal

public boolean isNumericRepDecimal()
Checks whether the NumericRep is Decimal.

Specified by:
isNumericRepDecimal in interface MessageInfoInterface
Returns:
boolean

isNumericRepHexadecimal

public boolean isNumericRepHexadecimal()
Checks whether the NumericRep is Hexadecimal.

Specified by:
isNumericRepHexadecimal in interface MessageInfoInterface
Returns:
boolean

isNumericRepOctal

public boolean isNumericRepOctal()
Checks whether the NumericRep is Octal.

Specified by:
isNumericRepOctal in interface MessageInfoInterface
Returns:
boolean

isNumericRepNetworkShort

public boolean isNumericRepNetworkShort()
Checks whether the NumericRep is Network Short.

Specified by:
isNumericRepNetworkShort in interface MessageInfoInterface
Returns:
boolean

isNumericRepNetworkLong

public boolean isNumericRepNetworkLong()
Checks whether the NumericRep Network Long.

Specified by:
isNumericRepNetworkLong in interface MessageInfoInterface
Returns:
boolean

isBeginEndMarkedMsg

public boolean isBeginEndMarkedMsg()
Checks whether the envelope type is BeginEndMarked.

Specified by:
isBeginEndMarkedMsg in interface MessageInfoInterface
Returns:
boolean

isEndMarkedMsg

public boolean isEndMarkedMsg()
Checks whether the envelope type is EndMarked.

Specified by:
isEndMarkedMsg in interface MessageInfoInterface
Returns:
boolean

isFixedLengthMsg

public boolean isFixedLengthMsg()
Checks whether the envelope type is FixedLength.

Specified by:
isFixedLengthMsg in interface MessageInfoInterface
Returns:
boolean

isLengthPrefixedMsg

public boolean isLengthPrefixedMsg()
Checks whether the envelope type is LengthPrefixed.

Specified by:
isLengthPrefixedMsg in interface MessageInfoInterface
Returns:
boolean

isMarkedAndFixedMsg

public boolean isMarkedAndFixedMsg()
Checks whether the envelope type is MarkedAndFixed.

Specified by:
isMarkedAndFixedMsg in interface MessageInfoInterface
Returns:
boolean

isPerActiveConnectionMsg

public boolean isPerActiveConnectionMsg()
Checks whether the envelope type is PerActiveConnection.

Specified by:
isPerActiveConnectionMsg in interface MessageInfoInterface
Returns:
boolean

isCustomEnvelopedMsg

public boolean isCustomEnvelopedMsg()
Checks whether the envelope type is Custom (user-defined).

Specified by:
isCustomEnvelopedMsg in interface MessageInfoInterface
Returns:
boolean

setBytesToRead

public void setBytesToRead(int bytesToRead)
                    throws TCPIPApplicationException
Sets the bytesToRead.

Specified by:
setBytesToRead in interface MessageInfoInterface
Parameters:
bytesToRead - The bytesToRead to set
Throws:
TCPIPApplicationException - on error

setEnvelopeType

public void setEnvelopeType(java.lang.String envelopeType)
                     throws TCPIPApplicationException
Sets the envelopeType.

Specified by:
setEnvelopeType in interface MessageInfoInterface
Parameters:
envelopeType - The envelopeType to set
Throws:
TCPIPApplicationException - on error

setCustomEnvelopedClassName

public void setCustomEnvelopedClassName(java.lang.String customEnvelopedClassName)
Sets the customEnvelopedClassName. The name should be a full class name. It will be used when the users want to define their own enveloped message style. The customer-defined envelope implementation class should satisfy following requirements:
     - It should represent a solid class.
     - It should have a constructor with an empty argument list.
     - It should be a type of com.stc.connector.tcpip.ext.msg.EnvelopedMsgReceiver.
     - It should be a type of com.stc.connector.tcpip.ext.msg.EnvelopedMsgSender.
 

Specified by:
setCustomEnvelopedClassName in interface MessageInfoInterface
Parameters:
customEnvelopedClassName - The customEnvelopedClassName to set

setCustomerDefinedProperty

public void setCustomerDefinedProperty(java.lang.String customerDefinedProperty)
Sets the customerDefinedProperty. It would contain a list of user-defined parameters and it is up to the user to parse this in user's customized envelope message implementation.

Specified by:
setCustomerDefinedProperty in interface MessageInfoInterface
Parameters:
customerDefinedProperty - The customerDefinedProperty to set

setIgnoreUntilChar

public void setIgnoreUntilChar(char ignoreUntilChar)
                        throws TCPIPApplicationException
Sets the ignoreUntilChar.

Specified by:
setIgnoreUntilChar in interface MessageInfoInterface
Parameters:
ignoreUntilChar - The ignoreUntilChar to set
Throws:
TCPIPApplicationException - on error

setNumericRepresentation

public void setNumericRepresentation(java.lang.String numericRepresentation)
                              throws TCPIPApplicationException
Sets the numericRepresentation. The valid numeric representations are:
    . Decimal
    . Hexadecimal
    . Octal
    . Network Long
    . Network Short
 

Specified by:
setNumericRepresentation in interface MessageInfoInterface
Parameters:
numericRepresentation - The numericRepresentation to set
Throws:
TCPIPApplicationException - on error

setStoreUntilChar

public void setStoreUntilChar(char storeUntilChar)
                       throws TCPIPApplicationException
Sets the storeUntilChar.

Specified by:
setStoreUntilChar in interface MessageInfoInterface
Parameters:
storeUntilChar - The storeUntilChar to set
Throws:
TCPIPApplicationException - on error

setWidthOfLength

public void setWidthOfLength(int widthOfLength)
                      throws TCPIPApplicationException
Sets the widthOfLength.

Specified by:
setWidthOfLength in interface MessageInfoInterface
Parameters:
widthOfLength - The widthOfLength to set
Throws:
TCPIPApplicationException - on error

validate

public void validate()
              throws TCPIPApplicationException
Validates the message configuration settings.

Throws:
TCPIPApplicationException - on error

Sun Adapter for TCP/IP HL7