Class Rest2LdapHttpApplication

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

public class Rest2LdapHttpApplication extends Object implements org.forgerock.http.DescribedHttpApplication
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 Schema schema
      Schema used to perform DN validations.
  • Constructor Details

    • Rest2LdapHttpApplication

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

      public Rest2LdapHttpApplication(File configDirectory, 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 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(LdapClient ldapClient)
      Creates a new Filter in charge of injecting LdapClientContext.
      Parameters:
      ldapClient - The LdapClient providing the LdapClientSocket injected as LdapClientContext
      Returns:
      a newly created Filter
    • newAnonymousFilter

      protected ConditionalFilters.ConditionalFilter newAnonymousFilter(LdapClient ldapClient)
      Creates a new Filter in charge of injecting LdapClientContext directly from a LdapClient.
      Parameters:
      ldapClient - The LdapClient used to get the LdapClientSocket
      Returns:
      a newly created Filter
    • getLdapClient

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

      protected ConditionalFilters.ConditionalFilter newBasicAuthenticationFilter(AuthenticationStrategy authenticationStrategy, Function<org.forgerock.http.protocol.Headers,Pair<String,String>,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
    • getApiProducer

      public org.forgerock.http.ApiProducer<io.swagger.models.Swagger> getApiProducer()
      Specified by:
      getApiProducer in interface org.forgerock.http.DescribedHttpApplication