|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.unboundid.ldap.listener.InMemoryListenerConfig
@NotMutable @ThreadSafety(level=COMPLETELY_THREADSAFE) public final class InMemoryListenerConfig
This class provides a data structure that can be used to configure a
listener for use in the in-memory directory server. Each in-memory directory
server instance has the ability to have multiple listeners, and those
listeners may have different settings (e.g., listen on one port for
unencrypted LDAP communication with optional support for StartTLS, and listen
on a separate port for SSL-encrypted communication). If the server is to
provide support for SSL and/or StartTLS, then the SSLUtil
class can
make it easy to create the necessary socket factories.
Constructor Summary | |
---|---|
InMemoryListenerConfig(java.lang.String listenerName,
java.net.InetAddress listenAddress,
int listenPort,
javax.net.ServerSocketFactory serverSocketFactory,
javax.net.SocketFactory clientSocketFactory,
javax.net.ssl.SSLSocketFactory startTLSSocketFactory)
Creates a new in-memory directory server listener configuration with the provided settings. |
Method Summary | |
---|---|
static InMemoryListenerConfig |
createLDAPConfig(java.lang.String listenerName)
Creates a new listener configuration that will listen for unencrypted LDAP communication on an automatically-selected port on all available addresses. |
static InMemoryListenerConfig |
createLDAPConfig(java.lang.String listenerName,
java.net.InetAddress listenAddress,
int listenPort,
javax.net.ssl.SSLSocketFactory startTLSSocketFactory)
Creates a new listener configuration that will listen for unencrypted LDAP communication, and may optionally support StartTLS. |
static InMemoryListenerConfig |
createLDAPConfig(java.lang.String listenerName,
int listenPort)
Creates a new listener configuration that will listen for unencrypted LDAP communication on the specified port on all available addresses. |
static InMemoryListenerConfig |
createLDAPSConfig(java.lang.String listenerName,
java.net.InetAddress listenAddress,
int listenPort,
javax.net.ssl.SSLServerSocketFactory serverSocketFactory,
javax.net.ssl.SSLSocketFactory clientSocketFactory)
Creates a new listener configuration that will listen for SSL-encrypted LDAP communication on an automatically-selected port on all available addresses. |
static InMemoryListenerConfig |
createLDAPSConfig(java.lang.String listenerName,
int listenPort,
javax.net.ssl.SSLServerSocketFactory serverSocketFactory)
Creates a new listener configuration that will listen for SSL-encrypted LDAP communication on the specified port on all available addresses. |
static InMemoryListenerConfig |
createLDAPSConfig(java.lang.String listenerName,
javax.net.ssl.SSLServerSocketFactory serverSocketFactory)
Creates a new listener configuration that will listen for SSL-encrypted LDAP communication on an automatically-selected port on all available addresses. |
javax.net.SocketFactory |
getClientSocketFactory()
Retrieves the socket factory that should be used to create client connections to the server, if defined. |
java.net.InetAddress |
getListenAddress()
Retrieves the address on which the listener should accept connections from clients, if defined. |
java.lang.String |
getListenerName()
Retrieves the name for this listener configuration. |
int |
getListenPort()
Retrieves the port on which the listener should accept connections from clients, if defined. |
javax.net.ServerSocketFactory |
getServerSocketFactory()
Retrieves the socket factory that should be used to create sockets when accepting client connections, if defined. |
javax.net.ssl.SSLSocketFactory |
getStartTLSSocketFactory()
Retrieves the socket factory that should be used to add StartTLS encryption to existing connections, if defined. |
java.lang.String |
toString()
Retrieves a string representation of this listener configuration. |
void |
toString(java.lang.StringBuilder buffer)
Appends a string representation of this listener configuration to the provided buffer. |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public InMemoryListenerConfig(java.lang.String listenerName, java.net.InetAddress listenAddress, int listenPort, javax.net.ServerSocketFactory serverSocketFactory, javax.net.SocketFactory clientSocketFactory, javax.net.ssl.SSLSocketFactory startTLSSocketFactory) throws LDAPException
listenerName
- The name to assign to this listener. It
must not be null
and must not be the
same as the name for any other listener
configured in the server.listenAddress
- The address on which the listener should
accept connections from clients. It may be
null
to indicate that it should
accept connections on all addresses on all
interfaces.listenPort
- The port on which the listener should accept
connections from clients. It may be 0 to
indicate that the server should
automatically choose an available port.serverSocketFactory
- The socket factory that should be used to
create sockets when accepting client
connections. It may be null
if the
JVM-default server socket factory should be
used.clientSocketFactory
- The socket factory that should be used to
create client connections to the server. It
may be null
if the JVM-default
socket factory should be used.startTLSSocketFactory
- The socket factory that should be used to
add StartTLS encryption to existing
connections. It may be null
if
StartTLS is not to be supported on this
listener, and should be null
if the
server socket factory already provides some
other form of communication security.
LDAPException
- If the provided listener name is null
or
the configured listen port is out of range.Method Detail |
---|
public static InMemoryListenerConfig createLDAPConfig(java.lang.String listenerName) throws LDAPException
listenerName
- The name to use for the listener. It must not be
null
.
LDAPException
- If the provided name is null
.public static InMemoryListenerConfig createLDAPConfig(java.lang.String listenerName, int listenPort) throws LDAPException
listenerName
- The name to use for the listener. It must not be
null
.listenPort
- The port on which the listener should accept
connections from clients. It may be 0 to indicate
that the server should automatically choose an
available port.
LDAPException
- If the provided listener name is null
or
the configured listen port is out of range.public static InMemoryListenerConfig createLDAPConfig(java.lang.String listenerName, java.net.InetAddress listenAddress, int listenPort, javax.net.ssl.SSLSocketFactory startTLSSocketFactory) throws LDAPException
listenerName
- The name to assign to this listener. It
must not be null
and must not be the
same as the name for any other listener
configured in the server.listenAddress
- The address on which the listener should
accept connections from clients. It may be
null
to indicate that it should
accept connections on all addresses on all
interfaces.listenPort
- The port on which the listener should accept
connections from clients. It may be 0 to
indicate that the server should
automatically choose an available port.startTLSSocketFactory
- The socket factory that should be used to
add StartTLS encryption to an existing
connection. It may be null
if
StartTLS is not to be supported on this
listener, and should be null
if the
server socket factory already provides some
other form of communication security.
LDAPException
- If the provided listener name is null
or
the configured listen port is out of range.public static InMemoryListenerConfig createLDAPSConfig(java.lang.String listenerName, javax.net.ssl.SSLServerSocketFactory serverSocketFactory) throws LDAPException
listenerName
- The name to use for the listener. It must not
be null
.serverSocketFactory
- The SSL server socket factory that will be
used for accepting SSL-based connections from
clients. It must not be null
.
LDAPException
- If the provided name is null
.public static InMemoryListenerConfig createLDAPSConfig(java.lang.String listenerName, int listenPort, javax.net.ssl.SSLServerSocketFactory serverSocketFactory) throws LDAPException
listenerName
- The name to use for the listener. It must not
be null
.listenPort
- The port on which the listener should accept
connections from clients. It may be 0 to
indicate that the server should
automatically choose an available port.serverSocketFactory
- The SSL server socket factory that will be
used for accepting SSL-based connections from
clients. It must not be null
.
LDAPException
- If the provided name is null
.public static InMemoryListenerConfig createLDAPSConfig(java.lang.String listenerName, java.net.InetAddress listenAddress, int listenPort, javax.net.ssl.SSLServerSocketFactory serverSocketFactory, javax.net.ssl.SSLSocketFactory clientSocketFactory) throws LDAPException
listenerName
- The name to use for the listener. It must not
be null
.listenAddress
- The address on which the listener should
accept connections from clients. It may be
null
to indicate that it should
accept connections on all addresses on all
interfaces.listenPort
- The port on which the listener should accept
connections from clients. It may be 0 to
indicate that the server should
automatically choose an available port.serverSocketFactory
- The SSL server socket factory that will be
used for accepting SSL-based connections from
clients. It must not be null
.clientSocketFactory
- The SSL socket factory that will be used to
create secure connections to the server. It
may be null
if a default "trust all"
socket factory should be used.
LDAPException
- If the provided name or server socket factory is
null
, or an error occurs while attempting to create a
client socket factory.public java.lang.String getListenerName()
public java.net.InetAddress getListenAddress()
null
if it should accept connections on all
addresses on all interfaces.public int getListenPort()
public javax.net.ServerSocketFactory getServerSocketFactory()
null
if the JVM-default
server socket factory should be used.public javax.net.SocketFactory getClientSocketFactory()
null
if the JVM-default
socket factory should be used.public javax.net.ssl.SSLSocketFactory getStartTLSSocketFactory()
null
if StartTLS should not be
supported.public java.lang.String toString()
toString
in class java.lang.Object
public void toString(java.lang.StringBuilder buffer)
buffer
- The buffer to which the information should be appended.
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |