public class ExistPolicyIndex extends XPathPolicyIndex implements PolicyIndex
| Modifier and Type | Field and Description |
|---|---|
protected org.xmldb.api.base.Collection |
m_collection |
ACTION_KEY, ENVIRONMENT_KEY, indexed, indexMap, m_policyReader, METADATA_POLICY_NS, namespaces, RESOURCE_KEY, SUBJECT_KEYXACML_RESOURCE_ID, XACML20_POLICY_NS| Modifier | Constructor and Description |
|---|---|
protected |
ExistPolicyIndex(PolicyReader policyReader) |
| Modifier and Type | Method and Description |
|---|---|
String |
addPolicy(String name,
String document)
Generates a policy based on the string data provided and the name.
|
boolean |
clear()
Clear the policy index completely
|
void |
close() |
boolean |
contains(String policyName)
Check if the policy identified by policyName exists.
|
protected org.xmldb.api.base.Collection |
createCollectionPath(String collectionPath,
org.xmldb.api.base.Collection rootCollection)
Create a collection given a full path to the collection.
|
protected static Document |
createDocument(String document) |
protected void |
deleteCollection()
delete the policy collection from the database
|
boolean |
deletePolicy(String name)
Removes the policy given by name from the data store.
|
protected org.xmldb.api.base.ResourceSet |
doQuery(String query,
Map<String,String> variables) |
Map<String,com.sun.xacml.AbstractPolicy> |
getPolicies(com.sun.xacml.EvaluationCtx eval,
com.sun.xacml.finder.PolicyFinder policyFinder)
Extracts a list of policies from the Policy Index that are relevant to
the given Evaluation Context.
|
com.sun.xacml.AbstractPolicy |
getPolicy(String name,
com.sun.xacml.finder.PolicyFinder policyFinder)
Obtains the policy with the provided name from the Policy Store.
|
protected static String |
IdToName(String Id) |
void |
init() |
protected void |
initCollection() |
void |
initDatabase() |
protected static String |
nameToId(String name) |
protected static byte[] |
nodeToByte(Node node)
get XML document supplied as w3c dom Node as bytes
|
void |
setCollectionName(String collectionName) |
void |
setDatabaseURI(String databaseURI) |
void |
setPassword(String password) |
void |
setUser(String user) |
protected static String[] |
sortDescending(String[] s)
sorts a string array in descending order of length
|
boolean |
updatePolicy(String name,
String newDocument)
Generates a new policy based for the given policy name and replaces the
old policy in the Policy Store with it.
|
getXpath, getXpathVariablesgetAttributeMap, handleDocument, makeComponents, setActionAttributes, setAttributeMap, setEnvironmentAttributes, setResourceAttributes, setSubjectAttributesprotected ExistPolicyIndex(PolicyReader policyReader) throws PolicyIndexException
PolicyIndexExceptionpublic String addPolicy(String name, String document) throws PolicyIndexException
PolicyIndexaddPolicy in interface PolicyIndexdocument - the policy as a StringPolicyIndexExceptionpublic boolean clear()
throws PolicyIndexException
PolicyIndexclear in interface PolicyIndexPolicyIndexExceptionpublic boolean contains(String policyName) throws PolicyIndexException
PolicyIndexcontains in interface PolicyIndexPolicyIndexExceptionpublic boolean deletePolicy(String name) throws PolicyIndexException
PolicyIndexdeletePolicy in interface PolicyIndexname - the name of the policyPolicyIndexExceptionpublic Map<String,com.sun.xacml.AbstractPolicy> getPolicies(com.sun.xacml.EvaluationCtx eval, com.sun.xacml.finder.PolicyFinder policyFinder) throws PolicyIndexException
PolicyIndexgetPolicies in interface PolicyIndexeval - the Evaluation Context from which to match policies againstPolicyIndexExceptionpublic com.sun.xacml.AbstractPolicy getPolicy(String name, com.sun.xacml.finder.PolicyFinder policyFinder) throws PolicyIndexException
PolicyIndexgetPolicy in interface PolicyIndexname - the name of the policy to returnPolicyIndexExceptionpublic boolean updatePolicy(String name, String newDocument) throws PolicyIndexException
PolicyIndexupdatePolicy in interface PolicyIndexname - the name of the policy to updatenewDocument - the new policy as a StringPolicyIndexExceptionprotected static byte[] nodeToByte(Node node) throws PolicyIndexException
node - PolicyIndexExceptionprotected static String[] sortDescending(String[] s)
s - protected org.xmldb.api.base.ResourceSet doQuery(String query, Map<String,String> variables) throws PolicyIndexException
PolicyIndexExceptionprotected org.xmldb.api.base.Collection createCollectionPath(String collectionPath, org.xmldb.api.base.Collection rootCollection) throws PolicyIndexException
collectionPath - rootCollection - PolicyIndexExceptionpublic void setDatabaseURI(String databaseURI)
public void setCollectionName(String collectionName)
public void setUser(String user)
public void setPassword(String password)
public void init()
throws PolicyIndexException
PolicyIndexExceptionpublic void initDatabase()
throws PolicyIndexException
PolicyIndexExceptionprotected void initCollection()
throws PolicyIndexException
PolicyIndexExceptionprotected void deleteCollection()
throws PolicyIndexException
PolicyIndexExceptionprotected static Document createDocument(String document) throws PolicyIndexException
PolicyIndexExceptionpublic void close()
Copyright © 2013 DuraSpace. All Rights Reserved.