/** * 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>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>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; }