Class PolicyResponseProvider
- java.lang.Object
-
- com.sun.identity.entitlement.opensso.PolicyResponseProvider
-
- All Implemented Interfaces:
ResourceAttribute
public class PolicyResponseProvider extends Object implements ResourceAttribute
This class is used to wrap legacy response providers from previous OpenAM versions and makes them available to the OpenAM entitlement framework. Note that this class is only used for custom Response Provider implementations.- Author:
- Steve Ferris
-
-
Constructor Summary
Constructors Constructor Description PolicyResponseProvider()Default constructorPolicyResponseProvider(String pResponseProviderName, String className, String propertyName, Set<String> propertyValues)Used by the entitlement framework to create an instance of this class
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description Map<String,Set<String>>evaluate(Subject adminSubject, String realm, Subject subject, String resourceName, Map<String,Set<String>> environment)Called by the entitlements framework to fetch its resource attributes; cascades the call through to the configured response provider implementationStringgetClassName()Returns the name of the underlying response provider implementationStringgetPResponseProviderName()Return the response provider nameStringgetPropertyName()Get the name of the property associated with this wrapper.Set<String>getPropertyValues()Get the name of the property values for this wrapperResponseProvidergetResponseProvider()Constructs a legacy response provider based on the information in this adapter.StringgetState()Returns the state of the wrapper in a JSON representationvoidsetPResponseProviderName(String pResponseProviderName)Sets the name of the response provider within the policyvoidsetPropertyName(String name)Set the name of the property associated with this wrappervoidsetPropertyValues(Set<String> propertyValues)Sets the property values associated with this wrappervoidsetState(String state)Given a JSON state representation, updates the class appropriatelyStringtoString()
-
-
-
Constructor Detail
-
PolicyResponseProvider
public PolicyResponseProvider()
Default constructor
-
PolicyResponseProvider
public PolicyResponseProvider(String pResponseProviderName, String className, String propertyName, Set<String> propertyValues)
Used by the entitlement framework to create an instance of this class- Parameters:
pResponseProviderName- The name of the instance of the rpclassName- The underlying (custom) policypropertyName- The name of the property for this wrapperpropertyValues- The set of values for this wrapper
-
-
Method Detail
-
getClassName
public String getClassName()
Returns the name of the underlying response provider implementation- Returns:
- The class name
-
setPropertyName
public void setPropertyName(String name)
Set the name of the property associated with this wrapper- Specified by:
setPropertyNamein interfaceResourceAttribute- Parameters:
name- The property name
-
getPropertyName
public String getPropertyName()
Get the name of the property associated with this wrapper.- Specified by:
getPropertyNamein interfaceResourceAttribute- Returns:
- The property name
-
getPropertyValues
public Set<String> getPropertyValues()
Get the name of the property values for this wrapper- Specified by:
getPropertyValuesin interfaceResourceAttribute- Returns:
- The property values
-
setPropertyValues
public void setPropertyValues(Set<String> propertyValues)
Sets the property values associated with this wrapper- Parameters:
propertyValues- The property values
-
evaluate
public Map<String,Set<String>> evaluate(Subject adminSubject, String realm, Subject subject, String resourceName, Map<String,Set<String>> environment) throws EntitlementException
Called by the entitlements framework to fetch its resource attributes; cascades the call through to the configured response provider implementation- Specified by:
evaluatein interfaceResourceAttribute- Parameters:
adminSubject- The admin user executing the policy evalrealm- The realm of the policy evalsubject- The user who is subject to the policy evalresourceName- The resource name of the policy evalenvironment- environment map from the policy eval client- Returns:
- The attributes (only one since resource attributes are singled)
- Throws:
EntitlementException
-
getResponseProvider
public ResponseProvider getResponseProvider() throws EntitlementException
Constructs a legacy response provider based on the information in this adapter.- Returns:
- the legacy response provider
- Throws:
EntitlementException- if an error occurs constructing the response provider.
-
setPResponseProviderName
public void setPResponseProviderName(String pResponseProviderName)
Sets the name of the response provider within the policy- Specified by:
setPResponseProviderNamein interfaceResourceAttribute- Parameters:
pResponseProviderName- The provider name
-
getPResponseProviderName
public String getPResponseProviderName()
Return the response provider name- Specified by:
getPResponseProviderNamein interfaceResourceAttribute- Returns:
- The provider name
-
getState
public String getState()
Returns the state of the wrapper in a JSON representation- Specified by:
getStatein interfaceResourceAttribute- Returns:
- the state in JSON format
-
setState
public void setState(String state)
Given a JSON state representation, updates the class appropriately- Specified by:
setStatein interfaceResourceAttribute- Parameters:
state-
-
-