Package netscape.ldap
Class LDAPConstraints
- java.lang.Object
-
- netscape.ldap.LDAPConstraints
-
- All Implemented Interfaces:
java.io.Serializable,java.lang.Cloneable
- Direct Known Subclasses:
LDAPSearchConstraints
public class LDAPConstraints extends java.lang.Object implements java.lang.Cloneable, java.io.SerializableRepresents a set of operation preferences. You can set these preferences for a particular operation by creating anLDAPConstraintsobject, specifying your preferences, and passing the object to the properLDAPConnectionmethod.- Version:
- 1.0
- See Also:
- Serialized Form
-
-
Constructor Summary
Constructors Constructor Description LDAPConstraints()Constructs anLDAPConstraintsobject that specifies the default set of constraints.LDAPConstraints(int msLimit, boolean doReferrals, LDAPBind bind_proc, int hop_limit)Constructs a newLDAPConstraintsobject and allows you to specify the constraints in that object.LDAPConstraints(int msLimit, boolean doReferrals, LDAPRebind rebind_proc, int hop_limit)Constructs a newLDAPConstraintsobject and allows you to specify the constraints in that object.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description java.lang.Objectclone()Makes a copy of an existing set of constraints.LDAPBindgetBindProc()Returns the object that provides the mechanism for authenticating to the server on referrals.LDAPControl[]getClientControls()Returns any client controls to be applied by the client to LDAP operations.intgetHopLimit()Returns the maximum number of hops to follow during a referral.LDAPRebindgetRebindProc()Returns the object that provides the method for getting authentication information.booleangetReferrals()Specifies whether nor not referrals are followed automatically.LDAPControl[]getServerControls()Returns any server controls to be applied by the server to LDAP operations.intgetTimeLimit()Returns the maximum number of milliseconds to wait for any operation under these constraints.voidsetBindProc(LDAPBind bind_proc)Sets the object that provides the mechanism for authenticating to the server on referrals.voidsetClientControls(LDAPControl control)Sets a client control for LDAP operations.voidsetClientControls(LDAPControl[] controls)Sets an array of client controls for LDAP operations.voidsetHopLimit(int hop_limit)Sets maximum number of hops to follow in sequence during a referral.voidsetRebindProc(LDAPRebind rebind_proc)Specifies the object that provides the method for getting authentication information.voidsetReferrals(boolean doReferrals)Specifies whether or not referrals are followed automatically.voidsetServerControls(LDAPControl control)Sets a server control for LDAP operations.voidsetServerControls(LDAPControl[] controls)Sets an array of server controls for LDAP operations.voidsetTimeLimit(int msLimit)Sets the maximum number of milliseconds to wait for any operation under these constraints.java.lang.StringtoString()Return a string representation of the object for debugging
-
-
-
Constructor Detail
-
LDAPConstraints
public LDAPConstraints()
Constructs anLDAPConstraintsobject that specifies the default set of constraints.
-
LDAPConstraints
public LDAPConstraints(int msLimit, boolean doReferrals, LDAPRebind rebind_proc, int hop_limit)Constructs a newLDAPConstraintsobject and allows you to specify the constraints in that object.- Parameters:
msLimit- maximum time in milliseconds to wait for results (0 by default, which means that there is no maximum time limit)doReferrals- specifytrueto follow referrals automatically, orFalseto throw anLDAPReferralExceptionerror if the server sends back a referral (Falseby default)rebind_proc- specifies the object that implements theLDAPRebindinterface (you need to define this class). The object will be used when the client follows referrals automatically. The object provides the client with a method for getting the distinguished name and password used to authenticate to another LDAP server during a referral. (This field isnullby default.)hop_limit- maximum number of referrals to follow in a sequence when attempting to resolve a request- See Also:
LDAPConnection.setOption(int, java.lang.Object)
-
LDAPConstraints
public LDAPConstraints(int msLimit, boolean doReferrals, LDAPBind bind_proc, int hop_limit)Constructs a newLDAPConstraintsobject and allows you to specify the constraints in that object.- Parameters:
msLimit- Mmaximum time in milliseconds to wait for results (0 by default, which means that there is no maximum time limit)doReferrals- specifytrueto follow referrals automatically, orFalseto throw anLDAPReferralExceptionerror if the server sends back a referral (Falseby default)bind_proc- specifies the object that implements theLDAPBindinterface (you need to define this class). The object will be used to authenticate to the server on referrals. (This field isnullby default.)hop_limit- maximum number of referrals to follow in a sequence when attempting to resolve a request- See Also:
LDAPConnection.setOption(int, java.lang.Object)
-
-
Method Detail
-
getTimeLimit
public int getTimeLimit()
Returns the maximum number of milliseconds to wait for any operation under these constraints. If 0, there is no maximum time limit on waiting for the operation results.- Returns:
- maximum number of milliseconds to wait for operation results.
-
getReferrals
public boolean getReferrals()
Specifies whether nor not referrals are followed automatically. Returnstrueif referrals are to be followed automatically, orfalseif referrals throw anLDAPReferralException.- Returns:
trueif referrals are followed automatically,falseif referrals throw anLDAPReferralException.
-
getBindProc
public LDAPBind getBindProc()
Returns the object that provides the mechanism for authenticating to the server on referrals. This object must implement theLDAPBindinterface.- Returns:
- object to use to authenticate to the server on referrals.
- See Also:
LDAPBind
-
getRebindProc
public LDAPRebind getRebindProc()
Returns the object that provides the method for getting authentication information. This object must implement theLDAPRebindinterface.- Returns:
- object to use to obtain information for authenticating to other LDAP servers during referrals.
- See Also:
LDAPRebind,LDAPRebindAuth
-
getHopLimit
public int getHopLimit()
Returns the maximum number of hops to follow during a referral.- Returns:
- maximum number of hops to follow during a referral.
-
getClientControls
public LDAPControl[] getClientControls()
Returns any client controls to be applied by the client to LDAP operations.- Returns:
- client controls for the client to apply to LDAP operations.
- See Also:
LDAPControl,LDAPConnection.getOption(int),LDAPConnection.setOption(int, java.lang.Object)
-
getServerControls
public LDAPControl[] getServerControls()
Returns any server controls to be applied by the server to LDAP operations.- Returns:
- server controls for the server to apply to LDAP operations.
- See Also:
LDAPControl,LDAPConnection.getOption(int),LDAPConnection.setOption(int, java.lang.Object)
-
setTimeLimit
public void setTimeLimit(int msLimit)
Sets the maximum number of milliseconds to wait for any operation under these constraints. If 0, there is no maximum time limit on waiting for the operation results. If the time limit is exceeded, an LDAPException with the result codeLDAPException.TIME_LIMITis thrown.- Parameters:
msLimit- Maximum number of milliseconds to wait for operation results (0 by default, which means that there is no maximum time limit.)- See Also:
LDAPException.LDAP_TIMEOUT
-
setReferrals
public void setReferrals(boolean doReferrals)
Specifies whether or not referrals are followed automatically. Specifytrueif referrals are to be followed automatically, orfalseif referrals are to throw anLDAPReferralException. (By default, this is set tofalse.)If you set this to
true, you need to create an object of this class that implements either theLDAPRebindorLDAPBindinterface. TheLDAPRebindobject identifies the method for retrieving authentication information which will be used when connecting to other LDAP servers during referrals. This object should be passed to thesetRebindProcmethod. Alternatively, theLDAPBindobject identifies an authentication mechanism to be used instead of the default authentication mechanism when following referrals. This object should be passed to thesetBindProcmethod.- Parameters:
doReferrals- set totrueif referrals should be followed automatically, orFalseif referrals should throw anLDAPReferralException- See Also:
LDAPBind,LDAPRebind,LDAPRebindAuth
-
setBindProc
public void setBindProc(LDAPBind bind_proc)
Sets the object that provides the mechanism for authenticating to the server on referrals. This object must implement theLDAPBindinterface.(By default, this isnull.) This method sets theLDAPRebindobject to null for this constraint.- Parameters:
bind_proc- object to use to authenticate to the server on referrals- See Also:
LDAPBind
-
setRebindProc
public void setRebindProc(LDAPRebind rebind_proc)
Specifies the object that provides the method for getting authentication information. This object must belong to a class that implements theLDAPRebindinterface. (By default, this isnull.) This method sets theLDAPBindobject to null for this constraint.- Parameters:
rebind_proc- object to use to obtain information for authenticating to other LDAP servers during referrals
-
setHopLimit
public void setHopLimit(int hop_limit)
Sets maximum number of hops to follow in sequence during a referral. (By default, this is 5.)- Parameters:
hop_limit- maximum number of hops to follow during a referral
-
setClientControls
public void setClientControls(LDAPControl control)
Sets a client control for LDAP operations.- Parameters:
control- client control for LDAP operations- See Also:
LDAPControl
-
setClientControls
public void setClientControls(LDAPControl[] controls)
Sets an array of client controls for LDAP operations.- Parameters:
controls- array of client controls for LDAP operations- See Also:
LDAPControl
-
setServerControls
public void setServerControls(LDAPControl control)
Sets a server control for LDAP operations.- Parameters:
control- server control for LDAP operations- See Also:
LDAPControl
-
setServerControls
public void setServerControls(LDAPControl[] controls)
Sets an array of server controls for LDAP operations.- Parameters:
controls- an array of server controls for LDAP operations- See Also:
LDAPControl
-
toString
public java.lang.String toString()
Return a string representation of the object for debugging- Overrides:
toStringin classjava.lang.Object- Returns:
- A string representation of the object
-
clone
public java.lang.Object clone()
Makes a copy of an existing set of constraints.- Overrides:
clonein classjava.lang.Object- Returns:
- a copy of an existing set of constraints
-
-