Package org.forgerock.opendj.rest2ldap
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 Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefault constructor called by the HTTP Framework which will use the default configuration directory.Rest2LdapHttpApplication(File configDirectory, Schema schema) Creates a new Rest2LDAP HTTP application using the provided configuration directory. -
Method Summary
Modifier and TypeMethodDescriptionorg.forgerock.http.ApiProducer<io.swagger.models.Swagger>Factory<org.forgerock.http.io.Buffer>protected LdapClientgetLdapClient(String name) Gets aLdapClientfrom its name.protected ConditionalFilters.ConditionalFilternewAnonymousFilter(LdapClient ldapClient) protected ConditionalFilters.ConditionalFilternewBasicAuthenticationFilter(AuthenticationStrategy authenticationStrategy, Function<org.forgerock.http.protocol.Headers, Pair<String, String>, NeverThrowsException> credentialsExtractor) Gets aFilterin charge of performing the HTTP-Basic Authentication.protected org.forgerock.http.FilternewProxyAuthzFilter(LdapClient ldapClient) Creates a newFilterin charge of injectingLdapClientContext.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
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
public final org.forgerock.http.Handler start() throws org.forgerock.http.HttpApplicationException- Specified by:
startin interfaceorg.forgerock.http.HttpApplication- Throws:
org.forgerock.http.HttpApplicationException
-
getBufferFactory
- Specified by:
getBufferFactoryin interfaceorg.forgerock.http.HttpApplication
-
stop
public void stop()- Specified by:
stopin interfaceorg.forgerock.http.HttpApplication
-
newProxyAuthzFilter
Creates a newFilterin charge of injectingLdapClientContext.- Parameters:
ldapClient- TheLdapClientproviding theLdapClientSocketinjected asLdapClientContext- Returns:
- a newly created
Filter
-
newAnonymousFilter
- Parameters:
ldapClient- TheLdapClientused to get theLdapClientSocket- Returns:
- a newly created
Filter
-
getLdapClient
Gets aLdapClientfrom its name.- Parameters:
name- Name of theLdapClientas specified in the configuration- Returns:
- The associated
LdapClientor 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 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
-
getApiProducer
public org.forgerock.http.ApiProducer<io.swagger.models.Swagger> getApiProducer()- Specified by:
getApiProducerin interfaceorg.forgerock.http.DescribedHttpApplication
-