ca.uhn.hl7v2.protocol.impl
Class SocketStreamSource

java.lang.Object
  extended by ca.uhn.hl7v2.protocol.impl.SocketStreamSource
All Implemented Interfaces:
StreamSource
Direct Known Subclasses:
ClientSocketStreamSource, ServerSocketStreamSource

public abstract class SocketStreamSource
extends java.lang.Object
implements StreamSource

A base implementation of StreamSource based on sockets.

Version:
$Revision: 1.1 $ updated on $Date: 2007/02/19 02:24:26 $ by $Author: jamesagnew $
Author:
Bryan Tripp

Constructor Summary
SocketStreamSource()
           
 
Method Summary
abstract  void connect()
          Gets fresh instance of socket, which is subsequently available from getSocket().
 void disconnect()
          Closes streams and underlying socket.
 java.io.InputStream getInboundStream()
           
 java.io.OutputStream getOutboundStream()
           
abstract  java.net.Socket getSocket()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SocketStreamSource

public SocketStreamSource()
Method Detail

getSocket

public abstract java.net.Socket getSocket()
Returns:
a socket from which input and output streams for message exchages are to be obtained

connect

public abstract void connect()
                      throws TransportException
Gets fresh instance of socket, which is subsequently available from getSocket().

Specified by:
connect in interface StreamSource
Throws:
TransportException

disconnect

public void disconnect()
                throws TransportException
Closes streams and underlying socket.

Specified by:
disconnect in interface StreamSource
Throws:
TransportException
See Also:
StreamSource.disconnect()

getOutboundStream

public java.io.OutputStream getOutboundStream()
                                       throws TransportException
Specified by:
getOutboundStream in interface StreamSource
Returns:
the stream to which we write outbound messages.
Throws:
TransportException

getInboundStream

public java.io.InputStream getInboundStream()
                                     throws TransportException
Specified by:
getInboundStream in interface StreamSource
Returns:
the stream to which we expect the remote server to send messages.
Throws:
TransportException


Copyright © 2001-2011 University Health Network. All Rights Reserved.