@Deprecated public class PolicyEvaluator extends Object
PolicyEvaluator
evaluates policies
and provides policy decisions.Modifier and Type | Field and Description |
---|---|
static String |
ADVICING_ORGANIZATION
Deprecated.
|
static String |
ALL_RESOURCES
Deprecated.
Constant used to identity all the resources of a service type.
|
static int |
DEFAULT_RESULTS_CACHE_RESOURCE_CAP
Deprecated.
|
static int |
DEFAULT_RESULTS_CACHE_SESSION_CAP
Deprecated.
|
static String |
EMPTY_RESOURCE_NAME
Deprecated.
Constant used to identity empty resource
|
static String |
REALM_DN
Deprecated.
Constant used for key to pass the realm DN in the env map, so that Condition(s)
can look up the relevant
PolicyConfig config map, if necessary. |
static String |
RESULTS_CACHE_RESOURCE_CAP
Deprecated.
|
static String |
RESULTS_CACHE_SESSION_CAP
Deprecated.
|
static int |
resultsCacheResourceCap
Deprecated.
|
static int |
resultsCacheSessionCap
Deprecated.
|
static SSOTokenListener |
ssoListener
Deprecated.
listener object to be used in cleaning up the
userNSRoleCache, subjectEvaluationCache , user role
cache in LDAPRoles and policyResultsCache
upon user token expiration.
|
static Map |
ssoListenerRegistry
Deprecated.
|
static String |
SUN_AM_ORIGINAL_REQUESTED_RESOURCE
Deprecated.
Constant used for key to pass the requested resource name uncanonicalized
in the env map, so that Condition(s)/ResponseProvider(s) could use
the requested resource name, if necessary
|
static String |
SUN_AM_REQUESTED_ACTIONS
Deprecated.
Constant used for key to pass the requested actions names
in the env map, so that Condition(s)/ResponseProvider(s) could use
the requested actions names, if necessary
|
static String |
SUN_AM_REQUESTED_RESOURCE
Deprecated.
Constant used for key to pass the requested resource name canonicalized
in the env map, so that Condition(s)/ResponseProvider(s) could use
the requested resource name, if necessary
|
Constructor and Description |
---|
PolicyEvaluator(String serviceTypeName)
Deprecated.
Constructor to create a
PolicyEvaluator given the
ServiceType name. |
PolicyEvaluator(String orgName,
String serviceTypeName)
Deprecated.
Constructor to create a
PolicyEvaluator given organization
name and the ServiceType name. |
PolicyEvaluator(String orgName,
String serviceTypeName,
String applicationName)
Deprecated.
Creates a new policy evaluator instance.
|
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)
Deprecated.
Evaluates privileges of the user to perform the specified actions
on the specified resource.
|
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 |
getProtectedResourcesIgnoreConditions(SSOToken token,
String rootResource)
Deprecated.
Gets protected resources for a user identified by single sign on token
Conditions defined in the policies are ignored while
computing protected resources.
|
Set |
getResourceNames(SSOToken token,
String resourceName,
boolean followReferral)
Deprecated.
Gets resource names that are exact matches, sub resources or
wild card matches of argument resource name.
|
Set |
getResourceNames(SSOToken token,
String resourceName,
boolean followReferral,
Set visitedOrgs)
Deprecated.
Gets resource names that are exact matches, sub resources or
wild card matches of argument resource name.
|
ResourceResult |
getResourceResult(SSOToken token,
String resourceName,
String scope,
Map envParameters)
Deprecated.
Use
getResourceResults() |
Set |
getResourceResults(SSOToken token,
String resourceName,
String scope,
Map envParameters)
Deprecated.
Gets resource result objects given a resource name.
|
static Set |
getUserNSRoleValues(SSOToken token)
Deprecated.
Get the set of role DNs of a user.
|
boolean |
isAllowed(SSOToken token,
String resourceName,
String actionName)
Deprecated.
Evaluates a simple privilege of boolean type.
|
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 ADVICING_ORGANIZATION
public static final String EMPTY_RESOURCE_NAME
public static final String SUN_AM_REQUESTED_RESOURCE
public static final String SUN_AM_ORIGINAL_REQUESTED_RESOURCE
public static final String SUN_AM_REQUESTED_ACTIONS
public static final String REALM_DN
PolicyConfig
config map, if necessary.
LDAPFilterCondition
needs to use PolicyConfig config map.public static final String RESULTS_CACHE_SESSION_CAP
public static int DEFAULT_RESULTS_CACHE_SESSION_CAP
public static int resultsCacheSessionCap
public static final String RESULTS_CACHE_RESOURCE_CAP
public static int DEFAULT_RESULTS_CACHE_RESOURCE_CAP
public static int resultsCacheResourceCap
public static Map ssoListenerRegistry
public static SSOTokenListener ssoListener
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 PolicyEvaluator(String orgName, String serviceTypeName) throws SSOException, PolicyException, NameNotFoundException
PolicyEvaluator
given organization
name and the ServiceType
name.orgName
- the name of the organization under which the evaluation
is being doneserviceTypeName
- the name of the ServiceType
for
which this evaluator can be used.SSOException
PolicyException
NameNotFoundException
public PolicyEvaluator(String orgName, String serviceTypeName, String applicationName) throws PolicyException, SSOException
orgName
- the name of the organization under which the evaluation is being doneserviceTypeName
- the name of the ServiceType
for which this evaluator can be usedapplicationName
- the application name containing the policies in questionPolicyException
- should some error occur constructor the evaluatorSSOException
- should some error occur with regards to any SSO tokenpublic boolean isAllowed(SSOToken token, String resourceName, String actionName) throws PolicyException, SSOException
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 resourceSSOException
- single-sign-on token invalid or expiredPolicyException
public 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) throws PolicyException, SSOException
token
- single sign on token of the user evaluating policiesresourceName
- name of the resource the user is trying to accessactionNames
- a Set
of Sting
objects
representing names of the actions the user is trying to perform on
the resourceSSOException
- single-sign-on token invalid or expiredPolicyException
- for any other abnormal condition.public 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 getProtectedResourcesIgnoreConditions(SSOToken token, String rootResource) throws SSOException, PolicyException
rootResource
or equal to the given rootResource
would be returned.
If all policies applicable to a resource are
only referral policies, no ProtectedResource
would be
returned for such a resource.token
- single sign on token of the userrootResource
- only resources that are sub resources of the
given rootResource
or equal to the
given rootResource
would be returned
rootResource
would be returned.
If PolicyEvaluator.ALL_RESOURCES
is
passed as rootResource
, resources under
all root resources of the service
type are considered while computing protected
resources.Set
of protected resources. The set
contains ProtectedResource
objects.SSOException
- if single sign on token is invalidPolicyException
- for any other abnormal conditionProtectedResource
public Set getResourceResults(SSOToken token, 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.token
- 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 ResourceResult getResourceResult(SSOToken token, String resourceName, String scope, Map envParameters) throws SSOException, PolicyException
getResourceResults()
ResourceResult
is a tree representation of policy decisions for all resources rooted
at the resource name.
To determine whether a resource defined in the policy
is a sub resource of argument resource name, argument resource name
and policy resource name are compared, treating wild characters as
literals. If comparison resulted in EXACT_MACTH
or
SUB_RESOURCE_MACTH
, the resource would be includedtoken
- 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
or
ResourceResult.STRICT_SUBTREE_SCOPE
, the method
will return a ResourceResult
object that
contains the policy decisions regarding the
resourceName
and its sub resources.
If the scope is ResourceResult.SELF_SCOPE
, the
method will return a ResourceResult
object that
contains the policy decision regarding the
resourceName
only. Note, scope values
ResourceResult.SUBTREE_SCOPE
and
ResourceResult.STRICT_SUBTREE_SCOPE
are being
treated as the same for backword compatibility reasons. This
method is being deprecated. The method
getResourceResults()
should be used instead.envParameters
- run-time environment parametersResourceResult
.SSOException
- 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 Set getResourceNames(SSOToken token, String resourceName, boolean followReferral) throws PolicyException, SSOException
EXACT_MATCH
, WILD_CARD_MACTH
or
SUB_RESOURCE_MACTH
, the resource result would be
included.token
- single sign on tokenresourceName
- resoure namefollowReferral
- indicates whether to follow the referrals
defined in policies to compute resource namesresourceName
.
The return value would also include the
resourceName
.SSOException
- if token
is invalidPolicyException
- for any other abnormal conditionResourceMatch.EXACT_MATCH
,
ResourceMatch.SUB_RESOURCE_MATCH
,
ResourceMatch.WILDCARD_MATCH
public Set getResourceNames(SSOToken token, String resourceName, boolean followReferral, Set visitedOrgs) throws PolicyException, SSOException
EXACT_MATCH
, WILD_CARD_MACTH
or
SUB_RESOURCE_MACTH
, the resource result would be
included.token
- single sign on tokenresourceName
- resoure namefollowReferral
- indicates whether to follow the referrals
defined in policies to compute resource namesvisitedOrgs
- organizations that were already visited to
compute resource namesresourceName
.
The return value would also include the
resourceName
.SSOException
- if token
is invalidPolicyException
- for any other abnormal conditionResourceMatch.EXACT_MATCH
,
ResourceMatch.SUB_RESOURCE_MATCH
,
ResourceMatch.WILDCARD_MATCH
public void addPolicyListener(PolicyListener policyListener)
policyListener
- the listener to be addedpublic void removePolicyListener(PolicyListener policyListener)
policyListener
- the listener to be removedpublic static Set getUserNSRoleValues(SSOToken token) throws SSOException, PolicyException
token
- single sign on token of the user evaluating policiesnsRole
attribute valuesSSOException
- single-sign-on token invalid or expiredPolicyException
- if an error occured while getting the
user's nsRole attribute value setCopyright © 2010–2025 Open Identity Platform Community. All rights reserved.