JBoss port of sunxacml 2.0.5

org.jboss.security.xacml.sunxacml
Class ConfigurationStore

java.lang.Object
  extended by org.jboss.security.xacml.sunxacml.ConfigurationStore

public class ConfigurationStore
extends Object

This class supports run-time loading of configuration data. It loads the configurations from an XML file that conforms to the configuration schema. By design this class does not get used automatically, nor does it change the state of the system directly. A programmer must choose to support this mechanism in their program, and then must explicitly use loaded elements. This way, the programmer still has full control over their security model, but also has the convenience of re-using a common configuration mechanism. See http://sunxacml.sourceforge.net/schema/config-0.4.xsd for the valid schema.

Note that becuase this doesn't tie directly into the rest of the code, you are still free to design your own run-time configuration mechanisms. This is simply provided as a convenience, and so that all programmers can start from a common point.

Since:
1.2
Author:
Seth Proctor

Field Summary
static String PDP_CONFIG_PROPERTY
          Property used to specify the configuration file.
 
Constructor Summary
ConfigurationStore()
          Default constructor.
ConfigurationStore(File configFile)
          Constructor that explicitly specifies the configuration file to load.
 
Method Summary
 AttributeFactory getAttributeFactory(String name)
          Returns the attribute factory with the given name.
 CombiningAlgFactory getCombiningAlgFactory(String name)
          Returns the combiningAlg factory with the given name.
 AttributeFactory getDefaultAttributeFactory()
          Returns the default attribute factory.
 CombiningAlgFactory getDefaultCombiningAlgFactory()
          Returns the default combiningAlg factory.
 FunctionFactoryProxy getDefaultFunctionFactoryProxy()
          Returns the default function factory proxy.
 PDPConfig getDefaultPDPConfig()
          Returns the default PDP configuration.
 FunctionFactoryProxy getFunctionFactoryProxy(String name)
          Returns the function factory proxy with the given name.
 PDPConfig getPDPConfig(String name)
          Returns the PDP configuration with the given name.
 Set getSupportedAttributeFactories()
          Returns a set of identifiers representing each attribute factory available.
 Set getSupportedCombiningAlgFactories()
          Returns a set of identifiers representing each combiningAlg factory available.
 Set getSupportedFunctionFactories()
          Returns a set of identifiers representing each function factory proxy available.
 Set getSupportedPDPConfigurations()
          Returns a set of identifiers representing each PDP configuration available.
 void registerAttributeFactories()
          Registers all the supported factories with the given identifiers.
 void registerCombiningAlgFactories()
          Registers all the supported factories with the given identifiers.
 void registerFunctionFactories()
          Registers all the supported factories with the given identifiers.
 void useDefaultFactories()
          Uses the default configuration to re-set the default factories used by the system (attribute, combining algorithm, and function).
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PDP_CONFIG_PROPERTY

public static final String PDP_CONFIG_PROPERTY
Property used to specify the configuration file.

See Also:
Constant Field Values
Constructor Detail

ConfigurationStore

public ConfigurationStore()
                   throws ParsingException
Default constructor. This constructor uses the PDP_CONFIG_PROPERTY property to load the configuration. If the property isn't set, if it names a file that can't be accessed, or if the file is invalid, then an exception is thrown.

Throws:
ParsingException - if anything goes wrong during the parsing of the configuration file, the class loading, or the factory and pdp setup

ConfigurationStore

public ConfigurationStore(File configFile)
                   throws ParsingException
Constructor that explicitly specifies the configuration file to load. This is useful if your security model doesn't allow the use of properties, if you don't want to use a property to specify a configuration file, or if you want to use more then one configuration file. If the file can't be accessed, or if the file is invalid, then an exception is thrown.

Throws:
ParsingException - if anything goes wrong during the parsing of the configuration file, the class loading, or the factory and pdp setup
Method Detail

getDefaultPDPConfig

public PDPConfig getDefaultPDPConfig()
                              throws UnknownIdentifierException
Returns the default PDP configuration. If no default was specified then this throws an exception.

Returns:
the default PDP configuration
Throws:
UnknownIdentifierException - if there is no default config

getPDPConfig

public PDPConfig getPDPConfig(String name)
                       throws UnknownIdentifierException
Returns the PDP configuration with the given name. If no such configuration exists then an exception is thrown.

Returns:
the matching PDP configuation
Throws:
UnknownIdentifierException - if the name is unknown

getSupportedPDPConfigurations

public Set getSupportedPDPConfigurations()
Returns a set of identifiers representing each PDP configuration available.

Returns:
a Set of Strings

getDefaultAttributeFactory

public AttributeFactory getDefaultAttributeFactory()
Returns the default attribute factory.

Returns:
the default attribute factory

getAttributeFactory

public AttributeFactory getAttributeFactory(String name)
                                     throws UnknownIdentifierException
Returns the attribute factory with the given name. If no such factory exists then an exception is thrown.

Returns:
the matching attribute factory
Throws:
UnknownIdentifierException - if the name is unknown

getSupportedAttributeFactories

public Set getSupportedAttributeFactories()
Returns a set of identifiers representing each attribute factory available.

Returns:
a Set of Strings

registerAttributeFactories

public void registerAttributeFactories()
Registers all the supported factories with the given identifiers. If a given identifier is already in use, then that factory is not registered. This method is provided only as a convenience, and any registration that may involve identifier clashes should be done by registering each factory individually.


getDefaultCombiningAlgFactory

public CombiningAlgFactory getDefaultCombiningAlgFactory()
Returns the default combiningAlg factory.

Returns:
the default combiningAlg factory

getCombiningAlgFactory

public CombiningAlgFactory getCombiningAlgFactory(String name)
                                           throws UnknownIdentifierException
Returns the combiningAlg factory with the given name. If no such factory exists then an exception is thrown.

Returns:
the matching combiningAlg factory
Throws:
UnknownIdentifierException - if the name is unknown

getSupportedCombiningAlgFactories

public Set getSupportedCombiningAlgFactories()
Returns a set of identifiers representing each combiningAlg factory available.

Returns:
a Set of Strings

registerCombiningAlgFactories

public void registerCombiningAlgFactories()
Registers all the supported factories with the given identifiers. If a given identifier is already in use, then that factory is not registered. This method is provided only as a convenience, and any registration that may involve identifier clashes should be done by registering each factory individually.


getDefaultFunctionFactoryProxy

public FunctionFactoryProxy getDefaultFunctionFactoryProxy()
Returns the default function factory proxy.

Returns:
the default function factory proxy

getFunctionFactoryProxy

public FunctionFactoryProxy getFunctionFactoryProxy(String name)
                                             throws UnknownIdentifierException
Returns the function factory proxy with the given name. If no such proxy exists then an exception is thrown.

Returns:
the matching function factory proxy
Throws:
UnknownIdentifierException - if the name is unknown

getSupportedFunctionFactories

public Set getSupportedFunctionFactories()
Returns a set of identifiers representing each function factory proxy available.

Returns:
a Set of Strings

registerFunctionFactories

public void registerFunctionFactories()
Registers all the supported factories with the given identifiers. If a given identifier is already in use, then that factory is not registered. This method is provided only as a convenience, and any registration that may involve identifier clashes should be done by registering each factory individually.


useDefaultFactories

public void useDefaultFactories()
Uses the default configuration to re-set the default factories used by the system (attribute, combining algorithm, and function). If a default is not provided for a given factory, then that factory will not be set as the system's default.


JBoss port of sunxacml 2.0.5

Copyright © 2011 JBoss, a division of Red Hat, Inc.. All Rights Reserved.