org.apache.camel.component.hl7
Class HL7MLLPCodec
java.lang.Object
org.apache.camel.component.hl7.HL7MLLPCodec
- All Implemented Interfaces:
- org.apache.mina.filter.codec.ProtocolCodecFactory
public class HL7MLLPCodec
- extends Object
- implements org.apache.mina.filter.codec.ProtocolCodecFactory
HL7 MLLP codec.
This codec supports encoding/decoding the HL7 MLLP protocol.
It will use the default markers for start and end combination:
- 0x0b (11 decimal) = start marker
- 0x0d (13 decimal = the \r char) = segment terminators
- 0x1c (28 decimal) = end 1 marker
- 0x0d (13 decimal) = end 2 marker
The decoder is used for decoding from MLLP (bytes) to String. The String will not contain any of
the start and end markers.
The encoder is used for encoding from String to MLLP (bytes). The String should not contain
any of the start and end markers, the encoder will add these, and stream the string as bytes.
Also the enocder will convert any \n (line breaks) as segment terminators to \r.
This codes supports charset encoding/decoding between bytes and String. The JVM platform default charset
is used, but the charset can be configued on this codec using the setter method.
The decoder will use the JVM platform default charset for decoding, but the charset can be configued on the this codec.
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
HL7MLLPCodec
public HL7MLLPCodec()
getDecoder
public org.apache.mina.filter.codec.ProtocolDecoder getDecoder()
throws Exception
- Specified by:
getDecoder
in interface org.apache.mina.filter.codec.ProtocolCodecFactory
- Throws:
Exception
getEncoder
public org.apache.mina.filter.codec.ProtocolEncoder getEncoder()
throws Exception
- Specified by:
getEncoder
in interface org.apache.mina.filter.codec.ProtocolCodecFactory
- Throws:
Exception
setCharset
public void setCharset(Charset charset)
setCharset
public void setCharset(String charsetName)
getCharset
public Charset getCharset()
isConvertLFtoCR
public boolean isConvertLFtoCR()
setConvertLFtoCR
public void setConvertLFtoCR(boolean convertLFtoCR)
getStartByte
public char getStartByte()
setStartByte
public void setStartByte(char startByte)
getEndByte1
public char getEndByte1()
setEndByte1
public void setEndByte1(char endByte1)
getEndByte2
public char getEndByte2()
setEndByte2
public void setEndByte2(char endByte2)
Apache CAMEL