Class RulebaseElement

java.lang.Object
COM.TIBCO.hawk.config.rbengine.rulebase.RulebaseElement
All Implemented Interfaces:
Cloneable
Direct Known Subclasses:
Action, Rule, Rulebase, Test

public abstract class RulebaseElement extends Object implements Cloneable
This class is a super class of the major rulebase elements: Rulebase, Rule, Test, and Action. It provides methods to set and retrieve the element name and schedule. All subclasses, except Rulebase, provide a default name. All subclass can accept a schedule name which should match one of the available schedules defined in the Schedules configuration file used by the RuleBaseEngine.
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static String
     
  • Method Summary

    Modifier and Type
    Method
    Description
    abstract Object
    Returns a copy of this object
    boolean
    Compares two RulebaseElements for equality.
    protected void
    fromXML(COM.TIBCO.hawk.util.xml.XmlElementNode node)
    Read XML representation of the action from the XML node.
    protected void
    fromXML(Reader reader)
    Restore the config object using from Reader.
    protected void
    fromXML(String xmlBuffer)
    Restore the configuration object from a string containing XML object that was generated by toXML().
    Returns the name for this rulebase element.
    Returns the schedule name for this rulebase element.
    protected void
    loadFromFile(String xmlFileName, boolean throwExp)
    Restore the config object using from XML that was generated by toXML().
    protected void
    saveToFile(String fileName)
    Save the configuration object to the specific file.
    void
    Sets the name of this rulebase element.
    void
    setSchedule(String schedule)
    Set the schedule name of this rulebase element.
    protected String
    Return an XML string that may be used to restore the configuration object using fromXML.
    protected void
    toXML(COM.TIBCO.hawk.util.xml.XmlWriter out)
    Write XML representation of this object to the XML writer.
    protected void
    toXML(Writer writer)
    Write the object to writer in XML.

    Methods inherited from class java.lang.Object

    finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • CNAME

      public static String CNAME
  • Method Details

    • setName

      public void setName(String name)
      Sets the name of this rulebase element.
    • getName

      public String getName()
      Returns the name for this rulebase element.
    • setSchedule

      public void setSchedule(String schedule)
      Set the schedule name of this rulebase element.
    • getSchedule

      public String getSchedule()
      Returns the schedule name for this rulebase element.
    • equals

      public boolean equals(Object obj)
      Compares two RulebaseElements for equality.
      Overrides:
      equals in class Object
    • clone

      public abstract Object clone()
      Returns a copy of this object
      Overrides:
      clone in class Object
    • fromXML

      protected void fromXML(String xmlBuffer) throws RulebaseException
      Restore the configuration object from a string containing XML object that was generated by toXML().
      Parameters:
      xmlBuffer -
      Throws:
      RulebaseException
    • fromXML

      protected void fromXML(Reader reader) throws RulebaseException
      Restore the config object using from Reader. Reader input contain the XML represnetation of the configuration object.
      Throws:
      RulebaseException
    • fromXML

      protected void fromXML(COM.TIBCO.hawk.util.xml.XmlElementNode node) throws RulebaseException
      Read XML representation of the action from the XML node.
      Parameters:
      node - the XML node containing the action.
      Throws:
      RulebaseException
    • toXML

      protected String toXML()
      Return an XML string that may be used to restore the configuration object using fromXML.
      See Also:
    • toXML

      protected void toXML(Writer writer) throws RulebaseException
      Write the object to writer in XML.
      Throws:
      RulebaseException
    • toXML

      protected void toXML(COM.TIBCO.hawk.util.xml.XmlWriter out) throws IOException, RulebaseException
      Write XML representation of this object to the XML writer.
      Parameters:
      out - the XML writer where the output will be written.
      Throws:
      IOException
      RulebaseException
    • loadFromFile

      protected void loadFromFile(String xmlFileName, boolean throwExp) throws RulebaseException
      Restore the config object using from XML that was generated by toXML().
      Parameters:
      fileName - fileName of the file that contain the configuration object
      throwExp - if false, suppress throwing the exception while reading the object.
      Throws:
      RulebaseException
    • saveToFile

      protected void saveToFile(String fileName) throws RulebaseException
      Save the configuration object to the specific file.
      Parameters:
      fileName - fileName of the file that the configuration object will be written to.
      Throws:
      RulebaseException