JBoss port of sunxacml 2.0.5

org.jboss.security.xacml.sunxacml.cond
Class StandardFunctionFactory

java.lang.Object
  extended by org.jboss.security.xacml.sunxacml.cond.FunctionFactory
      extended by org.jboss.security.xacml.sunxacml.cond.BaseFunctionFactory
          extended by org.jboss.security.xacml.sunxacml.cond.StandardFunctionFactory

public class StandardFunctionFactory
extends BaseFunctionFactory

This factory supports the standard set of functions specified in XACML 1.x and 2.0. It is the default factory used by the system, and imposes a singleton pattern insuring that there is only ever one instance of this class.

Note that because this supports only the standard functions, this factory does not allow the addition of any other functions. If you call addFunction on an instance of this class, an exception will be thrown. If you need a standard factory that is modifiable, you can either create a new BaseFunctionFactory (or some other implementation of FunctionFactory) populated with the standard functions from getStandardFunctions or you can use getNewFactoryProxy to get a proxy containing a new, modifiable set of factories.

Since:
1.2
Author:
Seth Proctor

Method Summary
 void addAbstractFunction(FunctionProxy proxy, URI identity)
          Always throws an exception, since support for new functions may not be added to a standard factory.
 void addFunction(Function function)
          Always throws an exception, since support for new functions may not be added to a standard factory.
static StandardFunctionFactory getConditionFactory()
          Returns a FuntionFactory that will only provide those functions that are usable in the root of the Condition.
static StandardFunctionFactory getGeneralFactory()
          Returns a FunctionFactory that provides access to all the functions.
static FunctionFactoryProxy getNewFactoryProxy()
          A convenience method that returns a proxy containing newly created instances of BaseFunctionFactorys that are correctly supersetted and contain the standard functions and abstract functions.
static Map getStandardAbstractFunctions(String xacmlVersion)
          Returns the set of abstract functions that this standard factory supports as a mapping of identifier to proxy.
static Set getStandardFunctions(String xacmlVersion)
          Returns the identifiers supported for the given version of XACML.
static StandardFunctionFactory getTargetFactory()
          Returns a FunctionFactory that will only provide those functions that are usable in Target matching.
 
Methods inherited from class org.jboss.security.xacml.sunxacml.cond.BaseFunctionFactory
createAbstractFunction, createAbstractFunction, createAbstractFunction, createAbstractFunction, createFunction, createFunction, getSupportedFunctions
 
Methods inherited from class org.jboss.security.xacml.sunxacml.cond.FunctionFactory
addAbstractConditionFunction, addAbstractGeneralFunction, addAbstractTargetFunction, addConditionFunction, addGeneralFunction, addTargetFunction, getConditionInstance, getConditionInstance, getGeneralInstance, getGeneralInstance, getInstance, getInstance, getTargetInstance, getTargetInstance, registerFactory, setDefaultFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getTargetFactory

public static StandardFunctionFactory getTargetFactory()
Returns a FunctionFactory that will only provide those functions that are usable in Target matching. This method enforces a singleton model, meaning that this always returns the same instance, creating the factory if it hasn't been requested before. This is the default model used by the FunctionFactory, ensuring quick access to this factory.

Returns:
a FunctionFactory for target functions

getConditionFactory

public static StandardFunctionFactory getConditionFactory()
Returns a FuntionFactory that will only provide those functions that are usable in the root of the Condition. These Functions are a superset of the Target functions. This method enforces a singleton model, meaning that this always returns the same instance, creating the factory if it hasn't been requested before. This is the default model used by the FunctionFactory, ensuring quick access to this factory.

Returns:
a FunctionFactory for condition functions

getGeneralFactory

public static StandardFunctionFactory getGeneralFactory()
Returns a FunctionFactory that provides access to all the functions. These Functions are a superset of the Condition functions. This method enforces a singleton model, meaning that this always returns the same instance, creating the factory if it hasn't been requested before. This is the default model used by the FunctionFactory, ensuring quick access to this factory.

Returns:
a FunctionFactory for all functions

getStandardFunctions

public static Set getStandardFunctions(String xacmlVersion)
Returns the identifiers supported for the given version of XACML. Because this factory supports identifiers from all versions of the XACML specifications, this method is useful for getting a list of which specific identifiers are supported by a given version of XACML.

Parameters:
xacmlVersion - a standard XACML identifier string, as provided in PolicyMetaData
Returns:
a Set of identifiers
Throws:
UnknownIdentifierException - if the version string is unknown

getStandardAbstractFunctions

public static Map getStandardAbstractFunctions(String xacmlVersion)
Returns the set of abstract functions that this standard factory supports as a mapping of identifier to proxy.

Returns:
a Map mapping URIs to FunctionProxys

getNewFactoryProxy

public static FunctionFactoryProxy getNewFactoryProxy()
A convenience method that returns a proxy containing newly created instances of BaseFunctionFactorys that are correctly supersetted and contain the standard functions and abstract functions. These factories allow adding support for new functions.

Returns:
a new proxy containing new factories supporting the standard functions

addFunction

public void addFunction(Function function)
                 throws IllegalArgumentException
Always throws an exception, since support for new functions may not be added to a standard factory.

Overrides:
addFunction in class BaseFunctionFactory
Parameters:
function - the Function to add to the factory
Throws:
UnsupportedOperationException - always
IllegalArgumentException - if the function's identifier is already used or if the function is non-boolean (when this is a Target or Condition factory)

addAbstractFunction

public void addAbstractFunction(FunctionProxy proxy,
                                URI identity)
                         throws IllegalArgumentException
Always throws an exception, since support for new functions may not be added to a standard factory.

Overrides:
addAbstractFunction in class BaseFunctionFactory
Parameters:
proxy - the FunctionProxy to add to the factory
identity - the function's identifier
Throws:
UnsupportedOperationException - always
IllegalArgumentException - if the function's identifier is already used

JBoss port of sunxacml 2.0.5

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