Package com.sun.identity.policy
Class PolicyEvaluator
java.lang.Object
com.sun.identity.policy.PolicyEvaluator
Deprecated.
The class
PolicyEvaluator
evaluates policies
and provides policy decisions.-
Field Summary
-
Constructor Summary
ConstructorDescriptionPolicyEvaluator
(String serviceTypeName) Deprecated.Constructor to create aPolicyEvaluator
given theServiceType
name. -
Method Summary
Modifier and TypeMethodDescriptionvoid
addPolicyListener
(PolicyListener policyListener) Deprecated.Adds a policy listener that would be notified whenever a policy is added, removed or changedgetPolicyDecision
(SSOToken token, String resourceName, Set actionNames, Map envParameters) Deprecated.Evaluates privileges of the user to perform the specified actions on the specified resource.getResourceResults
(SSOToken userToken, String resourceName, String scope, Map envParameters) Deprecated.Gets resource result objects given a resource name.boolean
Deprecated.Evaluates simple privileges of boolean type.void
removePolicyListener
(PolicyListener policyListener) Deprecated.Removes a policy listener that was previously registered to receive notifications whenever a policy is added, removed or changed.
-
Field Details
-
ALL_RESOURCES
Deprecated.Constant used to identity all the resources of a service type. The resources include the sub resources of all resource prefixes of resource type- See Also:
-
EMPTY_RESOURCE_NAME
Deprecated.Constant used to identity empty resource- See Also:
-
-
Constructor Details
-
PolicyEvaluator
@Supported public PolicyEvaluator(String serviceTypeName) throws SSOException, NameNotFoundException, PolicyException Deprecated.Constructor to create aPolicyEvaluator
given theServiceType
name.- Parameters:
serviceTypeName
- the name of theServiceType
for which this evaluator can be used.- Throws:
SSOException
- ifSSOToken
used byPolicyEvaluator
is invalidNameNotFoundException
- if the service with nameserviceTypeName
is not foundPolicyException
- for any other abnormal condition
-
-
Method Details
-
isAllowed
@Supported public boolean isAllowed(SSOToken token, String resourceName, String actionName, Map envParameters) throws SSOException, PolicyException Deprecated.Evaluates simple privileges of boolean type. The privilege indicate if the user can perform specified action on the specified resource. The evaluation depends on user's application environment parameters. Invoking this method would result inPolicyException
, if the syntax for theactionName
is not declared to be boolean, in the service schema.- Parameters:
token
- single sign on token of the user evaluating policiesresourceName
- name of the resource the user is trying to accessactionName
- name of the action the user is trying to perform on the resourceenvParameters
- run-time environment parameters- Returns:
- the result of the evaluation as a boolean value
- Throws:
SSOException
- single-sign-on token invalid or expiredPolicyException
- for any other abnormal condition
-
getPolicyDecision
@Supported public PolicyDecision getPolicyDecision(SSOToken token, String resourceName, Set actionNames, Map envParameters) throws SSOException, PolicyException Deprecated.Evaluates privileges of the user to perform the specified actions on the specified resource. The evaluation depends on user's application environment parameters.- Parameters:
token
- single sign on token of the user evaluating policiesresourceName
- name of the resource the user is trying to accessactionNames
-Set
of names(String
) of the action the user is trying to perform on the resourceenvParameters
-Map
of run-time environment parameters- Returns:
- policy decision
- Throws:
SSOException
- single-sign-on token invalid or expiredPolicyException
- for any other abnormal condition
-
getResourceResults
@Supported public Set getResourceResults(SSOToken userToken, String resourceName, String scope, Map envParameters) throws SSOException, PolicyException Deprecated.Gets resource result objects given a resource name. The set containsResourceResult
objects for all resources that would affect policy decisions for any resource associated with the argument resource name. To determine whether to include theResourceResult
of a resource, we compare argument resource name and policy resource name, treating wild characters in the policy resource name as wild. If the comparison resulted inEXACT_MATCH
,WILD_CARD_MACTH
orSUB_RESOURCE_MACTH
, the resource result would be included.- Parameters:
userToken
- single sign on token of the user evaluating policiesresourceName
- name of the resourcescope
- indicates whether to compute the resource result based on the policy decision for only theresourceName
or all the resources associated with the resource name. The valid scope values are:ResourceResult.SUBTREE_SCOPE
ResourceResult.STRICT_SUBTREE_SCOPE
ResourceResult.SELF_SCOPE
ResourceResult.SUBTREE_SCOPE
, the method will return a set ofResourceResult
objects, one of them for theresourceName
and its sub resources; the others are for resources that match theresourceName
by wildcard. If the scope isResourceResult.STRICT_SUBTREE_SCOPE
, the method will return a set object that contains oneResourceResult
object. TheResourceResult
contains the policy decisions regarding theresourceName
and its sub resources. If the scope isResourceResult.SELF_SCOPE
, the method will return a set object that contains oneResourceResult
object. TheResourceResult
contains the policy decision regarding theresourceName
only.envParameters
- run-time environment parameters- Returns:
- set of
ResourceResult
objects - Throws:
SSOException
- iftoken
is invalidPolicyException
- for any other abnormal condition- See Also:
-
addPolicyListener
Deprecated.Adds a policy listener that would be notified whenever a policy is added, removed or changed- Parameters:
policyListener
- the listener to be added
-
removePolicyListener
Deprecated.Removes a policy listener that was previously registered to receive notifications whenever a policy is added, removed or changed. It is not an error to attempt to remove a listener that was not registered. It would return silently.- Parameters:
policyListener
- the listener to be removed
-
Evaluator
instead asEntitlement
has replacedPolicy
.