Package org.forgerock.opendj.io
Class LDAP
java.lang.Object
org.forgerock.opendj.io.LDAP
This class contains various static utility methods encoding and decoding LDAP
protocol elements.
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringThe OID for the Kerberos V GSSAPI mechanism.static final StringThe OID for the LDAP notice of disconnection extended operation.static final byte[]Mapping between request protocol op and their respective response protocol op.static final byteThe protocol op type for abandon requests.static final byteThe protocol op type for add requests.static final byteThe protocol op type for add responses.static final byteThe protocol op type for bind requests.static final byteThe protocol op type for bind responses.static final byteThe protocol op type for compare requests.static final byteThe protocol op type for compare responses.static final byteThe protocol op type for delete requests.static final byteThe protocol op type for delete responses.static final byteThe protocol op type for extended requests.static final byteThe protocol op type for extended responses.static final byteThe protocol op type for intermediate responses.static final byteThe protocol op type for modify DN requests.static final byteThe protocol op type for modify DN responses.static final byteThe protocol op type for modify requests.static final byteThe protocol op type for modify responses.static final byteThe protocol op type for search requests.static final byteThe protocol op type for search result done elements.static final byteThe protocol op type for search result entries.static final byteThe protocol op type for search result references.static final byteThe protocol op type for unbind requests.static final byteThe BER type to use for the AuthenticationChoice element in a bind request when SASL authentication is to be used.static final byteThe BER type to use for the AuthenticationChoice element in a bind request when simple authentication is to be used.static final byteThe BER type to use for encoding the sequence of controls in an LDAP message.static final byteThe BER type to use for the OID of an extended request.static final byteThe BER type to use for the value of an extended request.static final byteThe BER type to use for the OID of an extended response.static final byteThe BER type to use for the value of an extended response.static final byteThe BER type to use for AND filter components.static final byteThe BER type to use for approximate filter components.static final byteThe BER type to use for equality filter components.static final byteThe BER type to use for extensible matching filter components.static final byteThe BER type to use for greater than or equal to filter components.static final byteThe BER type to use for less than or equal to filter components.static final byteThe BER type to use for NOT filter components.static final byteThe BER type to use for OR filter components.static final byteThe BER type to use for presence filter components.static final byteThe BER type to use for substring filter components.static final byteThe BER type to use for the OID of an intermediate response message.static final byteThe BER type to use for the value of an intermediate response message.static final byteThe BER type to use for the DN attributes flag in a matching rule assertion.static final byteThe BER type to use for the matching rule OID in a matching rule assertion.static final byteThe BER type to use for the attribute type in a matching rule assertion.static final byteThe BER type to use for the assertion value in a matching rule assertion.static final byteThe BER type to use for the newSuperior component of a modify DN request.static final byteThe BER type to use for encoding the sequence of referral URLs in an LDAPResult element.static final byteThe BER type to use for the server SASL credentials in a bind response.static final byteThe BER type to use for the subAny component(s) of a substring filter.static final byteThe BER type to use for the subFinal components of a substring filter.static final byteThe BER type to use for the subInitial component of a substring filter. -
Method Summary
Modifier and TypeMethodDescriptionstatic <R extends ASN1Reader>
LDAPReader<R> 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>
LDAPWriter<W> getWriter(W asn1Writer, int ldapVersion) Creates a new LDAP writer which will write LDAP messages to the provided ASN.1 writer.static EntryreadEntry(ASN1Reader reader, DecodeOptions options) Reads the next ASN.1 element from the providedASN1Readeras a anEntry.static FilterreadFilter(ASN1Reader reader) Reads the next ASN.1 element from the providedASN1Readeras aFilter.static voidwriteEntry(ASN1Writer writer, Entry entry) Writes anEntryto the providedASN1Writer.static voidwriteFilter(ASN1Writer writer, Filter filter) Writes aFilterto the providedASN1Writer.
-
Field Details
-
OID_GSSAPI_KERBEROS_V
The OID for the Kerberos V GSSAPI mechanism.- See Also:
-
OID_NOTICE_OF_DISCONNECTION
The OID for the LDAP notice of disconnection extended operation.- See Also:
-
OP_TYPE_ABANDON_REQUEST
The protocol op type for abandon requests.- See Also:
-
OP_TYPE_ADD_REQUEST
The protocol op type for add requests.- See Also:
-
OP_TYPE_ADD_RESPONSE
The protocol op type for add responses.- See Also:
-
OP_TYPE_BIND_REQUEST
The protocol op type for bind requests.- See Also:
-
OP_TYPE_BIND_RESPONSE
The protocol op type for bind responses.- See Also:
-
OP_TYPE_COMPARE_REQUEST
The protocol op type for compare requests.- See Also:
-
OP_TYPE_COMPARE_RESPONSE
The protocol op type for compare responses.- See Also:
-
OP_TYPE_DELETE_REQUEST
The protocol op type for delete requests.- See Also:
-
OP_TYPE_DELETE_RESPONSE
The protocol op type for delete responses.- See Also:
-
OP_TYPE_EXTENDED_REQUEST
The protocol op type for extended requests.- See Also:
-
OP_TYPE_EXTENDED_RESPONSE
The protocol op type for extended responses.- See Also:
-
OP_TYPE_INTERMEDIATE_RESPONSE
The protocol op type for intermediate responses.- See Also:
-
OP_TYPE_MODIFY_DN_REQUEST
The protocol op type for modify DN requests.- See Also:
-
OP_TYPE_MODIFY_DN_RESPONSE
The protocol op type for modify DN responses.- See Also:
-
OP_TYPE_MODIFY_REQUEST
The protocol op type for modify requests.- See Also:
-
OP_TYPE_MODIFY_RESPONSE
The protocol op type for modify responses.- See Also:
-
OP_TYPE_SEARCH_REQUEST
The protocol op type for search requests.- See Also:
-
OP_TYPE_SEARCH_RESULT_DONE
The protocol op type for search result done elements.- See Also:
-
OP_TYPE_SEARCH_RESULT_ENTRY
The protocol op type for search result entries.- See Also:
-
OP_TYPE_SEARCH_RESULT_REFERENCE
The protocol op type for search result references.- See Also:
-
OP_TYPE_UNBIND_REQUEST
The protocol op type for unbind requests.- See Also:
-
OP_TO_RESULT_TYPE
Mapping between request protocol op and their respective response protocol op. -
TYPE_AUTHENTICATION_SASL
The BER type to use for the AuthenticationChoice element in a bind request when SASL authentication is to be used.- See Also:
-
TYPE_AUTHENTICATION_SIMPLE
The BER type to use for the AuthenticationChoice element in a bind request when simple authentication is to be used.- See Also:
-
TYPE_CONTROL_SEQUENCE
The BER type to use for encoding the sequence of controls in an LDAP message.- See Also:
-
TYPE_EXTENDED_REQUEST_OID
The BER type to use for the OID of an extended request.- See Also:
-
TYPE_EXTENDED_REQUEST_VALUE
The BER type to use for the value of an extended request.- See Also:
-
TYPE_EXTENDED_RESPONSE_OID
The BER type to use for the OID of an extended response.- See Also:
-
TYPE_EXTENDED_RESPONSE_VALUE
The BER type to use for the value of an extended response.- See Also:
-
TYPE_FILTER_AND
The BER type to use for AND filter components.- See Also:
-
TYPE_FILTER_APPROXIMATE
The BER type to use for approximate filter components.- See Also:
-
TYPE_FILTER_EQUALITY
The BER type to use for equality filter components.- See Also:
-
TYPE_FILTER_EXTENSIBLE_MATCH
The BER type to use for extensible matching filter components.- See Also:
-
TYPE_FILTER_GREATER_OR_EQUAL
The BER type to use for greater than or equal to filter components.- See Also:
-
TYPE_FILTER_LESS_OR_EQUAL
The BER type to use for less than or equal to filter components.- See Also:
-
TYPE_FILTER_NOT
The BER type to use for NOT filter components.- See Also:
-
TYPE_FILTER_OR
The BER type to use for OR filter components.- See Also:
-
TYPE_FILTER_PRESENCE
The BER type to use for presence filter components.- See Also:
-
TYPE_FILTER_SUBSTRING
The BER type to use for substring filter components.- See Also:
-
TYPE_INTERMEDIATE_RESPONSE_OID
The BER type to use for the OID of an intermediate response message.- See Also:
-
TYPE_INTERMEDIATE_RESPONSE_VALUE
The BER type to use for the value of an intermediate response message.- See Also:
-
TYPE_MATCHING_RULE_DN_ATTRIBUTES
The BER type to use for the DN attributes flag in a matching rule assertion.- See Also:
-
TYPE_MATCHING_RULE_ID
The BER type to use for the matching rule OID in a matching rule assertion.- See Also:
-
TYPE_MATCHING_RULE_TYPE
The BER type to use for the attribute type in a matching rule assertion.- See Also:
-
TYPE_MATCHING_RULE_VALUE
The BER type to use for the assertion value in a matching rule assertion.- See Also:
-
TYPE_MODIFY_DN_NEW_SUPERIOR
The BER type to use for the newSuperior component of a modify DN request.- See Also:
-
TYPE_REFERRAL_SEQUENCE
The BER type to use for encoding the sequence of referral URLs in an LDAPResult element.- See Also:
-
TYPE_SERVER_SASL_CREDENTIALS
The BER type to use for the server SASL credentials in a bind response.- See Also:
-
TYPE_SUBANY
The BER type to use for the subAny component(s) of a substring filter.- See Also:
-
TYPE_SUBFINAL
The BER type to use for the subFinal components of a substring filter.- See Also:
-
TYPE_SUBINITIAL
The BER type to use for the subInitial component of a substring filter.- See Also:
-
-
Method Details
-
getReader
Creates a new LDAP reader which will read LDAP messages from an ASN.1 reader using the provided decoding options.- Type Parameters:
R- The type of ASN.1 reader used for decoding elements.- Parameters:
asn1Reader- The ASN.1 reader from which LDAP messages will be read.options- LDAP message decoding options.- Returns:
- A new LDAP reader which will read LDAP messages from an ASN.1 reader using the provided decoding options.
-
getWriter
Creates a new LDAP writer which will write LDAP messages to the provided ASN.1 writer.- Type Parameters:
W- The type of ASN.1 writer used for encoding elements.- Parameters:
asn1Writer- The ASN.1 writer to which LDAP messages will be written.ldapVersion- Version of the protocol to use to encode the messages.- Returns:
- A new LDAP writer which will write LDAP messages to the provided ASN.1 writer.
-
readFilter
Reads the next ASN.1 element from the providedASN1Readeras aFilter.- Parameters:
reader- TheASN1Readerfrom which the ASN.1 encodedFiltershould be read.- Returns:
- The decoded
Filter. - Throws:
IOException- If an error occurs while reading fromreader.
-
readEntry
Reads the next ASN.1 element from the providedASN1Readeras a anEntry.- Parameters:
reader- TheASN1Readerfrom which the ASN.1 encodedEntryshould be read.options- The decode options to use when decoding the entry.- Returns:
- The decoded
Entry. - Throws:
IOException- If an error occurs while reading fromreader.
-
writeFilter
Writes aFilterto the providedASN1Writer.- Parameters:
writer- TheASN1Writerto which the ASN.1 encodedFiltershould be written.filter- The filter.- Throws:
IOException- If an error occurs while writing towriter.
-
writeEntry
Writes anEntryto the providedASN1Writer.- Parameters:
writer- TheASN1Writerto which the ASN.1 encodedEntryshould be written.entry- The entry.- Throws:
IOException- If an error occurs while writing towriter.
-