Class JavaToLDAPSocketFactory
java.lang.Object
javax.net.SocketFactory
com.unboundid.ldap.sdk.migrate.ldapjdk.JavaToLDAPSocketFactory
- All Implemented Interfaces:
LDAPSocketFactory
@NotMutable
@ThreadSafety(level=COMPLETELY_THREADSAFE)
public final class JavaToLDAPSocketFactory
extends SocketFactory
implements LDAPSocketFactory
This class provides an
This class is primarily intended to be used in the process of updating applications which use the Netscape Directory SDK for Java to switch to or coexist with the UnboundID LDAP SDK for Java. For applications not written using the Netscape Directory SDK for Java, the standard Java socket factory may be used directly without the need for the
LDAPSocketFactory implementation that wraps a
standard Java socket factory to use when creating sockets. It will also
appear as a standard Java socket factory.
This class is primarily intended to be used in the process of updating applications which use the Netscape Directory SDK for Java to switch to or coexist with the UnboundID LDAP SDK for Java. For applications not written using the Netscape Directory SDK for Java, the standard Java socket factory may be used directly without the need for the
LDAPSocketFactory
interface.-
Constructor Summary
ConstructorsConstructorDescriptionCreates a new instance of this class that will use the provided socket factory. -
Method Summary
Modifier and TypeMethodDescriptioncreateSocket(String host, int port) Creates a new socket to the specified server.createSocket(String host, int port, InetAddress localAddress, int localPort) Creates a new socket to the specified server.createSocket(InetAddress address, int port) Creates a new socket to the specified server.createSocket(InetAddress address, int port, InetAddress localAddress, int localPort) Creates a new socket to the specified server.makeSocket(String host, int port) Creates a socket to use when connecting to the directory sever.Methods inherited from class javax.net.SocketFactory
createSocket, getDefault
-
Constructor Details
-
JavaToLDAPSocketFactory
Creates a new instance of this class that will use the provided socket factory.- Parameters:
f- The socket factory to use to create the LDAP socket factory.
-
-
Method Details
-
createSocket
Creates a new socket to the specified server.- Specified by:
createSocketin classSocketFactory- Parameters:
host- The host to which the connection should be established.port- The port to which the connection should be established.- Returns:
- The socket that was created.
- Throws:
IOException- If a problem occurs while creating the socket.
-
createSocket
@NotNull public Socket createSocket(@NotNull String host, int port, @NotNull InetAddress localAddress, int localPort) throws IOException Creates a new socket to the specified server.- Specified by:
createSocketin classSocketFactory- Parameters:
host- The host to which the connection should be established.port- The port to which the connection should be established.localAddress- The local address to use for the connection. This will be ignored.localPort- The local port to use for the connection. This will be ignored.- Returns:
- The socket that was created.
- Throws:
IOException- If a problem occurs while creating the socket.
-
createSocket
Creates a new socket to the specified server.- Specified by:
createSocketin classSocketFactory- Parameters:
address- The address to which the connection should be established.port- The port to which the connection should be established.- Returns:
- The socket that was created.
- Throws:
IOException- If a problem occurs while creating the socket.
-
createSocket
@NotNull public Socket createSocket(@NotNull InetAddress address, int port, @NotNull InetAddress localAddress, int localPort) throws IOException Creates a new socket to the specified server.- Specified by:
createSocketin classSocketFactory- Parameters:
address- The address to which the connection should be established.port- The port to which the connection should be established.localAddress- The local address to use for the connection. This will be ignored.localPort- The local port to use for the connection. This will be ignored.- Returns:
- The socket that was created.
- Throws:
IOException- If a problem occurs while creating the socket.
-
makeSocket
Creates a socket to use when connecting to the directory sever.- Specified by:
makeSocketin interfaceLDAPSocketFactory- Parameters:
host- The address of the server to which the socket should be connected.port- The port of the server to which the socket should be connected.- Returns:
- The connected socket to use to communicate with the directory server.
- Throws:
LDAPException- If a problem occurs while establishing the connection.
-