public class Rulebase extends RulebaseElement implements RBEConfigObject
The author and lastModification attributes are maintained by convention. Your code should set the author when a new rulebase is constructed. It should also record last modification information each time the rulebase is modified.
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
CNAME |
static java.lang.String |
FILE_EXTENSION |
Constructor and Description |
---|
Rulebase(java.io.Reader reader)
Construct the ruleBase object from a reader.
|
Rulebase(java.lang.String name,
Rule[] rules)
Constructs a Rulebase.
|
Modifier and Type | Method and Description |
---|---|
Rulebase |
applyVariables(java.util.Properties variables)
Substitutes variable in the rulebase with the key:value pairs in the variables.
|
java.lang.Object |
clone()
Returns a copy of this object
|
boolean |
equals(java.lang.Object obj)
Compare the specified object with this rulebase.
|
java.lang.String |
getAuthor()
Returns the author of the rulebase.
|
long |
getChecksum()
Returns the checksum of the config object
|
java.lang.String[] |
getCommands()
Returns the command list of a rulebase.
|
java.lang.String |
getComment()
Returns the rulebase comment.
|
java.lang.String |
getFileExtension()
Returns file extension based on the configuration object type.
|
java.lang.String[] |
getIncludedRulebases()
Returns the rulebase include list.
|
java.lang.String |
getLastModification()
Returns the last modification string.
|
Rule[] |
getRules()
Returns the list of Rule objects that
make up this rulebase.
|
void |
setAuthor(java.lang.String author)
Sets the author
|
void |
setCommands(java.lang.String[] commands)
Sets the commands list.
|
void |
setComment(java.lang.String comment)
Sets the comment.
|
void |
setIncludedRulebases(java.lang.String[] rbNames)
Sets the include rulebase list.
|
void |
setLastModification(java.lang.String mod)
Sets the last modification record.
|
void |
setName(java.lang.String name)
Sets the name of this rulebase element.
|
void |
setRules(Rule[] rules)
Sets the list of Rule objects that
make up this rulebase.
|
static java.lang.String |
substituteValues(java.lang.String source,
java.util.Properties prop)
substitues keys with values in the input
|
java.lang.String |
toString()
Returns the string representation of the parameter.
|
void |
toXML(java.io.Writer writer)
Write the configuration object to the writer in XML.
|
getName, getSchedule, setSchedule
getClass, hashCode, notify, notifyAll, wait, wait, wait
getName
public static java.lang.String CNAME
public static final java.lang.String FILE_EXTENSION
public Rulebase(java.io.Reader reader) throws RulebaseException
reader
- the input reader of the configuration object in XML
representation.RulebaseException
- if error encountered when creating rulebase
from the readerpublic Rulebase(java.lang.String name, Rule[] rules)
name
- the rulebase name, it must contain only alpha-numeric
characters, "_", "-", and no spaces.rules
- an array of Rule objects, all rules must have unique names.java.lang.IllegalArgumentException
- if either argument is nulljava.lang.IllegalArgumentException
- if name contains illegal charactersjava.lang.IllegalArgumentException
- if any of the rule names are not uniquepublic java.lang.String getFileExtension()
getFileExtension
in interface RBEConfigObject
public void toXML(java.io.Writer writer) throws RulebaseException
toXML
in interface RBEConfigObject
RulebaseException
public java.lang.String toString()
toString
in class java.lang.Object
public void setName(java.lang.String name)
setName
in class RulebaseElement
java.lang.IllegalArgumentException
- if name contains illegal characterspublic void setAuthor(java.lang.String author)
public java.lang.String getAuthor()
public void setLastModification(java.lang.String mod)
public java.lang.String getLastModification()
public void setComment(java.lang.String comment)
public java.lang.String getComment()
public void setRules(Rule[] rules) throws java.lang.IllegalArgumentException
rules
- the array of rules, may not be null, all names must be uniquejava.lang.IllegalArgumentException
- if rules is nulljava.lang.IllegalArgumentException
- if the rule names are not uniquepublic Rule[] getRules()
public void setIncludedRulebases(java.lang.String[] rbNames) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public java.lang.String[] getIncludedRulebases()
public void setCommands(java.lang.String[] commands) throws java.lang.IllegalArgumentException
java.lang.IllegalArgumentException
public java.lang.String[] getCommands()
public Rulebase applyVariables(java.util.Properties variables) throws java.io.IOException
variables
- a list of key:value pairs of the variables to be substituted.java.io.IOException
- if there is an error substituting rulebase variables.public boolean equals(java.lang.Object obj)
equals
in class RulebaseElement
obj
- the object to compare withpublic long getChecksum()
getChecksum
in interface RBEConfigObject
public java.lang.Object clone()
clone
in class RulebaseElement
public static java.lang.String substituteValues(java.lang.String source, java.util.Properties prop) throws java.lang.Exception
input
- prop
- REPLACES KEY with VALUESjava.lang.Exception
Copyright © 2000-2019 TIBCO Inc. All Rights Reserved.