/** * Sets isConnected() to false, then calls doConnect(), then sets isConnected() to * true. * @see ca.uhn.hl7v2.protocol.TransportLayer#connect() */ public void connect() throws TransportException { myIsConnected = false; doConnect(); myIsConnected = true; }
/** * @see ca.uhn.hl7v2.protocol.TransportLayer#disconnect() */ public void disconnect() throws TransportException { myIsConnected = false; doDisconnect(); }
/** * Delegates to <code>doSend()</code> after checking that we are connected. * * @see ca.uhn.hl7v2.protocol.TransportLayer#send(Transportable) */ public void send(Transportable theMessage) throws TransportException { if (!isConnected()) { throw new TransportException("Can't send because TransportLayer is not connected"); } doSend(theMessage); log.debug("Sent: {}", (theMessage == null ? null : theMessage.getMessage())); }
/** * Delegates to <code>doReceive()</code> and adds common metadata * to the resulting <code>Transportable</code> before it is returned. */ public Transportable receive() throws TransportException { if (!isConnected()) { throw new TransportException("Can't receive because TransportLayer is not connected"); } Transportable message = doReceive(); if (message != null) { message.getMetadata().putAll(myCommonMetadata); } log.debug("Received: {} ", (message == null ? null : message.getMessage())); return message; }
/** * Delegates to <code>doSend()</code> after checking that we are connected. * * @see ca.uhn.hl7v2.protocol.TransportLayer#send(Transportable) */ public void send(Transportable theMessage) throws TransportException { if (!isConnected()) { throw new TransportException("Can't send because TransportLayer is not connected"); } doSend(theMessage); log.debug("Sent: {}", (theMessage == null ? null : theMessage.getMessage())); }
/** * Delegates to <code>doReceive()</code> and adds common metadata * to the resulting <code>Transportable</code> before it is returned. */ public Transportable receive() throws TransportException { if (!isConnected()) { throw new TransportException("Can't receive because TransportLayer is not connected"); } Transportable message = doReceive(); if (message != null) { message.getMetadata().putAll(myCommonMetadata); } log.debug("Received: {} ", (message == null ? null : message.getMessage())); return message; }
/** * @see ca.uhn.hl7v2.protocol.TransportLayer#disconnect() */ public void disconnect() throws TransportException { myIsConnected = false; doDisconnect(); }
/** * Sets isConnected() to false, then calls doConnect(), then sets isConnected() to * true. * @see ca.uhn.hl7v2.protocol.TransportLayer#connect() */ public void connect() throws TransportException { myIsConnected = false; doConnect(); myIsConnected = true; }