Package cz.metacentrum.perun.core.impl
Class PerunPoliciesContainer
java.lang.Object
cz.metacentrum.perun.core.impl.PerunPoliciesContainer
PerunPoliciesContainer stores a list of perun policies and map of role management rules..
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionfetchPolicyWithAllIncludedPolicies
(String policyName) Fetch policy and all its (also nested) included policies.Return all loaded perun policies.Return all loaded roles management rules.getPerunPolicy
(String policyName) Get PerunPolicy for the policy name from the PerunPoliciesContainergetRoleManagementRules
(String roleName) Get RoleManagementRules for the role name from the PerunPoliciesContainervoid
setPerunPolicies
(Set<PerunPolicy> perunPolicies) void
setRolesManagementRules
(Map<String, RoleManagementRules> rolesManagementRules)
-
Constructor Details
-
PerunPoliciesContainer
public PerunPoliciesContainer()
-
-
Method Details
-
fetchPolicyWithAllIncludedPolicies
public List<PerunPolicy> fetchPolicyWithAllIncludedPolicies(String policyName) throws PolicyNotExistsException Fetch policy and all its (also nested) included policies. Method detects and skips cycles.- Parameters:
policyName
- is a policy definition for which will be policy and its all included policies fetched.- Returns:
- all included policies together with the policy defined by policyName.
- Throws:
PolicyNotExistsException
- when the given policyName does not exist in the PerunPoliciesContainer.
-
getAllPolicies
Return all loaded perun policies.- Returns:
- all loaded policies
-
getAllRolesManagementRules
Return all loaded roles management rules.- Returns:
- all roles management rules
-
getPerunPolicy
Get PerunPolicy for the policy name from the PerunPoliciesContainer- Parameters:
policyName
- for which will be the policy fetched- Returns:
- PerunPolicy for the role name
- Throws:
PolicyNotExistsException
- of there is no policy for the policy name
-
getRoleManagementRules
public RoleManagementRules getRoleManagementRules(String roleName) throws RoleManagementRulesNotExistsException Get RoleManagementRules for the role name from the PerunPoliciesContainer- Parameters:
roleName
- for which will be the rules fetched- Returns:
- RoleManagementRules for the role name
- Throws:
RoleManagementRulesNotExistsException
- of there are no rules for the role name
-
setPerunPolicies
-
setRolesManagementRules
-