org.openorb.orb.ssl
Class SSLTransport

java.lang.Object
  extended by org.openorb.orb.iiop.IIOPTransport
      extended by org.openorb.orb.ssl.SSLTransport

public class SSLTransport
extends org.openorb.orb.iiop.IIOPTransport

Transport layer for SSL connections.

Author:
Chris Wood

Constructor Summary
SSLTransport(java.net.InetAddress host, int port, int assocRequires, java.lang.String[] enableCipherSuites, javax.net.ssl.SSLSocketFactory socFactory)
          Constructor based on the internet address and the port number.
SSLTransport(javax.net.ssl.SSLSocket sock, int serverPort, SSLAssociation assoc)
          Constructor based on the server side socket.
 
Method Summary
 void close()
          Close magic reader threads.
protected  java.net.Socket createSocket(java.net.InetAddress host, int port)
          Open the socket to the specified host and port.
 void enableLogging(Logger logger)
          Provide this instance with a logger.
 javax.net.ssl.SSLSession getSocketSession()
          Return the SSLSession of the socket.
protected  boolean readMagic(int timeout, byte[] buf, int off)
          Reads four bytes from the input stream into the buffer at the specified offset.
 java.lang.String toString()
          Print out socket information.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SSLTransport

public SSLTransport(java.net.InetAddress host,
                    int port,
                    int assocRequires,
                    java.lang.String[] enableCipherSuites,
                    javax.net.ssl.SSLSocketFactory socFactory)
Constructor based on the internet address and the port number.

Parameters:
host - The host on which to listen.
port - The port on which to listen.
assocRequires - The required association options.
enableCipherSuites - An array of enabled cipher suites.
socFactory - The SSLSocketFactory to be used.

SSLTransport

public SSLTransport(javax.net.ssl.SSLSocket sock,
                    int serverPort,
                    SSLAssociation assoc)
Constructor based on the server side socket. The socket's session should have already been associated with the association.

Parameters:
sock - The socket top open.
serverPort - The port on which to open the socket.
assoc - The association.
Method Detail

enableLogging

public void enableLogging(Logger logger)
Provide this instance with a logger.

Parameters:
logger - The logger to be used.

createSocket

protected java.net.Socket createSocket(java.net.InetAddress host,
                                       int port)
                                throws java.io.IOException
Open the socket to the specified host and port.

Parameters:
host - The host on which to open the socket.
port - The port on which to open the socket.
Returns:
The socket created.
Throws:
java.io.IOException - When the socket could not be opened.

getSocketSession

public javax.net.ssl.SSLSession getSocketSession()
Return the SSLSession of the socket.

Returns:
The SSLSession of the socket associated with this transport.

toString

public java.lang.String toString()
Print out socket information.

Returns:
The socket information.

readMagic

protected boolean readMagic(int timeout,
                            byte[] buf,
                            int off)
                     throws java.io.EOFException
Reads four bytes from the input stream into the buffer at the specified offset. Returns true if the read was successful before the timeout occoured.

Parameters:
timeout - The time to wait for the arrival of the four bytes.
buf - The buffer to copy the four bytes to.
off - The offset to be used for the copy operation.
Returns:
True if reading was successful.
Throws:
java.io.EOFException - ???

close

public void close()
Close magic reader threads.