Package org.forgerock.opendj.rest2ldap
Class Rest2LdapHttpApplication
java.lang.Object
org.forgerock.opendj.rest2ldap.Rest2LdapHttpApplication
- All Implemented Interfaces:
org.forgerock.http.HttpApplication
Rest2ldap HTTP application.
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected final FileThe name of the JSON configuration directory in which config.json and rest2ldap/rest2ldap.json are located.protected final org.forgerock.opendj.ldap.schema.SchemaSchema used to perform DN validations. -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor called by the HTTP Framework which will use the default configuration directory.Rest2LdapHttpApplication(File configDirectory, org.forgerock.opendj.ldap.schema.Schema schema) Creates a new Rest2LDAP HTTP application using the provided configuration directory. -
Method Summary
Modifier and TypeMethodDescriptionorg.forgerock.util.Factory<org.forgerock.http.io.Buffer> protected org.forgerock.opendj.ldap.ConnectionFactorygetConnectionFactory(String name) Gets aConnectionFactoryfrom its name.protected ConditionalFilters.ConditionalFilternewAnonymousFilter(org.forgerock.opendj.ldap.ConnectionFactory connectionFactory) Creates a newFilterin charge of injectingAuthenticatedConnectionContextdirectly from aConnectionFactory.protected ConditionalFilters.ConditionalFilternewBasicAuthenticationFilter(AuthenticationStrategy authenticationStrategy, org.forgerock.util.Function<org.forgerock.http.protocol.Headers, org.forgerock.util.Pair<String, String>, org.forgerock.util.promise.NeverThrowsException> credentialsExtractor) Gets aFilterin charge of performing the HTTP-Basic Authentication.protected org.forgerock.http.FilternewProxyAuthzFilter(org.forgerock.opendj.ldap.ConnectionFactory connectionFactory) Creates a newFilterin charge of injectingAuthenticatedConnectionContext.final org.forgerock.http.Handlerstart()voidstop()
-
Field Details
-
configDirectory
The name of the JSON configuration directory in which config.json and rest2ldap/rest2ldap.json are located. -
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, 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- TheSchemaused to perform DN validations
-
-
Method Details
-
start
- Specified by:
startin interfaceorg.forgerock.http.HttpApplication- Throws:
org.forgerock.http.HttpApplicationException
-
getBufferFactory
- Specified by:
getBufferFactoryin interfaceorg.forgerock.http.HttpApplication
-
stop
- Specified by:
stopin interfaceorg.forgerock.http.HttpApplication
-
newProxyAuthzFilter
protected org.forgerock.http.Filter newProxyAuthzFilter(org.forgerock.opendj.ldap.ConnectionFactory connectionFactory) Creates a newFilterin charge of injectingAuthenticatedConnectionContext.- Parameters:
connectionFactory- TheConnectionFactoryproviding theConnectioninjected asAuthenticatedConnectionContext- Returns:
- a newly created
Filter
-
newAnonymousFilter
protected ConditionalFilters.ConditionalFilter newAnonymousFilter(org.forgerock.opendj.ldap.ConnectionFactory connectionFactory) Creates a newFilterin charge of injectingAuthenticatedConnectionContextdirectly from aConnectionFactory.- Parameters:
connectionFactory- TheConnectionFactoryused to get theConnection- Returns:
- a newly created
Filter
-
getConnectionFactory
Gets aConnectionFactoryfrom its name.- Parameters:
name- Name of theConnectionFactoryas specified in the configuration- Returns:
- The associated
ConnectionFactoryor 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 aFilterin charge of performing the HTTP-Basic Authentication. This filter create aSecurityContextreflecting the authenticated users.- Parameters:
authenticationStrategy- TheAuthenticationStrategyto use to authenticate the user.credentialsExtractor- Extract the user's credentials from theHeaders.- Returns:
- A new
Filter
-