org.opends.server.protocols.internal
Class InternalLDAPSocketFactory

java.lang.Object
  extended by javax.net.SocketFactory
      extended by org.opends.server.protocols.internal.InternalLDAPSocketFactory

@PublicAPI(stability=UNCOMMITTED,
           mayInstantiate=true,
           mayExtend=false,
           mayInvoke=true)
public final class InternalLDAPSocketFactory
extends javax.net.SocketFactory

This class provides an implementation of a javax.net.SocketFactory object that can be used to create internal LDAP sockets. This socket factory can be used with some common LDAP SDKs (e.g., JNDI) in order to allow that SDK to be used to perform internal operations within OpenDS with minimal changes needed from what is required to perform external LDAP communication.


Constructor Summary
InternalLDAPSocketFactory()
          Creates a new instance of this internal LDAP socket factory.
 
Method Summary
 java.net.Socket createSocket(java.net.InetAddress host, int port)
          Creates a new internal LDAP socket.
 java.net.Socket createSocket(java.net.InetAddress host, int port, java.net.InetAddress clientHost, int clientPort)
          Creates a new internal LDAP socket.
 java.net.Socket createSocket(java.lang.String host, int port)
          Creates a new internal LDAP socket.
 java.net.Socket createSocket(java.lang.String host, int port, java.net.InetAddress clientHost, int clientPort)
          Creates a new internal LDAP socket.
static javax.net.SocketFactory getDefault()
          Retrieves the default socket factory that should be used.
 java.lang.String toString()
          Retrieves a string representation of this internal LDAP socket factory.
 
Methods inherited from class javax.net.SocketFactory
createSocket
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

InternalLDAPSocketFactory

public InternalLDAPSocketFactory()
Creates a new instance of this internal LDAP socket factory.

Method Detail

getDefault

public static javax.net.SocketFactory getDefault()
Retrieves the default socket factory that should be used. Note that this method must be present for the implementation to work properly. Even though the superclass declares the same static method and static methods are not generally overridden, that is not the case here because the method is invoked through reflection, and the superclass returns a bogus socket factory.

Returns:
The default socket factory that should be used.

createSocket

public java.net.Socket createSocket(java.net.InetAddress host,
                                    int port)
Creates a new internal LDAP socket. The provided arguments will be ignored, as they are not needed by this implementation.

Specified by:
createSocket in class javax.net.SocketFactory
Parameters:
host - The remote address to which the socket should be connected.
port - The remote port to which the socket should be connected.
Returns:
The created internal LDAP socket.

createSocket

public java.net.Socket createSocket(java.lang.String host,
                                    int port)
Creates a new internal LDAP socket. The provided arguments will be ignored, as they are not needed by this implementation.

Specified by:
createSocket in class javax.net.SocketFactory
Parameters:
host - The remote address to which the socket should be connected.
port - The remote port to which the socket should be connected.
Returns:
The created internal LDAP socket.

createSocket

public java.net.Socket createSocket(java.net.InetAddress host,
                                    int port,
                                    java.net.InetAddress clientHost,
                                    int clientPort)
Creates a new internal LDAP socket. The provided arguments will be ignored, as they are not needed by this implementation.

Specified by:
createSocket in class javax.net.SocketFactory
Parameters:
host - The remote address to which the socket should be connected.
port - The remote port to which the socket should be connected.
clientHost - The local address to which the socket should be bound.
clientPort - The local port to which the socket should be bound.
Returns:
The created internal LDAP socket.

createSocket

public java.net.Socket createSocket(java.lang.String host,
                                    int port,
                                    java.net.InetAddress clientHost,
                                    int clientPort)
Creates a new internal LDAP socket. The provided arguments will be ignored, as they are not needed by this implementation.

Specified by:
createSocket in class javax.net.SocketFactory
Parameters:
host - The remote address to which the socket should be connected.
port - The remote port to which the socket should be connected.
clientHost - The local address to which the socket should be bound.
clientPort - The local port to which the socket should be bound.
Returns:
The created internal LDAP socket.

toString

public java.lang.String toString()
Retrieves a string representation of this internal LDAP socket factory.

Overrides:
toString in class java.lang.Object
Returns:
A string representation of this internal LDAP socket factory.