Package org.forgerock.opendj.hdap
Class Hdap
java.lang.Object
org.forgerock.opendj.hdap.Hdap
Lightweight REST API providing native LDAP capabilities.
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Option
<DecodeOptions> Specifies the LDAP decoding options which should be used when decoding LDAP DNs, attribute types, and controls.Specifies whether the LDAP schema should be loaded from the LDAP server before being able to serve requests.Specifies whether HDAP should normalize attribute names in the JSON representation of the resource, or use the name provided in the request.Specifies whether hdap should represent missing JSON property values usingnull
.static final Option
<ScheduledExecutorService> Specifies the scheduler which will be used for periodically detecting changes to LDAP schema.Specifies the interval between successive attempts to detect changes in LDAP schema.Specifies the interval between failed attempts to load the remote schema. -
Method Summary
Modifier and TypeMethodDescriptionstatic ResourceException
Adapts aThrowable
to aResourceException
.static Dn
dnOf
(ResourcePath resourcePath, SchemaResolver schemaResolver) Decodes the provided URL encoded resource path as a DN.static RequestHandler
newHdapRequestHandler
(Options options) Creates a new HDAP request handler with the provided options.
-
Field Details
-
LOAD_SCHEMA
Specifies whether the LDAP schema should be loaded from the LDAP server before being able to serve requests. -
NORMALIZE_ATTRIBUTE_NAMES
Specifies whether HDAP should normalize attribute names in the JSON representation of the resource, or use the name provided in the request. By default HDAP will normalize attribute names. -
SCHEMA_RETRY_INTERVAL
Specifies the interval between failed attempts to load the remote schema. The default configuration is to retry every 2 seconds. -
SCHEMA_RELOAD_INTERVAL
Specifies the interval between successive attempts to detect changes in LDAP schema. The default configuration is to attempt to detect changes every 30 seconds. -
SCHEDULER
Specifies the scheduler which will be used for periodically detecting changes to LDAP schema. A system-wide scheduler will be used by default. -
DECODE_OPTIONS
Specifies the LDAP decoding options which should be used when decoding LDAP DNs, attribute types, and controls. By default hdap will use a set of options of will always use the default schema. -
RETURN_NULL_FOR_MISSING_PROPERTIES
Specifies whether hdap should represent missing JSON property values usingnull
. By default missing JSON property values will not be included in any returned JSON resources.
-
-
Method Details
-
newHdapRequestHandler
Creates a new HDAP request handler with the provided options.- Parameters:
options
- The options.- Returns:
- The HDAP request handler.
-
dnOf
public static Dn dnOf(ResourcePath resourcePath, SchemaResolver schemaResolver) throws BadRequestException Decodes the provided URL encoded resource path as a DN. The resource path is the big-endian representation of the DN where each RDN is encoded as a separate path element. For example, the DNou=people,dc=example,dc=com
will be encoded asdc=com/dc=example/ou=people
.- Parameters:
resourcePath
- The URL encoded resource path.schemaResolver
- TheSchemaResolver
used to compute the DN.- Returns:
- the DN representation of the resource path.
- Throws:
BadRequestException
- whenever the resource path does not represent a DN.
-
asResourceException
Adapts aThrowable
to aResourceException
. If theThrowable
is an LDAPLdapException
then an appropriateResourceException
is returned, otherwise anInternalServerErrorException
is returned.- Parameters:
t
- TheThrowable
to be converted.- Returns:
- The equivalent resource exception.
-