Class Rest2LdapHttpApplication

java.lang.Object
org.forgerock.opendj.rest2ldap.Rest2LdapHttpApplication
All Implemented Interfaces:
org.forgerock.http.HttpApplication

public class Rest2LdapHttpApplication extends Object implements org.forgerock.http.HttpApplication
Rest2ldap HTTP application.
  • Field Details

    • configDirectory

      protected final File configDirectory
      The name of the JSON configuration directory in which config.json and rest2ldap/rest2ldap.json are located.
    • schema

      protected final org.forgerock.opendj.ldap.schema.Schema schema
      Schema used to perform DN validations.
  • Constructor Details

    • Rest2LdapHttpApplication

      Default constructor called by the HTTP Framework which will use the default configuration directory.
    • Rest2LdapHttpApplication

      public Rest2LdapHttpApplication(File configDirectory, org.forgerock.opendj.ldap.schema.Schema schema)
      Creates a new Rest2LDAP HTTP application using the provided configuration directory.
      Parameters:
      configDirectory - The name of the JSON configuration directory in which config.json and rest2ldap/rest2ldap.json are located.
      schema - The Schema used to perform DN validations
  • Method Details

    • start

      public final org.forgerock.http.Handler start() throws org.forgerock.http.HttpApplicationException
      Specified by:
      start in interface org.forgerock.http.HttpApplication
      Throws:
      org.forgerock.http.HttpApplicationException
    • getBufferFactory

      public org.forgerock.util.Factory<org.forgerock.http.io.Buffer> getBufferFactory()
      Specified by:
      getBufferFactory in interface org.forgerock.http.HttpApplication
    • stop

      public void stop()
      Specified by:
      stop in interface org.forgerock.http.HttpApplication
    • newProxyAuthzFilter

      protected org.forgerock.http.Filter newProxyAuthzFilter(org.forgerock.opendj.ldap.ConnectionFactory connectionFactory)
      Creates a new Filter in charge of injecting AuthenticatedConnectionContext.
      Parameters:
      connectionFactory - The ConnectionFactory providing the Connection injected as AuthenticatedConnectionContext
      Returns:
      a newly created Filter
    • newAnonymousFilter

      protected ConditionalFilters.ConditionalFilter newAnonymousFilter(org.forgerock.opendj.ldap.ConnectionFactory connectionFactory)
      Creates a new Filter in charge of injecting AuthenticatedConnectionContext directly from a ConnectionFactory.
      Parameters:
      connectionFactory - The ConnectionFactory used to get the Connection
      Returns:
      a newly created Filter
    • getConnectionFactory

      protected org.forgerock.opendj.ldap.ConnectionFactory getConnectionFactory(String name)
      Gets a ConnectionFactory from its name.
      Parameters:
      name - Name of the ConnectionFactory as specified in the configuration
      Returns:
      The associated ConnectionFactory or null if none can be found
    • newBasicAuthenticationFilter

      protected ConditionalFilters.ConditionalFilter newBasicAuthenticationFilter(AuthenticationStrategy authenticationStrategy, org.forgerock.util.Function<org.forgerock.http.protocol.Headers,org.forgerock.util.Pair<String,String>,org.forgerock.util.promise.NeverThrowsException> credentialsExtractor)
      Gets a Filter in charge of performing the HTTP-Basic Authentication. This filter create a SecurityContext reflecting the authenticated users.
      Parameters:
      authenticationStrategy - The AuthenticationStrategy to use to authenticate the user.
      credentialsExtractor - Extract the user's credentials from the Headers.
      Returns:
      A new Filter