|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object | +--com.sun.identity.policy.Rule
The class 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 Summary | |
Rule(java.lang.String serviceName,
java.util.Map actions)
Constructor to create a rule object with the service name and actions. |
|
Rule(java.lang.String serviceName,
java.lang.String resourceName,
java.util.Map actions)
Constructor to create a rule object with the service name, resource name and actions. |
|
Rule(java.lang.String ruleName,
java.lang.String serviceName,
java.lang.String resourceName,
java.util.Map actions)
Constructor to create a rule object with rule name, service name, resource name and actions. |
Method Summary | |
java.util.Set |
getActionNames()
Returns the action names that have been set for the rule. |
java.util.Map |
getActionValues()
Returns a Map of all action names and their
corresponding action values that have been set in the rule. |
java.util.Set |
getActionValues(java.lang.String actionName)
Returns a set of action values that have been set for the specified action name. |
java.lang.String |
getName()
Returns the name assigned to the rule. |
java.lang.String |
getResourceName()
Returns the resource name for which the rule has been created. |
java.lang.String |
getServiceTypeName()
Returns the service name for which the rule has been created. |
void |
setActionValues(java.util.Map actionValues)
Sets the action names and their corresponding actions values (or permissions) for the resource or the service. |
void |
setName(java.lang.String ruleName)
Sets the name for the rule. |
java.lang.String |
toXML()
Returns an XML string representing the rule. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Constructor Detail |
public Rule(java.lang.String serviceName, java.lang.String resourceName, java.util.Map actions) throws NameNotFoundException, InvalidNameException
Map
must have the action
name as it key and a Set
containing strings
as its value. The action names and action values must
match the privileges defined by the service via its
SMS XML file. If they do not match, InvalidNameException
is thrown. Also the parameters ruleName
and resourceName
can be null
.serviceName
- name of the service type as defined by
the service's SMS XMLresourceName
- 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(java.lang.String serviceName, java.util.Map actions) throws NameNotFoundException, InvalidNameException
Map
must have the action
name as it key and a Set
containing strings
as its value. The action names and action values must
match the privileges defined by the service via its
SMS XML file. If they do not match, InvalidNameException
is thrown. Also the parameters ruleName
and resourceName
can be null
.serviceName
- name of the service type as defined by
the service's SMS XMLactions
- 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(java.lang.String ruleName, java.lang.String serviceName, java.lang.String resourceName, java.util.Map actions) throws NameNotFoundException, InvalidNameException
Map
must have the action
name as it key and a Set
containing strings
as its value. The action names and action values must
match the privileges defined by the service via its
SMS XML file. If they do not match, InvalidNameException
is thrown. Also the parameters ruleName
and resourceName
can be null
.ruleName
- name of the ruleserviceName
- name of the service type as defined by
the service's SMS XMLresourceName
- 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 validMethod Detail |
public java.lang.String getName()
null
if it was not constructed with a name.public void setName(java.lang.String ruleName) throws InvalidNameException
ruleName
- rule name.InvalidNameException
- if rule name is invalid.public java.lang.String getServiceTypeName()
public java.lang.String getResourceName()
null
. However the resource name of
the rule cannot be changed.public java.util.Set getActionNames()
public java.util.Set getActionValues(java.lang.String actionName) throws NameNotFoundException
actionName
- action name for which to compute values.NameNotFoundException
- if actions name is not
found in the rulepublic java.util.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(java.util.Map actionValues) throws InvalidNameException
actionValues
- action names and their corresponding valuesInvalidNameException
- if action name is invalid.public java.lang.String toXML()
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: INNER | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |