org.apache.camel.component.hl7
Class HL7MLLPCodec

java.lang.Object
  extended by 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:

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.

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.


Constructor Summary
HL7MLLPCodec()
           
 
Method Summary
 Charset getCharset()
           
 org.apache.mina.filter.codec.ProtocolDecoder getDecoder(org.apache.mina.core.session.IoSession session)
           
 org.apache.mina.filter.codec.ProtocolEncoder getEncoder(org.apache.mina.core.session.IoSession session)
           
 char getEndByte1()
           
 char getEndByte2()
           
 char getStartByte()
           
 boolean isConvertLFtoCR()
           
 boolean isValidate()
           
 void setCharset(Charset charset)
           
 void setCharset(String charsetName)
           
 void setConvertLFtoCR(boolean convertLFtoCR)
           
 void setEndByte1(char endByte1)
           
 void setEndByte2(char endByte2)
           
 void setStartByte(char startByte)
           
 void setValidate(boolean validate)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HL7MLLPCodec

public HL7MLLPCodec()
Method Detail

getDecoder

public org.apache.mina.filter.codec.ProtocolDecoder getDecoder(org.apache.mina.core.session.IoSession session)
                                                        throws Exception
Specified by:
getDecoder in interface org.apache.mina.filter.codec.ProtocolCodecFactory
Throws:
Exception

getEncoder

public org.apache.mina.filter.codec.ProtocolEncoder getEncoder(org.apache.mina.core.session.IoSession session)
                                                        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)

isValidate

public boolean isValidate()

setValidate

public void setValidate(boolean validate)


Apache Camel