Package org.codice.ddf.condition
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 -
Method Summary
Modifier and TypeMethodDescriptionbooleanReturns whether the Condition is mutable.booleanReturns whether the evaluation must be postponed until the end of the permission check.booleanisSatisfied(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, waitMethods 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 returnsfalse(or this Condition is immutable), then this Condition must be able to directly answer theCondition.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:
isPostponedin interfaceorg.osgi.service.condpermadmin.Condition- Returns:
trueto indicate the evaluation must be postponed. Otherwise,falseif 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:
isMutablein interfaceorg.osgi.service.condpermadmin.Condition- Returns:
trueCondition.isSatisfied()can change. Otherwise,falseif the value returned byCondition.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:
isSatisfiedin interfaceorg.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:
trueif all the Condition objects are satisfied. Otherwise,falseif one of the Condition objects is not satisfied.
-