org.fcrepo.server.security.xacml.pdp.data
Class PolicyIndexBase

java.lang.Object
  extended by org.fcrepo.server.security.xacml.pdp.data.PolicyIndexBase
All Implemented Interfaces:
PolicyIndex
Direct Known Subclasses:
XPathPolicyIndex

public abstract class PolicyIndexBase
extends Object
implements PolicyIndex

Base abstract class for all PolicyIndex implementations. Gets the index configuration common to all implementations.

Version:
$Id$
Author:
Stephen Bayliss

Field Summary
protected static String ACTION_KEY
           
protected static String ENVIRONMENT_KEY
           
 boolean indexed
           
protected  Map<String,Map<String,String>> indexMap
           
protected  PolicyReader m_policyReader
           
protected static String METADATA_POLICY_NS
           
static Map<String,String> namespaces
           
protected static String RESOURCE_KEY
           
protected static String SUBJECT_KEY
           
 
Fields inherited from interface org.fcrepo.server.security.xacml.pdp.data.PolicyIndex
XACML_RESOURCE_ID, XACML20_POLICY_NS
 
Constructor Summary
protected PolicyIndexBase(PolicyReader policyReader)
           
 
Method Summary
protected  Map<String,Set<AttributeBean>> getAttributeMap(com.sun.xacml.EvaluationCtx eval)
          This method extracts the attributes listed in the indexMap from the given evaluation context.
protected  com.sun.xacml.AbstractPolicy handleDocument(Document doc, com.sun.xacml.finder.PolicyFinder policyFinder)
          A private method that handles reading the policy and creates the correct kind of AbstractPolicy.
protected static String[] makeComponents(String resourceId)
          Splits a XACML hierarchical resource-id value into a set of resource-id values that can be matched against a policy.
 void setActionAttributes(Map<String,String> attributeMap)
           
protected  void setAttributeMap(String mapKey, Map<String,String> attributeMap)
           
 void setEnvironmentAttributes(Map<String,String> attributeMap)
           
 void setResourceAttributes(Map<String,String> attributeMap)
           
 void setSubjectAttributes(Map<String,String> attributeMap)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface org.fcrepo.server.security.xacml.pdp.data.PolicyIndex
addPolicy, clear, contains, deletePolicy, getPolicies, getPolicy, updatePolicy
 

Field Detail

SUBJECT_KEY

protected static final String SUBJECT_KEY
See Also:
Constant Field Values

RESOURCE_KEY

protected static final String RESOURCE_KEY
See Also:
Constant Field Values

ACTION_KEY

protected static final String ACTION_KEY
See Also:
Constant Field Values

ENVIRONMENT_KEY

protected static final String ENVIRONMENT_KEY
See Also:
Constant Field Values

indexed

public boolean indexed

indexMap

protected Map<String,Map<String,String>> indexMap

m_policyReader

protected PolicyReader m_policyReader

METADATA_POLICY_NS

protected static final String METADATA_POLICY_NS
See Also:
Constant Field Values

namespaces

public static final Map<String,String> namespaces
Constructor Detail

PolicyIndexBase

protected PolicyIndexBase(PolicyReader policyReader)
                   throws PolicyIndexException
Throws:
PolicyIndexException
Method Detail

setSubjectAttributes

public void setSubjectAttributes(Map<String,String> attributeMap)

setResourceAttributes

public void setResourceAttributes(Map<String,String> attributeMap)

setActionAttributes

public void setActionAttributes(Map<String,String> attributeMap)

setEnvironmentAttributes

public void setEnvironmentAttributes(Map<String,String> attributeMap)

setAttributeMap

protected void setAttributeMap(String mapKey,
                               Map<String,String> attributeMap)

getAttributeMap

protected Map<String,Set<AttributeBean>> getAttributeMap(com.sun.xacml.EvaluationCtx eval)
                                                  throws URISyntaxException
This method extracts the attributes listed in the indexMap from the given evaluation context.

Parameters:
eval - the Evaluation Context from which to extract Attributes
Returns:
a Map of Attributes for each category (Subject, Resource, Action, Environment)
Throws:
URISyntaxException

handleDocument

protected com.sun.xacml.AbstractPolicy handleDocument(Document doc,
                                                      com.sun.xacml.finder.PolicyFinder policyFinder)
                                               throws com.sun.xacml.ParsingException
A private method that handles reading the policy and creates the correct kind of AbstractPolicy. Because this makes use of the policyFinder, it cannot be reused between finders. Consider moving to policyManager, which is not intended to be reused outside of a policyFinderModule, which is not intended to be reused amongst PolicyFinder instances.

Throws:
com.sun.xacml.ParsingException

makeComponents

protected static String[] makeComponents(String resourceId)
Splits a XACML hierarchical resource-id value into a set of resource-id values that can be matched against a policy. Eg an incoming request for /res1/res2/res3/.* should match /res1/.* /res1/res2/.* /res1/res2/res3/.* in policies.

Parameters:
resourceId - XACML hierarchical resource-id value
Returns:
array of individual resource-id values that can be used to match against policies


Copyright © 2012 DuraSpace. All Rights Reserved.