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 File
configDirectory
The name of the JSON configuration directory in which config.json and rest2ldap/rest2ldap.json are located.protected Schema
schema
Schema 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 LdapClient
getLdapClient(String name)
Gets aLdapClient
from its name.protected ConditionalFilters.ConditionalFilter
newAnonymousFilter(LdapClient ldapClient)
protected ConditionalFilters.ConditionalFilter
newBasicAuthenticationFilter(AuthenticationStrategy authenticationStrategy, Function<org.forgerock.http.protocol.Headers,Pair<String,String>,NeverThrowsException> credentialsExtractor)
Gets aFilter
in charge of performing the HTTP-Basic Authentication.protected org.forgerock.http.Filter
newProxyAuthzFilter(LdapClient ldapClient)
Creates a newFilter
in charge of injectingLdapClientContext
.org.forgerock.http.Handler
start()
void
stop()
-
-
-
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
- TheSchema
used to perform DN validations
-
-
Method Detail
-
start
public final org.forgerock.http.Handler start() throws org.forgerock.http.HttpApplicationException
- Specified by:
start
in interfaceorg.forgerock.http.HttpApplication
- Throws:
org.forgerock.http.HttpApplicationException
-
getBufferFactory
public Factory<org.forgerock.http.io.Buffer> getBufferFactory()
- Specified by:
getBufferFactory
in interfaceorg.forgerock.http.HttpApplication
-
stop
public void stop()
- Specified by:
stop
in interfaceorg.forgerock.http.HttpApplication
-
newProxyAuthzFilter
protected org.forgerock.http.Filter newProxyAuthzFilter(LdapClient ldapClient)
Creates a newFilter
in charge of injectingLdapClientContext
.- Parameters:
ldapClient
- TheLdapClient
providing theLdapClientSocket
injected asLdapClientContext
- Returns:
- a newly created
Filter
-
newAnonymousFilter
protected ConditionalFilters.ConditionalFilter newAnonymousFilter(LdapClient ldapClient)
- Parameters:
ldapClient
- TheLdapClient
used to get theLdapClientSocket
- Returns:
- a newly created
Filter
-
getLdapClient
protected LdapClient getLdapClient(String name)
Gets aLdapClient
from its name.- Parameters:
name
- Name of theLdapClient
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 aFilter
in charge of performing the HTTP-Basic Authentication. This filter create aSecurityContext
reflecting the authenticated users.- Parameters:
authenticationStrategy
- TheAuthenticationStrategy
to 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:
getApiProducer
in interfaceorg.forgerock.http.DescribedHttpApplication
-
-