netscape.ldap.controls

Class LDAPProxiedAuthControl

Implemented Interfaces:
Cloneable, java.io.Serializable

public class LDAPProxiedAuthControl
extends LDAPControl

Represents an LDAP v3 server control that specifies that you want the server to use the specified DN's identity for this operation. (The OID for this control is 2.16.840.1.113730.3.4.12.)

You can include the control in any request by constructing an LDAPSearchConstraints object and calling the setServerControls method. You can then pass this LDAPSearchConstraints object to the search or other request method of an LDAPConnection object.

For example:

 ...
 LDAPConnection ld = new LDAPConnection();
 try {
     // Connect to server.
     ld.connect( 3, hostname, portnumber, "", "" );

     // Create a "critical" proxied auth server control using
     // the DN "uid=charlie,ou=people,o=acme.com".
     LDAPProxiedAuthControl ctrl =
         new LDAPProxiedAuthControl( "uid=charlie,ou=people,o=acme.com",
                                     true );

     // Create search constraints to use that control.
     LDAPSearchConstraints cons = new LDAPSearchConstraints();
     cons.setServerControls( sortCtrl );

     // Send the search request.
     LDAPSearchResults res = ld.search( "o=Airius.com",
        LDAPv3.SCOPE_SUB, "(cn=Barbara*)", null, false, cons );

     ...

 

Version:
1.0
See Also:
LDAPControl, LDAPConstraints, LDAPSearchConstraints, LDAPConstraints.setServerControls(LDAPControl), Serialized Form

Field Summary

static String
PROXIEDAUTHREQUEST

Fields inherited from class netscape.ldap.LDAPControl

MANAGEDSAIT, PWEXPIRED, PWEXPIRING, m_critical, m_value

Constructor Summary

LDAPProxiedAuthControl(String dn, boolean critical)
Constructs an LDAPProxiedAuthControl object with a DN to use as identity.

Method Summary

String
toString()
Return a string representation of the control for debugging

Methods inherited from class netscape.ldap.LDAPControl

clone, createControl, flattenBER, getID, getValue, isCritical, lookupControlClass, newInstance, register, toString

Field Details

PROXIEDAUTHREQUEST

public static final String PROXIEDAUTHREQUEST

Constructor Details

LDAPProxiedAuthControl

public LDAPProxiedAuthControl(String dn,
                              boolean critical)
Constructs an LDAPProxiedAuthControl object with a DN to use as identity.
Parameters:
dn - DN to use as identity for execution of a request
critical - true if the LDAP operation should be discarded when the server does not support this control (in other words, this control is critical to the LDAP operation)

Method Details

toString

public String toString()
Return a string representation of the control for debugging
Overrides:
toString in interface LDAPControl
Returns:
a string representation of the control.