org.edg.security.authorization.repository
Class AttributeRepositoryFactory

java.lang.Object
  |
  +--org.edg.security.authorization.repository.AttributeRepositoryFactory

public class AttributeRepositoryFactory
extends java.lang.Object

Factory for creating AttributeRepository instances. Configuraiton example:

 <repository name="name" type="type">
     <!-- type-specific configuration -->
 </repository>
 
Currently supported AttributeRepository types are: Any other type is treated as Java class name: if such a class exists, the following is evaluated

Version:
$Id: AttributeRepositoryFactory.java,v 1.9 2003/04/28 09:24:21 mulmo Exp $
Author:
Olle Mulmo
See Also:
AttributeRepository, AttributeRepositoryCreator, And (type=and), Or (type=or), Map (type=map), VOMS (type=voms)

Field Summary
protected static org.apache.log4j.Logger logger
           
protected  AttributeMapFactory myMapFactory
           
protected  java.util.Hashtable myRepositories
           
static java.lang.String theNameAttribute
           
protected static java.util.Hashtable theRepositoryCreators
           
static java.lang.String theRepositoryElement
           
static java.lang.String theTypeAttribute
           
 
Constructor Summary
AttributeRepositoryFactory()
           
 
Method Summary
 AttributeMapFactory getAttributeMapFactory()
           
 java.util.List getAttributeRepositories(org.w3c.dom.Element definition)
          Method getAttributeRepositories.
 AttributeRepository getAttributeRepository(org.w3c.dom.Element definition)
          Method getAttributeRepository.
 AttributeRepository getAttributeRepository(java.lang.String repositoryId)
          Method getAttributeRepository.
 void init(java.lang.String config)
          Method getAttributeRepository.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

logger

protected static org.apache.log4j.Logger logger

theRepositoryElement

public static final java.lang.String theRepositoryElement
See Also:
Constant Field Values

theNameAttribute

public static final java.lang.String theNameAttribute
See Also:
Constant Field Values

theTypeAttribute

public static final java.lang.String theTypeAttribute
See Also:
Constant Field Values

myRepositories

protected java.util.Hashtable myRepositories

myMapFactory

protected AttributeMapFactory myMapFactory

theRepositoryCreators

protected static java.util.Hashtable theRepositoryCreators
Constructor Detail

AttributeRepositoryFactory

public AttributeRepositoryFactory()
Method Detail

init

public void init(java.lang.String config)
          throws java.lang.Exception
Method getAttributeRepository. Creates an Attribute Repository according to the specified structure. If such a repoistory has already been built with the given identity, that repository is returned instead

Parameters:
config - The location of the configuration file. May be null.
Returns:
AttributeRepository
Throws:
java.lang.Exception - if the repository cannot be built or found

getAttributeRepository

public AttributeRepository getAttributeRepository(java.lang.String repositoryId)
                                           throws java.lang.Exception
Method getAttributeRepository. Returns the Attribute Repository with the given identity,

Parameters:
repositoryId - An arbitrary string associated with the repository instance in question.
Returns:
AttributeRepository
Throws:
java.lang.Exception - if the repository cannot be found

getAttributeRepositories

public java.util.List getAttributeRepositories(org.w3c.dom.Element definition)
                                        throws java.lang.Exception
Method getAttributeRepositories. Returns a list of Attribute Repositories, by successively calling getAttributeRepository(Node) for each repository definition encountered.

Parameters:
definition - the XML snippet that defines the repository instance(s).
Returns:
List of AttributeRepository instances
Throws:
java.lang.Exception - if all the repositories cannot be created

getAttributeRepository

public AttributeRepository getAttributeRepository(org.w3c.dom.Element definition)
                                           throws java.lang.Exception
Method getAttributeRepository. Creates and returns an Attribute Repository according to the supplied definition. If the definition contains a 'name' identifier, and there already exists a repository associated with that name, that repository is returned instead.

Parameters:
definition - the XML snippet that defines the repository
Returns:
AttributeRepository the created instance
Throws:
java.lang.Exception - if the repository cannot be created

getAttributeMapFactory

public AttributeMapFactory getAttributeMapFactory()