Prev Class | Next Class | Frames | No Frames |
Summary: Nested | Field | Method | Constr | Detail: Nested | Field | Method | Constr |
java.lang.Object
netscape.ldap.LDAPConstraints
public class LDAPConstraints
extends java.lang.Object
implements Cloneable, java.io.Serializable
LDAPConstraints
object,
specifying your preferences, and passing the object to
the proper LDAPConnection
method.
Constructor Summary | |
| |
| |
|
Method Summary | |
Object |
|
LDAPBind |
|
LDAPControl[] |
|
int |
|
LDAPRebind |
|
boolean |
|
LDAPControl[] |
|
int |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
void |
|
String |
|
public LDAPConstraints()
Constructs anLDAPConstraints
object that specifies the default set of constraints.
public 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.
- 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:
netscape.ldap.LDAPConnection.setOption(int, java.lang.Object)
public 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.
- 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:
netscape.ldap.LDAPConnection.setOption(int, java.lang.Object)
public Object clone()
Makes a copy of an existing set of constraints.
- Returns:
- a copy of an existing set of constraints
public LDAPBind 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:
LDAPBind
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.
public int getHopLimit()
Returns the maximum number of hops to follow during a referral.
- Returns:
- maximum number of hops to follow during a referral.
public LDAPRebind 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:
LDAPRebind
,LDAPRebindAuth
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
.
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.
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.
public void setBindProc(LDAPBind bind_proc)
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:
LDAPBind
public void setClientControls(LDAPControl control)
Sets a client control for LDAP operations.
- Parameters:
control
- client control for LDAP operations
- See Also:
LDAPControl
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
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
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 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
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 totrue
, 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:
LDAPBind
,LDAPRebind
,LDAPRebindAuth
public void setServerControls(LDAPControl control)
Sets a server control for LDAP operations.
- Parameters:
control
- server control for LDAP operations
- See Also:
LDAPControl
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
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:
LDAPException.LDAP_TIMEOUT
public String toString()
Return a string representation of the object for debugging
- Returns:
- A string representation of the object