LDAPJDK 4.1

netscape.ldap
Interface LDAPv3

All Known Implementing Classes:
LDAPConnection

public interface LDAPv3
extends LDAPv2

Specifies additional features available in version 3 of the LDAP protocol. (To view preliminary information on this work in progress, see the LDAP v3 internet draft. You can find the latest version of this document listed under the Internet-Drafts section of the ASID home page.)


Field Summary
static java.lang.String ALL_USER_ATTRS
          Attribute type that you can specify in the LDAPConnection search method if you want to retrieve all attribute types.
static int CLIENTCONTROLS
          Option specifying client controls for LDAP operations.
static java.lang.String NO_ATTRS
          Attribute type that you can specify in the LDAPConnection search method if you don't want to retrieve any of the attribute types for entries found by the search.
static int SERVERCONTROLS
          Option specifying server controls for LDAP operations.
 
Fields inherited from interface netscape.ldap.LDAPv2
BATCHSIZE, BIND, DEFAULT_PORT, DEREF, DEREF_ALWAYS, DEREF_FINDING, DEREF_NEVER, DEREF_SEARCHING, PROTOCOL_VERSION, REFERRALS, REFERRALS_HOP_LIMIT, REFERRALS_REBIND_PROC, SCOPE_BASE, SCOPE_ONE, SCOPE_SUB, SERVER_TIMELIMIT, SIZELIMIT, TIMELIMIT
 
Method Summary
 void authenticate(int version, java.lang.String dn, java.lang.String passwd)
          Authenticates to the LDAP server (to which the object is currently connected) using the specified name, password, and version of the LDAP protocol.
 void bind(int version, java.lang.String dn, java.lang.String passwd)
          Authenticates to the LDAP server (to which the object is currently connected) using the specified name, password, and version of the LDAP protocol.
 void connect(int version, java.lang.String host, int port, java.lang.String dn, java.lang.String passwd)
          Connects and authenticates to the LDAP server using the specified version of the LDAP protocol.
 LDAPExtendedOperation extendedOperation(LDAPExtendedOperation op)
          Performs an extended operation on the directory.
 LDAPControl[] getResponseControls()
          Returns an array of the latest controls (if any) from the server.
 void rename(java.lang.String DN, java.lang.String newRDN, java.lang.String newParentDN, boolean deleteOldRDN)
          Renames and moves an entry in the directory.
 void rename(java.lang.String DN, java.lang.String newRDN, java.lang.String newParentDN, boolean deleteOldRDN, LDAPConstraints cons)
          Renames and moves an entry in the directory.
 
Methods inherited from interface netscape.ldap.LDAPv2
abandon, add, add, authenticate, bind, compare, compare, connect, connect, delete, delete, disconnect, getOption, modify, modify, modify, modify, read, read, read, rename, rename, search, search, setOption
 

Field Detail

CLIENTCONTROLS

public static final int CLIENTCONTROLS
Option specifying client controls for LDAP operations. These controls are interpreted by the client and are not passed to the LDAP server.
See Also:
LDAPControl, LDAPConnection.getOption(int), LDAPConnection.setOption(int, java.lang.Object)

SERVERCONTROLS

public static final int SERVERCONTROLS
Option specifying server controls for LDAP operations. These controls are passed to the LDAP server. They may also be returned by the server.
See Also:
LDAPControl, LDAPConnection.getOption(int), LDAPConnection.setOption(int, java.lang.Object)

NO_ATTRS

public static final java.lang.String NO_ATTRS
Attribute type that you can specify in the LDAPConnection search method if you don't want to retrieve any of the attribute types for entries found by the search.
See Also:
LDAPConnection.search(netscape.ldap.LDAPUrl)

ALL_USER_ATTRS

public static final java.lang.String ALL_USER_ATTRS
Attribute type that you can specify in the LDAPConnection search method if you want to retrieve all attribute types. You can use this if you want to retrieve all attributes in addition to an operational attribute. For example:

 ...
 String [] MY_ATTRS = { LDAPv3.ALL_USER_ATTRS, "modifiersName",
     "modifyTimestamp" };
 LDAPSearchResults res = ld.search( MY_SEARCHBASE,
     LDAPConnection.SCOPE_SUB, MY_FILTER, MY_ATTRS, false, cons );
 ...
 
See Also:
LDAPConnection.search(netscape.ldap.LDAPUrl)
Method Detail

connect

public void connect(int version,
                    java.lang.String host,
                    int port,
                    java.lang.String dn,
                    java.lang.String passwd)
             throws LDAPException
Connects and authenticates to the LDAP server using the specified version of the LDAP protocol.
Parameters:
version - requested version of the LDAP protocol: currently 2 or 3
host - hostname of the LDAP server
port - port number of the LDAP server. To specify the default port, use DEFAULT_PORT.
dn - distinguished name to use for authentication
passwd - password for authentication
Throws:
LDAPException - Failed to connect and authenticate to the server.

authenticate

public void authenticate(int version,
                         java.lang.String dn,
                         java.lang.String passwd)
                  throws LDAPException
Authenticates to the LDAP server (to which the object is currently connected) using the specified name, password, and version of the LDAP protocol. If the server does not support the requested protocol version, an exception is thrown. If the object has been disconnected from an LDAP server, this method attempts to reconnect to the server. If the object had already authenticated, the old authentication is discarded.
Parameters:
version - requested LDAP protocol version: currently 2 or 3.
dn - if non-null and non-empty, specifies that the connection and all operations through it should authenticate with dn as the distinguished name
passwd - if non-null and non-empty, specifies that the connection and all operations through it should authenticated with passwd as password
Throws:
LDAPException - Failed to authenticate to the LDAP server.

bind

public void bind(int version,
                 java.lang.String dn,
                 java.lang.String passwd)
          throws LDAPException
Authenticates to the LDAP server (to which the object is currently connected) using the specified name, password, and version of the LDAP protocol. If the server does not support the requested version of the protocol, an exception is thrown. If the object has been disconnected from an LDAP server, this method attempts to reconnect to the server. If the object had already authenticated, the old authentication is discarded.
Parameters:
version - requested LDAP protocol version: currently 2 or 3.
dn - if non-null and non-empty, specifies that the connection and all operations through it should authenticate with dn as the distinguished name
passwd - if non-null and non-empty, specifies that the connection and all operations through it should authenticate with passwd as password
Throws:
LDAPException - Failed to authenticate to the LDAP server.

extendedOperation

public LDAPExtendedOperation extendedOperation(LDAPExtendedOperation op)
                                        throws LDAPException
Performs an extended operation on the directory. Extended operations are part of version 3 of the LDAP protocol.

Parameters:
op - LDAPExtendedOperation object specifying the OID of the extended operation and the data to use in the operation
Returns:
LDAPExtendedOperation object representing the extended response returned by the server.
Throws:
LDAPException - Failed to execute the operation
See Also:
LDAPExtendedOperation

rename

public void rename(java.lang.String DN,
                   java.lang.String newRDN,
                   java.lang.String newParentDN,
                   boolean deleteOldRDN)
            throws LDAPException
Renames and moves an entry in the directory.
Parameters:
DN - original distinguished name (DN) for the entry
newRDN - new relative distinguished name (RDN) for the entry
newParentDN - distinguished name of the new parent entry of the specified entry
deleteOldRDN - specifies whether or not to remove the old RDN when renaming and moving the entry. If true, the old RDN will be deleted.
Throws:
LDAPException - Failed to rename the specified entry.

rename

public void rename(java.lang.String DN,
                   java.lang.String newRDN,
                   java.lang.String newParentDN,
                   boolean deleteOldRDN,
                   LDAPConstraints cons)
            throws LDAPException
Renames and moves an entry in the directory.
Parameters:
DN - original distinguished name (DN) for the entry
newRDN - new relative distinguished name (RDN) for the entry
newParentDN - distinguished name of the new parent entry of the specified entry
deleteOldRDN - specifies whether or not to remove the old RDN when renaming and moving the entry. If true, the old RDN will be deleted.
cons - the constraints set for the rename operation
Throws:
LDAPException - Failed to rename the specified entry.

getResponseControls

public LDAPControl[] getResponseControls()
Returns an array of the latest controls (if any) from the server.
Returns:
an array of the controls returned by an operation, or null if none.
See Also:
LDAPControl

LDAPJDK 4.1