Class Requests

java.lang.Object
org.forgerock.opendj.ldap.requests.Requests

public final class Requests extends Object
This class contains various methods for creating and manipulating requests.

All copy constructors of the form copyOfXXXRequest perform deep copies of their request parameter. More specifically, any controls, modifications, and attributes contained within the response will be duplicated.

Similarly, all unmodifiable views of request returned by methods of the form unmodifiableXXXRequest return deep unmodifiable views of their request parameter. More specifically, any controls, modifications, and attributes contained within the returned request will be unmodifiable.

  • Method Details

    • shallowCopyOfRequest

      public static Request shallowCopyOfRequest(Request request, String... excludeControlOids)
      Creates a new request that is a shallow copy of the provided request, except for controls list which is a new list containing the original controls (and not the original list of controls) possibly filtered by the provided exclusion parameter.

      The intended usage is to be able to perform modification of the controls of a request without affecting the original request.

      Parameters:
      request - the original request
      excludeControlOids - OIDs of controls to exclude from the new request
      Returns:
      the new request
    • copyOfAbandonRequest

      Creates a new abandon request that is an exact copy of the provided request.
      Parameters:
      request - The abandon request to be copied.
      Returns:
      The new abandon request.
      Throws:
      NullPointerException - If request was null
    • copyOfAddRequest

      public static AddRequest copyOfAddRequest(AddRequest request)
      Creates a new add request that is an exact copy of the provided request.
      Parameters:
      request - The add request to be copied.
      Returns:
      The new add request.
      Throws:
      NullPointerException - If request was null .
    • copyOfAnonymousSASLBindRequest

      Creates a new anonymous SASL bind request that is an exact copy of the provided request.
      Parameters:
      request - The anonymous SASL bind request to be copied.
      Returns:
      The new anonymous SASL bind request.
      Throws:
      NullPointerException - If request was null .
    • copyOfCancelExtendedRequest

      Creates a new cancel extended request that is an exact copy of the provided request.
      Parameters:
      request - The cancel extended request to be copied.
      Returns:
      The new cancel extended request.
      Throws:
      NullPointerException - If request was null .
    • copyOfCompareRequest

      Creates a new compare request that is an exact copy of the provided request.
      Parameters:
      request - The compare request to be copied.
      Returns:
      The new compare request.
      Throws:
      NullPointerException - If request was null .
    • copyOfCRAMMD5SASLBindRequest

      Creates a new CRAM MD5 SASL bind request that is an exact copy of the provided request.
      Parameters:
      request - The CRAM MD5 SASL bind request to be copied.
      Returns:
      The new CRAM-MD5 SASL bind request.
      Throws:
      NullPointerException - If request was null.
    • copyOfDeleteRequest

      Creates a new delete request that is an exact copy of the provided request.
      Parameters:
      request - The add request to be copied.
      Returns:
      The new delete request.
      Throws:
      NullPointerException - If request was null.
    • copyOfDigestMD5SASLBindRequest

      Creates a new digest MD5 SASL bind request that is an exact copy of the provided request.
      Parameters:
      request - The digest MD5 SASL bind request to be copied.
      Returns:
      The new DIGEST-MD5 SASL bind request.
      Throws:
      NullPointerException - If request was null.
    • copyOfExternalSASLBindRequest

      Creates a new external SASL bind request that is an exact copy of the provided request.
      Parameters:
      request - The external SASL bind request to be copied.
      Returns:
      The new External SASL bind request.
      Throws:
      NullPointerException - If request was null .
    • copyOfGenericBindRequest

      Creates a new generic bind request that is an exact copy of the provided request.
      Parameters:
      request - The generic bind request to be copied.
      Returns:
      The new generic bind request.
      Throws:
      NullPointerException - If request was null .
    • copyOfGenericExtendedRequest

      Creates a new generic extended request that is an exact copy of the provided request.
      Parameters:
      request - The generic extended request to be copied.
      Returns:
      The new generic extended request.
      Throws:
      NullPointerException - If request was null .
    • copyOfGSSAPISASLBindRequest

      Creates a new GSSAPI SASL bind request that is an exact copy of the provided request.
      Parameters:
      request - The GSSAPI SASL bind request to be copied.
      Returns:
      The new GSSAPI SASL bind request.
      Throws:
      NullPointerException - If request was null.
    • copyOfModifyDNRequest

      Creates a new modify DN request that is an exact copy of the provided request.
      Parameters:
      request - The modify DN request to be copied.
      Returns:
      The new modify DN request.
      Throws:
      NullPointerException - If request was null .
    • copyOfModifyRequest

      Creates a new modify request that is an exact copy of the provided request.
      Parameters:
      request - The modify request to be copied.
      Returns:
      The new modify request.
      Throws:
      NullPointerException - If request was null .
    • copyOfPasswordModifyExtendedRequest

      Creates a new password modify extended request that is an exact copy of the provided request.
      Parameters:
      request - The password modify extended request to be copied.
      Returns:
      The new password modify extended request.
      Throws:
      NullPointerException - If request was null .
    • copyOfPlainSASLBindRequest

      Creates a new plain SASL bind request that is an exact copy of the provided request.
      Parameters:
      request - The plain SASL bind request to be copied.
      Returns:
      The new Plain SASL bind request.
      Throws:
      NullPointerException - If request was null .
    • copyOfSearchRequest

      Creates a new search request that is an exact copy of the provided request.
      Parameters:
      request - The search request to be copied.
      Returns:
      The new search request.
      Throws:
      NullPointerException - If request was null .
    • copyOfSimpleBindRequest

      Creates a new simple bind request that is an exact copy of the provided request.
      Parameters:
      request - The simple bind request to be copied.
      Returns:
      The new simple bind request.
      Throws:
      NullPointerException - If request was null .
    • copyOfStartTLSExtendedRequest

      Creates a new startTLS extended request that is an exact copy of the provided request.
      Parameters:
      request - The startTLS extended request to be copied.
      Returns:
      The new start TLS extended request.
      Throws:
      NullPointerException - If request was null .
    • copyOfUnbindRequest

      Creates a new unbind request that is an exact copy of the provided request.
      Parameters:
      request - The unbind request to be copied.
      Returns:
      The new unbind request.
      Throws:
      NullPointerException - If request was null .
    • copyOfWhoAmIExtendedRequest

      Creates a new Who Am I extended request that is an exact copy of the provided request.
      Parameters:
      request - The who Am I extended request to be copied.
      Returns:
      The new Who Am I extended request.
      Throws:
      NullPointerException - If request was null .
    • newAbandonRequest

      public static AbandonRequest newAbandonRequest(int requestID)
      Creates a new abandon request using the provided message ID.
      Parameters:
      requestID - The request ID of the request to be abandoned.
      Returns:
      The new abandon request.
    • newAddRequest

      public static AddRequest newAddRequest(DN name)
      Creates a new add request using the provided distinguished name.
      Parameters:
      name - The distinguished name of the entry to be added.
      Returns:
      The new add request.
      Throws:
      NullPointerException - If name was null.
    • newAddRequest

      public static AddRequest newAddRequest(Entry entry)
      Creates a new add request backed by the provided entry. Modifications made to entry will be reflected in the returned add request. The returned add request supports updates to its list of controls, as well as updates to the name and attributes if the underlying entry allows.
      Parameters:
      entry - The entry to be added.
      Returns:
      The new add request.
      Throws:
      NullPointerException - If entry was null .
    • newAddRequest

      public static AddRequest newAddRequest(String name)
      Creates a new add request using the provided distinguished name decoded using the default schema.
      Parameters:
      name - The distinguished name of the entry to be added.
      Returns:
      The new add request.
      Throws:
      org.forgerock.i18n.LocalizedIllegalArgumentException - If name could not be decoded using the default schema.
      NullPointerException - If name was null.
    • newAddRequest

      public static AddRequest newAddRequest(String... ldifLines)
      Creates a new add request using the provided lines of LDIF decoded using the default schema.
      Parameters:
      ldifLines - Lines of LDIF containing an LDIF add change record or an LDIF entry record.
      Returns:
      The new add request.
      Throws:
      org.forgerock.i18n.LocalizedIllegalArgumentException - If ldifLines was empty, or contained invalid LDIF, or could not be decoded using the default schema.
      NullPointerException - If ldifLines was null .
    • newAnonymousSASLBindRequest

      Creates a new anonymous SASL bind request having the provided trace string.
      Parameters:
      traceString - The trace information, which has no semantic value, and can be used by administrators in order to identify the user.
      Returns:
      The new anonymous SASL bind request.
      Throws:
      NullPointerException - If traceString was null.
    • newCancelExtendedRequest

      public static CancelExtendedRequest newCancelExtendedRequest(int requestID)
      Creates a new cancel extended request using the provided message ID.
      Parameters:
      requestID - The request ID of the request to be abandoned.
      Returns:
      The new cancel extended request.
    • newChangeRecord

      public static ChangeRecord newChangeRecord(String... ldifLines)
      Creates a new change record (an add, delete, modify, or modify DN request) using the provided lines of LDIF decoded using the default schema.
      Parameters:
      ldifLines - Lines of LDIF containing an LDIF change record or an LDIF entry record.
      Returns:
      The new change record.
      Throws:
      org.forgerock.i18n.LocalizedIllegalArgumentException - If ldifLines was empty, or contained invalid LDIF, or could not be decoded using the default schema.
      NullPointerException - If ldifLines was null .
    • newCompareRequest

      public static CompareRequest newCompareRequest(DN name, AttributeDescription attributeDescription, Object assertionValue)
      Creates a new compare request using the provided distinguished name, attribute name, and assertion value.

      If the assertion value is not an instance of ByteString then it will be converted using the ByteString.valueOfObject(Object) method.

      Parameters:
      name - The distinguished name of the entry to be compared.
      attributeDescription - The name of the attribute to be compared.
      assertionValue - The assertion value to be compared.
      Returns:
      The new compare request.
      Throws:
      NullPointerException - If name, attributeDescription, or assertionValue was null.
    • newCompareRequest

      public static CompareRequest newCompareRequest(String name, String attributeDescription, Object assertionValue)
      Creates a new compare request using the provided distinguished name, attribute name, and assertion value decoded using the default schema.

      If the assertion value is not an instance of ByteString then it will be converted using the ByteString.valueOfObject(Object) method.

      Parameters:
      name - The distinguished name of the entry to be compared.
      attributeDescription - The name of the attribute to be compared.
      assertionValue - The assertion value to be compared.
      Returns:
      The new compare request.
      Throws:
      org.forgerock.i18n.LocalizedIllegalArgumentException - If name or attributeDescription could not be decoded using the default schema.
      NullPointerException - If name, attributeDescription, or assertionValue was null.
    • newCRAMMD5SASLBindRequest

      public static CRAMMD5SASLBindRequest newCRAMMD5SASLBindRequest(String authenticationID, byte[] password)
      Creates a new CRAM-MD5 SASL bind request having the provided authentication ID and password.
      Parameters:
      authenticationID - The authentication ID of the user. The authentication ID usually has the form "dn:" immediately followed by the distinguished name of the user, or "u:" followed by a user ID string, but other forms are permitted.
      password - The password of the user that the client wishes to bind as.
      Returns:
      The new CRAM-MD5 SASL bind request.
      Throws:
      NullPointerException - If authenticationID or password was null.
    • newCRAMMD5SASLBindRequest

      public static CRAMMD5SASLBindRequest newCRAMMD5SASLBindRequest(String authenticationID, char[] password)
      Creates a new CRAM-MD5 SASL bind request having the provided authentication ID and password.
      Parameters:
      authenticationID - The authentication ID of the user. The authentication ID usually has the form "dn:" immediately followed by the distinguished name of the user, or "u:" followed by a user ID string, but other forms are permitted.
      password - The password of the user that the client wishes to bind as. The password will be converted to a UTF-8 octet string.
      Returns:
      The new CRAM-MD5 SASL bind request.
      Throws:
      NullPointerException - If authenticationID or password was null.
    • newDeleteRequest

      public static DeleteRequest newDeleteRequest(DN name)
      Creates a new delete request using the provided distinguished name.
      Parameters:
      name - The distinguished name of the entry to be deleted.
      Returns:
      The new delete request.
      Throws:
      NullPointerException - If name was null.
    • newDeleteRequest

      public static DeleteRequest newDeleteRequest(String name)
      Creates a new delete request using the provided distinguished name decoded using the default schema.
      Parameters:
      name - The distinguished name of the entry to be deleted.
      Returns:
      The new delete request.
      Throws:
      org.forgerock.i18n.LocalizedIllegalArgumentException - If name could not be decoded using the default schema.
      NullPointerException - If name was null.
    • newDigestMD5SASLBindRequest

      public static DigestMD5SASLBindRequest newDigestMD5SASLBindRequest(String authenticationID, byte[] password)
      Creates a new DIGEST-MD5 SASL bind request having the provided authentication ID and password, but no realm or authorization ID.
      Parameters:
      authenticationID - The authentication ID of the user. The authentication ID usually has the form "dn:" immediately followed by the distinguished name of the user, or "u:" followed by a user ID string, but other forms are permitted.
      password - The password of the user that the client wishes to bind as.
      Returns:
      The new DIGEST-MD5 SASL bind request.
      Throws:
      NullPointerException - If authenticationID or password was null.
    • newDigestMD5SASLBindRequest

      public static DigestMD5SASLBindRequest newDigestMD5SASLBindRequest(String authenticationID, char[] password)
      Creates a new DIGEST-MD5 SASL bind request having the provided authentication ID and password, but no realm or authorization ID.
      Parameters:
      authenticationID - The authentication ID of the user. The authentication ID usually has the form "dn:" immediately followed by the distinguished name of the user, or "u:" followed by a user ID string, but other forms are permitted.
      password - The password of the user that the client wishes to bind as. The password will be converted to a UTF-8 octet string.
      Returns:
      The new DIGEST-MD5 SASL bind request.
      Throws:
      NullPointerException - If authenticationID or password was null.
    • newExternalSASLBindRequest

      Creates a new External SASL bind request with no authorization ID.
      Returns:
      The new External SASL bind request.
    • newGenericBindRequest

      public static GenericBindRequest newGenericBindRequest(byte authenticationType, byte[] authenticationValue)
      Creates a new generic bind request using an empty distinguished name, authentication type, and authentication information.
      Parameters:
      authenticationType - The authentication mechanism identifier for this generic bind request.
      authenticationValue - The authentication information for this generic bind request in a form defined by the authentication mechanism.
      Returns:
      The new generic bind request.
      Throws:
      NullPointerException - If authenticationValue was null.
    • newGenericBindRequest

      public static GenericBindRequest newGenericBindRequest(String name, byte authenticationType, byte[] authenticationValue)
      Creates a new generic bind request using the provided name, authentication type, and authentication information.

      The LDAP protocol defines the Bind name to be a distinguished name, however some LDAP implementations have relaxed this constraint and allow other identities to be used, such as the user's email address.

      Parameters:
      name - The name of the Directory object that the client wishes to bind as (may be empty).
      authenticationType - The authentication mechanism identifier for this generic bind request.
      authenticationValue - The authentication information for this generic bind request in a form defined by the authentication mechanism.
      Returns:
      The new generic bind request.
      Throws:
      NullPointerException - If name or authenticationValue was null.
    • newGenericExtendedRequest

      Creates a new generic extended request using the provided name and no value.
      Parameters:
      requestName - The dotted-decimal representation of the unique OID corresponding to this extended request.
      Returns:
      The new generic extended request.
      Throws:
      NullPointerException - If requestName was null.
    • newGenericExtendedRequest

      public static GenericExtendedRequest newGenericExtendedRequest(String requestName, Object requestValue)
      Creates a new generic extended request using the provided name and optional value.

      If the request value is not an instance of ByteString then it will be converted using the ByteString.valueOfObject(Object) method.

      Parameters:
      requestName - The dotted-decimal representation of the unique OID corresponding to this extended request.
      requestValue - The content of this generic extended request in a form defined by the extended operation, or null if there is no content.
      Returns:
      The new generic extended request.
      Throws:
      NullPointerException - If requestName was null.
    • newGSSAPISASLBindRequest

      public static GSSAPISASLBindRequest newGSSAPISASLBindRequest(String authenticationID, byte[] password)
      Creates a new GSSAPI SASL bind request having the provided authentication ID and password, but no realm, KDC address, or authorization ID.
      Parameters:
      authenticationID - The authentication ID of the user. The authentication ID usually has the form "dn:" immediately followed by the distinguished name of the user, or "u:" followed by a user ID string, but other forms are permitted.
      password - The password of the user that the client wishes to bind as.
      Returns:
      The new GSSAPI SASL bind request.
      Throws:
      NullPointerException - If authenticationID or password was null.
    • newGSSAPISASLBindRequest

      public static GSSAPISASLBindRequest newGSSAPISASLBindRequest(String authenticationID, char[] password)
      Creates a new GSSAPI SASL bind request having the provided authentication ID and password, but no realm, KDC address, or authorization ID.
      Parameters:
      authenticationID - The authentication ID of the user. The authentication ID usually has the form "dn:" immediately followed by the distinguished name of the user, or "u:" followed by a user ID string, but other forms are permitted.
      password - The password of the user that the client wishes to bind as. The password will be converted to a UTF-8 octet string.
      Returns:
      The new GSSAPI SASL bind request.
      Throws:
      NullPointerException - If authenticationID or password was null.
    • newGSSAPISASLBindRequest

      Creates a new GSSAPI SASL bind request having the provided subject, but no authorization ID.
      Parameters:
      subject - The Kerberos subject of the user to be authenticated.
      Returns:
      The new GSSAPI SASL bind request.
      Throws:
      NullPointerException - If subject was null.
    • newModifyDNRequest

      public static ModifyDNRequest newModifyDNRequest(DN name, RDN newRDN)
      Creates a new modify DN request using the provided distinguished name and new RDN. The new superior will be null, indicating that the renamed entry will remain under the same parent entry, and the old RDN attribute values will not be deleted.
      Parameters:
      name - The distinguished name of the entry to be renamed.
      newRDN - The new RDN of the entry.
      Returns:
      The new modify DN request.
      Throws:
      NullPointerException - If name or newRDN was null.
    • newModifyDNRequest

      public static ModifyDNRequest newModifyDNRequest(String name, String newRDN)
      Creates a new modify DN request using the provided distinguished name and new RDN decoded using the default schema. The new superior will be null, indicating that the renamed entry will remain under the same parent entry, and the old RDN attribute values will not be deleted.
      Parameters:
      name - The distinguished name of the entry to be renamed.
      newRDN - The new RDN of the entry.
      Returns:
      The new modify DN request.
      Throws:
      org.forgerock.i18n.LocalizedIllegalArgumentException - If name or newRDN could not be decoded using the default schema.
      NullPointerException - If name or newRDN was null.
    • newModifyRequest

      public static ModifyRequest newModifyRequest(DN name)
      Creates a new modify request using the provided distinguished name.
      Parameters:
      name - The distinguished name of the entry to be modified.
      Returns:
      The new modify request.
      Throws:
      NullPointerException - If name was null.
    • newModifyRequest

      public static ModifyRequest newModifyRequest(Entry fromEntry, Entry toEntry)
      Creates a new modify request containing a list of modifications which can be used to transform fromEntry into entry toEntry.

      The changes will be generated using a default set of options. More specifically, only user attributes will be compared, attributes will be compared using their matching rules, and all generated changes will be reversible: it will contain only modifications of type DELETE then ADD.

      Finally, the modify request will use the distinguished name taken from fromEntry. Moreover, this method will not check to see if both fromEntry and toEntry have the same distinguished name.

      This method is equivalent to:

       ModifyRequest request = Entries.diffEntries(fromEntry, toEntry);
       
      Or:
       ModifyRequest request = Entries.diffEntries(fromEntry, toEntry, Entries.diffOptions());
       
      Parameters:
      fromEntry - The source entry.
      toEntry - The destination entry.
      Returns:
      A modify request containing a list of modifications which can be used to transform fromEntry into entry toEntry. The returned request will always be non-null but may not contain any modifications.
      Throws:
      NullPointerException - If fromEntry or toEntry were null.
      See Also:
    • newModifyRequest

      public static ModifyRequest newModifyRequest(String name)
      Creates a new modify request using the provided distinguished name decoded using the default schema.
      Parameters:
      name - The distinguished name of the entry to be modified.
      Returns:
      The new modify request.
      Throws:
      org.forgerock.i18n.LocalizedIllegalArgumentException - If name could not be decoded using the default schema.
      NullPointerException - If name was null.
    • newModifyRequest

      public static ModifyRequest newModifyRequest(String... ldifLines)
      Creates a new modify request using the provided lines of LDIF decoded using the default schema.
      Parameters:
      ldifLines - Lines of LDIF containing a single LDIF modify change record.
      Returns:
      The new modify request.
      Throws:
      org.forgerock.i18n.LocalizedIllegalArgumentException - If ldifLines was empty, or contained invalid LDIF, or could not be decoded using the default schema.
      NullPointerException - If ldifLines was null .
    • newPasswordModifyExtendedRequest

      Creates a new password modify extended request, with no user identity, old password, or new password.
      Returns:
      The new password modify extended request.
    • newPlainSASLBindRequest

      public static PlainSASLBindRequest newPlainSASLBindRequest(String authenticationID, byte[] password)
      Creates a new Plain SASL bind request having the provided authentication ID and password, but no authorization ID.
      Parameters:
      authenticationID - The authentication ID of the user. The authentication ID usually has the form "dn:" immediately followed by the distinguished name of the user, or "u:" followed by a user ID string, but other forms are permitted.
      password - The password of the user that the client wishes to bind as.
      Returns:
      The new Plain SASL bind request.
      Throws:
      NullPointerException - If authenticationID or password was null.
    • newPlainSASLBindRequest

      public static PlainSASLBindRequest newPlainSASLBindRequest(String authenticationID, char[] password)
      Creates a new Plain SASL bind request having the provided authentication ID and password, but no authorization ID.
      Parameters:
      authenticationID - The authentication ID of the user. The authentication ID usually has the form "dn:" immediately followed by the distinguished name of the user, or "u:" followed by a user ID string, but other forms are permitted.
      password - The password of the user that the client wishes to bind as. The password will be converted to a UTF-8 octet string.
      Returns:
      The new Plain SASL bind request.
      Throws:
      NullPointerException - If authenticationID or password was null.
    • newSearchRequest

      public static SearchRequest newSearchRequest(DN name, SearchScope scope, Filter filter, String... attributeDescriptions)
      Creates a new search request using the provided distinguished name, scope, and filter.
      Parameters:
      name - The distinguished name of the base entry relative to which the search is to be performed.
      scope - The scope of the search.
      filter - The filter that defines the conditions that must be fulfilled in order for an entry to be returned.
      attributeDescriptions - The names of the attributes to be included with each entry.
      Returns:
      The new search request.
      Throws:
      NullPointerException - If the name, scope, or filter were null.
    • newSearchRequest

      public static SearchRequest newSearchRequest(String name, SearchScope scope, String filter, String... attributeDescriptions)
      Creates a new search request using the provided distinguished name, scope, and filter, decoded using the default schema.
      Parameters:
      name - The distinguished name of the base entry relative to which the search is to be performed.
      scope - The scope of the search.
      filter - The filter that defines the conditions that must be fulfilled in order for an entry to be returned.
      attributeDescriptions - The names of the attributes to be included with each entry.
      Returns:
      The new search request.
      Throws:
      org.forgerock.i18n.LocalizedIllegalArgumentException - If name could not be decoded using the default schema, or if filter is not a valid LDAP string representation of a filter.
      NullPointerException - If the name, scope, or filter were null.
    • newSingleEntrySearchRequest

      public static SearchRequest newSingleEntrySearchRequest(DN name, SearchScope scope, Filter filter, String... attributeDescriptions)
      Creates a new search request for a single entry, using the provided distinguished name, scope, and filter.
      Parameters:
      name - The distinguished name of the base entry relative to which the search is to be performed.
      scope - The scope of the search.
      filter - The filter that defines the conditions that must be fulfilled in order for an entry to be returned.
      attributeDescriptions - The names of the attributes to be included with each entry.
      Returns:
      The new search request.
      Throws:
      NullPointerException - If the name, scope, or filter were null.
    • newSingleEntrySearchRequest

      public static SearchRequest newSingleEntrySearchRequest(String name, SearchScope scope, String filter, String... attributeDescriptions)
      Creates a new search request for a single entry, using the provided distinguished name, scope, and filter, decoded using the default schema.
      Parameters:
      name - The distinguished name of the base entry relative to which the search is to be performed.
      scope - The scope of the search.
      filter - The filter that defines the conditions that must be fulfilled in order for an entry to be returned.
      attributeDescriptions - The names of the attributes to be included with each entry.
      Returns:
      The new search request.
      Throws:
      org.forgerock.i18n.LocalizedIllegalArgumentException - If name could not be decoded using the default schema, or if filter is not a valid LDAP string representation of a filter.
      NullPointerException - If the name, scope, or filter were null.
    • newSimpleBindRequest

      Creates a new simple bind request having an empty name and password suitable for anonymous authentication.
      Returns:
      The new simple bind request.
    • newSimpleBindRequest

      public static SimpleBindRequest newSimpleBindRequest(String name, byte[] password)
      Creates a new simple bind request having the provided name and password suitable for name/password authentication. The name will be decoded using the default schema.

      The LDAP protocol defines the Bind name to be a distinguished name, however some LDAP implementations have relaxed this constraint and allow other identities to be used, such as the user's email address.

      Parameters:
      name - The name of the Directory object that the client wishes to bind as, which may be empty.
      password - The password of the Directory object that the client wishes to bind as, which may be empty indicating that an unauthenticated bind is to be performed.
      Returns:
      The new simple bind request.
      Throws:
      NullPointerException - If name or password was null.
    • newSimpleBindRequest

      public static SimpleBindRequest newSimpleBindRequest(String name, char[] password)
      Creates a new simple bind request having the provided name and password suitable for name/password authentication. The name will be decoded using the default schema.

      The LDAP protocol defines the Bind name to be a distinguished name, however some LDAP implementations have relaxed this constraint and allow other identities to be used, such as the user's email address.

      Parameters:
      name - The name of the Directory object that the client wishes to bind as, which may be empty.
      password - The password of the Directory object that the client wishes to bind as, which may be empty indicating that an unauthenticated bind is to be performed. The password will be converted to a UTF-8 octet string.
      Returns:
      The new simple bind request.
      Throws:
      NullPointerException - If name or password was null.
    • newStartTLSExtendedRequest

      Creates a new start TLS extended request which will use the provided SSL context.
      Parameters:
      sslContext - The SSLContext that should be used when installing the TLS layer.
      Returns:
      The new start TLS extended request.
      Throws:
      NullPointerException - If sslContext was null.
    • newUnbindRequest

      Creates a new unbind request.
      Returns:
      The new unbind request.
    • newWhoAmIExtendedRequest

      Creates a new Who Am I extended request.
      Returns:
      The new Who Am I extended request.
    • unmodifiableAbandonRequest

      Creates an unmodifiable abandon request of the provided request.
      Parameters:
      request - The abandon request to be copied.
      Returns:
      The new abandon request.
      Throws:
      NullPointerException - If request was null
    • unmodifiableAddRequest

      public static AddRequest unmodifiableAddRequest(AddRequest request)
      Creates an unmodifiable add request of the provided request.
      Parameters:
      request - The add request to be copied.
      Returns:
      The new add request.
      Throws:
      NullPointerException - If request was null .
    • unmodifiableAnonymousSASLBindRequest

      Creates an unmodifiable anonymous SASL bind request of the provided request.
      Parameters:
      request - The anonymous SASL bind request to be copied.
      Returns:
      The new anonymous SASL bind request.
      Throws:
      NullPointerException - If request was null .
    • unmodifiableCancelExtendedRequest

      Creates an unmodifiable cancel extended request of the provided request.
      Parameters:
      request - The cancel extended request to be copied.
      Returns:
      The new cancel extended request.
      Throws:
      NullPointerException - If request was null .
    • unmodifiableCompareRequest

      Creates an unmodifiable compare request of the provided request.
      Parameters:
      request - The compare request to be copied.
      Returns:
      The new compare request.
      Throws:
      NullPointerException - If request was null .
    • unmodifiableCRAMMD5SASLBindRequest

      Creates an unmodifiable CRAM MD5 SASL bind request of the provided request.

      The returned bind request creates defensive copies of the password in order to maintain immutability.

      Parameters:
      request - The CRAM MD5 SASL bind request to be copied.
      Returns:
      The new CRAM-MD5 SASL bind request.
      Throws:
      NullPointerException - If request was null.
    • unmodifiableDeleteRequest

      Creates an unmodifiable delete request of the provided request.
      Parameters:
      request - The add request to be copied.
      Returns:
      The new delete request.
      Throws:
      NullPointerException - If request was null.
    • unmodifiableDigestMD5SASLBindRequest

      Creates an unmodifiable digest MD5 SASL bind request of the provided request.

      The returned bind request creates defensive copies of the password in order to maintain immutability.

      Parameters:
      request - The digest MD5 SASL bind request to be copied.
      Returns:
      The new DIGEST-MD5 SASL bind request.
      Throws:
      NullPointerException - If request was null.
    • unmodifiableExternalSASLBindRequest

      Creates an unmodifiable external SASL bind request of the provided request.
      Parameters:
      request - The external SASL bind request to be copied.
      Returns:
      The new External SASL bind request.
      Throws:
      NullPointerException - If request was null .
    • unmodifiableGenericBindRequest

      Creates an unmodifiable generic bind request of the provided request.

      The returned bind request creates defensive copies of the authentication value in order to maintain immutability.

      Parameters:
      request - The generic bind request to be copied.
      Returns:
      The new generic bind request.
      Throws:
      NullPointerException - If request was null .
    • unmodifiableGenericExtendedRequest

      Creates an unmodifiable generic extended request of the provided request.
      Parameters:
      request - The generic extended request to be copied.
      Returns:
      The new generic extended request.
      Throws:
      NullPointerException - If request was null .
    • unmodifiableGSSAPISASLBindRequest

      Creates an unmodifiable GSSAPI SASL bind request of the provided request.

      The returned bind request creates defensive copies of the password in order to maintain immutability.

      Parameters:
      request - The GSSAPI SASL bind request to be copied.
      Returns:
      The new GSSAPI SASL bind request.
      Throws:
      NullPointerException - If request was null.
    • unmodifiableModifyDNRequest

      Creates an unmodifiable modify DN request of the provided request.
      Parameters:
      request - The modify DN request to be copied.
      Returns:
      The new modify DN request.
      Throws:
      NullPointerException - If request was null .
    • unmodifiableModifyRequest

      Creates an unmodifiable modify request of the provided request.
      Parameters:
      request - The modify request to be copied.
      Returns:
      The new modify request.
      Throws:
      NullPointerException - If request was null .
    • unmodifiablePasswordModifyExtendedRequest

      Creates an unmodifiable password modify extended request of the provided request.
      Parameters:
      request - The password modify extended request to be copied.
      Returns:
      The new password modify extended request.
      Throws:
      NullPointerException - If request was null .
    • unmodifiablePlainSASLBindRequest

      Creates an unmodifiable plain SASL bind request of the provided request.

      The returned bind request creates defensive copies of the password in order to maintain immutability.

      Parameters:
      request - The plain SASL bind request to be copied.
      Returns:
      The new Plain SASL bind request.
      Throws:
      NullPointerException - If request was null .
    • unmodifiableSearchRequest

      Creates an unmodifiable search request of the provided request.
      Parameters:
      request - The search request to be copied.
      Returns:
      The new search request.
      Throws:
      NullPointerException - If request was null .
    • unmodifiableSimpleBindRequest

      Creates an unmodifiable simple bind request of the provided request.

      The returned bind request creates defensive copies of the password in order to maintain immutability.

      Parameters:
      request - The simple bind request to be copied.
      Returns:
      The new simple bind request.
      Throws:
      NullPointerException - If request was null .
    • unmodifiableStartTLSExtendedRequest

      Creates an unmodifiable startTLS extended request of the provided request.
      Parameters:
      request - The startTLS extended request to be copied.
      Returns:
      The new start TLS extended request.
      Throws:
      NullPointerException - If request was null .
    • unmodifiableUnbindRequest

      Creates an unmodifiable unbind request of the provided request.
      Parameters:
      request - The unbind request to be copied.
      Returns:
      The new unbind request.
      Throws:
      NullPointerException - If request was null .
    • unmodifiableWhoAmIExtendedRequest

      Creates an unmodifiable new Who Am I extended request of the provided request.
      Parameters:
      request - The who Am I extended request to be copied.
      Returns:
      The new Who Am I extended request.
      Throws:
      NullPointerException - If request was null .