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, send
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
connect, disconnect, getCommonMetadata, isConnected, receive, send
public 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 AbstractTransport
theMessage
- the message to sendTransportException
ca.uhn.hl7v2.protocol.AbstractTransport#doSend(ca.uhn.hl7v2.protocol.Transportable)
public Transportable doReceive() throws TransportException
AbstractTransport
doReceive
in class AbstractTransport
TransportException
ca.uhn.hl7v2.protocol.AbstractTransport#doReceive()
public void doConnect() throws TransportException
doConnect
in class AbstractTransport
TransportException
ca.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
AbstractTransport
doDisconnect
in class AbstractTransport
TransportException
TransportLayer.disconnect()
Copyright © 2001–2017 University Health Network. All rights reserved.