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,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:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final byteThe BER type for the extended request OID element.protected static final byteThe BER type for the extended request value element. -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedExtendedRequest(ExtendedRequest extendedRequest) Creates a new extended request with the information from the provided extended request.ExtendedRequest(String oid) Creates a new extended request with the provided OID and no value.ExtendedRequest(String oid, ASN1OctetString value) Creates a new extended request with the provided OID and value.ExtendedRequest(String oid, ASN1OctetString value, Control[] controls) Creates a new extended request with the provided OID and value.ExtendedRequest(String oid, Control[] controls) Creates a new extended request with the provided OID and no value. -
Method Summary
Modifier and TypeMethodDescriptionCreates a new instance of this LDAP request that may be modified without impacting this request.Creates a new instance of this LDAP request that may be modified without impacting this request.Encodes the extended request protocol op to an ASN.1 element.Retrieves the user-friendly name for the extended request, if available.final intRetrieves the message ID for the last LDAP message sent using this request.final StringgetOID()Retrieves the OID for this extended request.final OperationTypeRetrieves the type of operation that is represented by this request.final byteRetrieves the BER type for this protocol op.final ASN1OctetStringgetValue()Retrieves the encoded value for this extended request, if available.final 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.final voidresponseReceived(LDAPResponse response) voidAppends a number of lines comprising the Java source code that can be used to recreate this request to the given list.voidtoString(StringBuilder buffer) Appends a string representation of this request to the provided buffer.final 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 Details
-
TYPE_EXTENDED_REQUEST_OID
The BER type for the extended request OID element.- See Also:
-
TYPE_EXTENDED_REQUEST_VALUE
The BER type for the extended request value element.- See Also:
-
-
Constructor Details
-
ExtendedRequest
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
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
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 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
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 Details
-
getOID
Retrieves the OID for this extended request.- Returns:
- The OID for this extended request.
-
hasValue
Indicates whether this extended request has a value.- Returns:
trueif this extended request has a value, orfalseif not.
-
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
Retrieves the BER type for this protocol op.- Specified by:
getProtocolOpTypein interfaceProtocolOp- Returns:
- The BER type for this protocol op.
-
writeTo
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
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
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
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
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
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
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
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 List<String> lineList, @NotNull 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).
-