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 Modifier and Type Field Description protected FileconfigDirectoryThe name of the JSON configuration directory in which config.json and rest2ldap/rest2ldap.json are located.protected SchemaschemaSchema used to perform DN validations. 
- 
Constructor Summary
Constructors Constructor Description Rest2LdapHttpApplication()Default 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
All Methods Instance Methods Concrete Methods Modifier and Type Method Description org.forgerock.http.ApiProducer<io.swagger.models.Swagger>getApiProducer()Factory<org.forgerock.http.io.Buffer>getBufferFactory()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.org.forgerock.http.Handlerstart()voidstop() 
 - 
 
- 
- 
Constructor Detail
- 
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- TheSchemaused to perform DN validations
 
 - 
 
- 
Method Detail
- 
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
public Factory<org.forgerock.http.io.Buffer> getBufferFactory()
- Specified by:
 getBufferFactoryin interfaceorg.forgerock.http.HttpApplication
 
- 
stop
public void stop()
- Specified by:
 stopin interfaceorg.forgerock.http.HttpApplication
 
- 
newProxyAuthzFilter
protected org.forgerock.http.Filter newProxyAuthzFilter(LdapClient ldapClient)
Creates a newFilterin charge of injectingLdapClientContext.- Parameters:
 ldapClient- TheLdapClientproviding theLdapClientSocketinjected asLdapClientContext- Returns:
 - a newly created 
Filter 
 
- 
newAnonymousFilter
protected ConditionalFilters.ConditionalFilter newAnonymousFilter(LdapClient ldapClient)
- Parameters:
 ldapClient- TheLdapClientused to get theLdapClientSocket- Returns:
 - a newly created 
Filter 
 
- 
getLdapClient
protected LdapClient getLdapClient(String name)
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
 
 - 
 
 -