Class AbstractCondition

java.lang.Object
org.codice.ddf.condition.AbstractCondition
All Implemented Interfaces:
org.osgi.service.condpermadmin.Condition
Direct Known Subclasses:
BundleNameCondition, PrincipalCondition, SignerCondition

public abstract class AbstractCondition extends Object implements org.osgi.service.condpermadmin.Condition
  • Field Summary

    Fields inherited from interface org.osgi.service.condpermadmin.Condition

    FALSE, TRUE
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    boolean
    Returns whether the Condition is mutable.
    boolean
    Returns whether the evaluation must be postponed until the end of the permission check.
    boolean
    isSatisfied(org.osgi.service.condpermadmin.Condition[] conditions, Dictionary<Object,Object> context)
    Returns whether the specified set of Condition objects are satisfied.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait

    Methods inherited from interface org.osgi.service.condpermadmin.Condition

    isSatisfied
  • Constructor Details

    • AbstractCondition

      public AbstractCondition()
  • Method Details

    • isPostponed

      public boolean isPostponed()
      Returns whether the evaluation must be postponed until the end of the permission check. If this method returns false (or this Condition is immutable), then this Condition must be able to directly answer the Condition.isSatisfied() method. In other words, isSatisfied() will return very quickly since no external sources, such as for example users or networks, need to be consulted.
      This method must always return the same value whenever it is called so that the Conditional Permission Admin can cache its result.
      Specified by:
      isPostponed in interface org.osgi.service.condpermadmin.Condition
      Returns:
      true to indicate the evaluation must be postponed. Otherwise, false if the evaluation can be performed immediately.
    • isMutable

      public boolean isMutable()
      Returns whether the Condition is mutable. A Condition can go from mutable (true) to immutable (false) over time but never from immutable (false) to mutable ( true).
      Specified by:
      isMutable in interface org.osgi.service.condpermadmin.Condition
      Returns:
      true Condition.isSatisfied() can change. Otherwise, false if the value returned by Condition.isSatisfied() will not change for this condition.
    • isSatisfied

      public boolean isSatisfied(org.osgi.service.condpermadmin.Condition[] conditions, Dictionary<Object,Object> context)
      Returns whether the specified set of Condition objects are satisfied. Although this method is not static, it must be implemented as if it were static. All of the passed Condition objects will be of the same type and will correspond to the class type of the object on which this method is invoked. This method must be called inside a permission check only.
      Specified by:
      isSatisfied in interface org.osgi.service.condpermadmin.Condition
      Parameters:
      conditions - The array of Condition objects, which must all be of the same class and mutable. The receiver must be one of those Condition objects.
      context - A Dictionary object that implementors can use to track state. If this method is invoked multiple times in the same permission check, the same Dictionary will be passed multiple times. The SecurityManager treats this Dictionary as an opaque object and simply creates an empty dictionary and passes it to subsequent invocations if multiple invocations are needed.
      Returns:
      true if all the Condition objects are satisfied. Otherwise, false if one of the Condition objects is not satisfied.