org.jboss.security.xacml.sunxacml.combine
Class StandardCombiningAlgFactory

java.lang.Object
  extended by org.jboss.security.xacml.sunxacml.combine.CombiningAlgFactory
      extended by org.jboss.security.xacml.sunxacml.combine.BaseCombiningAlgFactory
          extended by org.jboss.security.xacml.sunxacml.combine.StandardCombiningAlgFactory

public class StandardCombiningAlgFactory
extends BaseCombiningAlgFactory

This factory supports the standard set of algorithms 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 algorithms, this factory does not allow the addition of any other algorithms. If you call addAlgorithm on an instance of this class, an exception will be thrown. If you need a standard factory that is modifiable, you should create a new BaseCombiningAlgFactory (or some other CombiningAlgFactory) and configure it with the standard algorithms using getStandardAlgorithms (or, in the case of BaseAttributeFactory, by providing the datatypes in the constructor).

Since:
1.2
Author:
Seth Proctor

Method Summary
 void addAlgorithm(CombiningAlgorithm alg)
          Throws an UnsupportedOperationException since you are not allowed to modify what a standard factory supports.
static StandardCombiningAlgFactory getFactory()
          Returns an instance of this factory.
static CombiningAlgFactory getNewFactory()
          A convenience method that returns a new instance of a CombiningAlgFactory that supports all of the standard algorithms.
static Set getStandardAlgorithms(String xacmlVersion)
          Returns the identifiers supported for the given version of XACML.
 
Methods inherited from class org.jboss.security.xacml.sunxacml.combine.BaseCombiningAlgFactory
createAlgorithm, getSupportedAlgorithms
 
Methods inherited from class org.jboss.security.xacml.sunxacml.combine.CombiningAlgFactory
addCombiningAlg, createCombiningAlg, getInstance, getInstance, registerFactory, setDefaultFactory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Method Detail

getFactory

public static StandardCombiningAlgFactory getFactory()
Returns an instance of this factory. 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 CombiningAlgFactory, ensuring quick access to this factory.

Returns:
the factory instance

getNewFactory

public static CombiningAlgFactory getNewFactory()
A convenience method that returns a new instance of a CombiningAlgFactory that supports all of the standard algorithms. The new factory allows adding support for new algorithms. This method should only be used when you need a new, mutable instance (eg, when you want to create a new factory that extends the set of supported algorithms). In general, you should use getFactory which is more efficient and enforces a singleton pattern.

Returns:
a new factory supporting the standard algorithms

getStandardAlgorithms

public static Set getStandardAlgorithms(String xacmlVersion)
                                 throws UnknownIdentifierException
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

addAlgorithm

public void addAlgorithm(CombiningAlgorithm alg)
Throws an UnsupportedOperationException since you are not allowed to modify what a standard factory supports.

Overrides:
addAlgorithm in class BaseCombiningAlgFactory
Parameters:
alg - the combining algorithm to add
Throws:
UnsupportedOperationException - always


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