Package com.sun.identity.policy
Class Rule
- java.lang.Object
-
- com.sun.identity.policy.Rule
-
- All Implemented Interfaces:
Cloneable
@Supported @Deprecated public class Rule extends Object implements Cloneable
Deprecated.As of OpenSSO Express 8.0, usecom.sun.identity.entitlement
instead asEntitlement
has replacedPolicy
.The classRule
provides interfaces to manage a rule that can be added to a policy. A rule contains the rule name, service type, a resource and a map containing action names and action values.
-
-
Constructor Summary
Constructors Constructor Description Rule(String ruleName, String serviceName, String resourceName, Map actions)
Deprecated.Constructor to create a rule object with rule name, service name, resource name and actions.Rule(String serviceName, String resourceName, Map actions)
Deprecated.Constructor to create a rule object with the service name, resource name and actions.Rule(String serviceName, Map actions)
Deprecated.Constructor to create a rule object with the service name and actions.
-
Method Summary
All Methods Instance Methods Concrete Methods Deprecated Methods Modifier and Type Method Description Set
getActionNames()
Deprecated.Returns the action names that have been set for the rule.Map
getActionValues()
Deprecated.Returns aMap
of all action names and their corresponding action values that have been set in the rule.Set
getActionValues(String actionName)
Deprecated.Returns a set of action values that have been set for the specified action name.String
getName()
Deprecated.Returns the name assigned to the rule.String
getResourceName()
Deprecated.Returns the resource name for which the rule has been created.Set<String>
getResourceNames()
Deprecated.Returns the resource names for which the rule has been created.String
getServiceTypeName()
Deprecated.Returns the service name for which the rule has been created.void
setActionValues(Map actionValues)
Deprecated.Sets the action names and their corresponding actions values (or permissions) for the resource or the service.void
setName(String ruleName)
Deprecated.Sets the name for the rule.void
setResourceNames(Set<String> resourceNames)
Deprecated.Sets the resource names for which the rule has been created.String
toXML()
Deprecated.Returns an XML string representing the rule.
-
-
-
Constructor Detail
-
Rule
@Supported public Rule(String serviceName, String resourceName, Map actions) throws NameNotFoundException, InvalidNameException
Deprecated.Constructor to create a rule object with the service name, resource name and actions. The actions provided as aMap
must have the action name as key and aSet
ofString
s as its value. The action names and action values must conform to the schema specified for the service. Otherwise,InvalidNameException
is thrown. The parametersruleName
andresourceName
can benull
.- Parameters:
serviceName
- name of the service type as defined by the service schemaresourceName
- name of the resource for the service typeactions
- map of action and action values for the resource- Throws:
NameNotFoundException
- the service name provided does not existInvalidNameException
- the resource name, action name, or values is not valid
-
Rule
@Supported public Rule(String serviceName, Map actions) throws NameNotFoundException, InvalidNameException
Deprecated.Constructor to create a rule object with the service name and actions. This is useful for services (and possibly action names) that do not have resource names. The actions provided as aMap
must have the action name as it key and aSet
ofString
s as its value. The action names and action values must conform to the schema specified for the service. Otherwise,InvalidNameException
is thrown. The parametersruleName
andresourceName
can benull
.- Parameters:
serviceName
- name of the service type as defined by the service schemaactions
- map of action and action values for the resource- Throws:
NameNotFoundException
- the service name provided does not existInvalidNameException
- the resource name, action name, or values is not valid
-
Rule
@Supported public Rule(String ruleName, String serviceName, String resourceName, Map actions) throws NameNotFoundException, InvalidNameException
Deprecated.Constructor to create a rule object with rule name, service name, resource name and actions. The actions provided as aMap
must have the action name as it key and aSet
ofString
s as its value. The action names and action values must conform to the service schema. Otherwise,InvalidNameException
is thrown. The parametersruleName
andresourceName
can benull
.- Parameters:
ruleName
- name of the ruleserviceName
- name of the service type as defined by the service schemaresourceName
- name of the resource for the service typeactions
- map of action and action values for the resource- Throws:
NameNotFoundException
- the service name provided does not existInvalidNameException
- the resource name, action name, or values is not valid
-
-
Method Detail
-
getName
@Supported public String getName()
Deprecated.Returns the name assigned to the rule. It could benull
if it was not constructed with a name.- Returns:
- rule name
-
setName
@Supported public void setName(String ruleName) throws InvalidNameException
Deprecated.Sets the name for the rule. If a name has already been assigned, it will be replaced with the given name.- Parameters:
ruleName
- rule name.- Throws:
InvalidNameException
- if rule name is invalid.
-
getServiceTypeName
@Supported public String getServiceTypeName()
Deprecated.Returns the service name for which the rule has been created. The service name of the rule cannot be changed once the rule is created.- Returns:
- service name
-
getResourceName
@Supported public String getResourceName()
Deprecated.Returns the resource name for which the rule has been created. If the service does not support resource names, the method will returnnull
. The resource name of the rule cannot be changed once the rule is created.- Returns:
- resource name
-
getResourceNames
@Supported public Set<String> getResourceNames()
Deprecated.Returns the resource names for which the rule has been created. If the service does not support resource names, the method will returnnull
. The resource name of the rule cannot be changed once the rule is created.- Returns:
- resource name
-
setResourceNames
@Supported public void setResourceNames(Set<String> resourceNames)
Deprecated.Sets the resource names for which the rule has been created. If the service does not support resource names, the method will returnnull
. The resource name of the rule cannot be changed once the rule is created.- Parameters:
resourceNames
- resource name
-
getActionNames
@Supported public Set getActionNames()
Deprecated.Returns the action names that have been set for the rule. The action names returned could be the same as the service's action names or a subset of it.- Returns:
- action names defined in this rule for the service
-
getActionValues
@Supported public Set getActionValues(String actionName) throws NameNotFoundException
Deprecated.Returns a set of action values that have been set for the specified action name.- Parameters:
actionName
- action name for which to compute values.- Returns:
- action names defined in this rule for the service
- Throws:
NameNotFoundException
- if actions name is not found in the rule
-
getActionValues
@Supported public Map getActionValues()
Deprecated.Returns aMap
of all action names and their corresponding action values that have been set in the rule. The "key" of theMap
will be the action name as a string, and its "value" will be aSet
which contains the action values as strings.- Returns:
- all action names and corresponding action values
-
setActionValues
@Supported public void setActionValues(Map actionValues) throws InvalidNameException
Deprecated.Sets the action names and their corresponding actions values (or permissions) for the resource or the service.- Parameters:
actionValues
- action names and their corresponding values- Throws:
InvalidNameException
- if action name is invalid.
-
toXML
@Supported public String toXML()
Deprecated.Returns an XML string representing the rule.- Returns:
- an XML string representing the rule.
-
-