@Deprecated public class Rule extends Object implements Cloneable
Rule
provides interfaces to manage
a rule that can be added to a policy.
A rule constains the rule name, service type,
a resource and a map containing action names and action values.Constructor and Description |
---|
Rule(String serviceName,
Map actions)
Deprecated.
Constructor to create a rule object with the
service 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 ruleName,
String serviceName,
String resourceName,
Map actions)
Deprecated.
Constructor to create a rule object with rule name,
service name, resource name and actions.
|
Modifier and Type | Method and Description |
---|---|
Set |
getActionNames()
Deprecated.
Returns the action names that have been set for the rule.
|
Map |
getActionValues()
Deprecated.
Returns a
Map 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.
|
public Rule(String serviceName, String resourceName, Map actions) throws NameNotFoundException, InvalidNameException
Map
must have the action
name as key and a Set
of String
s
as its value. The action names and action values must
conform to the schema specified for the service.
Otherwise, InvalidNameException
is thrown. The parameters ruleName
and resourceName
can be null
.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 resourceNameNotFoundException
- the service name provided does
not existInvalidNameException
- the resource name, action name,
or values is not validpublic Rule(String serviceName, Map actions) throws NameNotFoundException, InvalidNameException
Map
must have the action
name as it key and a Set
of String
s
as its value. The action names and action values must
conform to the schema specified for the service.
Otherwise, InvalidNameException
is thrown. The parameters ruleName
and resourceName
can be null
.serviceName
- name of the service type as defined by
the service schemaactions
- map of action and action values for the resourceNameNotFoundException
- the service name provided does
not existInvalidNameException
- the resource name, action name,
or values is not validpublic Rule(String ruleName, String serviceName, String resourceName, Map actions) throws NameNotFoundException, InvalidNameException
Map
must have the action
name as it key and a Set
of String
s
as its value. The action names and action values must
conform to the service schema.
Otherwise, InvalidNameException
is thrown. The parameters ruleName
and resourceName
can be null
.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 resourceNameNotFoundException
- the service name provided does
not existInvalidNameException
- the resource name, action name,
or values is not validpublic String getName()
null
if it was not constructed with a name.public void setName(String ruleName) throws InvalidNameException
ruleName
- rule name.InvalidNameException
- if rule name is invalid.public String getServiceTypeName()
public String getResourceName()
null
. The resource name of
the rule cannot be changed once the rule is created.public Set<String> getResourceNames()
null
. The resource name of
the rule cannot be changed once the rule is created.public void setResourceNames(Set<String> resourceNames)
null
. The resource name of
the rule cannot be changed once the rule is created.resourceNames
- resource namepublic Set getActionNames()
public Set getActionValues(String actionName) throws NameNotFoundException
actionName
- action name for which to compute values.NameNotFoundException
- if actions name is not
found in the rulepublic Map getActionValues()
Map
of all action names and their
corresponding action values that have been set in the rule.
The "key" of the Map
will be the action name
as a string, and its "value" will be a Set
which contains the action values as strings.public void setActionValues(Map actionValues) throws InvalidNameException
actionValues
- action names and their corresponding valuesInvalidNameException
- if action name is invalid.public String toXML()
Copyright © 2010-2018, ForgeRock All Rights Reserved.