gldapo
Class GldapoDirectoryRegistry

java.lang.Object
  extended by java.util.AbstractMap<K,V>
      extended by java.util.HashMap<K,V>
          extended by java.util.LinkedHashMap
              extended by gldapo.GldapoDirectoryRegistry
All Implemented Interfaces:
Serializable, Cloneable, Map

public class GldapoDirectoryRegistry
extends LinkedHashMap

A directory registry holds instances of GldapoDirectory, retrievable by their GldapoDirectory.getName().

See Also:
Serialized Form

Nested Class Summary
 
Nested classes/interfaces inherited from class java.util.AbstractMap
AbstractMap.SimpleEntry<K,V>, AbstractMap.SimpleImmutableEntry<K,V>
 
Constructor Summary
GldapoDirectoryRegistry()
           
 
Method Summary
 Object get(Object name)
          Allows the directories to be retrieved by name.
 GldapoDirectory getDefaultDirectory()
          Returns the current default directory.
 String getDefaultDirectoryName()
           
 MetaClass getMetaClass()
           
 Object getProperty(String name)
           
 Object invokeMethod(String name, Object args)
           
 boolean isHasDefault()
           
 void leftShift(Object directory)
          Does simple type check to make sure what's being added is an instance of GldapoDirectory
 Object put(Object key, Object value)
           
 void setDefaultDirectoryName(String value)
           
 void setMetaClass(MetaClass metaClass)
           
 void setProperty(String name, Object value)
           
 
Methods inherited from class java.util.LinkedHashMap
clear, containsValue, removeEldestEntry
 
Methods inherited from class java.util.HashMap
clone, containsKey, entrySet, isEmpty, keySet, putAll, remove, size, values
 
Methods inherited from class java.util.AbstractMap
equals, hashCode, toString
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.util.Map
containsKey, entrySet, equals, hashCode, isEmpty, keySet, putAll, remove, size, values
 

Constructor Detail

GldapoDirectoryRegistry

public GldapoDirectoryRegistry()
Method Detail

getDefaultDirectoryName

public String getDefaultDirectoryName()

setDefaultDirectoryName

public void setDefaultDirectoryName(String value)

getDefaultDirectory

public GldapoDirectory getDefaultDirectory()
                                    throws GldapoNoDefaultDirectoryException,
                                           GldapoDirectoryNotFoundException
Returns the current default directory.

If there is only one directory in the registry, it is returned regardless. Else the registry is searched for a directory with a name matching defaultDirectoryName.

Returns:
The default directory
Throws:
GldapoNoDefaultDirectoryException - If there is more then one registered directory, and defaultDirectoryName is null.
GldapoDirectoryNotFoundException - If there is no directory registered that has a name of defaultDirectoryName

isHasDefault

public boolean isHasDefault()

get

public Object get(Object name)
Allows the directories to be retrieved by name.

Specified by:
get in interface Map
Overrides:
get in class LinkedHashMap
Parameters:
name - The target directory
Throws:
GldapoDirectoryNotFoundException - If there is no directory registered with name

put

public Object put(Object key,
                  Object value)
Specified by:
put in interface Map
Overrides:
put in class HashMap

leftShift

public void leftShift(Object directory)
Does simple type check to make sure what's being added is an instance of GldapoDirectory

Parameters:
directory -

getMetaClass

public MetaClass getMetaClass()

setMetaClass

public void setMetaClass(MetaClass metaClass)

invokeMethod

public Object invokeMethod(String name,
                           Object args)

getProperty

public Object getProperty(String name)

setProperty

public void setProperty(String name,
                        Object value)


Copyright © 2007-2010 Codehaus. All Rights Reserved.