Class PolicyImpl

java.lang.Object
ch.tocco.nice2.security.impl.PolicyImpl
All Implemented Interfaces:
Policy, Serializable, Iterable<Rule>

public class PolicyImpl extends Object implements Policy
Simple implementation of Policy. This is used to be an anonymous class in PolicyBuilderImpl, which caused that the containing policy builder remained in memory even though it was no longer needed.
See Also:
  • Constructor Details

    • PolicyImpl

      public PolicyImpl(List<Rule> rules)
  • Method Details

    • isEmpty

      public boolean isEmpty()
      Specified by:
      isEmpty in interface Policy
    • getRules

      public List<Rule> getRules()
      Specified by:
      getRules in interface Policy
    • subPolicy

      public Policy subPolicy(Permission permission)
      Description copied from interface: Policy
      Returns a Policy 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.
      Specified by:
      subPolicy in interface Policy
    • subPolicy

      public Policy subPolicy(SecurityDomain securityDomain)
      Description copied from interface: Policy
      Returns a Policy 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.
      Specified by:
      subPolicy in interface Policy
    • iterator

      public Iterator<Rule> iterator()
      Specified by:
      iterator in interface Iterable<Rule>