public class ActiveConnection extends Object implements Connection
| Constructor and Description |
|---|
ActiveConnection(Parser parser,
LowerLayerProtocol llp,
Socket bidirectional)
Creates a new instance of Connection, with inbound and outbound
communication on a single port.
|
ActiveConnection(Parser parser,
LowerLayerProtocol llp,
Socket bidirectional,
ExecutorService executorService) |
ActiveConnection(Parser parser,
LowerLayerProtocol llp,
Socket inbound,
Socket outbound)
Creates a new instance of Connection, with inbound communication on one
port and outbound on another.
|
ActiveConnection(Parser parser,
LowerLayerProtocol llp,
Socket inbound,
Socket outbound,
ExecutorService executorService)
Creates a new instance of Connection, with inbound communication on one
port and outbound on another.
|
| Modifier and Type | Method and Description |
|---|---|
void |
activate()
Start the receiver thread(s)
|
void |
close()
Stops running Receiver threads and closes open sockets
|
protected HL7Writer |
getAckWriter()
Returns the HL7Writer through which responses to inbound messages should
be sent.
|
ExecutorService |
getExecutorService() |
Initiator |
getInitiator()
Returns the Initiator associated with this connection
|
Parser |
getParser() |
InetAddress |
getRemoteAddress()
Returns the address of the remote host to which this Connection is
connected.
|
Integer |
getRemotePort()
Returns the remote port on the remote host to which this Connection is
connected.
|
ca.uhn.hl7v2.app.Responder |
getResponder()
Returns the Responder associated with this connection
|
protected HL7Writer |
getSendWriter()
Returns the HL7Writer through which unsolicited outbound messages should
be sent.
|
boolean |
isOpen()
Returns true if this connection is open
|
protected boolean |
isRecipientWaiting(String ackID,
String message)
Given the ack ID (MSA-2) of a message, notifies a waiting consumer thread
about a received response.
|
boolean |
isSecure() |
String |
toString() |
protected Future<String> |
waitForResponse(String messageID,
long timeout)
Reserves a future incoming message by ack ID.
|
public ActiveConnection(Parser parser, LowerLayerProtocol llp, Socket bidirectional) throws LLPException, IOException
LLPExceptionIOExceptionpublic ActiveConnection(Parser parser, LowerLayerProtocol llp, Socket bidirectional, ExecutorService executorService) throws LLPException, IOException
LLPExceptionIOExceptionpublic ActiveConnection(Parser parser, LowerLayerProtocol llp, Socket inbound, Socket outbound) throws LLPException, IOException
LLPExceptionIOExceptionpublic ActiveConnection(Parser parser, LowerLayerProtocol llp, Socket inbound, Socket outbound, ExecutorService executorService) throws LLPException, IOException
LLPExceptionIOExceptionpublic void activate()
activate in interface Connectionpublic ExecutorService getExecutorService()
getExecutorService in interface Connectionpublic InetAddress getRemoteAddress()
getRemoteAddress in interface ConnectionConnection.getRemotePort()public Integer getRemotePort()
getRemotePort in interface ConnectionConnection.getRemoteAddress()public Initiator getInitiator()
getInitiator in interface Connectionpublic ca.uhn.hl7v2.app.Responder getResponder()
public boolean isSecure()
protected HL7Writer getSendWriter()
protected HL7Writer getAckWriter()
protected Future<String> waitForResponse(String messageID, long timeout) throws InterruptedException
InterruptedExceptionprotected boolean isRecipientWaiting(String ackID, String message)
public void close()
close in interface Connectionpublic boolean isOpen()
ConnectionisOpen in interface ConnectionCopyright © 2001–2017 University Health Network. All rights reserved.