|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.fcrepo.server.security.xacml.pdp.data.AbstractPolicyStore
org.fcrepo.server.security.xacml.pdp.data.FedoraPolicyStore
public class FedoraPolicyStore
A PolicyStore for managing policies stored as Fedora digital objects. Mainly used by the initial load of the bootstrap policies and by the rebuilder. For searching for policies see PolicyIndex.java and its implementations.
| Field Summary | |
|---|---|
protected Access |
apiAService
|
protected Management |
apiMService
|
protected Server |
fedoraServer
|
static String |
FESL_BOOTSTRAP_POLICY_NAMESPACE
|
static String |
FESL_POLICY_DATASTREAM
|
| Fields inherited from class org.fcrepo.server.security.xacml.pdp.data.AbstractPolicyStore |
|---|
LOGGER, policiesLoaded, policyNames |
| Constructor Summary | |
|---|---|
FedoraPolicyStore(Server server)
|
|
| Method Summary | |
|---|---|
String |
addPolicy(File f)
Generates a policy using the File provided. |
String |
addPolicy(File f,
String name)
Generates a policy using the File and name provided and adds it
to the Policy Store. |
String |
addPolicy(String document)
Generates a policy based on the string data provided. |
String |
addPolicy(String document,
String name)
Generates a policy based on the string data provided and the name. |
boolean |
contains(File policy)
Check if the policy identified by policyName exists. |
boolean |
contains(String policyName)
Check if the policy identified by policyName exists. |
boolean |
deletePolicy(String name)
Removes the policy given by name from the data store. |
byte[] |
getPolicy(String name)
Obtains the policy with the provided name from the Policy Store. |
void |
init()
Initialize this PolicyStore with the bootstrap policies |
List<String> |
listPolicies()
Obtains a list of stored policies. |
void |
setCollection(String collection)
|
void |
setCollectionRelationship(String collectionRelationship)
|
void |
setContentModel(String contentModel)
|
void |
setDatastreamControlGroup(String datastreamControlGroup)
|
void |
setPidNamespace(String pidNamespace)
|
void |
setSchemaLocations(Map<String,String> schemaLocation)
Map policy schema URIs to locations for the schema document |
void |
setSchemaValidation(boolean validate)
|
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. |
| Methods inherited from class org.fcrepo.server.security.xacml.pdp.data.AbstractPolicyStore |
|---|
addDocuments, addDocuments, reloadPolicies |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final String FESL_POLICY_DATASTREAM
public static String FESL_BOOTSTRAP_POLICY_NAMESPACE
protected Server fedoraServer
protected Management apiMService
protected Access apiAService
| Constructor Detail |
|---|
public FedoraPolicyStore(Server server)
throws PolicyStoreException
PolicyStoreException| Method Detail |
|---|
public void init()
throws PolicyStoreException,
FileNotFoundException
PolicyStore
init in interface PolicyStoreinit in class AbstractPolicyStorePolicyStoreException
FileNotFoundExceptionpublic void setPidNamespace(String pidNamespace)
public void setContentModel(String contentModel)
public void setDatastreamControlGroup(String datastreamControlGroup)
public void setCollection(String collection)
public void setCollectionRelationship(String collectionRelationship)
public void setSchemaValidation(boolean validate)
public void setSchemaLocations(Map<String,String> schemaLocation)
throws IOException,
SAXException
schemaLocation -
IOException
SAXException
public String addPolicy(File f)
throws PolicyStoreException
PolicyStoreFile provided. The name is
automatically generated based on the PolicyId attribute of the Policy.
The policy is then added to the Policy Store.
addPolicy in interface PolicyStoref - the policy as a File
PolicyStoreException
public String addPolicy(File f,
String name)
throws PolicyStoreException
PolicyStoreFile and name provided and adds it
to the Policy Store.
addPolicy in interface PolicyStoref - the policy as a Filename - the name to assign the policy
PolicyStoreException
public String addPolicy(String document)
throws PolicyStoreException
PolicyStore
addPolicy in interface PolicyStoredocument - the policy as a String
PolicyStoreException
public String addPolicy(String document,
String name)
throws PolicyStoreException
PolicyStore
addPolicy in interface PolicyStoredocument - the policy as a String
PolicyStoreException
public boolean deletePolicy(String name)
throws PolicyStoreException
PolicyStore
deletePolicy in interface PolicyStorename - the name of the policy
PolicyStoreException
public boolean updatePolicy(String name,
String newDocument)
throws PolicyStoreException
PolicyStore
updatePolicy in interface PolicyStorename - the name of the policy to updatenewDocument - the new policy as a String
PolicyStoreException
public byte[] getPolicy(String name)
throws PolicyStoreException
PolicyStore
getPolicy in interface PolicyStorename - the name of the policy to return
PolicyStoreException
public boolean contains(String policyName)
throws PolicyStoreException
contains in interface PolicyStorepolicyName -
PolicyStoreException
public boolean contains(File policy)
throws PolicyStoreException
contains in interface PolicyStorepolicy -
PolicyStoreException
public List<String> listPolicies()
throws PolicyStoreException
PolicyStore
listPolicies in interface PolicyStorePolicyStoreException
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||