org.eclipse.ohf.ihe.atna.transport
Class TransporterImpl

java.lang.Object
  extended by org.eclipse.ohf.ihe.atna.transport.TransporterImpl
All Implemented Interfaces:
TransporterService

public class TransporterImpl
extends java.lang.Object
implements TransporterService

Author:
Tim Jeffcoat, Don Jorgenson, Glenn Deen, Rick Stevens, Sondra Renly, Matthew Davis

Field Summary
 
Fields inherited from interface org.eclipse.ohf.ihe.atna.transport.service.transporter.TransporterService
TRANSPORT_NAME
 
Constructor Summary
TransporterImpl()
           
 
Method Summary
 javax.net.ssl.SSLSocket createTLSSocket(java.net.URI uri)
           
 java.io.InputStream getInputStream(java.net.URI uri)
          Establishes a connection to the given URI and returns an inputstream.
 java.net.Socket getSocket(java.net.URI uri, boolean wantTLS)
          Creates a returns a socket to the given URI.
 javax.xml.soap.SOAPMessage send(javax.xml.soap.SOAPMessage msg, java.net.URI uri)
          Connects to the given URI and sends the soap message.
static void setConnectionHandler(ConnectionHandler connectionHandler)
          Setting a connection handler to be used by this thread
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TransporterImpl

public TransporterImpl()
Method Detail

send

public javax.xml.soap.SOAPMessage send(javax.xml.soap.SOAPMessage msg,
                                       java.net.URI uri)
                                throws java.lang.UnsupportedOperationException,
                                       javax.xml.soap.SOAPException,
                                       java.net.MalformedURLException,
                                       java.io.IOException,
                                       java.lang.Exception,
                                       NoSecurityDomainException,
                                       java.security.NoSuchAlgorithmException
Connects to the given URI and sends the soap message.

Specified by:
send in interface TransporterService
Parameters:
msg -
url -
Returns:
SOAPMessage returned by the URI
Throws:
javax.xml.soap.SOAPException
java.lang.UnsupportedOperationException
java.net.MalformedURLException
NoSecurityDomainException
java.security.NoSuchAlgorithmException
java.io.IOException
java.lang.Exception

getSocket

public java.net.Socket getSocket(java.net.URI uri,
                                 boolean wantTLS)
                          throws java.security.KeyManagementException,
                                 NoSecurityDomainException,
                                 java.security.NoSuchAlgorithmException,
                                 java.net.UnknownHostException,
                                 java.io.IOException
Description copied from interface: TransporterService
Creates a returns a socket to the given URI. The socket will use TLS, unless

Specified by:
getSocket in interface TransporterService
wantTLS - true to use TLS, false otherwise
Returns:
Throws:
java.security.KeyManagementException
NoSecurityDomainException
java.security.NoSuchAlgorithmException
java.net.UnknownHostException
java.io.IOException

createTLSSocket

public javax.net.ssl.SSLSocket createTLSSocket(java.net.URI uri)
                                        throws NoSecurityDomainException,
                                               java.security.NoSuchAlgorithmException,
                                               java.security.KeyManagementException,
                                               java.net.UnknownHostException,
                                               java.io.IOException
Parameters:
uri -
Returns:
Throws:
NoSecurityDomainException
java.security.NoSuchAlgorithmException
java.security.KeyManagementException
java.net.UnknownHostException
java.io.IOException

getInputStream

public java.io.InputStream getInputStream(java.net.URI uri)
                                   throws NoSecurityDomainException,
                                          java.net.MalformedURLException,
                                          java.io.IOException,
                                          java.security.NoSuchAlgorithmException
Description copied from interface: TransporterService
Establishes a connection to the given URI and returns an inputstream. If the URI protocol requires TLS e.g. HTTPS, then, TLS is used.

Specified by:
getInputStream in interface TransporterService
Returns:
Throws:
NoSecurityDomainException
java.net.MalformedURLException
java.io.IOException
java.security.NoSuchAlgorithmException

setConnectionHandler

public static void setConnectionHandler(ConnectionHandler connectionHandler)
Setting a connection handler to be used by this thread

Parameters:
connectionHandler - The connection handler this thread should be using