Class MllpSocketBuffer
java.lang.Object
org.apache.camel.component.mllp.internal.MllpSocketBuffer
An OutputStream modeled after the ByteArrayOutputStream specifically for MLLP operations.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionintcapacity()voidvoidcloseSocket(Socket socket) voidcloseSocket(Socket socket, String logMessage) static StringformatAddressString(SocketAddress sourceAddress, SocketAddress targetAddress) intbyte[]intbyte[]booleanbooleanbooleanbooleanbooleanbooleanbooleanstatic booleanisConnectionValid(Socket socket) booleanisEmpty()booleanvoidvoidvoidvoidreset()voidresetSocket(Socket socket) voidresetSocket(Socket socket, String logMessage) voidsetEnvelopedMessage(byte[] hl7Payload) voidsetEnvelopedMessage(byte[] hl7Payload, int offset, int length) intsize()byte[]byte[]toHl7String(String charsetName) toHl7String(Charset charset) byte[]Convert the enveloped contents of the buffer (excluding enveloping characters) to a print-friendly String representation.Convert the entire contents of the buffer (including enveloping characters) to a print-friendly String representation.toString()voidwrite(byte[] b) voidwrite(byte[] sourceBytes, int offset, int writeCount) voidwrite(int b) void
-
Constructor Details
-
MllpSocketBuffer
-
-
Method Details
-
isEndOfDataRequired
public boolean isEndOfDataRequired() -
isEmpty
public boolean isEmpty() -
write
public void write(int b) -
write
public void write(byte[] b) -
write
public void write(byte[] sourceBytes, int offset, int writeCount) -
openMllpEnvelope
public void openMllpEnvelope() -
closeMllpEnvelope
public void closeMllpEnvelope() -
setEnvelopedMessage
public void setEnvelopedMessage(byte[] hl7Payload) -
setEnvelopedMessage
public void setEnvelopedMessage(byte[] hl7Payload, int offset, int length) -
reset
public void reset() -
readFrom
-
readFrom
public void readFrom(Socket socket, int receiveTimeout, int readTimeout) throws MllpSocketException, SocketTimeoutException -
writeTo
- Throws:
MllpSocketException
-
toByteArray
public byte[] toByteArray() -
toByteArrayAndReset
public byte[] toByteArrayAndReset() -
toString
-
toString
-
toString
-
toPrintFriendlyString
Convert the entire contents of the buffer (including enveloping characters) to a print-friendly String representation.- Returns:
- print-friendly String
-
toPrintFriendlyStringAndReset
-
toHl7String
-
toHl7String
-
toHl7String
-
toPrintFriendlyHl7String
Convert the enveloped contents of the buffer (excluding enveloping characters) to a print-friendly String representation.- Returns:
- print-friendly String
-
toMllpPayload
public byte[] toMllpPayload() -
getStartOfBlockIndex
public int getStartOfBlockIndex() -
getEndOfBlockIndex
public int getEndOfBlockIndex() -
hasCompleteEnvelope
public boolean hasCompleteEnvelope() -
hasStartOfBlock
public boolean hasStartOfBlock() -
hasEndOfBlock
public boolean hasEndOfBlock() -
hasEndOfData
public boolean hasEndOfData() -
hasOutOfBandData
public boolean hasOutOfBandData() -
hasLeadingOutOfBandData
public boolean hasLeadingOutOfBandData() -
hasTrailingOutOfBandData
public boolean hasTrailingOutOfBandData() -
getLeadingOutOfBandData
public byte[] getLeadingOutOfBandData() -
getTrailingOutOfBandData
public byte[] getTrailingOutOfBandData() -
size
public int size() -
capacity
public int capacity() -
closeSocket
-
closeSocket
-
resetSocket
-
resetSocket
-
isConnectionValid
-
formatAddressString
-