public final class Rest2LdapJsonConfigurator extends Object
Modifier and Type | Method and Description |
---|---|
static ConnectionFactory |
configureConnectionFactory(JsonValue configuration,
String name,
TrustManager trustManager,
X509KeyManager keyManager)
Creates a new connection factory using the named configuration in the provided JSON list of factory
configurations.
|
static ConnectionFactory |
configureConnectionFactory(JsonValue configuration,
String name,
TrustManager trustManager,
X509KeyManager keyManager,
ClassLoader providerClassLoader)
Creates a new connection factory using the named configuration in the provided JSON list of factory
configurations.
|
static RequestHandler |
configureEndpoint(File endpointDirectory,
Options options)
Creates a new CREST
RequestHandler representing a single endpoint whose configuration is defined in the
provided endpointDirectory parameter. |
static Router |
configureEndpoints(File endpointsDirectory,
Options options)
Creates a new CREST
Router using the provided endpoints configuration directory and Rest2Ldap options. |
static X509KeyManager |
configureKeyManager(JsonValue configuration)
Configures a
X509KeyManager using the provided JSON configuration. |
static Options |
configureOptions(JsonValue config)
Parses Rest2Ldap configuration options.
|
static List<Resource> |
configureResources(JsonValue config)
Parses a list of Rest2Ldap resource definitions.
|
static TrustManager |
configureTrustManager(JsonValue configuration)
Configures a
TrustManager using the provided JSON configuration. |
public static Options configureOptions(JsonValue config)
{ "readOnUpdatePolicy": "controls", "useSubtreeDelete": true, "usePermissiveModify": true, "useMvcc": true "mvccAttribute": "etag" }
See the sample configuration file for a detailed description of its content.
config
- The JSON configuration.IllegalArgumentException
- If the configuration is invalid.public static List<Resource> configureResources(JsonValue config)
"top": { "isAbstract": true, "properties": { "_rev": { "type": "simple" "ldapAttribute": "etag", "writability": "readOnly" }, ... }, ... }, ...
See the sample configuration file for a detailed description of its content.
config
- The JSON configuration.IllegalArgumentException
- If the configuration is invalid.public static Router configureEndpoints(File endpointsDirectory, Options options) throws IOException
Router
using the provided endpoints configuration directory and Rest2Ldap options.
The Rest2Ldap configuration typically has the following structure on disk:
endpointsDirectory
- The directory representing the Rest2Ldap "endpoints" directory.options
- The Rest2Ldap configuration options.Router
configured using the provided options and endpoints.IOException
- If the endpoints configuration cannot be read.IllegalArgumentException
- If the configuration is invalid.public static RequestHandler configureEndpoint(File endpointDirectory, Options options) throws IOException
RequestHandler
representing a single endpoint whose configuration is defined in the
provided endpointDirectory
parameter. The directory should contain a separate file for each supported
version of the REST endpoint. The name of the file, excluding the suffix, identifies the resource definition
which acts as the entry point into the endpoint.endpointDirectory
- The directory containing the endpoint's resource definitions, e.g.
rest2ldap/routes/api would contain definitions for the "api" endpoint.options
- The Rest2Ldap configuration options.RequestHandler
configured using the provided options and endpoint mappings.IOException
- If the endpoint configuration cannot be read.IllegalArgumentException
- If the configuration is invalid.public static X509KeyManager configureKeyManager(JsonValue configuration)
X509KeyManager
using the provided JSON configuration.configuration
- The JSON object containing the key manager configuration.public static TrustManager configureTrustManager(JsonValue configuration)
TrustManager
using the provided JSON configuration.configuration
- The JSON object containing the trust manager configuration.public static ConnectionFactory configureConnectionFactory(JsonValue configuration, String name, TrustManager trustManager, X509KeyManager keyManager, ClassLoader providerClassLoader)
configuration
- The JSON configuration.name
- The name of the connection factory configuration to be parsed.trustManager
- The trust manager to use for secure connection. Can be null
to use the default JVM trust manager.keyManager
- The key manager to use for secure connection. Can be null
to use the default JVM key manager.providerClassLoader
- The ClassLoader
used to fetch the TransportProvider
. This
can be useful in OSGI environments.IllegalArgumentException
- If the configuration is invalid.public static ConnectionFactory configureConnectionFactory(JsonValue configuration, String name, TrustManager trustManager, X509KeyManager keyManager)
configuration
- The JSON configuration.name
- The name of the connection factory configuration to be parsed.trustManager
- The trust manager to use for secure connection. Can be null
to use the default JVM trust manager.keyManager
- The key manager to use for secure connection. Can be null
to use the default JVM key manager.IllegalArgumentException
- If the configuration is invalid.Copyright 2010-2017 ForgeRock AS.