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

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 Details

  • 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 be null.
    • ExtendedRequest

      public ExtendedRequest(@NotNull 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 be null.
      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 be null.
      value - The encoded value for this extended request. It may be null if this request should not have a value.
    • ExtendedRequest

      Creates a new extended request with the provided OID and value.
      Parameters:
      oid - The OID for this extended request. It must not be null.
      value - The encoded value for this extended request. It may be null if 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 Details

    • getOID

      @NotNull public final 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:
      true if this extended request has a value, or false if not.
    • getValue

      Retrieves the encoded value for this extended request, if available.
      Returns:
      The encoded value for this extended request, or null if this request does not have a value.
    • getProtocolOpType

      public final byte getProtocolOpType()
      Retrieves the BER type for this protocol op.
      Specified by:
      getProtocolOpType in interface ProtocolOp
      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:
      writeTo in interface ProtocolOp
      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:
      encodeProtocolOp in interface ProtocolOp
      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:
      process in class LDAPRequest
      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

      Throws:
      LDAPException
    • getLastMessageID

      public final int getLastMessageID()
      Retrieves the message ID for the last LDAP message sent using this request.
      Specified by:
      getLastMessageID in class LDAPRequest
      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:
      getOperationType in class LDAPRequest
      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:
      duplicate in interface ReadOnlyLDAPRequest
      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:
      duplicate in interface ReadOnlyLDAPRequest
      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

      public void toString(@NotNull StringBuilder buffer)
      Appends a string representation of this request to the provided buffer.
      Specified by:
      toString in interface ProtocolOp
      Specified by:
      toString in interface ReadOnlyLDAPRequest
      Specified by:
      toString in class LDAPRequest
      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:
      toCode in interface ReadOnlyLDAPRequest
      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 is null or 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 (if true), or just to generate the request (if false).