Package com.tangosol.net
Class CompositeActionPolicy
java.lang.Object
com.tangosol.net.CompositeActionPolicy
- All Implemented Interfaces:
ActionPolicy
CompositeActionPolicy represents the "intersection" of two policies. More
formally, a given action is
allowed
iff both component
policies allow it.- Author:
- rhl 2012.09.20
-
Field Summary
Modifier and TypeFieldDescriptionprotected final ActionPolicy
The primary ActionPolicy.protected final ActionPolicy
The secondary ActionPolicy. -
Constructor Summary
ConstructorDescriptionCompositeActionPolicy
(ActionPolicy policyPrimary, ActionPolicy policySecondary) Construct a CompositeActionPolicy representing the specified policies. -
Method Summary
Modifier and TypeMethodDescriptionReturn the primary policy.Return the secondary policy.void
Called when the specified service loads and configures this policy.boolean
Evaluate if the specified action is currently allowed by this policy.Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
Methods inherited from interface com.tangosol.net.ActionPolicy
toString
-
Field Details
-
f_policyPrimary
The primary ActionPolicy. -
f_policySecondary
The secondary ActionPolicy.
-
-
Constructor Details
-
CompositeActionPolicy
Construct a CompositeActionPolicy representing the specified policies.- Parameters:
policyPrimary
- the first policy to consultpolicySecondary
- the second policy to consult
-
-
Method Details
-
init
Called when the specified service loads and configures this policy.Note: A policy could be applied to multiple services.
- Specified by:
init
in interfaceActionPolicy
- Parameters:
service
- the service that this policy applies to
-
isAllowed
Evaluate if the specified action is currently allowed by this policy.Note: for forward compatibility, implementations should generally return true for actions that are not recognized.
- Specified by:
isAllowed
in interfaceActionPolicy
- Parameters:
service
- the service that is performing the actionaction
- the action that is being performed- Returns:
- true iff the specified action is currently allowed by this policy
-
getPrimaryPolicy
Return the primary policy.- Returns:
- the primary policy
-
getSecondaryPolicy
Return the secondary policy.- Returns:
- the secondary policy
-