|
Sun Adapter for TCP/IP HL7 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.stc.connector.message.envelope.EnvelopedMsg
public abstract class EnvelopedMsg
This class represents an abstract envelope message. The configuration of the envelope defines when to start and when to stop reading the message.
The following are the pre-defined types: - Count Prefixed - Length Prefixed - End Marked - Begin-End Marked - Fixed Length - Per Active Connection - Marked and Fixed - Repeating - CustomFor more information, please refer the corresponding PDF documentation.
This e*Way can be configured to handle different kinds of envelopes. Each envelope needs to be configured according to its componenets. Supported Envelope Types: +-----------------------+---------------------------------------------------+ | Count Prefixed | {Counter} {Data} {Marker} {Data} {Marker} ... | +-----------------------+---------------------------------------------------+ | Length Prefixed | {Data Length} {Data} | +-----------------------+---------------------------------------------------+ | End Marked | {Data} {End Block} | +-----------------------+---------------------------------------------------+ | Begin-End Marked | {Start Block} {Data} {End Block} | +-----------------------+---------------------------------------------------+ | Fixed Length | {Data} | +-----------------------+---------------------------------------------------+ | Per Active Connection | {Data} | +-----------------------+---------------------------------------------------+ | Marked & Fixed | {Start Block} {Data} {Marker} {Fixed Length Data} | +-----------------------+---------------------------------------------------+ | Repeating | {Data} {Marker} {Data} {Marker} ... | +-----------------------+---------------------------------------------------+ | Custom | Customer defines the structure | +-----------------------+---------------------------------------------------+ Summary Of Envelopes And Their Dependencies: +-----------------------+---------------------------------------------------+ | Count Prefixed | Width Of Count | | | Numeric Representation | | | Store Until Character | +-----------------------+---------------------------------------------------+ | Length Prefixed | Width Of Length | | | Numeric Representation | +-----------------------+---------------------------------------------------+ | End Marked | Store Until Character | +-----------------------+---------------------------------------------------+ | Begin-End Marked | Store Until Character | | | Ignore Until Character | +-----------------------+---------------------------------------------------+ | Fixed Length | Bytes To Read | +-----------------------+---------------------------------------------------+ | Per Active Connection | | +-----------------------+---------------------------------------------------+ | Marked & Fixed | Store Until Character | | | Ignore Until Character | | | Bytes To Read | +-----------------------+---------------------------------------------------+ | Repeating | Count | | | Store Until Character | +-----------------------+---------------------------------------------------+ | Custom | Customer Defined Property | +-----------------------+---------------------------------------------------+ Count Prefixed ============== This envelope has the following structure: {Counter} {Data} {Marker} {Data} {Marker} ... The envelope consists of a number of Data-Marker pairs. The Counter component in this envelope indicates how many of the Data-Marker pairs to expect. The Counter component is an integer and it is represented in one of the allowed numeric representations. The Marker component of the envelope is the same as the Store Until configurable parameter. The 'Width Of Counter' must also be specified for the e*Way to be able to understand the Counter field. Length Prefixed =============== This envelope has the following structure: {Data Length} {Data} The Length component of this envelope indicates the length of the Data component. The length is represented in one of the allowed numeric representations. The Data component of the envelope is treated as a fixed length Event. The 'Width Of Length' must also be specified for the e*Way to be able to understand the Length field. End Marked ========== This envelope has the following structure: {Data} {End Block} The End Block component of this envelope is the same as the Store Until configurable parameter. Begin-End Marked ================ This envelope has the following structure: {Start Block} {Data} {End Block} The Start Block component of this envelope is the same as the Ignore Until configurable parameter, and the End Block component of this envelope is the same as the Store Until configurable parameter. Fixed Length ============ This envelope has the following structure: {Data} -------------------------------> Fixed Length This envelope is configured via the 'Bytes To Read' configurable parameter. It is assumed that all the Events will be the same length as specified in 'Bytes To Read'. Per Active Connection ===================== This envelope has the following structure: {Data} -------------------------------> Per active connection The Event has no envelopes around it. The connection to the e*Way is dropped by the external application after the Event has been sent in entire. Marked & Fixed ============== This envelope has the following structure: {Start Block} {Data} {Marker} {Fixed Length Data} This envelope is similar to the Begin-End Marked envelope. it is configured via the Ignore Until, Store Until, and Bytes To Read configurable parameters. The Marker component in this envelope is the same as the Store Until Configurable parameter. After reading the marker the e*Way will read the rest of the envelope as specified in the Bytes To Read parameter. Repeating ========= This envelope has the following structure: {Data} {Marker} {Data} {Marker} ... This envelope is similar to to Count Prefixed envelope. it is configured via the Count, and Store Until configurable parameters. The Marker component in this envelope is the same as the Store Until configurable parameter. The Event is assumed to always have the same number of Data-Marker pairs as specified in the Count configurable parameter. Custom ====== This envelope has not pre-defined structure. Customer is responsible for providing the structure and defining the behavior.
Field Summary | |
---|---|
static java.lang.String |
NUMERIC_REPRESENT_DECIMAL
NUMERIC_REPRESENT_DECIMAL |
static java.lang.String |
NUMERIC_REPRESENT_HEXADECIMAL
NUMERIC_REPRESENT_HEXADECIMAL |
static java.lang.String |
NUMERIC_REPRESENT_NETWORK_LONG
NUMERIC_REPRESENT_NETWORK_LONG |
static java.lang.String |
NUMERIC_REPRESENT_NETWORK_SHORT
NUMERIC_REPRESENT_NETWORK_SHORT |
static java.lang.String |
NUMERIC_REPRESENT_OCTAL
NUMERIC_REPRESENT_OCTAL |
static java.lang.String |
TYPE_BEGIN_END_MARKED
TYPE_BEGIN_END_MARKED_ACK |
static java.lang.String |
TYPE_COUNT_PREFIXED
TYPE_COUNT_PREFIXED |
static java.lang.String |
TYPE_CUSTOM
TYPE_CUSTOM |
static java.lang.String |
TYPE_END_MARKED
TYPE_END_MARKED |
static java.lang.String |
TYPE_FIXED_LENGTH
TYPE_FIXED_LENGTH |
static java.lang.String |
TYPE_LENGTH_PREFIXED
TYPE_LENGTH_PREFIXED |
static java.lang.String |
TYPE_MARKED_AND_FIXED
TYPE_MARKED_AND_FIXED |
static java.lang.String |
TYPE_PER_ACTIVE_CONNECTION
TYPE_PER_ACTIVE_CONNECTION |
static java.lang.String |
TYPE_REPEATING
TYPE_REPEATING |
static java.lang.String |
version
|
Constructor Summary | |
---|---|
EnvelopedMsg(AbstractMsg[] childMsgs)
Constructor |
|
EnvelopedMsg(AbstractMsg prefix,
AbstractMsg body,
AbstractMsg suffix)
Constructor |
Method Summary | |
---|---|
boolean |
equalsTo(AbstractMsg msg)
Checks whether the envelope message equals to the specified |
AbstractMsg |
getBody()
Returns the body. |
byte[] |
getBytes()
Returns a byte array. |
AbstractMsg[] |
getChildMsgs()
Returns the childMsgs. |
java.lang.String |
getEnvelopeType()
Returns the envelopeType. |
AbstractMsg |
getPrefix()
Returns the prefix. |
AbstractMsg |
getSuffix()
Returns the suffix. |
boolean |
isBeginEndMarkedMsg()
Checks whether the message is type of BeginEndMarkedMsg. |
boolean |
isCountPrefixedMsg()
Checks whether the message is type of CountPrefixedMsg. |
boolean |
isCustomMsg()
Checks whether the message is type of CustomMsg. |
boolean |
isEndMarkedMsg()
Checks whether the message is type of EndMarkedMsg. |
boolean |
isFixedLengthMsg()
Checks whether the message is type of FixedLengthMsg. |
boolean |
isLengthPrefixedMsg()
Checks whether the message is type of LengthPrefixedMsg. |
boolean |
isMarkedAndFixedMsg()
Checks whether the message is type of MarkedAndFixedMsg. |
boolean |
isPerActiveConnectionMsg()
Checks whether the message is type of PerActiveConnectionMsg. |
boolean |
isRepeatingMsg()
Checks whether the message is type of RepeatingMsg. |
protected void |
setBody(AbstractMsg body)
Sets the body. |
protected void |
setChildMsgs(AbstractMsg[] childMsgs)
Sets the childMsgs. |
protected void |
setEnvelopeType(java.lang.String envelopeType)
Sets the envelopeType. |
protected void |
setPrefix(AbstractMsg prefix)
Sets the prefix. |
protected void |
setSuffix(AbstractMsg suffix)
Sets the suffix. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String version
public static final java.lang.String TYPE_BEGIN_END_MARKED
public static final java.lang.String TYPE_COUNT_PREFIXED
public static final java.lang.String TYPE_END_MARKED
public static final java.lang.String TYPE_FIXED_LENGTH
public static final java.lang.String TYPE_LENGTH_PREFIXED
public static final java.lang.String TYPE_MARKED_AND_FIXED
public static final java.lang.String TYPE_PER_ACTIVE_CONNECTION
public static final java.lang.String TYPE_REPEATING
public static final java.lang.String TYPE_CUSTOM
public static final java.lang.String NUMERIC_REPRESENT_DECIMAL
public static final java.lang.String NUMERIC_REPRESENT_HEXADECIMAL
public static final java.lang.String NUMERIC_REPRESENT_OCTAL
public static final java.lang.String NUMERIC_REPRESENT_NETWORK_SHORT
public static final java.lang.String NUMERIC_REPRESENT_NETWORK_LONG
Constructor Detail |
---|
public EnvelopedMsg(AbstractMsg prefix, AbstractMsg body, AbstractMsg suffix)
prefix
- AbstractMsgbody
- AbstractMsgsuffix
- AbstractMsgpublic EnvelopedMsg(AbstractMsg[] childMsgs)
childMsgs
- AbstractMsg[]Method Detail |
---|
public AbstractMsg getBody()
public java.lang.String getEnvelopeType()
public AbstractMsg getPrefix()
public AbstractMsg getSuffix()
public AbstractMsg[] getChildMsgs()
protected void setEnvelopeType(java.lang.String envelopeType)
envelopeType
- The envelopeType to setprotected void setPrefix(AbstractMsg prefix)
prefix
- The prefix to setprotected void setBody(AbstractMsg body)
body
- The body to setprotected void setSuffix(AbstractMsg suffix)
suffix
- The suffix to setprotected void setChildMsgs(AbstractMsg[] childMsgs)
childMsgs
- The childMsgs to setpublic boolean isBeginEndMarkedMsg()
public boolean isCountPrefixedMsg()
public boolean isEndMarkedMsg()
public boolean isFixedLengthMsg()
public boolean isLengthPrefixedMsg()
public boolean isMarkedAndFixedMsg()
public boolean isPerActiveConnectionMsg()
public boolean isRepeatingMsg()
public boolean isCustomMsg()
public byte[] getBytes() throws java.io.IOException
AbstractMsg
getBytes
in interface AbstractMsg
java.io.IOException
- on errorAbstractMsg.getBytes()
public boolean equalsTo(AbstractMsg msg)
msg
- AbstractMsg
|
Sun Adapter for TCP/IP HL7 | ||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |