Class Hdap

java.lang.Object
org.forgerock.opendj.hdap.Hdap

public final class Hdap extends Object
Lightweight REST API providing native LDAP capabilities.
  • Field Details

    • LOAD_SCHEMA

      public static final Option<Boolean> LOAD_SCHEMA
      Specifies whether the LDAP schema should be loaded from the LDAP server before being able to serve requests.
    • NORMALIZE_ATTRIBUTE_NAMES

      public static final Option<Boolean> 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

      public static final Option<Duration> 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

      public static final Option<Duration> 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

      public static final Option<ScheduledExecutorService> 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

      public static final Option<DecodeOptions> 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

      public static final Option<Boolean> RETURN_NULL_FOR_MISSING_PROPERTIES
      Specifies whether hdap should represent missing JSON property values using null. By default missing JSON property values will not be included in any returned JSON resources.
  • Method Details

    • newHdapRequestHandler

      public static RequestHandler newHdapRequestHandler(Options options)
      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 DN ou=people,dc=example,dc=com will be encoded as dc=com/dc=example/ou=people.
      Parameters:
      resourcePath - The URL encoded resource path.
      schemaResolver - The SchemaResolver 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

      public static ResourceException asResourceException(Throwable t)
      Adapts a Throwable to a ResourceException. If the Throwable is an LDAP LdapException then an appropriate ResourceException is returned, otherwise an InternalServerErrorException is returned.
      Parameters:
      t - The Throwable to be converted.
      Returns:
      The equivalent resource exception.