public class PolicyManager extends Object
| Constructor and Description |
|---|
PolicyManager(org.wso2.carbon.registry.core.Registry registry)
Constructor accepting an instance of the registry to use.
|
| Modifier and Type | Method and Description |
|---|---|
void |
addPolicy(Policy policy)
Adds the given policy artifact to the registry.
|
Policy[] |
findPolicies(PolicyFilter criteria)
Finds all policy artifacts matching the given filter criteria.
|
Policy[] |
getAllPolicies()
Finds all policy artifacts on the registry.
|
Policy |
getPolicy(String policyId)
Fetches the given policy artifact on the registry.
|
Policy |
newPolicy(byte[] content)
Create a new Schema based on content either embedded or passed to a service.
|
Policy |
newPolicy(byte[] content,
String name)
Create a new Schema based on content either embedded or passed to a service.
|
Policy |
newPolicy(String url)
Creates a new policy artifact from the given URL.
|
void |
removePolicy(String policyId)
Removes the given policy artifact from the registry.
|
protected void |
setContent(Policy policy,
org.wso2.carbon.registry.core.Resource policyResource)
Sets content of the given policy artifact to the given resource on the
registry.
|
void |
updatePolicy(Policy policy)
Updates the given policy artifact on the registry.
|
public PolicyManager(org.wso2.carbon.registry.core.Registry registry)
registry - the instance of the registry.public Policy newPolicy(byte[] content) throws org.wso2.carbon.registry.core.exceptions.RegistryException
content - the schema contentGovernanceException - if the operation failed.org.wso2.carbon.registry.core.exceptions.RegistryExceptionpublic Policy newPolicy(byte[] content, String name) throws org.wso2.carbon.registry.core.exceptions.RegistryException
content - the schema contentname - the schema nameGovernanceException - if the operation failed.org.wso2.carbon.registry.core.exceptions.RegistryExceptionpublic Policy newPolicy(String url) throws GovernanceException
url - the given URL.GovernanceException - if the operation failed.public void addPolicy(Policy policy) throws GovernanceException
policy - the policy artifact.GovernanceException - if the operation failed.public void updatePolicy(Policy policy) throws GovernanceException
policy - the policy artifact.GovernanceException - if the operation failed.public Policy getPolicy(String policyId) throws GovernanceException
policyId - the identifier of the policy artifact.GovernanceException - if the operation failed.public void removePolicy(String policyId) throws GovernanceException
policyId - the identifier of the policy artifact.GovernanceException - if the operation failed.protected void setContent(Policy policy, org.wso2.carbon.registry.core.Resource policyResource) throws GovernanceException
policy - the policy artifact.policyResource - the content resource.GovernanceException - if the operation failed.public Policy[] findPolicies(PolicyFilter criteria) throws GovernanceException
criteria - the filter criteria to be matched.GovernanceException - if the operation failed.public Policy[] getAllPolicies() throws GovernanceException
GovernanceException - if the operation failed.Copyright © 2017 WSO2. All Rights Reserved.