@Deprecated public class PolicyEvaluator extends Object
PolicyEvaluator
evaluates policies
and provides policy decisions.Modifier and Type | Field and Description |
---|---|
static String |
ALL_RESOURCES
Deprecated.
Constant used to identity all the resources of a service type.
|
static String |
EMPTY_RESOURCE_NAME
Deprecated.
Constant used to identity empty resource
|
Constructor and Description |
---|
PolicyEvaluator(String serviceTypeName)
Deprecated.
Constructor to create a
PolicyEvaluator given the
ServiceType name. |
Modifier and Type | Method and Description |
---|---|
void |
addPolicyListener(PolicyListener policyListener)
Deprecated.
Adds a policy listener that would be notified whenever a policy
is added, removed or changed
|
PolicyDecision |
getPolicyDecision(SSOToken token,
String resourceName,
Set actionNames,
Map envParameters)
Deprecated.
Evaluates privileges of the user to perform the specified actions
on the specified resource.
|
Set |
getResourceResults(SSOToken userToken,
String resourceName,
String scope,
Map envParameters)
Deprecated.
Gets resource result objects given a resource name.
|
boolean |
isAllowed(SSOToken token,
String resourceName,
String actionName,
Map envParameters)
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.
|
public static final String ALL_RESOURCES
public static final String EMPTY_RESOURCE_NAME
public PolicyEvaluator(String serviceTypeName) throws SSOException, NameNotFoundException, PolicyException
PolicyEvaluator
given the
ServiceType
name.serviceTypeName
- the name of the ServiceType
for
which this evaluator can be used.SSOException
- if SSOToken
used by
PolicyEvaluator
is invalidNameNotFoundException
- if the service with name
serviceTypeName
is not foundPolicyException
- for any other abnormal conditionpublic boolean isAllowed(SSOToken token, String resourceName, String actionName, Map envParameters) throws SSOException, PolicyException
PolicyException
,
if the syntax for the actionName
is not declared to be
boolean, in the service schema.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 parametersSSOException
- single-sign-on token invalid or expiredPolicyException
- for any other abnormal conditionpublic PolicyDecision getPolicyDecision(SSOToken token, String resourceName, Set actionNames, Map envParameters) throws SSOException, PolicyException
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 parametersSSOException
- single-sign-on token invalid or expiredPolicyException
- for any other abnormal conditionpublic Set getResourceResults(SSOToken userToken, String resourceName, String scope, Map envParameters) throws SSOException, PolicyException
ResourceResult
objects for all resources
that would affect policy decisions for any resource associated with the
argument resource name. To determine whether to include the
ResourceResult
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 in
EXACT_MATCH
, WILD_CARD_MACTH
or
SUB_RESOURCE_MACTH
, the resource result would be
included.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 the resourceName
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 of ResourceResult
objects, one of them for the resourceName
and
its sub resources; the others are for resources that match
the resourceName
by wildcard. If the scope is
ResourceResult.STRICT_SUBTREE_SCOPE
, the
method will return a set object that contains one
ResourceResult
object. The
ResourceResult
contains the policy decisions
regarding the resourceName
and its sub
resources. If the scope is
ResourceResult.SELF_SCOPE
, the method will
return a set object that contains one
ResourceResult
object.
The ResourceResult
contains the policy decision
regarding the resourceName
only.envParameters
- run-time environment parametersResourceResult
objectsSSOException
- if token
is invalidPolicyException
- for any other abnormal conditionResourceMatch.EXACT_MATCH
,
ResourceMatch.SUB_RESOURCE_MATCH
,
ResourceMatch.WILDCARD_MATCH
,
ResourceResult.SUBTREE_SCOPE
,
ResourceResult.STRICT_SUBTREE_SCOPE
,
ResourceResult.SELF_SCOPE
public void addPolicyListener(PolicyListener policyListener)
policyListener
- the listener to be addedpublic void removePolicyListener(PolicyListener policyListener)
policyListener
- the listener to be removedCopyright © 2010-2018, ForgeRock All Rights Reserved.