public void togglePolicyEnabled(Policy policy) { LivePolicy livePolicy = livePolicies.get(policy.getID()); if (policy.isEnabled()) { livePolicy.activate(); } else { livePolicy.deactivate(); } }
public Map<Policy, Set<Conflict>> getPolicyConflicts( Policy policy, Collection<Policy> possibleOverlappingPolicies) { LivePolicy livePolicy = new LivePolicyDisabled(policy); Map<Policy, Set<Conflict>> conflicts = ConflictChecker.getConflictingPolicies( livePolicy, possibleOverlappingPolicies, livePolicies, database); ConflictChecker.describe(livePolicy.getPolicy(), conflicts); return conflicts; }
public void deletePolicy(Policy policy) { LivePolicy livePolicy = livePolicies.get(policy.getID()); livePolicy.deactivate(); livePolicies.remove(policy.getID()); policies.remove(policy); }