Class BindRequestProtocolOp

    • Constructor Detail

      • BindRequestProtocolOp

        public BindRequestProtocolOp​(@Nullable
                                     java.lang.String bindDN,
                                     @Nullable
                                     java.lang.String password)
        Creates a new bind request protocol op for a simple bind.
        Parameters:
        bindDN - The DN for this bind request.
        password - The password for this bind request.
      • BindRequestProtocolOp

        public BindRequestProtocolOp​(@Nullable
                                     java.lang.String bindDN,
                                     @Nullable
                                     byte[] password)
        Creates a new bind request protocol op for a simple bind.
        Parameters:
        bindDN - The DN for this bind request.
        password - The password for this bind request.
      • BindRequestProtocolOp

        public BindRequestProtocolOp​(@Nullable
                                     java.lang.String bindDN,
                                     @NotNull
                                     java.lang.String saslMechanism,
                                     @Nullable
                                     ASN1OctetString saslCredentials)
        Creates a new bind request protocol op for a SASL bind.
        Parameters:
        bindDN - The DN for this bind request.
        saslMechanism - The name of the SASL mechanism for this bind request. It must not be null.
        saslCredentials - The SASL credentials for this bind request, if any.
      • BindRequestProtocolOp

        public BindRequestProtocolOp​(@NotNull
                                     SimpleBindRequest request)
                              throws LDAPSDKUsageException
        Creates a new bind request protocol op from the provided bind request object.
        Parameters:
        request - The simple bind request to use to create this protocol op. It must have been created with a static password rather than using a password provider.
        Throws:
        LDAPSDKUsageException - If the provided simple bind request is configured to use a password provider rather than a static password.
      • BindRequestProtocolOp

        public BindRequestProtocolOp​(@NotNull
                                     GenericSASLBindRequest request)
        Creates a new bind request protocol op from the provided bind request object.
        Parameters:
        request - The generic SASL bind request to use to create this protocol op.
    • Method Detail

      • getVersion

        public int getVersion()
        Retrieves the protocol version for this bind request.
        Returns:
        The protocol version for this bind request.
      • getBindDN

        @NotNull
        public java.lang.String getBindDN()
        Retrieves the bind DN for this bind request.
        Returns:
        The bind DN for this bind request, or an empty string if none was provided.
      • getSimplePassword

        @Nullable
        public ASN1OctetString getSimplePassword()
        Retrieves the password to use for simple authentication.
        Returns:
        The password to use for simple authentication, or null if SASL authentication will be used.
      • getSASLMechanism

        @Nullable
        public java.lang.String getSASLMechanism()
        Retrieves the name of the SASL mechanism for this bind request.
        Returns:
        The name of the SASL mechanism for this bind request, or null if simple authentication will be used.
      • getSASLCredentials

        @Nullable
        public ASN1OctetString getSASLCredentials()
        Retrieves the credentials to use for SASL authentication, if any.
        Returns:
        The credentials to use for SASL authentication, or null if there are no SASL credentials or if simple authentication will be used.
      • writeTo

        public void writeTo​(@NotNull
                            ASN1Buffer buffer)
        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:
        buffer - The ASN.1 buffer to which the encoded representation should be written.
      • toBindRequest

        @NotNull
        public BindRequest toBindRequest​(@Nullable
                                         Control... controls)
        Creates a new bind request object from this bind request protocol op.
        Parameters:
        controls - The set of controls to include in the bind request. It may be empty or null if no controls should be included.
        Returns:
        The bind request that was created.
      • toString

        @NotNull
        public java.lang.String toString()
        Retrieves a string representation of this protocol op.
        Overrides:
        toString in class java.lang.Object
        Returns:
        A string representation of this protocol op.
      • toString

        public void toString​(@NotNull
                             java.lang.StringBuilder buffer)
        Appends a string representation of this LDAP protocol op to the provided buffer.
        Specified by:
        toString in interface ProtocolOp
        Parameters:
        buffer - The buffer to which the string representation should be appended.