Package ch.tocco.nice2.security.impl
Class PolicyBuilderImpl
java.lang.Object
ch.tocco.nice2.security.impl.PolicyBuilderImpl
- All Implemented Interfaces:
Policy
,PolicyBuilder
,Serializable
,Iterable<Rule>
- See Also:
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionappendRule
(Rule rule) Add a rule at the policy's endclear()
getRules()
boolean
isEmpty()
iterator()
newRuleBuilder
(Rule rule) policy()
prependRule
(Rule rule) Prepend a rule to the policy's startprependRules
(Collection<? extends Rule> rules) removeRule
(Rule rule) subPolicy
(Permission permission) Returns aPolicy
that contains only rules that are relevant for the given permission.subPolicy
(SecurityDomain permission) Returns aPolicy
that contains only rules that are relevant for the given domain.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface java.lang.Iterable
forEach, spliterator
-
Constructor Details
-
PolicyBuilderImpl
public PolicyBuilderImpl() -
PolicyBuilderImpl
-
-
Method Details
-
clear
- Specified by:
clear
in interfacePolicyBuilder
-
appendRule
Description copied from interface:PolicyBuilder
Add a rule at the policy's end- Specified by:
appendRule
in interfacePolicyBuilder
- Parameters:
rule
- the rule to be added- Returns:
- PolicyBuilder
-
prependRule
Description copied from interface:PolicyBuilder
Prepend a rule to the policy's start- Specified by:
prependRule
in interfacePolicyBuilder
- Parameters:
rule
- the rule to be prepended- Returns:
- PolicyBuilder
-
prependRules
- Specified by:
prependRules
in interfacePolicyBuilder
-
removeRule
- Specified by:
removeRule
in interfacePolicyBuilder
-
newRuleBuilder
- Specified by:
newRuleBuilder
in interfacePolicyBuilder
-
newRuleBuilder
- Specified by:
newRuleBuilder
in interfacePolicyBuilder
-
policy
- Specified by:
policy
in interfacePolicyBuilder
-
isEmpty
public boolean isEmpty() -
getRules
-
subPolicy
Description copied from interface:Policy
Returns aPolicy
that contains only rules that are relevant for the given permission. This policy may be cached internally and is more efficient than filtering rules manually. -
subPolicy
Description copied from interface:Policy
Returns aPolicy
that contains only rules that are relevant for the given domain. This policy may be cached internally and is more efficient than filtering rules manually. -
iterator
-