|
SunTM's XACML Implementation for JavaTM | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object com.sun.xacml.cond.FunctionFactory com.sun.xacml.cond.BaseFunctionFactory
This is a basic implementation of FunctionFactory
. It
implements the insertion and retrieval methods, but it doesn't actually
setup the factory with any functions. It also assumes a certain model
with regard to the different kinds of functions (Target, Condition, and
General). For this reason, you may want to re-use this class, or you
may want to extend FunctionFactory directly, if you're writing a new
factory implementation.
Note that while this class is thread-safe on all creation methods, it is not safe to add support for a new function while creating an instance of a function. This follows from the assumption that most people will initialize these factories up-front, and then start processing without ever modifying the factories. If you need these mutual operations to be thread-safe, then you should write a wrapper class that implements the right synchronization.
Constructor Summary | |
BaseFunctionFactory()
Default constructor. |
|
BaseFunctionFactory(FunctionFactory superset)
Constructor that sets a "superset factory". |
|
BaseFunctionFactory(FunctionFactory superset,
Set supportedFunctions,
Map supportedAbstractFunctions)
Constructor that defines the initial functions supported by this factory and uses a superset factory. |
|
BaseFunctionFactory(Set supportedFunctions,
Map supportedAbstractFunctions)
Constructor that defines the initial functions supported by this factory but doesn't use a superset factory. |
Method Summary | |
void |
addAbstractFunction(FunctionProxy proxy,
URI identity)
Adds the abstract function proxy to the factory. |
void |
addFunction(Function function)
Adds the function to the factory. |
Function |
createAbstractFunction(String identity,
Node root)
Tries to get an instance of the specified abstract function. |
Function |
createAbstractFunction(String identity,
Node root,
String xpathVersion)
Tries to get an instance of the specified abstract function. |
Function |
createAbstractFunction(URI identity,
Node root)
Tries to get an instance of the specified abstract function. |
Function |
createAbstractFunction(URI identity,
Node root,
String xpathVersion)
Tries to get an instance of the specified abstract function. |
Function |
createFunction(String identity)
Tries to get an instance of the specified function. |
Function |
createFunction(URI identity)
Tries to get an instance of the specified function. |
Set |
getSupportedFunctions()
Returns the function identifiers supported by this factory. |
Methods inherited from class com.sun.xacml.cond.FunctionFactory |
addAbstractConditionFunction, addAbstractGeneralFunction, addAbstractTargetFunction, addConditionFunction, addGeneralFunction, addTargetFunction, getConditionInstance, getGeneralInstance, getTargetInstance, setDefaultFactory |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public BaseFunctionFactory()
public BaseFunctionFactory(FunctionFactory superset)
superset
- the superset factory or nullpublic BaseFunctionFactory(Set supportedFunctions, Map supportedAbstractFunctions)
supportedFunctions
- a Set
of Function
ssupportedAbstractFunctions
- a mapping from URI
to
FunctionProxy
public BaseFunctionFactory(FunctionFactory superset, Set supportedFunctions, Map supportedAbstractFunctions)
BaseFunctionFactory(FunctionFactory)
and then manually add each function.
superset
- the superset factory or nullsupportedFunctions
- a Set
of Function
ssupportedAbstractFunctions
- a mapping from URI
to
FunctionProxy
Method Detail |
public void addFunction(Function function) throws IllegalArgumentException
addFunction
in class FunctionFactory
function
- the Function
to add to the factory
IllegalArgumentException
- if the function's identifier is already
used or if the function is non-boolean
(when this is a Target or Condition
factory)public void addAbstractFunction(FunctionProxy proxy, URI identity) throws IllegalArgumentException
addAbstractFunction
in class FunctionFactory
proxy
- the FunctionProxy
to add to the factoryidentity
- the function's identifier
IllegalArgumentException
- if the function's identifier is already
usedpublic Set getSupportedFunctions()
getSupportedFunctions
in class FunctionFactory
Set
of String
spublic Function createFunction(URI identity) throws UnknownIdentifierException, FunctionTypeException
createFunction
in class FunctionFactory
identity
- the name of the function
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 createAbstractFunctionpublic Function createFunction(String identity) throws UnknownIdentifierException, FunctionTypeException
createFunction
in class FunctionFactory
identity
- the name of the function
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 createAbstractFunctionpublic Function createAbstractFunction(URI identity, Node root) throws UnknownIdentifierException, ParsingException, FunctionTypeException
createAbstractFunction
in class FunctionFactory
identity
- the name of the functionroot
- the DOM root containing info used to create the function
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 inputspublic Function createAbstractFunction(URI identity, Node root, String xpathVersion) throws UnknownIdentifierException, ParsingException, FunctionTypeException
createAbstractFunction
in class FunctionFactory
identity
- the name of the functionroot
- the DOM root containing info used to create the functionxpathVersion
- the version specified in the contianing policy, or
null if no version was specified
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 inputspublic Function createAbstractFunction(String identity, Node root) throws UnknownIdentifierException, ParsingException, FunctionTypeException
createAbstractFunction
in class FunctionFactory
identity
- the name of the functionroot
- the DOM root containing info used to create the function
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 inputspublic Function createAbstractFunction(String identity, Node root, String xpathVersion) throws UnknownIdentifierException, ParsingException, FunctionTypeException
createAbstractFunction
in class FunctionFactory
identity
- the name of the functionroot
- the DOM root containing info used to create the functionxpathVersion
- the version specified in the contianing policy, or
null if no version was specified
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 | |||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
Sun, Sun Microsystems, the Sun Logo, and Java are trademarks or registered trademarks of Sun Microsystems, Inc. in the US and other countries.