Class ExtendedRequest

    • 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 be null.
      • 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 be null.
        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 be null.
        value - The encoded value for this extended request. It may be null if 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 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 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:
        true if this extended request has a value, or false if 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 null if this request does not have a value.
      • 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.
      • 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.
      • 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.
      • 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:
        duplicate in interface ReadOnlyLDAPRequest
        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:
        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

        @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.
      • 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:
        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).