|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectgldapo.Gldapo
public class Gldapo
The singleton instance of this class provides access to the various registries and settings at runtime. It is also the entry point for initializing Gldapo.
| Constructor Summary | |
|---|---|
Gldapo()
Create a Gldapo instance with only defaults. |
|
Gldapo(Map config)
Create a Gldapo instance with a config |
|
| Method Summary | |
|---|---|
void |
consumeConfig(Map config)
Uses the extract* methods to interpret the config, then iteratively add's the items
to the respective registry. |
static List |
extractDirectoriesFromConfig(Map config)
Creates a List of GldapoDirectory objects from the given config. |
static Collection |
extractSchemasFromConfig(Map config)
Fetches the schema classes indictated by the config. |
static Collection |
extractTypeMappingsFromConfig(Map config)
Fetches the type mapping classes indictated by the config. |
static Object |
getCONFIG_KEY_DEFAULT_DIRECTORY()
|
static Object |
getCONFIG_KEY_DIRECTORIES()
|
static Object |
getCONFIG_KEY_SCHEMAS()
|
static Object |
getCONFIG_KEY_TYPEMAPPINGS()
|
static Object |
getDEFAULT_CONFIG_FILENAME()
|
GldapoDirectoryRegistry |
getDirectories()
|
static Gldapo |
getInstance()
|
MetaClass |
getMetaClass()
|
Object |
getProperty(String name)
|
GldapoSchemaRegistry |
getSchemas()
|
GldapoTypeMappingRegistry |
getTypemappings()
|
static Object |
initialize()
Calls initialize(String) with a null string. |
static Object |
initialize(Map config)
Calls resetWithConfig(Map) on the gldapo instance |
static Object |
initialize(String environment)
Tries to find the default config file and passes it's URL along with environment
to initialize(URL,String) |
static Object |
initialize(URL configUrl)
Calls initialize(URL,String), passing configUrl and a null environment |
static Object |
initialize(URL configUrl,
String environment)
Initializes using the config script configUrl and parses it for environment |
Object |
invokeMethod(String name,
Object args)
|
void |
resetWithConfig(Map config)
Calls clear() on the directory, schema and type mapping registries before passing the config to
consumeConfig(Map) |
void |
setDirectories(GldapoDirectoryRegistry value)
|
static void |
setInstance(Gldapo value)
|
void |
setMetaClass(MetaClass metaClass)
|
void |
setProperty(String name,
Object value)
|
void |
setSchemas(GldapoSchemaRegistry value)
|
void |
setTypemappings(GldapoTypeMappingRegistry value)
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public Gldapo()
public Gldapo(Map config)
resetWithConfig(Map)| Method Detail |
|---|
public static final Object getDEFAULT_CONFIG_FILENAME()
public static final Object getCONFIG_KEY_TYPEMAPPINGS()
public static final Object getCONFIG_KEY_DIRECTORIES()
public static final Object getCONFIG_KEY_DEFAULT_DIRECTORY()
public static final Object getCONFIG_KEY_SCHEMAS()
public static Gldapo getInstance()
public static void setInstance(Gldapo value)
public GldapoDirectoryRegistry getDirectories()
public void setDirectories(GldapoDirectoryRegistry value)
public GldapoSchemaRegistry getSchemas()
public void setSchemas(GldapoSchemaRegistry value)
public GldapoTypeMappingRegistry getTypemappings()
public void setTypemappings(GldapoTypeMappingRegistry value)
public void resetWithConfig(Map config)
clear() on the directory, schema and type mapping registries before passing the config to
consumeConfig(Map)
public void consumeConfig(Map config)
extract* methods to interpret the config, then iteratively add's the items
to the respective registry.
extractDirectoriesFromConfig(Map),
extractTypeMappingsFromConfig(Map),
extractSchemasFromConfig(Map)public static Object initialize()
initialize(String) with a null string.
public static Object initialize(String environment)
throws GldapoInitializationException
default config file and passes it's URL along with environment
to initialize(URL,String)
environment - the environment to parse the default config file with
GldapoInitializationException - If no default config file can be foundpublic static Object initialize(URL configUrl)
initialize(URL,String), passing configUrl and a null environment
public static Object initialize(URL configUrl,
String environment)
throws GldapoInitializationException
configUrl and parses it for environment
Creates a ConfigSlurper with the context of environment
and uses it to parse configUrl into a ConfigObject.
The config object is then passed to initialize(Map).
configUrl - The location of the config script (must not be null)environment - The environment context to parse configUrl with (can be null)
GldapoInitializationException - If configUrl is null
public static Object initialize(Map config)
throws GldapoInitializationException
resetWithConfig(Map) on the gldapo instance
GldapoInitializationException
public static Collection extractSchemasFromConfig(Map config)
throws GldapoInvalidConfigException
Looks in the config for a Collection under the key indicated by CONFIG_KEY_SCHEMAS
GldapoInvalidConfigException - if the relevant item in the config is not a Collection
public static Collection extractTypeMappingsFromConfig(Map config)
throws GldapoInvalidConfigException
Looks in the config for a Collection under the key indicated by CONFIG_KEY_TYPEMAPPINGS
GldapoInvalidConfigException - if the relevant item in the config is not a Collection
public static List extractDirectoriesFromConfig(Map config)
throws GldapoInvalidConfigException
List of GldapoDirectory objects from the given config.
Looks in the config for a Map under the key indicated by CONFIG_KEY_DIRECTORIES.
Each key/value pair in the directories config is turned into an instance of GldapoDirectory by using the
GldapoDirectory.GldapoDirectory(String,Map) constructor where the key is the String and the value is the
Map.
An example config map for this method might look like this ...
[ directories: [ d1: [ url: "ldap://example.com" ], d2: [ url: "ldap://example.com" ] ] ]See
GldapoDirectory.GldapoDirectory(String,Map) for the format of the directory map.
GldapoDirectory objects
GldapoInvalidConfigException - if the relevant item in the config is not a Mappublic MetaClass getMetaClass()
public void setMetaClass(MetaClass metaClass)
public Object invokeMethod(String name,
Object args)
public Object getProperty(String name)
public void setProperty(String name,
Object value)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||