SunTM's XACML Implementation for JavaTM

com.sun.xacml
Class ConfigurationStore

java.lang.Object
  extended bycom.sun.xacml.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.3.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.

NOTE: The name of this class, its interfaces, and they way it interacts with the rest of the code is currently unstable, so expect some changes between now and the next release.

Since:
1.2

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 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()
                                            throws UnknownIdentifierException
Returns the default attribute factory. If no default was specified then this throws an exception.

Returns:
the default attribute factory
Throws:
UnknownIdentifierException - if there is no default 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

getDefaultCombiningAlgFactory

public CombiningAlgFactory getDefaultCombiningAlgFactory()
                                                  throws UnknownIdentifierException
Returns the default combiningAlg factory. If no default was specified then this throws an exception.

Returns:
the default combiningAlg factory
Throws:
UnknownIdentifierException - if there is no default 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

getDefaultFunctionFactoryProxy

public FunctionFactoryProxy getDefaultFunctionFactoryProxy()
                                                    throws UnknownIdentifierException
Returns the default function factory proxy. If no default was specified then this throws an exception.

Returns:
the default function factory proxy
Throws:
UnknownIdentifierException - if there is no default factory

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

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.


Sun's XACML Implementation Version 1.2

Copyright 2003-2004 Sun Microsystems, Inc. All rights reserved. Use is subject to license terms.

Sun, Sun Microsystems, the Sun Logo, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.