Class LDAPProxiedAuthControl
java.lang.Object
netscape.ldap.LDAPControl
netscape.ldap.controls.LDAPProxiedAuthControl
- All Implemented Interfaces:
Serializable, Cloneable
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:
-
Field Summary
FieldsFields inherited from class LDAPControl
m_critical, m_value, MANAGEDSAIT, PWEXPIRED, PWEXPIRING -
Constructor Summary
ConstructorsConstructorDescriptionLDAPProxiedAuthControl(String dn, boolean critical) Constructs anLDAPProxiedAuthControlobject with a DN to use as identity. -
Method Summary
Methods inherited from class LDAPControl
clone, createControl, flattenBER, getID, getValue, isCritical, lookupControlClass, newInstance, registerModifier and TypeMethodDescriptionclone()Creates a copy of the control.protected static LDAPControlcreateControl(String oid, boolean critical, byte[] value) Returns aLDAPControlobject instantiated by the Class associated byLDAPControl.registerto the oid.protected byte[]flattenBER(BERSequence ber) Create a "flattened" BER encoding from a BER, and return it as a byte array.getID()Gets the object ID (OID) of the control.byte[]getValue()Gets the data in the control.booleanSpecifies whether or not the control is critical to the LDAP operation.protected static Class<?> lookupControlClass(String oid) Returns theClassthat has been registered to oid.static LDAPControl[]newInstance(byte[] data) Instantiates all of the controls contained within the LDAP message fragment specified by data and returns them in anLDAPControlarray.static voidAssociates a class with an oid.
-
Field Details
-
PROXIEDAUTHREQUEST
- See Also:
-
-
Constructor Details
-
LDAPProxiedAuthControl
Constructs anLDAPProxiedAuthControlobject with a DN to use as identity.- Parameters:
dn- DN to use as identity for execution of a requestcritical-trueif 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)- See Also:
-
-
Method Details
-
toString
Description copied from class:LDAPControlReturn a string representation of the control for debugging- Overrides:
toStringin classLDAPControl- Returns:
- a string representation of the control.
-