public class FedoraPolicyStore extends AbstractPolicyStore implements PolicyStore
| Modifier and Type | Field and Description |
|---|---|
protected Access |
apiAService |
protected Management |
apiMService |
protected Server |
fedoraServer |
static String |
FESL_BOOTSTRAP_POLICY_NAMESPACE |
static String |
FESL_POLICY_DATASTREAM |
LOGGER, policiesLoaded, policyNames| Constructor and Description |
|---|
FedoraPolicyStore(Server server) |
| Modifier and Type | Method and Description |
|---|---|
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.
|
addDocuments, addDocuments, reloadPoliciespublic static final String FESL_POLICY_DATASTREAM
public static String FESL_BOOTSTRAP_POLICY_NAMESPACE
protected Server fedoraServer
protected Management apiMService
protected Access apiAService
public FedoraPolicyStore(Server server) throws PolicyStoreException
PolicyStoreExceptionpublic void init()
throws PolicyStoreException,
FileNotFoundException
PolicyStoreinit in interface PolicyStoreinit in class AbstractPolicyStorePolicyStoreExceptionFileNotFoundExceptionpublic 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 - IOExceptionSAXExceptionpublic 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 FilePolicyStoreExceptionpublic 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 policyPolicyStoreExceptionpublic String addPolicy(String document) throws PolicyStoreException
PolicyStoreaddPolicy in interface PolicyStoredocument - the policy as a StringPolicyStoreExceptionpublic String addPolicy(String document, String name) throws PolicyStoreException
PolicyStoreaddPolicy in interface PolicyStoredocument - the policy as a StringPolicyStoreExceptionpublic boolean deletePolicy(String name) throws PolicyStoreException
PolicyStoredeletePolicy in interface PolicyStorename - the name of the policyPolicyStoreExceptionpublic boolean updatePolicy(String name, String newDocument) throws PolicyStoreException
PolicyStoreupdatePolicy in interface PolicyStorename - the name of the policy to updatenewDocument - the new policy as a StringPolicyStoreExceptionpublic byte[] getPolicy(String name) throws PolicyStoreException
PolicyStoregetPolicy in interface PolicyStorename - the name of the policy to returnPolicyStoreExceptionpublic boolean contains(String policyName) throws PolicyStoreException
contains in interface PolicyStorepolicyName - PolicyStoreExceptionpublic boolean contains(File policy) throws PolicyStoreException
contains in interface PolicyStorepolicy - PolicyStoreExceptionpublic List<String> listPolicies() throws PolicyStoreException
PolicyStorelistPolicies in interface PolicyStorePolicyStoreExceptionCopyright © 2013 DuraSpace. All Rights Reserved.