com.sun.identity.policy
クラス Rule

java.lang.Object
  上位を拡張 com.sun.identity.policy.Rule

public class Rule
extends Object

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.


コンストラクタの概要
Rule(String serviceName, Map actions)
          Constructor to create a rule object with the service name and actions.
Rule(String serviceName, String resourceName, Map actions)
          Constructor to create a rule object with the service name, resource name and actions.
Rule(String ruleName, String serviceName, String resourceName, Map actions)
          Constructor to create a rule object with rule name, service name, resource name and actions.
 
メソッドの概要
 Set getActionNames()
          Returns the action names that have been set for the rule.
 Map getActionValues()
          Returns a Map of all action names and their corresponding action values that have been set in the rule.
 Set getActionValues(String actionName)
          Returns a set of action values that have been set for the specified action name.
 String getName()
          Returns the name assigned to the rule.
 String getResourceName()
          Returns the resource name for which the rule has been created.
 String getServiceTypeName()
          Returns the service name for which the rule has been created.
 void setActionValues(Map actionValues)
          Sets the action names and their corresponding actions values (or permissions) for the resource or the service.
 void setName(String ruleName)
          Sets the name for the rule.
 String toXML()
          Returns an XML string representing the rule.
 

コンストラクタの詳細

Rule

public Rule(String serviceName,
            String resourceName,
            Map actions)
     throws NameNotFoundException,
            InvalidNameException
Constructor to create a rule object with the service name, resource name and actions. The actions provided as a Map must have the action name as key and a Set of Strings 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 schema
resourceName - name of the resource for the service type
actions - map of action and action values for the resource
例外:
NameNotFoundException - the service name provided does not exist
InvalidNameException - the resource name, action name, or values is not valid

Rule

public Rule(String serviceName,
            Map actions)
     throws NameNotFoundException,
            InvalidNameException
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 a Map must have the action name as it key and a Set of Strings 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 schema
actions - map of action and action values for the resource
例外:
NameNotFoundException - the service name provided does not exist
InvalidNameException - the resource name, action name, or values is not valid

Rule

public Rule(String ruleName,
            String serviceName,
            String resourceName,
            Map actions)
     throws NameNotFoundException,
            InvalidNameException
Constructor to create a rule object with rule name, service name, resource name and actions. The actions provided as a Map must have the action name as it key and a Set of Strings 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 rule
serviceName - name of the service type as defined by the service schema
resourceName - name of the resource for the service type
actions - map of action and action values for the resource
例外:
NameNotFoundException - the service name provided does not exist
InvalidNameException - the resource name, action name, or values is not valid
メソッドの詳細

getName

public String getName()
Returns the name assigned to the rule. It could be null if it was not constructed with a name.

戻り値:
rule name

setName

public void setName(String ruleName)
             throws InvalidNameException
Sets the name for the rule. If a name has already been assigned, it will be replaced with the given name.

パラメータ:
ruleName - rule name.
例外:
InvalidNameException - if rule name is invalid.

getServiceTypeName

public String getServiceTypeName()
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.

戻り値:
service name

getResourceName

public String getResourceName()
Returns the resource name for which the rule has been created. If the service does not support resource names, the method will return null. The resource name of the rule cannot be changed once the rule is created.

戻り値:
resource name

getActionNames

public Set getActionNames()
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.

戻り値:
action names defined in this rule for the service

getActionValues

public Set getActionValues(String actionName)
                    throws NameNotFoundException
Returns a set of action values that have been set for the specified action name.

パラメータ:
actionName - action name for which to compute values.
戻り値:
action names defined in this rule for the service
例外:
NameNotFoundException - if actions name is not found in the rule

getActionValues

public Map getActionValues()
Returns a 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.

戻り値:
all action names and corresponding action values

setActionValues

public void setActionValues(Map actionValues)
                     throws InvalidNameException
Sets the action names and their corresponding actions values (or permissions) for the resource or the service.

パラメータ:
actionValues - action names and their corresponding values
例外:
InvalidNameException - if action name is invalid.

toXML

public String toXML()
Returns an XML string representing the rule.

戻り値:
an XML string representing the rule.