public final class Ldap extends Object
LdapReader
,
LdapWriter
Modifier and Type | Field and Description |
---|---|
static String |
OID_GSSAPI_KERBEROS_V
The OID for the Kerberos V GSSAPI mechanism.
|
static String |
OID_NOTICE_OF_DISCONNECTION
The OID for the LDAP notice of disconnection extended operation.
|
static byte |
OP_TYPE_ABANDON_REQUEST
The protocol op type for abandon requests.
|
static byte |
OP_TYPE_ADD_REQUEST
The protocol op type for add requests.
|
static byte |
OP_TYPE_ADD_RESPONSE
The protocol op type for add responses.
|
static byte |
OP_TYPE_BIND_REQUEST
The protocol op type for bind requests.
|
static byte |
OP_TYPE_BIND_RESPONSE
The protocol op type for bind responses.
|
static byte |
OP_TYPE_COMPARE_REQUEST
The protocol op type for compare requests.
|
static byte |
OP_TYPE_COMPARE_RESPONSE
The protocol op type for compare responses.
|
static byte |
OP_TYPE_DELETE_REQUEST
The protocol op type for delete requests.
|
static byte |
OP_TYPE_DELETE_RESPONSE
The protocol op type for delete responses.
|
static byte |
OP_TYPE_EXTENDED_REQUEST
The protocol op type for extended requests.
|
static byte |
OP_TYPE_EXTENDED_RESPONSE
The protocol op type for extended responses.
|
static byte |
OP_TYPE_INTERMEDIATE_RESPONSE
The protocol op type for intermediate responses.
|
static byte |
OP_TYPE_MODIFY_DN_REQUEST
The protocol op type for modify DN requests.
|
static byte |
OP_TYPE_MODIFY_DN_RESPONSE
The protocol op type for modify DN responses.
|
static byte |
OP_TYPE_MODIFY_REQUEST
The protocol op type for modify requests.
|
static byte |
OP_TYPE_MODIFY_RESPONSE
The protocol op type for modify responses.
|
static byte |
OP_TYPE_SEARCH_REQUEST
The protocol op type for search requests.
|
static byte |
OP_TYPE_SEARCH_RESULT_DONE
The protocol op type for search result done elements.
|
static byte |
OP_TYPE_SEARCH_RESULT_ENTRY
The protocol op type for search result entries.
|
static byte |
OP_TYPE_SEARCH_RESULT_REFERENCE
The protocol op type for search result references.
|
static byte |
OP_TYPE_UNBIND_REQUEST
The protocol op type for unbind requests.
|
static byte |
TYPE_AUTHENTICATION_SASL
The BER type to use for the AuthenticationChoice element in a bind
request when SASL authentication is to be used.
|
static byte |
TYPE_AUTHENTICATION_SIMPLE
The BER type to use for the AuthenticationChoice element in a bind
request when simple authentication is to be used.
|
static byte |
TYPE_CONTROL_SEQUENCE
The BER type to use for encoding the sequence of controls in an LDAP message.
|
static byte |
TYPE_EXTENDED_REQUEST_OID
The BER type to use for the OID of an extended request.
|
static byte |
TYPE_EXTENDED_REQUEST_VALUE
The BER type to use for the value of an extended request.
|
static byte |
TYPE_EXTENDED_RESPONSE_OID
The BER type to use for the OID of an extended response.
|
static byte |
TYPE_EXTENDED_RESPONSE_VALUE
The BER type to use for the value of an extended response.
|
static byte |
TYPE_FILTER_AND
The BER type to use for AND filter components.
|
static byte |
TYPE_FILTER_APPROXIMATE
The BER type to use for approximate filter components.
|
static byte |
TYPE_FILTER_EQUALITY
The BER type to use for equality filter components.
|
static byte |
TYPE_FILTER_EXTENSIBLE_MATCH
The BER type to use for extensible matching filter components.
|
static byte |
TYPE_FILTER_GREATER_OR_EQUAL
The BER type to use for greater than or equal to filter components.
|
static byte |
TYPE_FILTER_LESS_OR_EQUAL
The BER type to use for less than or equal to filter components.
|
static byte |
TYPE_FILTER_NOT
The BER type to use for NOT filter components.
|
static byte |
TYPE_FILTER_OR
The BER type to use for OR filter components.
|
static byte |
TYPE_FILTER_PRESENCE
The BER type to use for presence filter components.
|
static byte |
TYPE_FILTER_SUBSTRING
The BER type to use for substring filter components.
|
static byte |
TYPE_INTERMEDIATE_RESPONSE_OID
The BER type to use for the OID of an intermediate response message.
|
static byte |
TYPE_INTERMEDIATE_RESPONSE_VALUE
The BER type to use for the value of an intermediate response message.
|
static byte |
TYPE_MATCHING_RULE_DN_ATTRIBUTES
The BER type to use for the DN attributes flag in a matching rule assertion.
|
static byte |
TYPE_MATCHING_RULE_ID
The BER type to use for the matching rule OID in a matching rule assertion.
|
static byte |
TYPE_MATCHING_RULE_TYPE
The BER type to use for the attribute type in a matching rule assertion.
|
static byte |
TYPE_MATCHING_RULE_VALUE
The BER type to use for the assertion value in a matching rule assertion.
|
static byte |
TYPE_MODIFY_DN_NEW_SUPERIOR
The BER type to use for the newSuperior component of a modify DN request.
|
static byte |
TYPE_REFERRAL_SEQUENCE
The BER type to use for encoding the sequence of referral URLs in an LDAPResult element.
|
static byte |
TYPE_SERVER_SASL_CREDENTIALS
The BER type to use for the server SASL credentials in a bind response.
|
static byte |
TYPE_SUBANY
The BER type to use for the subAny component(s) of a substring filter.
|
static byte |
TYPE_SUBFINAL
The BER type to use for the subFinal components of a substring filter.
|
static byte |
TYPE_SUBINITIAL
The BER type to use for the subInitial component of a substring filter.
|
Modifier and Type | Method and Description |
---|---|
static <R extends Asn1Reader> |
getReader(R asn1Reader,
DecodeOptions options)
Creates a new LDAP reader which will read LDAP messages from an ASN.1
reader using the provided decoding options.
|
static <W extends Asn1Writer> |
getWriter(W asn1Writer,
int ldapVersion)
Creates a new LDAP writer which will write LDAP messages to the provided
ASN.1 writer.
|
static Attribute |
readAttribute(Asn1Reader reader,
DecodeOptions options,
Schema schema)
Reads the next ASN.1 element from the provided
ASN1Reader as an Attribute . |
static Control |
readControl(Asn1Reader reader)
Reads the next ASN.1 element from the provided
ASN1Reader as a Control . |
static Entry |
readEntry(Asn1Reader reader,
DecodeOptions options)
Reads the next ASN.1 element from the provided
ASN1Reader as an Entry . |
static Filter |
readFilter(Asn1Reader reader)
Reads the next ASN.1 element from the provided
ASN1Reader as a Filter using a maximum filter
depth of 100. |
static Filter |
readFilter(Asn1Reader reader,
int maxFilterDepth)
Reads the next ASN.1 element from the provided
ASN1Reader as a Filter using the provided maximum
filter depth. |
static Modification |
readModification(Asn1Reader reader,
DecodeOptions options,
Schema schema)
Reads the next ASN.1 element from the provided
ASN1Reader as a Modification . |
static byte |
requestToResponseProtocolOpType(byte requestProtocolOpType)
Returns the response protocol operation type associated to the given request protocol op.
|
static void |
writeAttribute(Asn1Writer writer,
Attribute attribute)
Writes an
Attribute to the provided Asn1Writer . |
static void |
writeEntry(Asn1Writer writer,
Entry entry)
Writes an
Entry to the provided Asn1Writer . |
static void |
writeFilter(Asn1Writer writer,
Filter filter)
Writes a
Filter to the provided Asn1Writer . |
static void |
writeModification(Asn1Writer writer,
Modification modification)
Writes an
Modification to the provided Asn1Writer . |
public static final String OID_GSSAPI_KERBEROS_V
public static final String OID_NOTICE_OF_DISCONNECTION
public static final byte OP_TYPE_ABANDON_REQUEST
public static final byte OP_TYPE_ADD_REQUEST
public static final byte OP_TYPE_ADD_RESPONSE
public static final byte OP_TYPE_BIND_REQUEST
public static final byte OP_TYPE_BIND_RESPONSE
public static final byte OP_TYPE_COMPARE_REQUEST
public static final byte OP_TYPE_COMPARE_RESPONSE
public static final byte OP_TYPE_DELETE_REQUEST
public static final byte OP_TYPE_DELETE_RESPONSE
public static final byte OP_TYPE_EXTENDED_REQUEST
public static final byte OP_TYPE_EXTENDED_RESPONSE
public static final byte OP_TYPE_INTERMEDIATE_RESPONSE
public static final byte OP_TYPE_MODIFY_DN_REQUEST
public static final byte OP_TYPE_MODIFY_DN_RESPONSE
public static final byte OP_TYPE_MODIFY_REQUEST
public static final byte OP_TYPE_MODIFY_RESPONSE
public static final byte OP_TYPE_SEARCH_REQUEST
public static final byte OP_TYPE_SEARCH_RESULT_DONE
public static final byte OP_TYPE_SEARCH_RESULT_ENTRY
public static final byte OP_TYPE_SEARCH_RESULT_REFERENCE
public static final byte OP_TYPE_UNBIND_REQUEST
public static final byte TYPE_AUTHENTICATION_SASL
public static final byte TYPE_AUTHENTICATION_SIMPLE
public static final byte TYPE_CONTROL_SEQUENCE
public static final byte TYPE_EXTENDED_REQUEST_OID
public static final byte TYPE_EXTENDED_REQUEST_VALUE
public static final byte TYPE_EXTENDED_RESPONSE_OID
public static final byte TYPE_EXTENDED_RESPONSE_VALUE
public static final byte TYPE_FILTER_AND
public static final byte TYPE_FILTER_APPROXIMATE
public static final byte TYPE_FILTER_EQUALITY
public static final byte TYPE_FILTER_EXTENSIBLE_MATCH
public static final byte TYPE_FILTER_GREATER_OR_EQUAL
public static final byte TYPE_FILTER_LESS_OR_EQUAL
public static final byte TYPE_FILTER_NOT
public static final byte TYPE_FILTER_OR
public static final byte TYPE_FILTER_PRESENCE
public static final byte TYPE_FILTER_SUBSTRING
public static final byte TYPE_INTERMEDIATE_RESPONSE_OID
public static final byte TYPE_INTERMEDIATE_RESPONSE_VALUE
public static final byte TYPE_MATCHING_RULE_DN_ATTRIBUTES
public static final byte TYPE_MATCHING_RULE_ID
public static final byte TYPE_MATCHING_RULE_TYPE
public static final byte TYPE_MATCHING_RULE_VALUE
public static final byte TYPE_MODIFY_DN_NEW_SUPERIOR
public static final byte TYPE_REFERRAL_SEQUENCE
public static final byte TYPE_SERVER_SASL_CREDENTIALS
public static final byte TYPE_SUBANY
public static final byte TYPE_SUBFINAL
public static final byte TYPE_SUBINITIAL
public static byte requestToResponseProtocolOpType(byte requestProtocolOpType)
requestProtocolOpType
- The request's protocol-op typeIllegalArgumentException
- if requestProtocolOpType
does not identify a request producing response.public static <R extends Asn1Reader> LdapReader<R> getReader(R asn1Reader, DecodeOptions options)
R
- The type of ASN.1 reader used for decoding elements.asn1Reader
- The ASN.1 reader from which LDAP messages will be read.options
- LDAP message decoding options.public static <W extends Asn1Writer> LdapWriter<W> getWriter(W asn1Writer, int ldapVersion)
W
- The type of ASN.1 writer used for encoding elements.asn1Writer
- The ASN.1 writer to which LDAP messages will be written.ldapVersion
- Version of the protocol to use to encode the messages.public static Control readControl(Asn1Reader reader) throws IOException
ASN1Reader
as a Control
.reader
- The ASN1Reader
from which the ASN.1 encoded Control
should be read.Control
.IOException
- If an error occurs while reading from reader
.public static Filter readFilter(Asn1Reader reader) throws IOException
ASN1Reader
as a Filter
using a maximum filter
depth of 100. The maximum filter depth can prevent stack overflow errors from filters that look like (&(&(&(&(&(&(&(&(&....
.reader
- The ASN1Reader
from which the ASN.1 encoded Filter
should be read.Filter
.IOException
- If an error occurs while reading from reader
.LocalizedIllegalArgumentException
- If an attribute description contains invalid character, exceeds the maximum filter depth, or if the
search filter has an unrecognized type.public static Filter readFilter(Asn1Reader reader, int maxFilterDepth) throws IOException
ASN1Reader
as a Filter
using the provided maximum
filter depth. The maximum filter depth can prevent stack overflow errors from filters that look like (&(&(&(&(&(&(&(&(&....
.reader
- The ASN1Reader
from which the ASN.1 encoded Filter
should be read.maxFilterDepth
- The maximum depth to which nested search filters will be processed. This can prevent stack overflow
errors from filters that look like (&(&(&(&(&(&(&(&(&....
.Filter
.IOException
- If an error occurs while reading from reader
.LocalizedIllegalArgumentException
- If an attribute description contains invalid character, exceeds the maximum filter depth, or if the
search filter has an unrecognized type.public static Entry readEntry(Asn1Reader reader, DecodeOptions options) throws IOException
ASN1Reader
as an Entry
.reader
- The ASN1Reader
from which the ASN.1 encoded Entry
should be read.options
- The decode options to use when decoding the entry.Entry
.IOException
- If an error occurs while reading from reader
.public static void writeFilter(Asn1Writer writer, Filter filter) throws IOException
Filter
to the provided Asn1Writer
.writer
- The Asn1Writer
to which the ASN.1 encoded Filter
should be written.filter
- The filter.IOException
- If an error occurs while writing to writer
.public static void writeEntry(Asn1Writer writer, Entry entry) throws IOException
Entry
to the provided Asn1Writer
.writer
- The Asn1Writer
to which the ASN.1 encoded Entry
should be written.entry
- The entry.IOException
- If an error occurs while writing to writer
.public static Modification readModification(Asn1Reader reader, DecodeOptions options, Schema schema) throws IOException
ASN1Reader
as a Modification
.reader
- The ASN1Reader
from which the ASN.1 encoded Modification
should be read.options
- The decode options to use when decoding the modification.schema
- The schemaModification
.IOException
- If an error occurs while reading from reader
.public static Attribute readAttribute(Asn1Reader reader, DecodeOptions options, Schema schema) throws IOException
ASN1Reader
as an Attribute
.reader
- The ASN1Reader
from which the ASN.1 encoded Attribute
should be read.options
- The decode options to use when decoding the attribute.schema
- The schemaAttribute
.IOException
- If an error occurs while reading from reader
.public static void writeModification(Asn1Writer writer, Modification modification) throws IOException
Modification
to the provided Asn1Writer
.writer
- The Asn1Writer
to which the ASN.1 encoded Modification
should be written.modification
- The modification.IOException
- If an error occurs while writing to writer
.public static void writeAttribute(Asn1Writer writer, Attribute attribute) throws IOException
Attribute
to the provided Asn1Writer
.writer
- The Asn1Writer
to which the ASN.1 encoded Attribute
should be written.attribute
- The attribute.IOException
- If an error occurs while writing to writer
.Copyright 2010-2022 ForgeRock AS.