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
Fields -
Constructor Summary
ConstructorsConstructorDescriptionPolicyEvaluator(String serviceTypeName) Deprecated.Constructor to create aPolicyEvaluatorgiven theServiceTypename. -
Method Summary
Modifier and TypeMethodDescriptionvoidaddPolicyListener(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.booleanDeprecated.Evaluates simple privileges of boolean type.voidremovePolicyListener(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 aPolicyEvaluatorgiven theServiceTypename.- Parameters:
serviceTypeName- the name of theServiceTypefor which this evaluator can be used.- Throws:
SSOException- ifSSOTokenused byPolicyEvaluatoris invalidNameNotFoundException- if the service with nameserviceTypeNameis 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 theactionNameis 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-Setof names(String) of the action the user is trying to perform on the resourceenvParameters-Mapof 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 containsResourceResultobjects for all resources that would affect policy decisions for any resource associated with the argument resource name. To determine whether to include theResourceResultof 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_MACTHorSUB_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 theresourceNameor all the resources associated with the resource name. The valid scope values are:ResourceResult.SUBTREE_SCOPEResourceResult.STRICT_SUBTREE_SCOPEResourceResult.SELF_SCOPE
ResourceResult.SUBTREE_SCOPE, the method will return a set ofResourceResultobjects, one of them for theresourceNameand its sub resources; the others are for resources that match theresourceNameby wildcard. If the scope isResourceResult.STRICT_SUBTREE_SCOPE, the method will return a set object that contains oneResourceResultobject. TheResourceResultcontains the policy decisions regarding theresourceNameand its sub resources. If the scope isResourceResult.SELF_SCOPE, the method will return a set object that contains oneResourceResultobject. TheResourceResultcontains the policy decision regarding theresourceNameonly.envParameters- run-time environment parameters- Returns:
- set of
ResourceResultobjects - Throws:
SSOException- iftokenis 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
-
Evaluatorinstead asEntitlementhas replacedPolicy.