org.opensaml.xacml.ctx.provider
Class ObligationService

java.lang.Object
  extended by org.opensaml.xacml.ctx.provider.ObligationService

public class ObligationService
extends Object

A service for evaluating the obligations within a context.


Nested Class Summary
private  class ObligationService.ObligationHandlerComparator
          Comparator used to order obligation handlers by precedence.
 
Field Summary
private  Set<BaseObligationHandler> obligationHandlers
          Registered obligation handlers.
private  ReentrantReadWriteLock rwLock
          Read/write lock around the registered obligation handlers.
 
Constructor Summary
ObligationService()
          Constructor.
 
Method Summary
 void addObligationhandler(BaseObligationHandler handler)
          Adds an obligation handler to the list of registered handlers This method waits until a write lock is obtained for the set of registered obligation handlers.
 void addObligationhandler(Collection<BaseObligationHandler> handlers)
          Adds a collection of obligation handler to the list of registered handlers This method waits until a write lock is obtained for the set of registered obligation handlers.
 Set<BaseObligationHandler> getObligationHandlers()
          Gets the registered obligation handlers.
protected  Map<String,ObligationType> preprocessObligations(ObligationProcessingContext context)
          Preprocesses the obligations returned within the result.
 void processObligations(ObligationProcessingContext context)
          Processes the obligations within the effective XACML policy.
 void removeObligationHandler(BaseObligationHandler handler)
          Removes an obligation handler from the list of registered handlers This method waits until a write lock is obtained for the set of registered obligation handlers.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

rwLock

private ReentrantReadWriteLock rwLock
Read/write lock around the registered obligation handlers.


obligationHandlers

private Set<BaseObligationHandler> obligationHandlers
Registered obligation handlers.

Constructor Detail

ObligationService

public ObligationService()
Constructor.

Method Detail

getObligationHandlers

public Set<BaseObligationHandler> getObligationHandlers()
Gets the registered obligation handlers.

Returns:
registered obligation handlers

addObligationhandler

public void addObligationhandler(BaseObligationHandler handler)
Adds an obligation handler to the list of registered handlers This method waits until a write lock is obtained for the set of registered obligation handlers.

Parameters:
handler - the handler to add to the list of registered handlers.

addObligationhandler

public void addObligationhandler(Collection<BaseObligationHandler> handlers)
Adds a collection of obligation handler to the list of registered handlers This method waits until a write lock is obtained for the set of registered obligation handlers.

Parameters:
handlers - the collection of handlers to add to the list of registered handlers.

removeObligationHandler

public void removeObligationHandler(BaseObligationHandler handler)
Removes an obligation handler from the list of registered handlers This method waits until a write lock is obtained for the set of registered obligation handlers.

Parameters:
handler - the handler to remove from the list of registered handlers.

processObligations

public void processObligations(ObligationProcessingContext context)
                        throws ObligationProcessingException
Processes the obligations within the effective XACML policy. This method waits until a read lock is obtained for the set of registered obligation handlers.

Parameters:
context - current processing context
Throws:
ObligationProcessingException - thrown if there is a problem evaluating an obligation

preprocessObligations

protected Map<String,ObligationType> preprocessObligations(ObligationProcessingContext context)
Preprocesses the obligations returned within the result. This preprocessing determines the active effect, based on ResultType.getDecision(), and creates an index that maps obligation IDs to the ObligationType returned by the PDP.

Parameters:
context - current processing context
Returns:
preprocessed obligations


Copyright © 1999-2012. All Rights Reserved.