SunTM's XACML Implementation for JavaTM

com.sun.xacml.cond
Class FunctionFactory

java.lang.Object
  extended bycom.sun.xacml.cond.FunctionFactory
Direct Known Subclasses:
BaseFunctionFactory

public abstract class FunctionFactory
extends Object

Factory used to create all functions. There are three kinds of factories: general, condition, and target. These provide functions that can be used anywhere, only in a condition's root and only in a target (respectively).

Note that all functions, except for abstract functions, are singletons, so any instance that is added to a factory will be the same one returned from the create methods. This is done because most functions don't have state, so there is no need to have more than one, or to spend the time creating multiple instances that all do the same thing.

Since:
1.0

Constructor Summary
protected FunctionFactory()
          Default constructor.
 
Method Summary
static void addAbstractConditionFunction(FunctionProxy proxy, URI identity)
          Deprecated. As of version 1.2, replaced by addAbstractFunction(FunctionProxy,URI). The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.
abstract  void addAbstractFunction(FunctionProxy proxy, URI identity)
          Adds the abstract function proxy to the factory.
static void addAbstractGeneralFunction(FunctionProxy proxy, URI identity)
          Deprecated. As of version 1.2, replaced by addAbstractFunction(FunctionProxy,URI). The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.
static void addAbstractTargetFunction(FunctionProxy proxy, URI identity)
          Deprecated. As of version 1.2, replaced by addAbstractFunction(FunctionProxy,URI). The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.
static void addConditionFunction(Function function)
          Deprecated. As of version 1.2, replaced by addFunction(Function). The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.
abstract  void addFunction(Function function)
          Adds the function to the factory.
static void addGeneralFunction(Function function)
          Deprecated. As of version 1.2, replaced by addFunction(Function). The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.
static void addTargetFunction(Function function)
          Deprecated. As of version 1.2, replaced by addFunction(Function). The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.
abstract  Function createAbstractFunction(String identity, Node root)
          Tries to get an instance of the specified abstract function.
abstract  Function createAbstractFunction(String identity, Node root, String xpathVersion)
          Tries to get an instance of the specified abstract function.
abstract  Function createAbstractFunction(URI identity, Node root)
          Tries to get an instance of the specified abstract function.
abstract  Function createAbstractFunction(URI identity, Node root, String xpathVersion)
          Tries to get an instance of the specified abstract function.
abstract  Function createFunction(String identity)
          Tries to get an instance of the specified function.
abstract  Function createFunction(URI identity)
          Tries to get an instance of the specified function.
static FunctionFactory getConditionInstance()
          Returns the default FuntionFactory that will only provide those functions that are usable in the root of the Condition.
static FunctionFactory getGeneralInstance()
          Returns the default FunctionFactory that provides access to all the functions.
abstract  Set getSupportedFunctions()
          Returns the function identifiers supported by this factory.
static FunctionFactory getTargetInstance()
          Returns the default FunctionFactory that will only provide those functions that are usable in Target matching.
static void setDefaultFactory(FunctionFactoryProxy proxy)
          Sets the default factory.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

FunctionFactory

protected FunctionFactory()
Default constructor. Used only by subclasses.

Method Detail

getTargetInstance

public static final FunctionFactory getTargetInstance()
Returns the default FunctionFactory that will only provide those functions that are usable in Target matching.

Returns:
a FunctionFactory for target functions

getConditionInstance

public static final FunctionFactory getConditionInstance()
Returns the default 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.

Returns:
a FunctionFactory for condition functions

getGeneralInstance

public static final FunctionFactory getGeneralInstance()
Returns the default FunctionFactory that provides access to all the functions. These Functions are a superset of the Condition functions.

Returns:
a FunctionFactory for all functions

setDefaultFactory

public static final void setDefaultFactory(FunctionFactoryProxy proxy)
Sets the default factory. Note that this is just a placeholder for now, and will be replaced with a more useful mechanism soon.


addFunction

public abstract void addFunction(Function function)
Adds the function to the factory. Most functions have no state, so the singleton model used here is typically desireable. The factory will not enforce the requirement that a Target or Condition matching function must be boolean.

Parameters:
function - the Function to add to the factory
Throws:
IllegalArgumentException - if the function's identifier is already used

addAbstractFunction

public abstract void addAbstractFunction(FunctionProxy proxy,
                                         URI identity)
Adds the abstract function proxy to the factory. This is used for those functions which have state, or change behavior (for instance the standard map function, which changes its return type based on how it is used).

Parameters:
proxy - the FunctionProxy to add to the factory
identity - the function's identifier
Throws:
IllegalArgumentException - if the function's identifier is already used

addTargetFunction

public static void addTargetFunction(Function function)
Deprecated. As of version 1.2, replaced by addFunction(Function). The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.

Adds a target function.

Parameters:
function - the function to add
Throws:
IllegalArgumentException - if the name is already in use

addAbstractTargetFunction

public static void addAbstractTargetFunction(FunctionProxy proxy,
                                             URI identity)
Deprecated. As of version 1.2, replaced by addAbstractFunction(FunctionProxy,URI). The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.

Adds an abstract target function.

Parameters:
proxy - the function proxy to add
identity - the name of the function
Throws:
IllegalArgumentException - if the name is already in use

addConditionFunction

public static void addConditionFunction(Function function)
Deprecated. As of version 1.2, replaced by addFunction(Function). The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.

Adds a condition function.

Parameters:
function - the function to add
Throws:
IllegalArgumentException - if the name is already in use

addAbstractConditionFunction

public static void addAbstractConditionFunction(FunctionProxy proxy,
                                                URI identity)
Deprecated. As of version 1.2, replaced by addAbstractFunction(FunctionProxy,URI). The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.

Adds an abstract condition function.

Parameters:
proxy - the function proxy to add
identity - the name of the function
Throws:
IllegalArgumentException - if the name is already in use

addGeneralFunction

public static void addGeneralFunction(Function function)
Deprecated. As of version 1.2, replaced by addFunction(Function). The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.

Adds a general function.

Parameters:
function - the function to add
Throws:
IllegalArgumentException - if the name is already in use

addAbstractGeneralFunction

public static void addAbstractGeneralFunction(FunctionProxy proxy,
                                              URI identity)
Deprecated. As of version 1.2, replaced by addAbstractFunction(FunctionProxy,URI). The new factory system requires you to get a factory instance and then call the non-static methods on that factory. The static versions of these methods have been left in for now, but are slower and will be removed in a future version.

Adds an abstract general function.

Parameters:
proxy - the function proxy to add
identity - the name of the function
Throws:
IllegalArgumentException - if the name is already in use

getSupportedFunctions

public abstract Set getSupportedFunctions()
Returns the function identifiers supported by this factory.

Returns:
a Set of Strings

createFunction

public abstract Function createFunction(URI identity)
                                 throws UnknownIdentifierException,
                                        FunctionTypeException
Tries to get an instance of the specified function.

Parameters:
identity - the name of the function
Throws:
UnknownIdentifierException - if the name isn't known
FunctionTypeException - if the name is known to map to an abstract function, and should therefore be created through createAbstractFunction

createFunction

public abstract Function createFunction(String identity)
                                 throws UnknownIdentifierException,
                                        FunctionTypeException
Tries to get an instance of the specified function.

Parameters:
identity - the name of the function
Throws:
UnknownIdentifierException - if the name isn't known
FunctionTypeException - if the name is known to map to an abstract function, and should therefore be created through createAbstractFunction

createAbstractFunction

public abstract Function createAbstractFunction(URI identity,
                                                Node root)
                                         throws UnknownIdentifierException,
                                                ParsingException,
                                                FunctionTypeException
Tries to get an instance of the specified abstract function.

Parameters:
identity - the name of the function
root - the DOM root containing info used to create the function
Throws:
UnknownIdentifierException - if the name isn't known
FunctionTypeException - if the name is known to map to a concrete function, and should therefore be created through createFunction
ParsingException - if the function can't be created with the given inputs

createAbstractFunction

public abstract Function createAbstractFunction(URI identity,
                                                Node root,
                                                String xpathVersion)
                                         throws UnknownIdentifierException,
                                                ParsingException,
                                                FunctionTypeException
Tries to get an instance of the specified abstract function.

Parameters:
identity - the name of the function
root - the DOM root containing info used to create the function
xpathVersion - the version specified in the contianing policy, or null if no version was specified
Throws:
UnknownIdentifierException - if the name isn't known
FunctionTypeException - if the name is known to map to a concrete function, and should therefore be created through createFunction
ParsingException - if the function can't be created with the given inputs

createAbstractFunction

public abstract Function createAbstractFunction(String identity,
                                                Node root)
                                         throws UnknownIdentifierException,
                                                ParsingException,
                                                FunctionTypeException
Tries to get an instance of the specified abstract function.

Parameters:
identity - the name of the function
root - the DOM root containing info used to create the function
Throws:
UnknownIdentifierException - if the name isn't known
FunctionTypeException - if the name is known to map to a concrete function, and should therefore be created through createFunction
ParsingException - if the function can't be created with the given inputs

createAbstractFunction

public abstract Function createAbstractFunction(String identity,
                                                Node root,
                                                String xpathVersion)
                                         throws UnknownIdentifierException,
                                                ParsingException,
                                                FunctionTypeException
Tries to get an instance of the specified abstract function.

Parameters:
identity - the name of the function
root - the DOM root containing info used to create the function
xpathVersion - the version specified in the contianing policy, or null if no version was specified
Throws:
UnknownIdentifierException - if the name isn't known
FunctionTypeException - if the name is known to map to a concrete function, and should therefore be created through createFunction
ParsingException - if the function can't be created with the given inputs

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.