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

public Class ConfigurableSSLServerSocketFactory

extends ServerSocketFactory
Class Inheritance
Imports
java.io.IOException, java.net.InetAddress, .ServerSocket, javax.net.ServerSocketFactory, javax.net.ssl.SSLServerSocket, .SSLServerSocketFactory

An SSLServerSocketFactory that configures SSL parameters (those specified in SSLParametersConfiguration) on each newly created socket.

When any of this factory's createServerSocket methods are invoked, it calls on a delegate SSLServerSocketFactory 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 SSLServerSocketFactory
private final SSLParametersConfiguration

Constructor Summary

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

Creates a new factory.

Method Summary

Modifier and TypeMethod and Description
public ServerSocket
createServerSocket(int
the port to listen to
port
,
int
how many connections are queued
backlog
,
InetAddress
the network interface address to use
ifAddress
)

Implements abstract javax.net.ServerSocketFactory.createServerSocket.

Returns a server socket bound to the specified port, with a specified listen backlog and local IP.
public ServerSocket
createServerSocket(int
the port to listen to
port
,
int
how many connections are queued
backlog
)

Implements abstract javax.net.ServerSocketFactory.createServerSocket.

Returns a server socket bound to the specified port, and uses the specified connection backlog.
public ServerSocket
createServerSocket(int
the port to listen to
port
)

Implements abstract javax.net.ServerSocketFactory.createServerSocket.

Returns a server socket bound to the specified port.
Inherited from javax.net.ServerSocketFactory:
createServerSocketgetDefault

Field Detail

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

Constructor Detail

ConfigurableSSLServerSocketFactoryback to summary
public ConfigurableSSLServerSocketFactory(SSLParametersConfiguration parameters, SSLServerSocketFactory delegate)

Creates a new factory.

Parameters
parameters:SSLParametersConfiguration

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

delegate:SSLServerSocketFactory

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

Method Detail

createServerSocketback to summary
public ServerSocket createServerSocket(int port, int backlog, InetAddress ifAddress) throws IOException

Implements abstract javax.net.ServerSocketFactory.createServerSocket.

Doc from javax.net.ServerSocketFactory.createServerSocket.

Returns a server socket bound to the specified port, with a specified listen backlog and local IP.

The ifAddress argument can be used on a multi-homed host for a ServerSocket that will only accept connect requests to one of its addresses. If ifAddress is null, it will accept connections on all local addresses. The socket is configured with the socket options (such as accept timeout) given to this factory.

The backlog argument must be a positive value greater than 0. If the value passed if equal or less than 0, then the default value will be assumed.

If there is a security manager, its checkListen method is called with the port argument as its argument to ensure the operation is allowed. This could result in a SecurityException.

Parameters
port:int

the port to listen to

backlog:int

how many connections are queued

ifAddress:InetAddress

the network interface address to use

Returns:ServerSocket

the ServerSocket

Annotations
@Override
Exceptions
IOException:
for networking errors
createServerSocketback to summary
public ServerSocket createServerSocket(int port, int backlog) throws IOException

Implements abstract javax.net.ServerSocketFactory.createServerSocket.

Doc from javax.net.ServerSocketFactory.createServerSocket.

Returns a server socket bound to the specified port, and uses the specified connection backlog. The socket is configured with the socket options (such as accept timeout) given to this factory.

The backlog argument must be a positive value greater than 0. If the value passed if equal or less than 0, then the default value will be assumed.

If there is a security manager, its checkListen method is called with the port argument as its argument to ensure the operation is allowed. This could result in a SecurityException.

Parameters
port:int

the port to listen to

backlog:int

how many connections are queued

Returns:ServerSocket

the ServerSocket

Annotations
@Override
Exceptions
IOException:
for networking errors
createServerSocketback to summary
public ServerSocket createServerSocket(int port) throws IOException

Implements abstract javax.net.ServerSocketFactory.createServerSocket.

Doc from javax.net.ServerSocketFactory.createServerSocket.

Returns a server socket bound to the specified port. The socket is configured with the socket options (such as accept timeout) given to this factory.

If there is a security manager, its checkListen method is called with the port argument as its argument to ensure the operation is allowed. This could result in a SecurityException.

Parameters
port:int

the port to listen to

Returns:ServerSocket

the ServerSocket

Annotations
@Override
Exceptions
IOException:
for networking errors