public final class Requests extends Object
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.
Modifier and Type | Method and Description |
---|---|
static AbandonRequest |
copyOfAbandonRequest(AbandonRequest request)
Creates a new abandon request that is an exact copy of the provided
request.
|
static AddRequest |
copyOfAddRequest(AddRequest request)
Creates a new add request that is an exact copy of the provided request.
|
static AnonymousSASLBindRequest |
copyOfAnonymousSASLBindRequest(AnonymousSASLBindRequest request)
Creates a new anonymous SASL bind request that is an exact copy of the
provided request.
|
static CancelExtendedRequest |
copyOfCancelExtendedRequest(CancelExtendedRequest request)
Creates a new cancel extended request that is an exact copy of the
provided request.
|
static CompareRequest |
copyOfCompareRequest(CompareRequest request)
Creates a new compare request that is an exact copy of the provided
request.
|
static CRAMMD5SASLBindRequest |
copyOfCRAMMD5SASLBindRequest(CRAMMD5SASLBindRequest request)
Creates a new CRAM MD5 SASL bind request that is an exact copy of the
provided request.
|
static DeleteRequest |
copyOfDeleteRequest(DeleteRequest request)
Creates a new delete request that is an exact copy of the provided
request.
|
static DigestMD5SASLBindRequest |
copyOfDigestMD5SASLBindRequest(DigestMD5SASLBindRequest request)
Creates a new digest MD5 SASL bind request that is an exact copy of the
provided request.
|
static ExternalSASLBindRequest |
copyOfExternalSASLBindRequest(ExternalSASLBindRequest request)
Creates a new external SASL bind request that is an exact copy of the
provided request.
|
static GenericBindRequest |
copyOfGenericBindRequest(GenericBindRequest request)
Creates a new generic bind request that is an exact copy of the provided
request.
|
static GenericExtendedRequest |
copyOfGenericExtendedRequest(GenericExtendedRequest request)
Creates a new generic extended request that is an exact copy of the
provided request.
|
static GSSAPISASLBindRequest |
copyOfGSSAPISASLBindRequest(GSSAPISASLBindRequest request)
Creates a new GSSAPI SASL bind request that is an exact copy of the
provided request.
|
static ModifyDNRequest |
copyOfModifyDNRequest(ModifyDNRequest request)
Creates a new modify DN request that is an exact copy of the provided
request.
|
static ModifyRequest |
copyOfModifyRequest(ModifyRequest request)
Creates a new modify request that is an exact copy of the provided
request.
|
static PasswordModifyExtendedRequest |
copyOfPasswordModifyExtendedRequest(PasswordModifyExtendedRequest request)
Creates a new password modify extended request that is an exact copy of
the provided request.
|
static PlainSASLBindRequest |
copyOfPlainSASLBindRequest(PlainSASLBindRequest request)
Creates a new plain SASL bind request that is an exact copy of the
provided request.
|
static SearchRequest |
copyOfSearchRequest(SearchRequest request)
Creates a new search request that is an exact copy of the provided
request.
|
static SimpleBindRequest |
copyOfSimpleBindRequest(SimpleBindRequest request)
Creates a new simple bind request that is an exact copy of the provided
request.
|
static StartTLSExtendedRequest |
copyOfStartTLSExtendedRequest(StartTLSExtendedRequest request)
Creates a new startTLS extended request that is an exact copy of the
provided request.
|
static UnbindRequest |
copyOfUnbindRequest(UnbindRequest request)
Creates a new unbind request that is an exact copy of the provided
request.
|
static WhoAmIExtendedRequest |
copyOfWhoAmIExtendedRequest(WhoAmIExtendedRequest request)
Creates a new Who Am I extended request that is an exact copy of the
provided request.
|
static AbandonRequest |
newAbandonRequest(int requestID)
Creates a new abandon request using the provided message ID.
|
static AddRequest |
newAddRequest(DN name)
Creates a new add request using the provided distinguished name.
|
static AddRequest |
newAddRequest(Entry entry)
Creates a new add request backed by the provided entry.
|
static AddRequest |
newAddRequest(String... ldifLines)
Creates a new add request using the provided lines of LDIF decoded using
the default schema.
|
static AddRequest |
newAddRequest(String name)
Creates a new add request using the provided distinguished name decoded
using the default schema.
|
static AnonymousSASLBindRequest |
newAnonymousSASLBindRequest(String traceString)
Creates a new anonymous SASL bind request having the provided trace
string.
|
static CancelExtendedRequest |
newCancelExtendedRequest(int requestID)
Creates a new cancel extended request using the provided message ID.
|
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.
|
static CompareRequest |
newCompareRequest(DN name,
AttributeDescription attributeDescription,
Object assertionValue)
Creates a new compare request using the provided distinguished name,
attribute name, and assertion value.
|
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.
|
static CRAMMD5SASLBindRequest |
newCRAMMD5SASLBindRequest(String authenticationID,
byte[] password)
Creates a new CRAM-MD5 SASL bind request having the provided
authentication ID and password.
|
static CRAMMD5SASLBindRequest |
newCRAMMD5SASLBindRequest(String authenticationID,
char[] password)
Creates a new CRAM-MD5 SASL bind request having the provided
authentication ID and password.
|
static DeleteRequest |
newDeleteRequest(DN name)
Creates a new delete request using the provided distinguished name.
|
static DeleteRequest |
newDeleteRequest(String name)
Creates a new delete request using the provided distinguished name
decoded using the default schema.
|
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.
|
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.
|
static ExternalSASLBindRequest |
newExternalSASLBindRequest()
Creates a new External SASL bind request with no authorization ID.
|
static GenericBindRequest |
newGenericBindRequest(byte authenticationType,
byte[] authenticationValue)
Creates a new generic bind request using an empty distinguished name,
authentication type, and authentication information.
|
static GenericBindRequest |
newGenericBindRequest(String name,
byte authenticationType,
byte[] authenticationValue)
Creates a new generic bind request using the provided name,
authentication type, and authentication information.
|
static GenericExtendedRequest |
newGenericExtendedRequest(String requestName)
Creates a new generic extended request using the provided name and no
value.
|
static GenericExtendedRequest |
newGenericExtendedRequest(String requestName,
Object requestValue)
Creates a new generic extended request using the provided name and
optional value.
|
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.
|
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.
|
static GSSAPISASLBindRequest |
newGSSAPISASLBindRequest(Subject subject)
Creates a new GSSAPI SASL bind request having the provided subject, but
no authorization ID.
|
static ModifyDNRequest |
newModifyDNRequest(DN name,
RDN newRDN)
Creates a new modify DN request using the provided distinguished name and
new RDN.
|
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.
|
static ModifyRequest |
newModifyRequest(DN name)
Creates a new modify request using the provided distinguished name.
|
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 . |
static ModifyRequest |
newModifyRequest(String... ldifLines)
Creates a new modify request using the provided lines of LDIF decoded
using the default schema.
|
static ModifyRequest |
newModifyRequest(String name)
Creates a new modify request using the provided distinguished name
decoded using the default schema.
|
static PasswordModifyExtendedRequest |
newPasswordModifyExtendedRequest()
Creates a new password modify extended request, with no user identity,
old password, or new password.
|
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.
|
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.
|
static SearchRequest |
newSearchRequest(DN name,
SearchScope scope,
Filter filter,
String... attributeDescriptions)
Creates a new search request using the provided distinguished name,
scope, and filter.
|
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.
|
static SimpleBindRequest |
newSimpleBindRequest()
Creates a new simple bind request having an empty name and password
suitable for anonymous authentication.
|
static SimpleBindRequest |
newSimpleBindRequest(String name,
byte[] password)
Creates a new simple bind request having the provided name and password
suitable for name/password authentication.
|
static SimpleBindRequest |
newSimpleBindRequest(String name,
char[] password)
Creates a new simple bind request having the provided name and password
suitable for name/password authentication.
|
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.
|
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.
|
static StartTLSExtendedRequest |
newStartTLSExtendedRequest(SSLContext sslContext)
Creates a new start TLS extended request which will use the provided SSL
context.
|
static UnbindRequest |
newUnbindRequest()
Creates a new unbind request.
|
static WhoAmIExtendedRequest |
newWhoAmIExtendedRequest()
Creates a new Who Am I extended request.
|
static AbandonRequest |
unmodifiableAbandonRequest(AbandonRequest request)
Creates an unmodifiable abandon request of the provided request.
|
static AddRequest |
unmodifiableAddRequest(AddRequest request)
Creates an unmodifiable add request of the provided request.
|
static AnonymousSASLBindRequest |
unmodifiableAnonymousSASLBindRequest(AnonymousSASLBindRequest request)
Creates an unmodifiable anonymous SASL bind request of the provided
request.
|
static CancelExtendedRequest |
unmodifiableCancelExtendedRequest(CancelExtendedRequest request)
Creates an unmodifiable cancel extended request of the provided request.
|
static CompareRequest |
unmodifiableCompareRequest(CompareRequest request)
Creates an unmodifiable compare request of the provided request.
|
static CRAMMD5SASLBindRequest |
unmodifiableCRAMMD5SASLBindRequest(CRAMMD5SASLBindRequest request)
Creates an unmodifiable CRAM MD5 SASL bind request of the provided
request.
|
static DeleteRequest |
unmodifiableDeleteRequest(DeleteRequest request)
Creates an unmodifiable delete request of the provided request.
|
static DigestMD5SASLBindRequest |
unmodifiableDigestMD5SASLBindRequest(DigestMD5SASLBindRequest request)
Creates an unmodifiable digest MD5 SASL bind request of the provided
request.
|
static ExternalSASLBindRequest |
unmodifiableExternalSASLBindRequest(ExternalSASLBindRequest request)
Creates an unmodifiable external SASL bind request of the provided
request.
|
static GenericBindRequest |
unmodifiableGenericBindRequest(GenericBindRequest request)
Creates an unmodifiable generic bind request of the provided request.
|
static GenericExtendedRequest |
unmodifiableGenericExtendedRequest(GenericExtendedRequest request)
Creates an unmodifiable generic extended request of the provided request.
|
static GSSAPISASLBindRequest |
unmodifiableGSSAPISASLBindRequest(GSSAPISASLBindRequest request)
Creates an unmodifiable GSSAPI SASL bind request of the provided request.
|
static ModifyDNRequest |
unmodifiableModifyDNRequest(ModifyDNRequest request)
Creates an unmodifiable modify DN request of the provided request.
|
static ModifyRequest |
unmodifiableModifyRequest(ModifyRequest request)
Creates an unmodifiable modify request of the provided request.
|
static PasswordModifyExtendedRequest |
unmodifiablePasswordModifyExtendedRequest(PasswordModifyExtendedRequest request)
Creates an unmodifiable password modify extended request of the provided
request.
|
static PlainSASLBindRequest |
unmodifiablePlainSASLBindRequest(PlainSASLBindRequest request)
Creates an unmodifiable plain SASL bind request of the provided request.
|
static SearchRequest |
unmodifiableSearchRequest(SearchRequest request)
Creates an unmodifiable search request of the provided request.
|
static SimpleBindRequest |
unmodifiableSimpleBindRequest(SimpleBindRequest request)
Creates an unmodifiable simple bind request of the provided request.
|
static StartTLSExtendedRequest |
unmodifiableStartTLSExtendedRequest(StartTLSExtendedRequest request)
Creates an unmodifiable startTLS extended request of the provided
request.
|
static UnbindRequest |
unmodifiableUnbindRequest(UnbindRequest request)
Creates an unmodifiable unbind request of the provided request.
|
static WhoAmIExtendedRequest |
unmodifiableWhoAmIExtendedRequest(WhoAmIExtendedRequest request)
Creates an unmodifiable new Who Am I extended request of the provided
request.
|
public static AbandonRequest copyOfAbandonRequest(AbandonRequest request)
request
- The abandon request to be copied.NullPointerException
- If request
was null
public static AddRequest copyOfAddRequest(AddRequest request)
request
- The add request to be copied.NullPointerException
- If request
was null
.public static AnonymousSASLBindRequest copyOfAnonymousSASLBindRequest(AnonymousSASLBindRequest request)
request
- The anonymous SASL bind request to be copied.NullPointerException
- If request
was null
.public static CancelExtendedRequest copyOfCancelExtendedRequest(CancelExtendedRequest request)
request
- The cancel extended request to be copied.NullPointerException
- If request
was null
.public static CompareRequest copyOfCompareRequest(CompareRequest request)
request
- The compare request to be copied.NullPointerException
- If request
was null
.public static CRAMMD5SASLBindRequest copyOfCRAMMD5SASLBindRequest(CRAMMD5SASLBindRequest request)
request
- The CRAM MD5 SASL bind request to be copied.NullPointerException
- If request
was null
.public static DeleteRequest copyOfDeleteRequest(DeleteRequest request)
request
- The add request to be copied.NullPointerException
- If request
was null
.public static DigestMD5SASLBindRequest copyOfDigestMD5SASLBindRequest(DigestMD5SASLBindRequest request)
request
- The digest MD5 SASL bind request to be copied.NullPointerException
- If request
was null
.public static ExternalSASLBindRequest copyOfExternalSASLBindRequest(ExternalSASLBindRequest request)
request
- The external SASL bind request to be copied.NullPointerException
- If request
was null
.public static GenericBindRequest copyOfGenericBindRequest(GenericBindRequest request)
request
- The generic bind request to be copied.NullPointerException
- If request
was null
.public static GenericExtendedRequest copyOfGenericExtendedRequest(GenericExtendedRequest request)
request
- The generic extended request to be copied.NullPointerException
- If request
was null
.public static GSSAPISASLBindRequest copyOfGSSAPISASLBindRequest(GSSAPISASLBindRequest request)
request
- The GSSAPI SASL bind request to be copied.NullPointerException
- If request
was null
.public static ModifyDNRequest copyOfModifyDNRequest(ModifyDNRequest request)
request
- The modify DN request to be copied.NullPointerException
- If request
was null
.public static ModifyRequest copyOfModifyRequest(ModifyRequest request)
request
- The modify request to be copied.NullPointerException
- If request
was null
.public static PasswordModifyExtendedRequest copyOfPasswordModifyExtendedRequest(PasswordModifyExtendedRequest request)
request
- The password modify extended request to be copied.NullPointerException
- If request
was null
.public static PlainSASLBindRequest copyOfPlainSASLBindRequest(PlainSASLBindRequest request)
request
- The plain SASL bind request to be copied.NullPointerException
- If request
was null
.public static SearchRequest copyOfSearchRequest(SearchRequest request)
request
- The search request to be copied.NullPointerException
- If request
was null
.public static SimpleBindRequest copyOfSimpleBindRequest(SimpleBindRequest request)
request
- The simple bind request to be copied.NullPointerException
- If request
was null
.public static StartTLSExtendedRequest copyOfStartTLSExtendedRequest(StartTLSExtendedRequest request)
request
- The startTLS extended request to be copied.NullPointerException
- If request
was null
.public static UnbindRequest copyOfUnbindRequest(UnbindRequest request)
request
- The unbind request to be copied.NullPointerException
- If request
was null
.public static WhoAmIExtendedRequest copyOfWhoAmIExtendedRequest(WhoAmIExtendedRequest request)
request
- The who Am I extended request to be copied.NullPointerException
- If request
was null
.public static AbandonRequest newAbandonRequest(int requestID)
requestID
- The request ID of the request to be abandoned.public static AddRequest newAddRequest(DN name)
name
- The distinguished name of the entry to be added.NullPointerException
- If name
was null
.public static AddRequest newAddRequest(Entry entry)
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.entry
- The entry to be added.NullPointerException
- If entry
was null
.public static AddRequest newAddRequest(String name)
name
- The distinguished name of the entry to be added.LocalizedIllegalArgumentException
- If name
could not be decoded using the default
schema.NullPointerException
- If name
was null
.public static AddRequest newAddRequest(String... ldifLines)
ldifLines
- Lines of LDIF containing an LDIF add change record or an LDIF
entry record.LocalizedIllegalArgumentException
- If ldifLines
was empty, or contained invalid LDIF, or
could not be decoded using the default schema.NullPointerException
- If ldifLines
was null
.public static AnonymousSASLBindRequest newAnonymousSASLBindRequest(String traceString)
traceString
- The trace information, which has no semantic value, and can be
used by administrators in order to identify the user.NullPointerException
- If traceString
was null
.public static CancelExtendedRequest newCancelExtendedRequest(int requestID)
requestID
- The request ID of the request to be abandoned.public static ChangeRecord newChangeRecord(String... ldifLines)
ldifLines
- Lines of LDIF containing an LDIF change record or an LDIF
entry record.LocalizedIllegalArgumentException
- If ldifLines
was empty, or contained invalid LDIF, or
could not be decoded using the default schema.NullPointerException
- If ldifLines
was null
.public static CompareRequest newCompareRequest(DN name, AttributeDescription attributeDescription, Object assertionValue)
If the assertion value is not an instance of ByteString
then it
will be converted using the ByteString.valueOfObject(Object)
method.
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.NullPointerException
- If name
, attributeDescription
, or
assertionValue
was null
.public static CompareRequest newCompareRequest(String name, String attributeDescription, Object assertionValue)
If the assertion value is not an instance of ByteString
then it
will be converted using the ByteString.valueOfObject(Object)
method.
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.LocalizedIllegalArgumentException
- If name
or attributeDescription
could not be
decoded using the default schema.NullPointerException
- If name
, attributeDescription
, or
assertionValue
was null
.public static CRAMMD5SASLBindRequest newCRAMMD5SASLBindRequest(String authenticationID, byte[] password)
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.NullPointerException
- If authenticationID
or password
was
null
.public static CRAMMD5SASLBindRequest newCRAMMD5SASLBindRequest(String authenticationID, char[] password)
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.NullPointerException
- If authenticationID
or password
was
null
.public static DeleteRequest newDeleteRequest(DN name)
name
- The distinguished name of the entry to be deleted.NullPointerException
- If name
was null
.public static DeleteRequest newDeleteRequest(String name)
name
- The distinguished name of the entry to be deleted.LocalizedIllegalArgumentException
- If name
could not be decoded using the default
schema.NullPointerException
- If name
was null
.public static DigestMD5SASLBindRequest newDigestMD5SASLBindRequest(String authenticationID, byte[] password)
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.NullPointerException
- If authenticationID
or password
was
null
.public static DigestMD5SASLBindRequest newDigestMD5SASLBindRequest(String authenticationID, char[] password)
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.NullPointerException
- If authenticationID
or password
was
null
.public static ExternalSASLBindRequest newExternalSASLBindRequest()
public static GenericBindRequest newGenericBindRequest(byte authenticationType, byte[] authenticationValue)
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.NullPointerException
- If authenticationValue
was null
.public static GenericBindRequest newGenericBindRequest(String name, byte authenticationType, byte[] authenticationValue)
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.
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.NullPointerException
- If name
or authenticationValue
was
null
.public static GenericExtendedRequest newGenericExtendedRequest(String requestName)
requestName
- The dotted-decimal representation of the unique OID
corresponding to this extended request.NullPointerException
- If requestName
was null
.public static GenericExtendedRequest newGenericExtendedRequest(String requestName, Object requestValue)
If the request value is not an instance of ByteString
then it
will be converted using the ByteString.valueOfObject(Object)
method.
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.NullPointerException
- If requestName
was null
.public static GSSAPISASLBindRequest newGSSAPISASLBindRequest(String authenticationID, byte[] password)
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.NullPointerException
- If authenticationID
or password
was
null
.public static GSSAPISASLBindRequest newGSSAPISASLBindRequest(String authenticationID, char[] password)
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.NullPointerException
- If authenticationID
or password
was
null
.public static GSSAPISASLBindRequest newGSSAPISASLBindRequest(Subject subject)
subject
- The Kerberos subject of the user to be authenticated.NullPointerException
- If subject
was null
.public static ModifyDNRequest newModifyDNRequest(DN name, RDN newRDN)
null
, indicating that the
renamed entry will remain under the same parent entry, and the old RDN
attribute values will not be deleted.name
- The distinguished name of the entry to be renamed.newRDN
- The new RDN of the entry.NullPointerException
- If name
or newRDN
was null
.public static ModifyDNRequest newModifyDNRequest(String name, String newRDN)
null
, indicating that the renamed entry will remain under the
same parent entry, and the old RDN attribute values will not be deleted.name
- The distinguished name of the entry to be renamed.newRDN
- The new RDN of the entry.LocalizedIllegalArgumentException
- If name
or newRDN
could not be decoded using
the default schema.NullPointerException
- If name
or newRDN
was null
.public static ModifyRequest newModifyRequest(DN name)
name
- The distinguished name of the entry to be modified.NullPointerException
- If name
was null
.public static ModifyRequest newModifyRequest(Entry fromEntry, Entry toEntry)
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());
fromEntry
- The source entry.toEntry
- The destination entry.fromEntry
into entry toEntry
.
The returned request will always be non-null
but may not
contain any modifications.NullPointerException
- If fromEntry
or toEntry
were null
.Entries.diffEntries(Entry, Entry)
public static ModifyRequest newModifyRequest(String name)
name
- The distinguished name of the entry to be modified.LocalizedIllegalArgumentException
- If name
could not be decoded using the default
schema.NullPointerException
- If name
was null
.public static ModifyRequest newModifyRequest(String... ldifLines)
ldifLines
- Lines of LDIF containing a single LDIF modify change record.LocalizedIllegalArgumentException
- If ldifLines
was empty, or contained invalid LDIF, or
could not be decoded using the default schema.NullPointerException
- If ldifLines
was null
.public static PasswordModifyExtendedRequest newPasswordModifyExtendedRequest()
public static PlainSASLBindRequest newPlainSASLBindRequest(String authenticationID, byte[] password)
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.NullPointerException
- If authenticationID
or password
was
null
.public static PlainSASLBindRequest newPlainSASLBindRequest(String authenticationID, char[] password)
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.NullPointerException
- If authenticationID
or password
was
null
.public static SearchRequest newSearchRequest(DN name, SearchScope scope, Filter filter, String... attributeDescriptions)
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.NullPointerException
- If the name
, scope
, or filter
were
null
.public static SearchRequest newSearchRequest(String name, SearchScope scope, String filter, String... attributeDescriptions)
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.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
.public static SearchRequest newSingleEntrySearchRequest(DN name, SearchScope scope, Filter filter, String... attributeDescriptions)
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.NullPointerException
- If the name
, scope
, or filter
were
null
.public static SearchRequest newSingleEntrySearchRequest(String name, SearchScope scope, String filter, String... attributeDescriptions)
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.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
.public static SimpleBindRequest newSimpleBindRequest()
public static SimpleBindRequest newSimpleBindRequest(String name, byte[] password)
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.
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.NullPointerException
- If name
or password
was null
.public static SimpleBindRequest newSimpleBindRequest(String name, char[] password)
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.
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.NullPointerException
- If name
or password
was null
.public static StartTLSExtendedRequest newStartTLSExtendedRequest(SSLContext sslContext)
sslContext
- The SSLContext that should be used when installing the TLS
layer.NullPointerException
- If sslContext
was null
.public static UnbindRequest newUnbindRequest()
public static WhoAmIExtendedRequest newWhoAmIExtendedRequest()
public static AbandonRequest unmodifiableAbandonRequest(AbandonRequest request)
request
- The abandon request to be copied.NullPointerException
- If request
was null
public static AddRequest unmodifiableAddRequest(AddRequest request)
request
- The add request to be copied.NullPointerException
- If request
was null
.public static AnonymousSASLBindRequest unmodifiableAnonymousSASLBindRequest(AnonymousSASLBindRequest request)
request
- The anonymous SASL bind request to be copied.NullPointerException
- If request
was null
.public static CancelExtendedRequest unmodifiableCancelExtendedRequest(CancelExtendedRequest request)
request
- The cancel extended request to be copied.NullPointerException
- If request
was null
.public static CompareRequest unmodifiableCompareRequest(CompareRequest request)
request
- The compare request to be copied.NullPointerException
- If request
was null
.public static CRAMMD5SASLBindRequest unmodifiableCRAMMD5SASLBindRequest(CRAMMD5SASLBindRequest request)
The returned bind request creates defensive copies of the password in order to maintain immutability.
request
- The CRAM MD5 SASL bind request to be copied.NullPointerException
- If request
was null
.public static DeleteRequest unmodifiableDeleteRequest(DeleteRequest request)
request
- The add request to be copied.NullPointerException
- If request
was null
.public static DigestMD5SASLBindRequest unmodifiableDigestMD5SASLBindRequest(DigestMD5SASLBindRequest request)
The returned bind request creates defensive copies of the password in order to maintain immutability.
request
- The digest MD5 SASL bind request to be copied.NullPointerException
- If request
was null
.public static ExternalSASLBindRequest unmodifiableExternalSASLBindRequest(ExternalSASLBindRequest request)
request
- The external SASL bind request to be copied.NullPointerException
- If request
was null
.public static GenericBindRequest unmodifiableGenericBindRequest(GenericBindRequest request)
The returned bind request creates defensive copies of the authentication value in order to maintain immutability.
request
- The generic bind request to be copied.NullPointerException
- If request
was null
.public static GenericExtendedRequest unmodifiableGenericExtendedRequest(GenericExtendedRequest request)
request
- The generic extended request to be copied.NullPointerException
- If request
was null
.public static GSSAPISASLBindRequest unmodifiableGSSAPISASLBindRequest(GSSAPISASLBindRequest request)
The returned bind request creates defensive copies of the password in order to maintain immutability.
request
- The GSSAPI SASL bind request to be copied.NullPointerException
- If request
was null
.public static ModifyDNRequest unmodifiableModifyDNRequest(ModifyDNRequest request)
request
- The modify DN request to be copied.NullPointerException
- If request
was null
.public static ModifyRequest unmodifiableModifyRequest(ModifyRequest request)
request
- The modify request to be copied.NullPointerException
- If request
was null
.public static PasswordModifyExtendedRequest unmodifiablePasswordModifyExtendedRequest(PasswordModifyExtendedRequest request)
request
- The password modify extended request to be copied.NullPointerException
- If request
was null
.public static PlainSASLBindRequest unmodifiablePlainSASLBindRequest(PlainSASLBindRequest request)
The returned bind request creates defensive copies of the password in order to maintain immutability.
request
- The plain SASL bind request to be copied.NullPointerException
- If request
was null
.public static SearchRequest unmodifiableSearchRequest(SearchRequest request)
request
- The search request to be copied.NullPointerException
- If request
was null
.public static SimpleBindRequest unmodifiableSimpleBindRequest(SimpleBindRequest request)
The returned bind request creates defensive copies of the password in order to maintain immutability.
request
- The simple bind request to be copied.NullPointerException
- If request
was null
.public static StartTLSExtendedRequest unmodifiableStartTLSExtendedRequest(StartTLSExtendedRequest request)
request
- The startTLS extended request to be copied.NullPointerException
- If request
was null
.public static UnbindRequest unmodifiableUnbindRequest(UnbindRequest request)
request
- The unbind request to be copied.NullPointerException
- If request
was null
.public static WhoAmIExtendedRequest unmodifiableWhoAmIExtendedRequest(WhoAmIExtendedRequest request)
request
- The who Am I extended request to be copied.NullPointerException
- If request
was null
.Copyright 2010-2017 ForgeRock AS.