Rule Execution Server API

ilog.rules.res.model.mbean
Interface IlrJMXRuleAppMBean

All Superinterfaces:
IlrJMXEntityMBean

public interface IlrJMXRuleAppMBean
extends IlrJMXEntityMBean

IlrJMXRuleAppMBean represents a RuleApp entity in the Rule Execution Server management model. Use the RuleApp entity to create, list, and remove rulesets, as well as manage properties. It can also be used to create RuleApp archives.

A JMX notification is sent if a property is changed on an MBean instance (on the call of the method setProperty). The notification type is IlrJMXRuleAppMBean.NOTIFICATION_PROPERTY_CHANGE. The message contains the property key that has been changed. The new value of the property is retrieved from userData (null if the property has been removed).

For example to retrieve a deployed RuleApp:

 public IlrJMXRuleAppMBean getRuleAppMBean(ObjectName ruleappMBeanName) {
        return (IlrJMXRuleAppMBean) Proxy.newProxyInstance(IlrJMXRuleAppMBean.class.getClassLoader(),
                new Class[] { IlrJMXRuleAppMBean.class }, createHandler(ruleappMBeanName));
 }
 

See Also:
IlrJMXRulesetMBean, IlrJMXRepositoryMBean

Field Summary
static String KEY_NAME
          The property key for the RuleApp name in the objectName of all RuleApp MBeans.
static String KEY_VERSION
          The property key for the RuleApp version in the objectName of all RuleApp MBeans.
static String NOTIFICATION_PROPERTY_CHANGE
          Notification type if a property is changed.
static String VALUE_TYPE
          The type used in the objectName of all RuleApp MBeans.
 
Method Summary
 ObjectName addRuleset(String rulesetName, String rulesetVersion, byte[] rulesetArchive)
          Adds the specific version of a ruleset .
 ObjectName addRuleset(String rulesetName, String rulesetVersion, String engineType, byte[] rulesetArchive)
          Adds the specific version of a ruleset.
 byte[] export()
          Creates a RuleApp archive.
 ObjectName getGreatestRulesetObjectName(String rulesetName)
          Returns the greatest version of a specific ruleset.
 Properties getProperties()
          Returns all properties defined on this RuleApp.
 String getProperty(String key)
          Returns the property value specified by the key.
 ObjectName getRulesetObjectName(String rulesetName, String rulesetVersion)
          Returns a specific ruleset version.
 Set<ObjectName> getRulesetObjectNames()
          Returns all rulesets in the RuleApp.
 Set<ObjectName> getRulesetObjectNames(String rulesetName)
          Returns all rulesets with a specific name.
 boolean removeRuleset(String rulesetName, String rulesetVersion)
          Removes a the specific version of a ruleset.
 void setProperty(String key, String value)
          Sets the value corresponding to a key.
 
Methods inherited from interface ilog.rules.res.model.mbean.IlrJMXEntityMBean
getCreationDate, getDescription, getDisplayName, getModelObjectName, getName, getRepositoryObjectName, getVersion, setDescription, setDisplayName
 

Field Detail

VALUE_TYPE

static final String VALUE_TYPE
The type used in the objectName of all RuleApp MBeans.

See Also:
Constant Field Values

KEY_NAME

static final String KEY_NAME
The property key for the RuleApp name in the objectName of all RuleApp MBeans.

See Also:
Constant Field Values

KEY_VERSION

static final String KEY_VERSION
The property key for the RuleApp version in the objectName of all RuleApp MBeans.

See Also:
Constant Field Values

NOTIFICATION_PROPERTY_CHANGE

static final String NOTIFICATION_PROPERTY_CHANGE
Notification type if a property is changed.

Since:
JRules 6.0
See Also:
Constant Field Values
Method Detail

getRulesetObjectNames

Set<ObjectName> getRulesetObjectNames()
Returns all rulesets in the RuleApp.

Returns:
A list of ObjectName instances.

getRulesetObjectNames

Set<ObjectName> getRulesetObjectNames(String rulesetName)
Returns all rulesets with a specific name.

Parameters:
rulesetName - The name of the ruleset.
Returns:
A set of ObjectName instances.

getGreatestRulesetObjectName

ObjectName getGreatestRulesetObjectName(String rulesetName)
Returns the greatest version of a specific ruleset.

Since:
JRules 6.0
Parameters:
rulesetName - The ruleset name.
Returns:
The ruleset objectname. If rulesetName does not exist, null is returned.

getRulesetObjectName

ObjectName getRulesetObjectName(String rulesetName,
                                String rulesetVersion)
Returns a specific ruleset version.

Parameters:
rulesetName - The ruleset name.
rulesetVersion - The ruleset version.
Returns:
The ruleset. If this ruleset version does not exist, null is returned.

addRuleset

ObjectName addRuleset(String rulesetName,
                      String rulesetVersion,
                      String engineType,
                      byte[] rulesetArchive)
                      throws InstanceAlreadyExistsException,
                             InvalidAttributeValueException,
                             OperationsException
Adds the specific version of a ruleset.

Throws:
InstanceAlreadyExistsException - if this ruleset already exists.
InvalidAttributeValueException - if the parameters are invalid.
OperationsException - If an internal error occurred.
Parameters:
rulesetName - The name of the ruleset. Must match the following regular expression [\p{Alpha}\p{Digit}_]+. (
rulesetVersion - The version in the format: "MajorNumber.MinorNumber". MajorNumber must be greater than 0. MinorNumber must be greater or equal to 0.
engineType - The engine type, either the classic rule engine or the decision engine. To get the values, call the IlrEngineType.toString() method.
rulesetArchive - The ruleset archive to add. This parameter cannot be null.
Returns:
The ruleset object name.

addRuleset

ObjectName addRuleset(String rulesetName,
                      String rulesetVersion,
                      byte[] rulesetArchive)
                      throws InstanceAlreadyExistsException,
                             InvalidAttributeValueException,
                             OperationsException
Adds the specific version of a ruleset .

Since:
JRules 6.0
Throws:
InstanceAlreadyExistsException - if this ruleset already exists.
InvalidAttributeValueException - if the parameters are invalid.
OperationsException - If an internal error occurred.
Parameters:
rulesetName - The name of the ruleset. Must match the following regular expression [\p{Alpha}\p{Digit}_]+.
rulesetVersion - The version in the format: "MajorNumber.MinorNumber". MajorNumber must be greater than 0. MinorNumber must be greater or equal to 0.
rulesetArchive - The ruleset archive to add. This parameter cannot be null.
Returns:
The ruleset object name.

removeRuleset

boolean removeRuleset(String rulesetName,
                      String rulesetVersion)
                      throws OperationsException
Removes a the specific version of a ruleset.

Throws:
OperationsException - if an internal error occurred.
Parameters:
rulesetName - The ruleset name.
rulesetVersion - The version.
Returns:
If rulesetVersion of rulesetName has been removed, true is returned. If this ruleset does not exist, false is returned.

getProperty

String getProperty(String key)
                   throws OperationsException
Returns the property value specified by the key.

Since:
JRules 6.0
Throws:
OperationsException - if a data access error occurred.
Parameters:
key - The property key.
Returns:
The property value.

getProperties

Properties getProperties()
                         throws OperationsException
Returns all properties defined on this RuleApp.

Since:
JRules 6.0
Throws:
OperationsException - if a data access error occurred.
Returns:
All properties.

setProperty

void setProperty(String key,
                 String value)
                 throws OperationsException
Sets the value corresponding to a key.

Since:
JRules 6.0
Throws:
OperationsException - if a data access error occurred.
Parameters:
key - The key to be placed into the property list.
value - The value corresponding to key.

export

byte[] export()
              throws OperationsException
Creates a RuleApp archive.

Throws:
IOException - if an IOException occurs during RuleApp archive creation.
OperationsException - if an internal error occurs.
Returns:
An archive in a byte array.

Rule Execution Server API

© Copyright IBM Corp. 1987, 2013