# com.bea.p13n.controls.rules
RulesManagerControl Interface

public interface RulesManagerControl
extends `Control`

This control defines the API for accessing and managing rules and rulesets for the portal rules manager. It is intended to be used only by portal system administrators. Rulesets are stored in the Portal data repository and are updated using data sync. They are loaded automatically when the server starts. To facilitate loading rulesets via data sync, simply place the ruleset file (generally ends with .rls) into the application's META-INF/data directory. For better organization, you may place the rulesets into a subdirectory, such as META-INF/data/rulesets. The ruleset uri is relative to the META-INF/data directory. Because this control requires the caller be in an authorized role, it cannot be used from a JWS.
Security requirements: The caller must be in the role of "PortalSystemAdministrator" to invoke all of these methods

All Superinterfaces
  `Control`, `Control`, `Serializable`

## Method Summary

`public `String`` | `getRuleDescription`(`String` rulesetUri, `String` ruleName) Retrieves the desrciption of the rule within the named ruleset
`public `Collection`` | `getRuleSets`() Retrieves an immutable `Collection` containing the URI strings of all the rule sets available in the rule set repository subsystem.
`public `String`` | `getRuleSetXml`(`String` ruleSetUri) Retrieves the rule set as an XML String
`public `String`[]` | `getRulesForRuleSet`(`String` rulesetUri) Retrieves an array rule names for a given ruleset

## Method Detail

### getRuleDescription(String, String) Method

    public String getRuleDescription(String rulesetUri,
                                     String ruleName)
         throws RuleSetNotFoundException, ApplicationException, IllegalArgumentException, P13nControlException

Retrieves the desrciption of the rule within the named ruleset

#### Parameters

rulesetUri
  uri of the ruleset, relative to the application's META-INF/data directory

ruleName
  rule name

#### Returns

the description of the rule.

#### Exceptions

``RuleSetNotFoundException``
  if the rule set referenced by the supplied URI cannot be located by the rule set repository subsystem.
``ApplicationException``
  if the rule set repository subsystem is unable to retrieve the rule set.
``IllegalArgumentException``
  if the `ruleSetUri` is an invalid rule set URI or if the format is not supported.
``P13nControlException``
  if remote errors are encountered.

### getRuleSets() Method

    public Collection getRuleSets()
         throws ApplicationException, P13nControlException

Retrieves an immutable `Collection` containing the URI strings of all the rule sets available in the rule set repository subsystem.
The rule sets represented by the returned URI strings may then be retrieved by supplying each returned rule set URI string to the `getRuleSet` method.

#### Returns

a `Collection` of all rule set URI strings.

#### Exceptions

``ApplicationException``
  if the rule set repository subsystem is unable to retrieve the rule set URI strings.
``P13nControlException``
  if remote errors are encountered.

### getRuleSetXml(String) Method

    public String getRuleSetXml(String ruleSetUri)
         throws IllegalArgumentException, RuleSetNotFoundException, ApplicationException, P13nControlException

Retrieves the rule set as an XML String

#### Parameters

ruleSetUri
  the URI of the target rule set.

#### Returns

the rule set as an XML String.

#### Exceptions

``IllegalArgumentException``
  if the `ruleSetUri` is an invalid rule set URI or if the format is not supported.
``RuleSetNotFoundException``
  if the rule set referenced by the supplied URI cannot be located by the rule set repository subsystem.
``ApplicationException``
  if the rule set repository subsystem is unable to retrieve the rule set.
``P13nControlException``
  if remote errors are encountered.

### getRulesForRuleSet(String) Method

    public String[] getRulesForRuleSet(String rulesetUri)
         throws ApplicationException, P13nControlException

Retrieves an array rule names for a given ruleset

#### Parameters

rulesetUri
  uri of the ruleset, relative to the application's META-INF/data directory

#### Returns

an array of all rules for the named ruleset uri.

#### Exceptions

``ApplicationException``
  if the rule set repository subsystem is unable to retrieve the rule set URI strings.if the rule set repository subsystem is unable to retrieve the rule set URI strings.
``P13nControlException``
  if remote errors are encountered.