issrg.pba.management.agent
Class SSLSocketFactoryWrap

java.lang.Object
  extended by javax.net.SocketFactory
      extended by javax.net.ssl.SSLSocketFactory
          extended by issrg.pba.management.agent.SSLSocketFactoryWrap
All Implemented Interfaces:
java.util.EventListener, javax.net.ssl.HandshakeCompletedListener

public class SSLSocketFactoryWrap
extends javax.net.ssl.SSLSocketFactory
implements javax.net.ssl.HandshakeCompletedListener

wrap the SSL socket factory.

this wrap was created to allow access to SSL sockets and from there access to the peer principal ( the authenticated PKC's subject)

as a socket is authenticated, a notification of the peer principal is given to the agent.

Version:
0.2.2008.03.10
Author:
mfb4@kent.ac.uk

Method Summary
 java.net.Socket createSocket()
          Delegate to wrapped factory.
 java.net.Socket createSocket(java.net.InetAddress host, int port)
          Delegate to wrapped factory.
 java.net.Socket createSocket(java.net.InetAddress address, int port, java.net.InetAddress localAddress, int localPort)
          Delegate to wrapped factory.
 java.net.Socket createSocket(java.net.Socket s, java.lang.String host, int port, boolean autoClose)
          This method passes of the creation of the socket.
 java.net.Socket createSocket(java.lang.String host, int port)
          Delegate to wrapped factory.
 java.net.Socket createSocket(java.lang.String host, int port, java.net.InetAddress localHost, int localPort)
          Delegate to wrapped factory.
 boolean equals(java.lang.Object obj)
          Delegate to wrapped factory.
 java.lang.String[] getDefaultCipherSuites()
          Delegate to wrapped factory.
 java.lang.String[] getSupportedCipherSuites()
          Delegate to wrapped factory.
 void handshakeCompleted(javax.net.ssl.HandshakeCompletedEvent event)
          listen for a successful socket handshake completion.
 int hashCode()
          Delegate to wrapped factory.
 java.lang.String toString()
          Delegate to wrapped factory.
 
Methods inherited from class javax.net.ssl.SSLSocketFactory
getDefault
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Method Detail

createSocket

public java.net.Socket createSocket(java.net.Socket s,
                                    java.lang.String host,
                                    int port,
                                    boolean autoClose)
                             throws java.io.IOException
This method passes of the creation of the socket. to the wrapped factory, then listens for Handshake completion.

Specified by:
createSocket in class javax.net.ssl.SSLSocketFactory
Parameters:
s - passed down
host - passed down
port - passed down
autoClose - passed down
Returns:
the SSL socket
Throws:
java.io.IOException - on an IO exception
Since:
0.2.2008.03.10
See Also:
(java.net.Socket, java.lang.String, int, boolean)

handshakeCompleted

public void handshakeCompleted(javax.net.ssl.HandshakeCompletedEvent event)
listen for a successful socket handshake completion.

Specified by:
handshakeCompleted in interface javax.net.ssl.HandshakeCompletedListener
Parameters:
event - object
Since:
0.2.2008.03.10

getDefaultCipherSuites

public java.lang.String[] getDefaultCipherSuites()
Delegate to wrapped factory.

Specified by:
getDefaultCipherSuites in class javax.net.ssl.SSLSocketFactory
Returns:
...
See Also:
SSLSocketFactory.getDefaultCipherSuites()

getSupportedCipherSuites

public java.lang.String[] getSupportedCipherSuites()
Delegate to wrapped factory.

Specified by:
getSupportedCipherSuites in class javax.net.ssl.SSLSocketFactory
Returns:
...
See Also:
SSLSocketFactory.getSupportedCipherSuites()

createSocket

public java.net.Socket createSocket()
                             throws java.io.IOException
Delegate to wrapped factory.

Overrides:
createSocket in class javax.net.SocketFactory
Returns:
...
Throws:
java.io.IOException - ...
See Also:
SocketFactory.createSocket()

createSocket

public java.net.Socket createSocket(java.net.InetAddress host,
                                    int port)
                             throws java.io.IOException
Delegate to wrapped factory.

Specified by:
createSocket in class javax.net.SocketFactory
Parameters:
host - ...
port - ...
Returns:
...
Throws:
java.io.IOException - ...
See Also:
SocketFactory.createSocket(java.net.InetAddress, int)

createSocket

public java.net.Socket createSocket(java.net.InetAddress address,
                                    int port,
                                    java.net.InetAddress localAddress,
                                    int localPort)
                             throws java.io.IOException
Delegate to wrapped factory.

Specified by:
createSocket in class javax.net.SocketFactory
Parameters:
address - ...
port - ...
localAddress - ...
localPort - ...
Returns:
...
Throws:
java.io.IOException - ...
See Also:
(java.net.InetAddress, int, java.net.InetAddress, int)

createSocket

public java.net.Socket createSocket(java.lang.String host,
                                    int port)
                             throws java.io.IOException
Delegate to wrapped factory.

Specified by:
createSocket in class javax.net.SocketFactory
Parameters:
host - ...
port - ...
Returns:
...
Throws:
java.io.IOException - ...
See Also:
SocketFactory.createSocket(java.lang.String, int)

createSocket

public java.net.Socket createSocket(java.lang.String host,
                                    int port,
                                    java.net.InetAddress localHost,
                                    int localPort)
                             throws java.io.IOException
Delegate to wrapped factory.

Specified by:
createSocket in class javax.net.SocketFactory
Parameters:
host - ...
port - ...
localHost - ...
localPort - ...
Returns:
...
Throws:
java.io.IOException - ...
See Also:
(java.lang.String, int, java.net.InetAddress, int)

toString

public java.lang.String toString()
Delegate to wrapped factory.

Overrides:
toString in class java.lang.Object
Returns:
...
See Also:
Object.toString()

equals

public boolean equals(java.lang.Object obj)
Delegate to wrapped factory.

Overrides:
equals in class java.lang.Object
Parameters:
obj - ...
Returns:
...
See Also:
Object.equals(java.lang.Object)

hashCode

public int hashCode()
Delegate to wrapped factory.

Overrides:
hashCode in class java.lang.Object
Returns:
...
See Also:
Object.hashCode()