Class OAUTHBEARERBindRequest

    • Constructor Detail

      • OAUTHBEARERBindRequest

        public OAUTHBEARERBindRequest​(@NotNull
                                      java.lang.String accessToken,
                                      @Nullable
                                      Control... controls)
        Creates a new OAUTHBEARER bind request with the provided access token. All other properties will be unset.
        Parameters:
        accessToken - The access token to use for this bind request. It must not be null or empty.
        controls - The set of controls to include in the bind request. It may be null or empty if no controls are needed.
      • OAUTHBEARERBindRequest

        public OAUTHBEARERBindRequest​(@NotNull
                                      OAUTHBEARERBindRequestProperties properties,
                                      @Nullable
                                      Control... controls)
        Creates a new OAUTHBEARER bind request with the provided set of properties.
        Parameters:
        properties - The set of properties to use to create this bind request. It must not be null.
        controls - The set of controls to include in the bind request. It may be null or empty if no controls are needed.
    • Method Detail

      • getAccessToken

        @NotNull
        public java.lang.String getAccessToken()
        Retrieves the access token to include in the bind request.
        Returns:
        The access token to include in the bind request.
      • getAuthorizationID

        @Nullable
        public java.lang.String getAuthorizationID()
        Retrieves the authorization ID to include in the GS2 header for the bind request, if any.
        Returns:
        The authorization ID to include in the GS2 header for the bind request, or null if no authorization ID should be included.
      • getServerAddress

        @Nullable
        public java.lang.String getServerAddress()
        Retrieves the server address to include in the bind request, if any.
        Returns:
        The server address to include in the bind request, or null if it should be omitted.
      • getServerPort

        @Nullable
        public java.lang.Integer getServerPort()
        Retrieves the server port to include in the bind request, if any.
        Returns:
        The server port to include in the bind request, or null if it should be omitted.
      • getRequestMethod

        @Nullable
        public java.lang.String getRequestMethod()
        Retrieves the method to use for HTTP-based requests, if any.
        Returns:
        The method to use for HTTP-based requests, or null if it should be omitted from the bind request.
      • getRequestPath

        @Nullable
        public java.lang.String getRequestPath()
        Retrieves the path to use for HTTP-based requests, if any.
        Returns:
        The path to use for HTTP-based requests, or null if it should be omitted from the bind request.
      • getRequestPostData

        @Nullable
        public java.lang.String getRequestPostData()
        Retrieves the data to submit when posting an HTTP-based request, if any.
        Returns:
        The post data for HTTP-based requests, or null if it should be omitted from the bind request.
      • getRequestQueryString

        @Nullable
        public java.lang.String getRequestQueryString()
        Retrieves the query string to use for HTTP-based requests, if any.
        Returns:
        The query string to use for HTTP-based requests, or null if it should be omitted from the bind request.
      • getAdditionalKeyValuePairs

        @NotNull
        public java.util.Map<java.lang.String,​java.lang.String> getAdditionalKeyValuePairs()
        Retrieves an unmodifiable map of additional key-value pairs that should be included in the bind request.
        Returns:
        An unmodifiable map of additional key-value pairs that should be included in the bind request. It will not be null but may be empty.
      • process

        @NotNull
        protected OAUTHBEARERBindResult process​(@NotNull
                                                LDAPConnection connection,
                                                int depth)
                                         throws LDAPException
        Sends this bind request to the target server over the provided connection and returns the corresponding response.
        Specified by:
        process in class BindRequest
        Parameters:
        connection - The connection to use to send this bind request to the server and read the associated response.
        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:
        The bind response read from the server.
        Throws:
        LDAPException - If a problem occurs while sending the request or reading the response.
      • duplicate

        @NotNull
        public OAUTHBEARERBindRequest 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.
        Specified by:
        duplicate in interface ReadOnlyLDAPRequest
        Specified by:
        duplicate in class BindRequest
        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.
      • getLastMessageID

        public int getLastMessageID()
        Retrieves the message ID for the last LDAP message sent using this request.
        Overrides:
        getLastMessageID in class SASLBindRequest
        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.
      • toString

        public void toString​(@NotNull
                             java.lang.StringBuilder buffer)
        Appends a string representation of the OAUTHBEARER bind request to the provided buffer.
        Specified by:
        toString in interface ReadOnlyLDAPRequest
        Specified by:
        toString in class LDAPRequest
        Parameters:
        buffer - The buffer to which the information should be appended. It must not be null.
      • 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
        Overrides:
        toCode in class SASLBindRequest
        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).