Package com.framed.interop.hl7.mllp
Class MllpClient
java.lang.Object
com.framed.interop.hl7.mllp.MllpClient
- All Implemented Interfaces:
Closeable,AutoCloseable
MLLP client (the message initiator): connects to a remote MLLP endpoint, sends a framed HL7
message and reads back the framed acknowledgement.
The connection is opened lazily and reused; on any I/O error it is dropped so the next call reconnects. Instances are synchronised so a single client can be shared across threads.
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidclose()sendAndReceive(String message) Sends an HL7 message and returns the acknowledgement message.
-
Constructor Details
-
MllpClient
- Parameters:
host- target hostport- target porttimeoutMs- connect and read timeout in milliseconds
-
-
Method Details
-
sendAndReceive
Sends an HL7 message and returns the acknowledgement message.- Parameters:
message- the HL7 message to send- Returns:
- the acknowledgement (ACK) message text
- Throws:
IOException- if the connection fails, times out, or the peer closes before replying
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
