Top Description Fields Constructors Methods
ch.qos.logback.core.net.ssl

public Class ConfigurableSSLSocketFactory

extends SocketFactory
Class Inheritance
Imports
java.io.IOException, java.net.InetAddress, .Socket, .UnknownHostException, javax.net.SocketFactory, javax.net.ssl.SSLParameters, .SSLSocket, .SSLSocketFactory

An SSLSocketFactory that configures SSL parameters (those covered by SSLParameters) on each newly created socket.

When any of this factory's createSocket methods are invoked, it calls on a SSLSocketFactory delegate to create the socket, and then sets the SSL parameters of the socket (using the provided configuration) before returning the socket to the caller.

Author
Carl Harris

Field Summary

Modifier and TypeField and Description
private final SSLSocketFactory
private final SSLParametersConfiguration

Constructor Summary

AccessConstructor and Description
public
ConfigurableSSLSocketFactory(SSLParametersConfiguration
parameters that will be configured on each socket created by the factory
parameters
,
SSLSocketFactory
socket factory that will be called upon to create sockets before configuration
delegate
)

Creates a new factory.

Method Summary

Modifier and TypeMethod and Description
public Socket
createSocket(InetAddress
the server network address
address
,
int
the server port
port
,
InetAddress
the client network address
localAddress
,
int
the client port
localPort
)

Implements abstract javax.net.SocketFactory.createSocket.

Creates a socket and connect it to the specified remote address on the specified remote port.
public Socket
createSocket(InetAddress
the server host
host
,
int
the server port
port
)

Implements abstract javax.net.SocketFactory.createSocket.

Creates a socket and connects it to the specified port number at the specified address.
public Socket
createSocket(String
the server host name with which to connect, or null for the loopback address.
host
,
int
the server port
port
,
InetAddress
the local address the socket is bound to
localHost
,
int
the local port the socket is bound to
localPort
)

Implements abstract javax.net.SocketFactory.createSocket.

Creates a socket and connects it to the specified remote host on the specified remote port.
public Socket
createSocket(String
the server host name with which to connect, or null for the loopback address.
host
,
int
the server port
port
)

Implements abstract javax.net.SocketFactory.createSocket.

Creates a socket and connects it to the specified remote host at the specified remote port.
Inherited from javax.net.SocketFactory:
createSocketgetDefault

Field Detail

delegateback to summary
private final SSLSocketFactory delegate
parametersback to summary
private final SSLParametersConfiguration parameters

Constructor Detail

ConfigurableSSLSocketFactoryback to summary
public ConfigurableSSLSocketFactory(SSLParametersConfiguration parameters, SSLSocketFactory delegate)

Creates a new factory.

Parameters
parameters:SSLParametersConfiguration

parameters that will be configured on each socket created by the factory

delegate:SSLSocketFactory

socket factory that will be called upon to create sockets before configuration

Method Detail

createSocketback to summary
public Socket createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) throws IOException

Implements abstract javax.net.SocketFactory.createSocket.

Doc from javax.net.SocketFactory.createSocket.

Creates a socket and connect it to the specified remote address on the specified remote port. The socket will also be bound to the local address and port supplied. The socket is configured using the socket options established for this factory.

If there is a security manager, its checkConnect method is called with the host address and port as its arguments. This could result in a SecurityException.

Parameters
address:InetAddress

the server network address

port:int

the server port

localAddress:InetAddress

the client network address

localPort:int

the client port

Returns:Socket

the Socket

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs when creating the socket
createSocketback to summary
public Socket createSocket(InetAddress host, int port) throws IOException

Implements abstract javax.net.SocketFactory.createSocket.

Doc from javax.net.SocketFactory.createSocket.

Creates a socket and connects it to the specified port number at the specified address. This socket is configured using the socket options established for this factory.

If there is a security manager, its checkConnect method is called with the host address and port as its arguments. This could result in a SecurityException.

Parameters
host:InetAddress

the server host

port:int

the server port

Returns:Socket

the Socket

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs when creating the socket
createSocketback to summary
public Socket createSocket(String host, int port, InetAddress localHost, int localPort) throws IOException, UnknownHostException

Implements abstract javax.net.SocketFactory.createSocket.

Doc from javax.net.SocketFactory.createSocket.

Creates a socket and connects it to the specified remote host on the specified remote port. The socket will also be bound to the local address and port supplied. This socket is configured using the socket options established for this factory.

If there is a security manager, its checkConnect method is called with the host address and port as its arguments. This could result in a SecurityException.

Parameters
host:String

the server host name with which to connect, or null for the loopback address.

port:int

the server port

localHost:InetAddress

the local address the socket is bound to

localPort:int

the local port the socket is bound to

Returns:Socket

the Socket

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs when creating the socket
UnknownHostException:
if the host is not known
createSocketback to summary
public Socket createSocket(String host, int port) throws IOException, UnknownHostException

Implements abstract javax.net.SocketFactory.createSocket.

Doc from javax.net.SocketFactory.createSocket.

Creates a socket and connects it to the specified remote host at the specified remote port. This socket is configured using the socket options established for this factory.

If there is a security manager, its checkConnect method is called with the host address and port as its arguments. This could result in a SecurityException.

Parameters
host:String

the server host name with which to connect, or null for the loopback address.

port:int

the server port

Returns:Socket

the Socket

Annotations
@Override
Exceptions
IOException:
if an I/O error occurs when creating the socket
UnknownHostException:
if the host is not known