Package de.fraunhofer.iese.mydata.policy
Interface IPolicyService
-
- All Known Subinterfaces:
IBasicManagementService,IManagementService
public interface IPolicyServiceThe Interface IPolicyService.
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description PolicyIdaddPolicy(Policy policy)Adds a policy and add it to the list of policies of the corresponding solutionvoiddeletePolicy(PolicyId policyId)Removes the policy.voiddeployPolicy(PolicyId policyId)Deploys a policy at the local PDP of the solution.Set<Policy>getDeployedPolicies()Gets all deployed policies.Set<Policy>getDeployedPolicies(SolutionId solutionId)Gets all deployed policy for a solution.Set<Policy>getPolicies(SolutionId solutionId)Gets all policy.PolicygetPolicy(PolicyId policyId)Gets the policy.Set<Policy>getRevokedPolicies(SolutionId solutionId)Gets all revoked policy for a solution.booleanisPolicyDeployed(PolicyId policyId)Checks if a policy is deployed.Set<PolicyId>listDeployedPolicies(SolutionId solutionId)Provides a list of currently deployed policies.Set<PolicyId>listPolicies(SolutionId solutionId)Gets all policy ids.Set<PolicyId>listRevokedPolicies(SolutionId solutionId)Provides a list of currently revoked policies.booleanpolicyExists(PolicyId policyId)voidrevokePolicy(PolicyId policyId)Revokes a currently deployed policy.PolicyIdupdatePolicy(Policy policy)Updates a currently deployed policy.
-
-
-
Method Detail
-
addPolicy
PolicyId addPolicy(Policy policy) throws IOException, ConflictingResourceException, ResourceUpdateException, InvalidEntityException, NoSuchEntityException
Adds a policy and add it to the list of policies of the corresponding solution- Parameters:
policy- the policy- Returns:
- policy id of the added policy, will never be null
- Throws:
IOException- Signals that an I/O exception has occurred.ResourceUpdateException- if add is not successfulConflictingResourceException- if the policy id already existsInvalidEntityException- if the policy is not validNoSuchEntityException- if the solution does not exist
-
policyExists
boolean policyExists(PolicyId policyId) throws IOException, InvalidEntityException
- Throws:
IOExceptionInvalidEntityException
-
getPolicy
Policy getPolicy(PolicyId policyId) throws IOException, NoSuchEntityException, InvalidEntityException
Gets the policy.- Parameters:
policyId- the policy component_id- Returns:
- the latest policy
- Throws:
IOException- Signals that an I/O exception has occurred.NoSuchEntityException- if there is no policy with the id givenInvalidEntityException- if the policy id is not valid
-
getPolicies
Set<Policy> getPolicies(SolutionId solutionId) throws IOException, InvalidEntityException, NoSuchEntityException
Gets all policy.- Parameters:
solutionId- the solutionId- Returns:
- all policy
- Throws:
IOException- Signals that an I/O exception has occurred.InvalidEntityException- if the solution id is not validNoSuchEntityException- if the solution does not exist
-
listPolicies
Set<PolicyId> listPolicies(SolutionId solutionId) throws IOException, InvalidEntityException, NoSuchEntityException
Gets all policy ids.- Parameters:
solutionId- the solutionid- Returns:
- all policy IDs
- Throws:
IOException- Signals that an I/O exception has occurred.InvalidEntityException- if the solution id is not validNoSuchEntityException- if the solution does not exist
-
getDeployedPolicies
Set<Policy> getDeployedPolicies() throws IOException
Gets all deployed policies. needed for PDP- Returns:
- all policy
- Throws:
IOException- Signals that an I/O exception has occurred.
-
getDeployedPolicies
Set<Policy> getDeployedPolicies(SolutionId solutionId) throws IOException, InvalidEntityException, NoSuchEntityException
Gets all deployed policy for a solution.- Parameters:
solutionId- the solutionId- Returns:
- all policy
- Throws:
IOException- Signals that an I/O exception has occurred.InvalidEntityException- if the solution id is not validNoSuchEntityException- if the solution does not exist
-
getRevokedPolicies
Set<Policy> getRevokedPolicies(SolutionId solutionId) throws IOException, InvalidEntityException, NoSuchEntityException
Gets all revoked policy for a solution.- Parameters:
solutionId- the solutionId- Returns:
- all policy
- Throws:
IOException- Signals that an I/O exception has occurred.InvalidEntityException- if the solution id is not validNoSuchEntityException- if the solution does not exist
-
listDeployedPolicies
Set<PolicyId> listDeployedPolicies(SolutionId solutionId) throws IOException, InvalidEntityException, NoSuchEntityException
Provides a list of currently deployed policies.- Parameters:
solutionId-- Returns:
- list of currently deployed policy ids
- Throws:
IOException- communication failureInvalidEntityException- if the solution id is not validNoSuchEntityException- if the solution does not exist
-
listRevokedPolicies
Set<PolicyId> listRevokedPolicies(SolutionId solutionId) throws IOException, InvalidEntityException, NoSuchEntityException
Provides a list of currently revoked policies.- Parameters:
solutionId-- Returns:
- list of currently revoked policy ids
- Throws:
IOException- communication failureInvalidEntityException- if the solution id is not validNoSuchEntityException
-
isPolicyDeployed
boolean isPolicyDeployed(PolicyId policyId) throws IOException, NoSuchEntityException, InvalidEntityException
Checks if a policy is deployed.- Parameters:
policyId- the policy component_id- Returns:
- true, if is deployed
- Throws:
IOException- Signals that an I/O exception has occurred.NoSuchEntityException- if there is no policy with the given idInvalidEntityException- if the policy id is not valid
-
updatePolicy
PolicyId updatePolicy(Policy policy) throws IOException, ResourceUpdateException, NoSuchEntityException, InvalidEntityException
Updates a currently deployed policy.- Parameters:
policy- the policy to be updated- Returns:
- true, if the policy was updated successfully, false otherwise
- Throws:
IOException- if connection problem occursResourceUpdateException- if update is not successfulNoSuchEntityException- if there is no policyInvalidEntityException- if the policy is not valid
-
deployPolicy
void deployPolicy(PolicyId policyId) throws IOException, NoSuchEntityException, ResourceUpdateException, InvalidEntityException
Deploys a policy at the local PDP of the solution.- Parameters:
policyId- the component_id of the policy to be deployed. Will be retrieved via the PRP- Throws:
IOException- if connection problem occursResourceUpdateException- if deploy was not successfulNoSuchEntityException- if there is no policy with the given idInvalidEntityException- if the policyid to be deployed is not valid
-
revokePolicy
void revokePolicy(PolicyId policyId) throws IOException, NoSuchEntityException, ResourceUpdateException, InvalidEntityException
Revokes a currently deployed policy.- Parameters:
policyId- the ID of the policy to be revoked- Throws:
IOException- if connection problem occursNoSuchEntityException- if there is no policy with the given idResourceUpdateException- if revoke is not successfulInvalidEntityException- if the given policy id is not valid
-
deletePolicy
void deletePolicy(PolicyId policyId) throws IOException, ResourceUpdateException, NoSuchEntityException, InvalidEntityException, ConflictingResourceException
Removes the policy.- Parameters:
policyId- the policyid to delete- Throws:
IOException- Signals that an I/O exception has occurred.ResourceUpdateException- if delete is not successfulNoSuchEntityException- if there is no policy with the given idInvalidEntityException- if the policy id is not validConflictingResourceException- if the policy to be deleted is deployed
-
-