org.clazzes.remoting.client
Class SSLClientParameters

java.lang.Object
  extended by org.clazzes.remoting.SocketParameters
      extended by org.clazzes.remoting.client.ClientParameters
          extended by org.clazzes.remoting.client.SSLClientParameters

public class SSLClientParameters
extends ClientParameters

An SSL-specific implementation of the parameters object.

Author:
wglas

Field Summary
 
Fields inherited from class org.clazzes.remoting.client.ClientParameters
socketFactory
 
Fields inherited from class org.clazzes.remoting.SocketParameters
marshalerFactory
 
Constructor Summary
SSLClientParameters()
          Construct an SSL client parameters object with the following default parameters: needClientAuthtrue wantClientAuthfalse enableSessionCreationtrue soTimeout60000 tcpNoDelaytrue
 
Method Summary
 void addHandshakeCompletedListeners(javax.net.ssl.HandshakeCompletedListener handshakeCompletedListener)
           
 java.util.List<javax.net.ssl.HandshakeCompletedListener> getHandshakeCompletedListeners()
           
 javax.net.SocketFactory getSocketFactory()
          Return the socket factory used.
 boolean isEnableSessionCreation()
           
 boolean isNeedClientAuth()
           
 boolean isWantClientAuth()
           
 void setEnableSessionCreation(boolean enableSessionCreation)
           
 void setHandshakeCompletedListeners(java.util.List<javax.net.ssl.HandshakeCompletedListener> handshakeCompletedListeners)
           
 void setNeedClientAuth(boolean needClientAuth)
           
 void setWantClientAuth(boolean wantClientAuth)
           
 java.util.Map<java.lang.String,java.lang.Object> tuneSocket(java.net.Socket socket)
          Apply user-defined setting to the socket.
 
Methods inherited from class org.clazzes.remoting.client.ClientParameters
getSoTimeout, isAsynchronous, setAsynchronous, setSocketFactory, setSoTimeout
 
Methods inherited from class org.clazzes.remoting.SocketParameters
getMarshalerFactory, isTcpNoDelay, setMarshalerFactory, setTcpNoDelay
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SSLClientParameters

public SSLClientParameters()
Construct an SSL client parameters object with the following default parameters:
needClientAuthtrue
wantClientAuthfalse
enableSessionCreationtrue
soTimeout60000
tcpNoDelaytrue

Method Detail

getSocketFactory

public javax.net.SocketFactory getSocketFactory()
Return the socket factory used. If not set via {ClientParameters.setSocketFactory(SocketFactory), SSLSocketFactory.getDefault() is returned.

Overrides:
getSocketFactory in class ClientParameters
Returns:
The socket factory used by this client. If not set by ClientParameters.setSocketFactory(SocketFactory), SocketFactory.getDefault() is returned.

tuneSocket

public java.util.Map<java.lang.String,java.lang.Object> tuneSocket(java.net.Socket socket)
                                                            throws java.io.IOException
Description copied from class: SocketParameters
Apply user-defined setting to the socket. This may involve setting of SSL-parameters in derived classes.

Overrides:
tuneSocket in class ClientParameters
Parameters:
socket - The socket to prepare for connecting.
Returns:
A map of connection-bound metadata.
Throws:
java.io.IOException - Upon errors from methods of Socket.
See Also:
SocketMetaData, SSLMetaData

getHandshakeCompletedListeners

public java.util.List<javax.net.ssl.HandshakeCompletedListener> getHandshakeCompletedListeners()
Returns:
The list of SSL handshake completion listeners to register in tuneSocket(Socket).

setHandshakeCompletedListeners

public void setHandshakeCompletedListeners(java.util.List<javax.net.ssl.HandshakeCompletedListener> handshakeCompletedListeners)
Parameters:
handshakeCompletedListeners - The list of SSL handshake completion listeners to register in tuneSocket(Socket) to set.

addHandshakeCompletedListeners

public void addHandshakeCompletedListeners(javax.net.ssl.HandshakeCompletedListener handshakeCompletedListener)
Parameters:
handshakeCompletedListener - An SSL handshake completion listener to be registered by tuneSocket(Socket) to add.

isNeedClientAuth

public boolean isNeedClientAuth()
Returns:
Whether the SSL socket requests an obligatory client authentication.
See Also:
SSLSocket.getNeedClientAuth()

setNeedClientAuth

public void setNeedClientAuth(boolean needClientAuth)
Parameters:
needClientAuth - The need client authentication flag of the SSL socket to set.
See Also:
SSLSocket.setNeedClientAuth(boolean)

isWantClientAuth

public boolean isWantClientAuth()
Returns:
Whether the SSL socket requests an optional client authentication. If isNeedClientAuth() returns true, this flag is ignored.
See Also:
SSLSocket.getWantClientAuth()

setWantClientAuth

public void setWantClientAuth(boolean wantClientAuth)
Parameters:
wantClientAuth - The request client authentication flag of the SSL socket to set. If isNeedClientAuth() returns true, this flag is ignored.
See Also:
SSLSocket.setWantClientAuth(boolean)

isEnableSessionCreation

public boolean isEnableSessionCreation()
Returns:
Whether to enable session creation on the generated SSL socket.
See Also:
SSLSocket.getEnableSessionCreation()

setEnableSessionCreation

public void setEnableSessionCreation(boolean enableSessionCreation)
Parameters:
enableSessionCreation - The session enable flag to set to the SSL socket.
See Also:
SSLSocket.setEnableSessionCreation(boolean)


Copyright © 2010. All Rights Reserved.