org.clazzes.remoting.client
Class SSLClientParameters
java.lang.Object
org.clazzes.remoting.SocketParameters
org.clazzes.remoting.client.ClientParameters
org.clazzes.remoting.client.SSLClientParameters
public class SSLClientParameters
- extends ClientParameters
An SSL-specific implementation of the parameters object.
- Author:
- wglas
Constructor Summary |
SSLClientParameters()
Construct an SSL client parameters object with the following default parameters:
needClientAuthtrue
wantClientAuthfalse
enableSessionCreationtrue
soTimeout60000
tcpNoDelaytrue
|
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
SSLClientParameters
public SSLClientParameters()
- Construct an SSL client parameters object with the following default parameters:
needClientAuth | true |
wantClientAuth | false |
enableSessionCreation | true |
soTimeout | 60000 |
tcpNoDelay | true |
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.