Package com.unboundid.ldap.sdk
Class UpdatableLDAPRequest
java.lang.Object
com.unboundid.ldap.sdk.LDAPRequest
com.unboundid.ldap.sdk.UpdatableLDAPRequest
- All Implemented Interfaces:
ReadOnlyLDAPRequest,Serializable
- Direct Known Subclasses:
AddRequest,CompareRequest,DeleteRequest,ModifyDNRequest,ModifyRequest,SearchRequest
@NotExtensible
@ThreadSafety(level=NOT_THREADSAFE)
public abstract class UpdatableLDAPRequest
extends LDAPRequest
This class is the superclass of all types of LDAP requests that can be
altered. It provides methods for updating the set of controls to include as
part of the request and for configuring a response timeout, which is
the maximum length of time that the SDK should wait for a response to the
request before returning an error back to the caller.
- See Also:
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedUpdatableLDAPRequest(Control[] controls) Creates a new LDAP request with the provided set of controls. -
Method Summary
Modifier and TypeMethodDescriptionfinal voidaddControl(Control control) Adds the provided control to the set of controls for this request.final voidaddControls(Control... controls) Adds the provided controls to the set of controls for this request.final voidRemoves all controls from this request.final booleanremoveControl(Control control) Removes the provided control from the set of controls for this request.final ControlremoveControl(String oid) Removes the control with the specified OID from the set of controls for this request.final ControlreplaceControl(Control control) Replaces the control with the same OID as the provided control with the provided control.final ControlreplaceControl(String oid, Control control) Replaces the control with the specified OID with the provided control.final voidsetControls(Control... controls) Specifies the set of controls for this request.final voidsetControls(List<Control> controls) Specifies the set of controls for this request.Methods inherited from class com.unboundid.ldap.sdk.LDAPRequest
followReferrals, getControl, getControlList, getControls, getIntermediateResponseListener, getLastMessageID, getOperationType, getReferralConnector, getReferralConnectorInternal, getReferralDepth, getResponseTimeoutMillis, hasControl, hasControl, process, setFollowReferrals, setIntermediateResponseListener, setReferralConnector, setReferralDepth, setResponseTimeoutMillis, toString, toStringMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, waitMethods inherited from interface com.unboundid.ldap.sdk.ReadOnlyLDAPRequest
duplicate, duplicate, toCode
-
Constructor Details
-
UpdatableLDAPRequest
Creates a new LDAP request with the provided set of controls.- Parameters:
controls- The set of controls to include in this LDAP request.
-
-
Method Details
-
setControls
Specifies the set of controls for this request.- Parameters:
controls- The set of controls for this request.
-
setControls
Specifies the set of controls for this request.- Parameters:
controls- The set of controls for this request.
-
clearControls
Removes all controls from this request. -
addControl
Adds the provided control to the set of controls for this request.- Parameters:
control- The control to add to the set of controls for this request. It must not benull.
-
addControls
Adds the provided controls to the set of controls for this request.- Parameters:
controls- The controls to add to the set of controls for this request.
-
removeControl
Removes the control with the specified OID from the set of controls for this request. If this request has multiple controls with the same OID, then only the first will be removed.- Parameters:
oid- The OID of the control to remove. It must not benull.- Returns:
- The control that was removed, or
nullif this request does not have any control with the specified OID.
-
removeControl
Removes the provided control from the set of controls for this request. This will have no impact if the provided control is not included in the set of controls for this request.- Parameters:
control- The control to remove from the set of controls for this request. It must not benull.- Returns:
trueif the control was found and removed, orfalseif not.
-
replaceControl
Replaces the control with the same OID as the provided control with the provided control. If no control with the same OID exists in the request, then the control will be added to the request. If the request has multiple controls with the same OID as the new control, then only the first will be replaced.- Parameters:
control- The control to use in place of the existing control with the same OID. It must not benull.- Returns:
- The control that was replaced, or
nullif there was no control with the same OID as the provided control.
-
replaceControl
Replaces the control with the specified OID with the provided control. If no control with the given OID exists in the request, then a new control will be added. If this request has multiple controls with the specified OID, then only the first will be replaced.- Parameters:
oid- The OID of the control to replace with the provided control. It must not benull.control- The control to use in place of the control with the specified OID. It may benullif the control should be removed. It may have a different OID than the OID of the control being replaced.- Returns:
- The control that was replaced, or
nullif there was no control with the specified OID.
-