Package com.sun.identity.policy.plugins
Class OrgReferral
- java.lang.Object
-
- com.sun.identity.policy.plugins.OrgReferral
-
- All Implemented Interfaces:
Referral
- Direct Known Subclasses:
PeerOrgReferral,SubOrgReferral
public abstract class OrgReferral extends Object implements Referral
An abstract class to facilitate policy referrals based on organization
-
-
Field Summary
Fields Modifier and Type Field Description protected Map_configurationMapprotected String_orgNameprotected CachecachedPolicyEvaluatorsprotected static StringCAN_NOT_GET_VALUES_FOR_REFERRALprotected static DebugDEBUG
-
Constructor Summary
Constructors Constructor Description OrgReferral()No argument constructor
-
Method Summary
All Methods Instance Methods Abstract Methods Concrete Methods Modifier and Type Method Description StringgetDisplayNameForValue(String value, Locale locale)Returns the display name for the value for the given locale.PolicyDecisiongetPolicyDecision(SSOToken token, String resourceType, String resourceName, Set actionNames, Map envParameters)Gets policy evaluation resultsabstract StringgetReferralTypeName()Gets the name of the ReferralTypeSetgetResourceNames(SSOToken token, String serviceTypeName, String resourceName)Gets resource names that are exact matches, sub resources or wild card matches of argument resource name.abstract ValidValuesgetValidValues(SSOToken token)Gets the valid values for this referralabstract ValidValuesgetValidValues(SSOToken token, String pattern)Gets the valid values for this referral matching a patternSetgetValues()Gets the values of this referralSyntaxgetValueSyntax(SSOToken token)Returns the syntax of the values theOrgReferralvoidinitialize(Map configurationMap)Initializes the referral with a map of Configuration parametersvoidsetValues(Set values)Sets the values of this referral.
-
-
-
Field Detail
-
DEBUG
protected static final Debug DEBUG
-
CAN_NOT_GET_VALUES_FOR_REFERRAL
protected static final String CAN_NOT_GET_VALUES_FOR_REFERRAL
- See Also:
- Constant Field Values
-
_configurationMap
protected Map _configurationMap
-
_orgName
protected String _orgName
-
cachedPolicyEvaluators
protected Cache cachedPolicyEvaluators
-
-
Method Detail
-
initialize
public void initialize(Map configurationMap)
Initializes the referral with a map of Configuration parameters- Specified by:
initializein interfaceReferral- Parameters:
configurationMap- a map containing configuration information. Each key of the map is a configuration parameter. Each value of the key would be a set of values for the parameter. The map is cloned and a reference to the clone is stored in the referral
-
setValues
public void setValues(Set values) throws InvalidNameException
Sets the values of this referral.- Specified by:
setValuesin interfaceReferral- Parameters:
values- a set of values for this referral Each element of the set has to be a String- Throws:
InvalidNameException- if any value passed in the values is invalid
-
getValues
public Set getValues()
Gets the values of this referral
-
getDisplayNameForValue
public String getDisplayNameForValue(String value, Locale locale) throws NameNotFoundException
Returns the display name for the value for the given locale. For all the valid values obtained through the methodsgetValidValuesthis method must be called by GUI and CLI to get the corresponding display name. Thelocalevariable could be used by the plugin to customize the display name for the given locale. Thelocalevariable could benull, in which case the plugin must use the default locale (most probabily en_US). This method returns only the display name and should not be used for the methodsetValues. Alternatively, if the plugin does not have to localize the value, it can just return thevalueas is.- Specified by:
getDisplayNameForValuein interfaceReferral- Parameters:
value- one of the valid value for the pluginlocale- locale for which the display name must be customized- Returns:
- the display name for the value for the given locale.
- Throws:
NameNotFoundException- if the givenvalueis not one of the valid values for the plugin
-
getValidValues
public abstract ValidValues getValidValues(SSOToken token) throws SSOException, PolicyException
Gets the valid values for this referral- Specified by:
getValidValuesin interfaceReferral- Parameters:
token- SSOToken- Returns:
ValidValuesobject- Throws:
SSOException- ifSSOToken>is not validPolicyException- if unable to get the list of valid names.
-
getValidValues
public abstract ValidValues getValidValues(SSOToken token, String pattern) throws SSOException, PolicyException
Gets the valid values for this referral matching a pattern- Specified by:
getValidValuesin interfaceReferral- Parameters:
token- SSOTokenpattern- a pattern to match against the value- Returns:
- ValidValues object
- Throws:
SSOException- ifSSOToken>is not validPolicyException- if unable to get the list of valid names.
-
getValueSyntax
public Syntax getValueSyntax(SSOToken token) throws SSOException, PolicyException
Returns the syntax of the values theOrgReferral- Specified by:
getValueSyntaxin interfaceReferral- Parameters:
token- theSSOTokenthat will be used to determine the syntax- Returns:
- set of of valid names for the referral.
- Throws:
SSOException- ifSSOToken>is not validPolicyException- See Also:
Syntax
-
getReferralTypeName
public abstract String getReferralTypeName()
Gets the name of the ReferralType- Specified by:
getReferralTypeNamein interfaceReferral- Returns:
- name of the ReferralType representing this referral
-
getPolicyDecision
public PolicyDecision getPolicyDecision(SSOToken token, String resourceType, String resourceName, Set actionNames, Map envParameters) throws SSOException, PolicyException
Gets policy evaluation results- Specified by:
getPolicyDecisionin interfaceReferral- Parameters:
token- SSOTokenresourceType- resource typeresourceName- name of the resourceactionNames- a set of action namesenvParameters- a map of enivronment parameters. Each key is an environment parameter name. Each value is a set of values for the parameter.- Returns:
- policy decision
- Throws:
SSOExceptionPolicyException
-
getResourceNames
public Set getResourceNames(SSOToken token, String serviceTypeName, String resourceName) throws PolicyException, SSOException
Gets resource names that are exact matches, sub resources or wild card matches of argument resource name. To determine whether to include a resource name of a resource, argument resource name and policy resource name are compared treating wild characters in the policy resource name as wild. If the comparsion resulted in EXACT_MATCH, WILD_CARD_MACTH or SUB_RESOURCE_MACTH, the resource result would be included.- Specified by:
getResourceNamesin interfaceReferral- Parameters:
token- sso tokenserviceTypeName- service type nameresourceName- resource name- Returns:
- names of sub resources for the given resourceName. The return value also includes the resourceName.
- Throws:
PolicyException- if unable to get the Set of resource names.SSOException- is the token is invalid.- See Also:
ResourceMatch.EXACT_MATCH,ResourceMatch.SUB_RESOURCE_MATCH,ResourceMatch.WILDCARD_MATCH
-
-