Package netscape.ldap
Class LDAPConstraints
java.lang.Object
netscape.ldap.LDAPConstraints
- All Implemented Interfaces:
Serializable
,Cloneable
- Direct Known Subclasses:
LDAPSearchConstraints
Represents a set of operation preferences.
You can set these preferences for a particular operation
by creating an
LDAPConstraints
object,
specifying your preferences, and passing the object to
the proper LDAPConnection
method.
- Version:
- 1.0
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionConstructs anLDAPConstraints
object that specifies the default set of constraints.LDAPConstraints
(int msLimit, boolean doReferrals, LDAPBind bind_proc, int hop_limit) Constructs a newLDAPConstraints
object and allows you to specify the constraints in that object.LDAPConstraints
(int msLimit, boolean doReferrals, LDAPRebind rebind_proc, int hop_limit) Constructs a newLDAPConstraints
object and allows you to specify the constraints in that object. -
Method Summary
Modifier and TypeMethodDescriptionclone()
Makes a copy of an existing set of constraints.Returns the object that provides the mechanism for authenticating to the server on referrals.Returns any client controls to be applied by the client to LDAP operations.int
Returns the maximum number of hops to follow during a referral.Returns the object that provides the method for getting authentication information.boolean
Specifies whether nor not referrals are followed automatically.Returns any server controls to be applied by the server to LDAP operations.int
Returns the maximum number of milliseconds to wait for any operation under these constraints.void
setBindProc
(LDAPBind bind_proc) Sets the object that provides the mechanism for authenticating to the server on referrals.void
setClientControls
(LDAPControl control) Sets a client control for LDAP operations.void
setClientControls
(LDAPControl[] controls) Sets an array of client controls for LDAP operations.void
setHopLimit
(int hop_limit) Sets maximum number of hops to follow in sequence during a referral.void
setRebindProc
(LDAPRebind rebind_proc) Specifies the object that provides the method for getting authentication information.void
setReferrals
(boolean doReferrals) Specifies whether or not referrals are followed automatically.void
setServerControls
(LDAPControl control) Sets a server control for LDAP operations.void
setServerControls
(LDAPControl[] controls) Sets an array of server controls for LDAP operations.void
setTimeLimit
(int msLimit) Sets the maximum number of milliseconds to wait for any operation under these constraints.toString()
Return a string representation of the object for debugging
-
Constructor Details
-
LDAPConstraints
public LDAPConstraints()Constructs anLDAPConstraints
object that specifies the default set of constraints. -
LDAPConstraints
Constructs a newLDAPConstraints
object 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
- specifytrue
to follow referrals automatically, orFalse
to throw anLDAPReferralException
error if the server sends back a referral (False
by default)rebind_proc
- specifies the object that implements theLDAPRebind
interface (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 isnull
by default.)hop_limit
- maximum number of referrals to follow in a sequence when attempting to resolve a request- See Also:
-
LDAPConstraints
Constructs a newLDAPConstraints
object 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
- specifytrue
to follow referrals automatically, orFalse
to throw anLDAPReferralException
error if the server sends back a referral (False
by default)bind_proc
- specifies the object that implements theLDAPBind
interface (you need to define this class). The object will be used to authenticate to the server on referrals. (This field isnull
by default.)hop_limit
- maximum number of referrals to follow in a sequence when attempting to resolve a request- See Also:
-
-
Method Details
-
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. Returnstrue
if referrals are to be followed automatically, orfalse
if referrals throw anLDAPReferralException
.- Returns:
true
if referrals are followed automatically,false
if referrals throw anLDAPReferralException
.
-
getBindProc
Returns the object that provides the mechanism for authenticating to the server on referrals. This object must implement theLDAPBind
interface.- Returns:
- object to use to authenticate to the server on referrals.
- See Also:
-
getRebindProc
Returns the object that provides the method for getting authentication information. This object must implement theLDAPRebind
interface.- Returns:
- object to use to obtain information for authenticating to other LDAP servers during referrals.
- See Also:
-
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
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:
-
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:
-
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_LIMIT
is 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:
-
setReferrals
public void setReferrals(boolean doReferrals) Specifies whether or not referrals are followed automatically. Specifytrue
if referrals are to be followed automatically, orfalse
if 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 theLDAPRebind
orLDAPBind
interface. TheLDAPRebind
object 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 thesetRebindProc
method. Alternatively, theLDAPBind
object identifies an authentication mechanism to be used instead of the default authentication mechanism when following referrals. This object should be passed to thesetBindProc
method.- Parameters:
doReferrals
- set totrue
if referrals should be followed automatically, orFalse
if referrals should throw anLDAPReferralException
- See Also:
-
setBindProc
Sets the object that provides the mechanism for authenticating to the server on referrals. This object must implement theLDAPBind
interface.(By default, this isnull
.) This method sets theLDAPRebind
object to null for this constraint.- Parameters:
bind_proc
- object to use to authenticate to the server on referrals- See Also:
-
setRebindProc
Specifies the object that provides the method for getting authentication information. This object must belong to a class that implements theLDAPRebind
interface. (By default, this isnull
.) This method sets theLDAPBind
object 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
Sets a client control for LDAP operations.- Parameters:
control
- client control for LDAP operations- See Also:
-
setClientControls
Sets an array of client controls for LDAP operations.- Parameters:
controls
- array of client controls for LDAP operations- See Also:
-
setServerControls
Sets a server control for LDAP operations.- Parameters:
control
- server control for LDAP operations- See Also:
-
setServerControls
Sets an array of server controls for LDAP operations.- Parameters:
controls
- an array of server controls for LDAP operations- See Also:
-
toString
Return a string representation of the object for debugging -
clone
Makes a copy of an existing set of constraints.
-