public class URLTransport extends AbstractTransport implements TransportLayer
TransportLayer that reads and writes from an URL (for example
over HTTP).| Modifier and Type | Field and Description |
|---|---|
protected int |
myBufferSize |
static String |
URL_KEY
Key in Transportable metadata map under which URL is stored.
|
| Constructor and Description |
|---|
URLTransport(URL theURL,
boolean connectOnSend,
boolean connectOnReceive,
boolean connectOnConnect)
The boolean configuration flags determine when new connections are made.
|
| Modifier and Type | Method and Description |
|---|---|
void |
doConnect()
Calls openConnection() on the underlying URL and configures the connection,
if this transport is configured to connect when connect() is called (see
constructor params).
|
void |
doDisconnect()
Performs disconnection as described in TransportLayer.disconnect().
|
Transportable |
doReceive()
Called by receive(), which then adds common metadata.
|
void |
doSend(Transportable theMessage)
Writes the given message to the URL.
|
String |
getContentType() |
void |
setContentType(String theContentType) |
connect, disconnect, getCommonMetadata, isConnected, receive, sendclone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitconnect, disconnect, getCommonMetadata, isConnected, receive, sendpublic static final String URL_KEY
protected int myBufferSize
public URLTransport(URL theURL, boolean connectOnSend, boolean connectOnReceive, boolean connectOnConnect)
theURL - the URL at which messages are to be read and writtenconnectOnSend - makes a new connection before each sendconnectOnReceive - makes a new connection before each receiveconnectOnConnect - makes a new connection when connect() is calledpublic void doSend(Transportable theMessage) throws TransportException
doSend in class AbstractTransporttheMessage - the message to sendTransportExceptionca.uhn.hl7v2.protocol.AbstractTransport#doSend(ca.uhn.hl7v2.protocol.Transportable)public Transportable doReceive() throws TransportException
AbstractTransportdoReceive in class AbstractTransportTransportExceptionca.uhn.hl7v2.protocol.AbstractTransport#doReceive()public void doConnect() throws TransportException
doConnect in class AbstractTransportTransportExceptionca.uhn.hl7v2.protocol.AbstractTransport#doConnect()public String getContentType()
public void setContentType(String theContentType)
theContentType - the string to be used in the request property "Content-Type"
(defaults to "application/hl7+doc+xml")public void doDisconnect() throws TransportException
AbstractTransportdoDisconnect in class AbstractTransportTransportExceptionTransportLayer.disconnect()Copyright © 2001–2017 University Health Network. All rights reserved.