Package com.unboundid.ldap.sdk
Class ExtendedRequest
- java.lang.Object
-
- com.unboundid.ldap.sdk.LDAPRequest
-
- com.unboundid.ldap.sdk.ExtendedRequest
-
- All Implemented Interfaces:
ProtocolOp,ReadOnlyLDAPRequest,java.io.Serializable
- Direct Known Subclasses:
CancelExtendedRequest,ClearMissedNotificationChangesAlarmExtendedRequest,CollectSupportDataExtendedRequest,ConsumeSingleUseTokenExtendedRequest,DeleteNotificationDestinationExtendedRequest,DeleteNotificationSubscriptionExtendedRequest,DeliverOneTimePasswordExtendedRequest,DeliverPasswordResetTokenExtendedRequest,DeliverSingleUseTokenExtendedRequest,DeregisterYubiKeyOTPDeviceExtendedRequest,EndAdministrativeSessionExtendedRequest,EndBatchedTransactionExtendedRequest,EndTransactionExtendedRequest,GeneratePasswordExtendedRequest,GenerateTOTPSharedSecretExtendedRequest,GetBackupCompatibilityDescriptorExtendedRequest,GetChangelogBatchExtendedRequest,GetConfigurationExtendedRequest,GetConnectionIDExtendedRequest,GetPasswordQualityRequirementsExtendedRequest,GetSubtreeAccessibilityExtendedRequest,GetSupportedOTPDeliveryMechanismsExtendedRequest,IdentifyBackupCompatibilityProblemsExtendedRequest,ListConfigurationsExtendedRequest,ListNotificationSubscriptionsExtendedRequest,MultiUpdateExtendedRequest,PasswordModifyExtendedRequest,PasswordPolicyStateExtendedRequest,PurgeRetiredInterServerCertificatesExtendedRequest,PurgeRetiredListenerCertificatesExtendedRequest,RegisterYubiKeyOTPDeviceExtendedRequest,ReplaceInterServerCertificateExtendedRequest,ReplaceListenerCertificateExtendedRequest,RevokeTOTPSharedSecretExtendedRequest,SetNotificationDestinationExtendedRequest,SetNotificationSubscriptionExtendedRequest,SetSubtreeAccessibilityExtendedRequest,StartAdministrativeSessionExtendedRequest,StartBatchedTransactionExtendedRequest,StartTLSExtendedRequest,StartTransactionExtendedRequest,StreamDirectoryValuesExtendedRequest,StreamProxyValuesExtendedRequest,ValidateTOTPPasswordExtendedRequest,VerifyPasswordExtendedRequest,WhoAmIExtendedRequest
@Extensible @NotMutable @ThreadSafety(level=NOT_THREADSAFE) public class ExtendedRequest extends LDAPRequest implements ProtocolOp
This class implements the processing necessary to perform an LDAPv3 extended operation, which provides a way to request actions not included in the core LDAP protocol. Subclasses can provide logic to help implement more specific types of extended operations, but it is important to note that if such subclasses include an extended request value, then the request value must be kept up-to-date if any changes are made to custom elements in that class that would impact the request value encoding.- See Also:
- Serialized Form
-
-
Field Summary
Fields Modifier and Type Field Description protected static byteTYPE_EXTENDED_REQUEST_OIDThe BER type for the extended request OID element.protected static byteTYPE_EXTENDED_REQUEST_VALUEThe BER type for the extended request value element.
-
Constructor Summary
Constructors Modifier Constructor Description protectedExtendedRequest(ExtendedRequest extendedRequest)Creates a new extended request with the information from the provided extended request.ExtendedRequest(java.lang.String oid)Creates a new extended request with the provided OID and no value.ExtendedRequest(java.lang.String oid, ASN1OctetString value)Creates a new extended request with the provided OID and value.ExtendedRequest(java.lang.String oid, ASN1OctetString value, Control[] controls)Creates a new extended request with the provided OID and value.ExtendedRequest(java.lang.String oid, Control[] controls)Creates a new extended request with the provided OID and no value.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description ExtendedRequestduplicate()Creates a new instance of this LDAP request that may be modified without impacting this request.ExtendedRequestduplicate(Control[] controls)Creates a new instance of this LDAP request that may be modified without impacting this request.ASN1ElementencodeProtocolOp()Encodes the extended request protocol op to an ASN.1 element.java.lang.StringgetExtendedRequestName()Retrieves the user-friendly name for the extended request, if available.intgetLastMessageID()Retrieves the message ID for the last LDAP message sent using this request.java.lang.StringgetOID()Retrieves the OID for this extended request.OperationTypegetOperationType()Retrieves the type of operation that is represented by this request.bytegetProtocolOpType()Retrieves the BER type for this protocol op.ASN1OctetStringgetValue()Retrieves the encoded value for this extended request, if available.booleanhasValue()Indicates whether this extended request has a value.protected ExtendedResultprocess(LDAPConnection connection, int depth)Sends this extended request to the directory server over the provided connection and returns the associated response.voidresponseReceived(LDAPResponse response)voidtoCode(java.util.List<java.lang.String> lineList, java.lang.String requestID, int indentSpaces, boolean includeProcessing)Appends a number of lines comprising the Java source code that can be used to recreate this request to the given list.voidtoString(java.lang.StringBuilder buffer)Appends a string representation of this request to the provided buffer.voidwriteTo(ASN1Buffer writer)Writes an ASN.1-encoded representation of this LDAP protocol op to the provided ASN.1 buffer.-
Methods inherited from class com.unboundid.ldap.sdk.LDAPRequest
followReferrals, getControl, getControlList, getControls, getIntermediateResponseListener, getReferralConnector, getReferralConnectorInternal, getReferralDepth, getResponseTimeoutMillis, hasControl, hasControl, setFollowReferrals, setIntermediateResponseListener, setReferralConnector, setReferralDepth, setResponseTimeoutMillis, toString
-
-
-
-
Field Detail
-
TYPE_EXTENDED_REQUEST_OID
protected static final byte TYPE_EXTENDED_REQUEST_OID
The BER type for the extended request OID element.- See Also:
- Constant Field Values
-
TYPE_EXTENDED_REQUEST_VALUE
protected static final byte TYPE_EXTENDED_REQUEST_VALUE
The BER type for the extended request value element.- See Also:
- Constant Field Values
-
-
Constructor Detail
-
ExtendedRequest
public ExtendedRequest(@NotNull java.lang.String oid)
Creates a new extended request with the provided OID and no value.- Parameters:
oid- The OID for this extended request. It must not benull.
-
ExtendedRequest
public ExtendedRequest(@NotNull java.lang.String oid, @Nullable Control[] controls)
Creates a new extended request with the provided OID and no value.- Parameters:
oid- The OID for this extended request. It must not benull.controls- The set of controls for this extended request.
-
ExtendedRequest
public ExtendedRequest(@NotNull java.lang.String oid, @Nullable ASN1OctetString value)
Creates a new extended request with the provided OID and value.- Parameters:
oid- The OID for this extended request. It must not benull.value- The encoded value for this extended request. It may benullif this request should not have a value.
-
ExtendedRequest
public ExtendedRequest(@NotNull java.lang.String oid, @Nullable ASN1OctetString value, @Nullable Control[] controls)
Creates a new extended request with the provided OID and value.- Parameters:
oid- The OID for this extended request. It must not benull.value- The encoded value for this extended request. It may benullif this request should not have a value.controls- The set of controls for this extended request.
-
ExtendedRequest
protected ExtendedRequest(@NotNull ExtendedRequest extendedRequest)
Creates a new extended request with the information from the provided extended request.- Parameters:
extendedRequest- The extended request that should be used to create this new extended request.
-
-
Method Detail
-
getOID
@NotNull public final java.lang.String getOID()
Retrieves the OID for this extended request.- Returns:
- The OID for this extended request.
-
hasValue
public final boolean hasValue()
Indicates whether this extended request has a value.- Returns:
trueif this extended request has a value, orfalseif not.
-
getValue
@Nullable public final ASN1OctetString getValue()
Retrieves the encoded value for this extended request, if available.- Returns:
- The encoded value for this extended request, or
nullif this request does not have a value.
-
getProtocolOpType
public final byte getProtocolOpType()
Retrieves the BER type for this protocol op.- Specified by:
getProtocolOpTypein interfaceProtocolOp- Returns:
- The BER type for this protocol op.
-
writeTo
public final void writeTo(@NotNull ASN1Buffer writer)
Writes an ASN.1-encoded representation of this LDAP protocol op to the provided ASN.1 buffer. This method is intended for internal use only and should not be used by third-party code.- Specified by:
writeToin interfaceProtocolOp- Parameters:
writer- The ASN.1 buffer to which the encoded representation should be written.
-
encodeProtocolOp
@NotNull public ASN1Element encodeProtocolOp()
Encodes the extended request protocol op to an ASN.1 element.- Specified by:
encodeProtocolOpin interfaceProtocolOp- Returns:
- The ASN.1 element with the encoded extended request protocol op.
-
process
@NotNull protected ExtendedResult process(@NotNull LDAPConnection connection, int depth) throws LDAPException
Sends this extended request to the directory server over the provided connection and returns the associated response.- Specified by:
processin classLDAPRequest- Parameters:
connection- The connection to use to communicate with the directory server.depth- The current referral depth for this request. It should always be one for the initial request, and should only be incremented when following referrals.- Returns:
- An LDAP result object that provides information about the result of the extended operation processing.
- Throws:
LDAPException- If a problem occurs while sending the request or reading the response.
-
responseReceived
@InternalUseOnly public final void responseReceived(@NotNull LDAPResponse response) throws LDAPException
- Throws:
LDAPException
-
getLastMessageID
public final int getLastMessageID()
Retrieves the message ID for the last LDAP message sent using this request.- Specified by:
getLastMessageIDin classLDAPRequest- Returns:
- The message ID for the last LDAP message sent using this request, or -1 if it no LDAP messages have yet been sent using this request.
-
getOperationType
@NotNull public final OperationType getOperationType()
Retrieves the type of operation that is represented by this request.- Specified by:
getOperationTypein classLDAPRequest- Returns:
- The type of operation that is represented by this request.
-
duplicate
@NotNull public ExtendedRequest duplicate()
Creates a new instance of this LDAP request that may be modified without impacting this request.. Subclasses should override this method to return a duplicate of the appropriate type.- Specified by:
duplicatein interfaceReadOnlyLDAPRequest- Returns:
- A new instance of this LDAP request that may be modified without impacting this request.
-
duplicate
@NotNull public ExtendedRequest duplicate(@Nullable Control[] controls)
Creates a new instance of this LDAP request that may be modified without impacting this request. The provided controls will be used for the new request instead of duplicating the controls from this request.. Subclasses should override this method to return a duplicate of the appropriate type.- Specified by:
duplicatein interfaceReadOnlyLDAPRequest- Parameters:
controls- The set of controls to include in the duplicate request.- Returns:
- A new instance of this LDAP request that may be modified without impacting this request.
-
getExtendedRequestName
@NotNull public java.lang.String getExtendedRequestName()
Retrieves the user-friendly name for the extended request, if available. If no user-friendly name has been defined, then the OID will be returned.- Returns:
- The user-friendly name for this extended request, or the OID if no user-friendly name is available.
-
toString
public void toString(@NotNull java.lang.StringBuilder buffer)
Appends a string representation of this request to the provided buffer.- Specified by:
toStringin interfaceProtocolOp- Specified by:
toStringin interfaceReadOnlyLDAPRequest- Specified by:
toStringin classLDAPRequest- Parameters:
buffer- The buffer to which to append a string representation of this request.
-
toCode
public void toCode(@NotNull java.util.List<java.lang.String> lineList, @NotNull java.lang.String requestID, int indentSpaces, boolean includeProcessing)
Appends a number of lines comprising the Java source code that can be used to recreate this request to the given list.- Specified by:
toCodein interfaceReadOnlyLDAPRequest- Parameters:
lineList- The list to which the source code lines should be added.requestID- The name that should be used as an identifier for the request. If this isnullor empty, then a generic ID will be used.indentSpaces- The number of spaces that should be used to indent the generated code. It must not be negative.includeProcessing- Indicates whether the generated code should include code required to actually process the request and handle the result (iftrue), or just to generate the request (iffalse).
-
-