TIBCO Hawk® Configuration Object API Reference

Software Release 4.9 November 2010 Important Information SOME TIBCO EMBEDS OR BUNDLES OTHER TIBCO SOFTWARE. USE OF SUCH EMBEDDED OR BUNDLED TIBCO SOFTWARE IS SOLELY TO ENABLE THE FUNCTIONALITY (OR PROVIDE LIMITED ADD-ON FUNCTIONALITY) OF THE LICENSED TIBCO SOFTWARE. THE EMBEDDED OR BUNDLED SOFTWARE IS NOT LICENSED TO BE USED OR ACCESSED BY ANY OTHER TIBCO SOFTWARE OR FOR ANY OTHER PURPOSE. USE OF TIBCO SOFTWARE AND THIS DOCUMENT IS SUBJECT TO THE TERMS AND CONDITIONS OF A LICENSE AGREEMENT FOUND IN EITHER A SEPARATELY EXECUTED SOFTWARE LICENSE AGREEMENT, OR, IF THERE IS NO SUCH SEPARATE AGREEMENT, THE CLICKWRAP END USER LICENSE AGREEMENT WHICH IS DISPLAYED DURING DOWNLOAD OR INSTALLATION OF THE SOFTWARE (AND WHICH IS DUPLICATED IN LICENSE FILE) OR IF THERE IS NO SUCH SOFTWARE LICENSE AGREEMENT OR CLICKWRAP END USER LICENSE AGREEMENT, THE LICENSE(S) LOCATED IN THE “LICENSE” FILE(S) OF THE SOFTWARE. USE OF THIS DOCUMENT IS SUBJECT TO THOSE TERMS AND CONDITIONS, AND YOUR USE HEREOF SHALL CONSTITUTE ACCEPTANCE OF AND AN AGREEMENT TO BE BOUND BY THE SAME. This document contains confidential information that is subject to U.S. and international copyright laws and treaties. No part of this document may be reproduced in any form without the written authorization of TIBCO Software Inc. TIBCO, The Power of Now, TIBCO ActiveMatrix BusinessWorks, TIBCO Hawk, TIBCO Designer, TIBCO Rendezvous, TIBCO Enterprise Message Service, TIBCO Runtime Agent, TIBCO Administrator, TIBCO ActiveEnterprise and TIBCO Repository are either registered trademarks or trademarks of TIBCO Software Inc. in the United States and/or other countries. EJB, Java EE, J2EE, and all Java-based trademarks and logos are trademarks or registered trademarks of Sun Microsystems, Inc. in the U.S. and other countries. All other product and company names and marks mentioned in this document are the property of their respective owners and are mentioned for identification purposes only. THIS SOFTWARE MAY BE AVAILABLE ON MULTIPLE OPERATING SYSTEMS. HOWEVER, NOT ALL OPERATING SYSTEM PLATFORMS FOR A SPECIFIC SOFTWARE VERSION ARE RELEASED AT THE SAME TIME. SEE THE README FILE FOR THE AVAILABILITY OF THIS SOFTWARE VERSION ON A SPECIFIC OPERATING SYSTEM PLATFORM. THIS DOCUMENT IS PROVIDED “AS IS” WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESS OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE, OR NON-INFRINGEMENT. THIS DOCUMENT COULD INCLUDE TECHNICAL INACCURACIES OR TYPOGRAPHICAL ERRORS. CHANGES ARE PERIODICALLY ADDED TO THE INFORMATION HEREIN; THESE CHANGES WILL BE INCORPORATED IN NEW EDITIONS OF THIS DOCUMENT. TIBCO SOFTWARE INC. MAY MAKE IMPROVEMENTS AND/OR CHANGES IN THE PRODUCT(S) AND/OR THE PROGRAM(S) DESCRIBED IN THIS DOCUMENT AT ANY TIME. THE CONTENTS OF THIS DOCUMENT MAY BE MODIFIED AND/OR QUALIFIED, DIRECTLY OR INDIRECTLY, BY OTHER DOCUMENTATION WHICH ACCOMPANIES THIS SOFTWARE, INCLUDING BUT NOT LIMITED TO ANY RELEASE NOTES AND "READ ME" FILES. Copyright © 1996-2010 TIBCO Software Inc. ALL RIGHTS RESERVED. TIBCO Software Inc. Confidential Information | iii Contents

Preface xv Changes from the Previous Release of this Guidexvi Related Documentationxvii TIBCO Hawk Documentationxvii Other TIBCO Product Documentationxviii Third-Party Documentationxviii Typographical Conventionsxix Connecting with TIBCO Resourcesxxi How to Join TIBCOmmunityxxi How to Access All TIBCO Documentationxxi How to Contact TIBCO Supportxxi

Chapter 1 Overview1 Overview of the TIBCO Hawk Enterprise Monitor System2 Configuration Objects4 How the TIBCO Hawk Configuration Object API Fits In5 Structure of the TIBCO Hawk Configuration Object API6 Related TIBCO Hawk APIs8 TIBCO Hawk Application Management Interface API8 TIBCO Hawk Console API8 TIBCO Hawk Security API9

Chapter 2 Concepts11 Configuration Objects12 Rulebases13 Structure of a Rulebase13 Alerts and Clears18 Posted Conditions18 Variable Substitution19 Legal Characters19 Overruling20 Rulebase configuration management20 Schedule21 Structure of a Schedule21 Period Class21

TIBCO Hawk Configuration Object API Reference iv | Contents

PeriodGroup Class21 Use of Schedules in Rulebases22 Schedule Configuration Management23 Schedules and Agent Performance24 RulebaseMap25 Group Mapping25 Rulebase Mapping26 Command Mapping26 Agent processing of RulebaseMap26 Configuration Object Integrity27 Dependence on the Console API28

Chapter 3 's Checklist31 Overview32 Install32 Code32 Compile32 Run32

Chapter 4 Configuration Object API Class Structure33 Key to the UML diagrams34 Configuration Object API Classes35

Chapter 5 config.rbengine Package45 COM.TIBCO.hawk.config.rbengine 46 RBEConfigObject 47 RBEConfigObject.getName() 48 RBEConfigObject.getChecksum() 49 RBEConfigObject.getFileExtension() 50 RBEConfigObject.toXML() 51 RBEConfigObjectAttributes 52 RBEConfigObjectAttributes.clone() 54 RBEConfigObjectAttributes.constructChangedStamp() 55 RBEConfigObjectAttributes.getAuthor() 56 RBEConfigObjectAttributes.getComment() 57 RBEConfigObjectAttributes.getLastModification() 58 RBEConfigObjectAttributes.setAuthor() 59 RBEConfigObjectAttributes.setComment() 60 RBEConfigObjectAttributes.setLastModification() 61 RBEConfigObjectXML 62 RBEConfigObjectXML.RBEConfigObjectXML() 63

TIBCO Hawk Configuration Object API Reference Contents | v

RBEConfigObjectXML.getXMLString() 64 RBEConfigObjectXML.getXMLReader() 65 RBEConfigObjectException 66 RBEConfigObjectException.RBEConfigObjectException() 67

Chapter 6 config.rbengine.rulebase Package69 COM.TIBCO.hawk.config.rbengine.rulebase 71 RuleDataContext 74 RuleDataContext.getRuleData() 75 RuleDataContext.getPostedConditions() 76 Action 77 Action.equals() 78 Action.getMethodInvocation() 79 Action.setMethodInvocation() 80 Action.getMicroAgentName() 81 Action.setMicroAgentName() 82 Action.getProperties() 83 Action.setProperties() 84 Action.toString() 85 ClearAction 86 ClearAction.ClearAction() 87 ClearAction.toString() 88 ConsequenceAction 89 ConsequenceAction.ConsequenceAction() 90 ConsequenceAction.getEscalationTime() 91 ConsequenceAction.getPerformActionPolicy() 92 ConsequenceAction.setEscalationTime() 93 ConsequenceAction.setPerformActionPolicy() 94 ConsequenceAction.toString() 95 DataSource 96 DataSource.DataSource() 97 DataSource.DataSource() 98 DataSource.getDisplayName() 99 DataSource.getMethodSubscription() 100 DataSource.getMicroAgentName() 101 DataSource.setDisplayName() 102 DataSource.setMethodSubscription() 103 DataSource.setMicroAgentName() 104 DataSource.toString() 105 OperandDescriptor 106 OperandDescriptor.OperandDescriptor() 107 OperandDescriptor.getName() 108

TIBCO Hawk Configuration Object API Reference vi | Contents

OperandDescriptor.getDescription() 109 OperandDescriptor.toString() 110 OperandDescriptor.getType() 111 Operator 112 Operator.Operator() 113 Operator.evaluate() 114 Operator.getDisplayName() 115 Operator.getName() 116 Operator.getOperands() 117 Operator.getOperatorDescriptors() 118 Operator.getType() 119 Operator.setRuleDataContext() 120 Operator.toString() 121 OperatorDescriptor 122 OperatorDescriptor.OperatorDescriptor() 124 OperatorDescriptor.getDescription() 125 OperatorDescriptor.getDisplayName() 126 OperatorDescriptor.getFixedOperandDescriptors() 127 OperatorDescriptor.getName() 128 OperatorDescriptor.getType() 129 OperatorDescriptor.getVariableOperandDescriptor() 130 OperatorDescriptor.toString() 131 Rule 132 Rule.Rule() 133 Rule.clearTests() 134 Rule.getDataSource() 135 Rule.getOverRuling() 136 Rule.getTests() 137 Rule.setDataSource() 138 Rule.setOverRuling() 139 Rule.setTests() 140 Rule.toString() 141 Rulebase 142 Rulebase.Rulebase() 144 Rulebase.getAuthor() 145 Rulebase.getCheckSum() 146 Rulebase.getCommands() 147 Rulebase.getComment() 148 Rulebase.getFileExtension() 149 Rulebase.getIncludedRulebases() 150 Rulebase.getLastModification() 151 Rulebase.getRules() 152 Rulebase.setAuthor() 153 Rulebase.setCommands() 154

TIBCO Hawk Configuration Object API Reference Contents | vii

Rulebase.setComment() 155 Rulebase.setIncludedRulebases() 156 Rulebase.setLastModification() 157 Rulebase.setName() 158 Rulebase.setRules() 159 Rulebase.toString() 160 Rulebase.toXML() 161 RulebaseElement 162 RulebaseElement.getName() 163 RulebaseElement.getSchedule() 164 RulebaseElement.setName() 165 RulebaseElement.setSchedule() 166 COM.TIBCO.hawk.config.rbengine.rulebase.policy 167 ClearConditionPolicy() 169 PerformActionPolicy() 170 TrueConditionPolicy() 171 ClearOnFirstFalse 172 ClearOnFirstFalse.ClearOnFirstFalse() 173 ClearOnFirstFalse.equals() 174 ClearTest 175 ClearTest.ClearTest() 176 ClearTest.getTestExpression() 177 ClearTimer 178 ClearTimer.ClearTimer() 179 ClearTimer.getTimerInterval() 180 PerformAlways 181 PerformAlways.PerformAlways() 182 PerformCountOnInterval 183 PerformCountOnInterval.PerformCountOnInterval() 184 PerformCountOnInterval.getCount() 185 PerformCountOnInterval.getInterval() 186 PerformOnlyOnce 187 PerformOnlyOnce.PerformOnlyOnce() 188 TrueCountThreshold 189 TrueCountThreshold.TrueCountThreshold() 190 TrueCountThreshold.getTrueCountThreshold() 191 RulebaseXML 192 RulebaseXML.RulebaseXML() 193 RulebaseXML.getXMLString() 194 RulebaseXML.getXMLReader() 195 Test 196

TIBCO Hawk Configuration Object API Reference viii | Contents

Test.Test() 197 Test.getClearActions() 198 Test.getClearConditionPolicy() 199 Test.getConsequenceActions() 200 Test.getTestExpressionOperator() 201 Test.getTrueConditionPolicy() 202 Test.setClearActions() 203 Test.setClearConditionPolicy() 204 Test.setConsequenceActions() 205 Test.setTestExpressionOperator() 206 Test.setTrueConditionPolicy() 207 Test.toString() 208 VariableOperandDescriptor 209 VariableOperandDescriptor.VariableOperandDescriptor() 210 VariableOperandDescriptor.getMax() 211 VariableOperandDescriptor.getMin() 212 VariableOperandDescriptor.toString() 213 OperatorException 214 OperatorException.OperatorException() 215 RulebaseException 216 RulebaseException.RulebaseException() 217

Chapter 7 config.rbengine.schedule Package219 COM.TIBCO.hawk.config.rbengine.schedule 220 Schedulable 222 Schedulable.inSchedule() 223 Attributes 224 Period 225 Period.APRIL() 233 Period.AUGUST() 234 Period.DAYS_IN_MONTH() 235 Period.DECEMBER() 236 Period.FEBRUARY() 237 Period.FIRST_WEEKDAY_OF_MONTH() 238 Period.FOURTH_WEEKDAY_OF_MONTH() 239 Period.FRIDAY() 240 Period.JANUARY() 241 Period.JULY() 242 Period.JUNE() 243 Period.LAST_DAY_OF_MONTH() 244 Period.LAST_WEEKDAY_OF_MONTH() 245 Period.MARCH() 246 Period.MAY() 247

TIBCO Hawk Configuration Object API Reference Contents | ix

Period.MINUTES_IN_DAY() 248 Period.MONDAY() 249 Period.MONTHS_IN_YEAR() 250 Period.NOVEMBER() 251 Period.NUM_OF_DAYS_IN_MONTH() 252 Period.NUM_OF_DAYS_IN_WEEK() 253 Period.NUM_OF_INTERVALS() 254 Period.NUM_OF_MINUTES() 255 Period.NUM_OF_MONTHS() 256 Period.OCTOBER() 257 Period.SATURDAY() 258 Period.SECOND_WEEKDAY_OF_MONTH() 259 Period.SEPTEMBER() 260 Period.SUNDAY() 261 Period.THIRD_WEEKDAY_OF_MONTH() 262 Period.THURSDAY() 263 Period.TIME_OF_DAY() 264 Period.TUESDAY() 265 Period.WEDNESDAY() 266 Period.WEEKDAYS_IN_MONTH() 267 Period.Period() 268 Period.clone() 269 Period.equals() 270 Period.exclude() 271 Period.excludeAll() 272 Period.include() 273 Period.includeAll() 274 Period.inSchedule() 275 Period.isAlwaysExcluded() 276 Period.isIncluded() 277 Period.toString() 278 PeriodGroup 279 PeriodGroup.PeriodGroup() 281 PeriodGroup.clone() 282 PeriodGroup.equals() 283 PeriodGroup.getName() 284 PeriodGroup.getPeriods() 285 PeriodGroup.inSchedule() 286 PeriodGroup.setName() 287 PeriodGroup.setPeriods() 288 PeriodGroup.toString() 289 PeriodGroupReference 290 PeriodGroupReference.PeriodGroupReference() 292 PeriodGroupReference.clone() 293

TIBCO Hawk Configuration Object API Reference x | Contents

PeriodGroupReference.equals() 294 PeriodGroupReference.getName() 295 PeriodGroupReference.inSchedule() 296 PeriodGroupReference.setName() 297 PeriodGroupReference.toString() 298 Schedule 299 Schedule.Schedule() 302 Schedule.addExclusionPeriod() 303 Schedule.addInclusionPeriod() 304 Schedule.clone() 305 Schedule.equals() 306 Schedule.getExclusionPeriods() 307 Schedule.getInclusionPeriods() 308 Schedule.getName() 309 Schedule.getSecondTillNextScheduleChange() 310 Schedule.getTimeZone() 311 Schedule.inSchedule() 312 Schedule.isUsingPeriodGroup() 313 Schedule.removeExclusionPeriod() 314 Schedule.removeInclusionPeriod() 315 Schedule.setName() 316 Schedule.setTimeZone() 317 Schedule.toString() 318 Schedules 319 Schedules.FILE_EXTENSION() 322 Schedules.SchedulesFileName() 323 Schedules.SchedulesName() 324 Schedules.Schedules() 325 Schedules.addPeriodGroup() 326 Schedules.addSchedule() 327 Schedules.clone() 328 Schedules.equals() 329 Schedules.getAttributes() 330 Schedules.getFileExtension() 331 Schedules.getPeriodGroup() 332 Schedules.getPeriodGroups() 333 Schedules.getSchedule() 334 Schedules.getSchedules() 335 Schedules.getScheduleUsingPeriodGroup() 336 Schedules.removePeriodGroup() 337 Schedules.removeSchedule() 338 Schedules.renamePeriodGroup() 339 Schedules.setAttributes() 340 Schedules.setPeriodGroups() 341

TIBCO Hawk Configuration Object API Reference Contents | xi

Schedules.setSchedules() 342 Schedules.toString() 343 Schedules.toXML() 344 SchedulesXML 345 SchedulesXML.SchedulesXML() 347 ScheduleException 348 ScheduleException.ScheduleException() 349

Chapter 8 config.rbengine.rbmap Package351 COM.TIBCO.hawk.config.rbengine.rbmap 352 Attributes 353 Attributes.clone 354 Attributes.setUseCommandMapping 355 Attributes.usingCommandMapping 356 Attributes.usingCommandMappingOnly 357 RBMap 358 RBMap.FILE_EXTENSION 362 RBMap.RBMapFileName 363 RBMap.RBMapName 364 RBMap.RBMap 365 RBMap.clone 366 RBMap.equals 367 RBMap.getAgentRulebases 368 RBMap.getAttributes 369 RBMap.getChecksum 370 RBMap.getCommands 371 RBMap.getFileExtension 372 RBMap.getGroups 373 RBMap.getMemberForCommand 374 RBMap.getMembersForRulebase 375 RBMap.getMembersInGroup 376 RBMap.getRulebases 377 RBMap.removeCommand 378 RBMap.removeGroup 379 RBMap.removeRulebase 380 RBMap.setAttributes 381 RBMap.setMemberForCommand 382 RBMap.setMembersForRulebase 383 RBMap.setMembersInGroup 384 RBMap.toXML 385 RBMapXML 386 RBMapXML.RBMapXML 388 RBMapXML.RBMapException 389

TIBCO Hawk Configuration Object API Reference xii | Contents

RBMapXML.RBMapException 390

Appendix A Common Configuration Object API Methods 391 Microagent and Method Invocation used in ConsequenceAction392 Interaction with Agent and Repository using the Console API394 Methods Reference395 RuleBaseEngine:sendAlertMessage 396 RuleBaseEngine:execute 397 RuleBaseEngine:sendMail 398 RuleBaseEngine:addRuleBase 399 RuleBaseEngine:deleteRuleBase 400 RuleBaseEngine:setSchedules 401 RuleBaseEngine:getSchedules 402 RuleBaseEngine:getRBMap 403 Repository:addRuleBase 404 Repository:deleteRuleBase 405 Repository:setSchedules 406 Repository:getSchedules 407 Repository:setRBMap 408 Repository:getRBMap 409

Appendix B Sample Programs 411 Rulebase Samples412 RBIsample1.java412 RBIsample2.java412 RBIsample3.java412 Schedule Samples414 ScheduleCreateAndSave.java414 ScheduleUsingExclusion.java414 ScheduleWithPeriodGroup.java414 ScheduleGetAndSet.java414 Rulebase Map Samples416 RBMapCreateAndSave.java416 RBMapUseCommand.java416 RBMapUseCommand.java416

Appendix MicroAgentDescriptorXML 417 MicroAgentDescriptorXML 418 MicroAgentDescriptorXML.saveToPath() 419

TIBCO Hawk Configuration Object API Reference Contents | xiii

MicroAgentDescriptorXML.toXML() 420 MicroAgentDescriptorXML.fromXML() 421

Index 423

TIBCO Hawk Configuration Object API Reference xiv | Contents

TIBCO Hawk Configuration Object API Reference | xv Preface

This manual is intended for use by . It contains detailed descriptions of each class and method in the TIBCO Hawk® Configuration Object API, and a set of Java interfaces and classes that allow you to define configuration objects used by the TIBCO Hawk agents. This manual assumes you are familiar with TIBCO Rendezvous architecture and the concepts of system monitoring.

Topics

• Changes from the Previous Release of this Guide, page xvi • Related Documentation, page xvii • Typographical Conventions, page xix • Connecting with TIBCO Resources, page xxi

TIBCO Hawk Configuration Object API Reference xvi | Changes from the Previous Release of this Guide

Changes from the Previous Release of this Guide

This section itemizes the major changes from the previous release of this guide. The guide has been updated to address defects and changes.

TIBCO Hawk Configuration Object API Reference Preface | xvii

Related Documentation

This section lists documentation resources you may find useful.

TIBCO Hawk Documentation The following documents form the TIBCO Hawk documentation set: • TIBCO Hawk Installation and Configuration Read this book first. It contains step-by-step instructions for installing TIBCO Hawk software on various operating system platforms. It also describes how to configure the software for specific applications, once it is installed. An installation FAQ is included. • TIBCO Hawk Administrator’s Guide This manual includes basic descriptions of TIBCO Hawk concepts, instructions for using TIBCO Hawk Display, monitoring strategies with examples, a comprehensive FAQ, and a glossary. All books in the documentation set refer to features explained in this book. • TIBCO Hawk Plug-in for TIBCO Administrator Contains detailed descriptions of the TIBCO Hawk plug-ins accessed via TIBCO Administrator. • TIBCO Hawk Programmer’s Guide All programmers should read this manual. It covers the AMI protocol, AMI messages, the AMI Workbench development tool, and the TIBCO Hawk security framework and its classes. Programmers should then refer to the appropriate language reference for the AMI API. The TIBCO Hawk Application Management Interface (AMI) exposes internal application methods to TIBCO Hawk. • TIBCO Hawk AMI C Reference Contains detailed descriptions of each datatype and function in the TIBCO Hawk C AMI API. • TIBCO Hawk AMI C++ Reference Contains detailed descriptions of each datatype and function in the TIBCO Hawk C++ AMI API. • TIBCO Hawk AMI Java Reference Contains detailed descriptions of each class and method in the TIBCO Hawk Java AMI API. • TIBCO Hawk Console API Reference Contains detailed descriptions of each class and method in the TIBCO Hawk Console API, a set of Java interfaces that allow you to manage and interact with TIBCO Hawk agents and monitor alerts generated by these agents. • TIBCO Hawk Configuration Object API Reference Contains detailed descriptions of each class and method in the TIBCO Hawk Configuration Object API. • TIBCO Hawk Methods Reference A reference to the microagents and methods used by a TIBCO Hawk Agent for system and application monitoring.

TIBCO Hawk Configuration Object API Reference xviii | Related Documentation

• TIBCO Hawk HTTP Adapter User’s Guide Contains information about performing discovery, monitoring of agent status, monitoring of agent alerts, method invocation, method subscription, and many more activities on TIBCO Hawk and third-party products. • TIBCO Hawk Enterprise Message Service Administrator Plug-in Microagent Reference Contains details about the microagent methods that are used to administer and monitor the TIBCO Enterprise Message Service server. • TIBCO Hawk Release Notes Read the release notes for a list of new and changed features. This document also contains lists of known issues and closed issues for this release.

Other TIBCO Product Documentation You may find it useful to read the documentation for the following TIBCO products: •TIBCO Rendezvous® — TIBCO Rendezvous Concepts — TIBCO Rendezvous Administration — TIBCO Rendezvous Configuration Tools • TIBCO Enterprise Message Service™ — TIBCO Enterprise Message Service Installation — TIBCO Enterprise Message Service User’s Guide • TIBCO Administator™ — TIBCO Administrator Installation Guide

Third-Party Documentation You may find the following third-party documentation useful. • The Java Language Specification by Gosling, Joy, and Steele

TIBCO Hawk Configuration Object API Reference Preface | xix

Typographical Conventions

The following typographical conventions are used in this manual.

Table 1 General Typographical Conventions Convention Use Many TIBCO products CAN be installed within the same directory. This directory is referenced in documentation as TIBCO_HOME. The value of TIBCO_HOME TIBCO_HOME depends on the operating system. For example, on Windows systems, the default value is C:\tibco. Incompatible products and multiple instances of the same product should be installed into different installation environments.

CONFIG_FOLDER A TIBCO configuration folder stores configuration data generated by TIBCO products. Configuration data can include sample scripts, session data, configured binaries, logs, and so on. This folder is referenced in documentation as CONFIG_FOLDER. TIBCO Hawk installs into a directory within . This directory is HAWK_HOME referenced in documentation as HAWK_HOME. The value of HAWK_HOME depends on the operating system. For example on Windows systems, the default value is C:\tibco\hawk\4.9.

code font Code font identifies commands, code examples, filenames, pathnames, and output displayed in a command window. For example: Use MyCommand to start the foo process.

bold code Bold code font is used in the following ways: font • In procedures, to indicate what a user types. For example: Type admin. • In large code samples, to indicate the parts of the sample that are of particular interest. • In command syntax, to indicate the default parameter for a command. For example, if no parameter is specified, MyCommand is enabled: MyCommand [enable | disable]

TIBCO Hawk Configuration Object API Reference xx | Typographical Conventions

Table 1 General Typographical Conventions (Cont’d) Convention Use

italic font Italic font is used in the following ways: • To indicate a document title. For example: See TIBCO BusinessWorks Concepts. • To introduce new terms For example: A portal page may contain several portlets. Portlets are mini-applications that run in a portal. • To indicate a variable in a command or code syntax that you must replace. For example: MyCommand pathname

Key Key name separated by a plus sign indicate keys pressed simultaneously. For combinations example: Ctrl+C. Key names separated by a comma and space indicate keys pressed one after the other. For example: Esc, Ctrl+Q.

The note icon indicates information that is of special interest or importance, for example, an additional action required only in certain circumstances.

The tip icon indicates an idea that could be useful, for example, a way to apply the information provided in the current section to achieve a specific result.

The warning icon indicates the potential for a damaging situation, for example, data loss or corruption if certain steps are taken or not taken.

TIBCO Hawk Configuration Object API Reference Preface | xxi

Connecting with TIBCO Resources

How to Join TIBCOmmunity TIBCOmmunity is an online destinaton for TIBCO customers, partners, and resident experts—a place to share and access the collective experience of the TIBCO community. TIBCOmmunity offers forums, blogs, and access to a variety of resources. To register, go to http://www.tibcommunity.com.

How to Access All TIBCO Documentation After you join TIBCOmmunity, you can access the documentation for all supported product versions here: http://docs.tibco.com/TibcoDoc

How to Contact TIBCO Support For comments or problems with this manual or the software it addresses, please contact TIBCO Support as follows. • For an overview of TIBCO Support, and information about getting started with TIBCO Support, visit this site: http://www.tibco.com/services/support • If you already have a valid maintenance or support contract, visit this site: https://support.tibco.com Entry to this site requires a user name and password. If you do not have a user name, you can request one.

TIBCO Hawk Configuration Object API Reference xxii | Connecting with TIBCO Resources

TIBCO Hawk Configuration Object API Reference | 1

Chapter 1 Overview

The TIBCO Hawk Configuration Object API is a Java language interface which is used to build and update TIBCO Hawk Agents configuration objects. The API is an integral part of the TIBCO Hawk Enterprise Monitor system and is used by several of its components. When the TIBCO Hawk Configuration Object API is used with the TIBCO Hawk Console API, you can use the combined to manage configuration objects through remote method invocations on TIBCO Hawk agents or repositories. This chapter provides a brief overview of the major components of the TIBCO Hawk Enterprise Monitor and configuration objects in TIBCO Hawk. It also describes how the TIBCO Hawk Configuration Object API is used. The chapter includes a summary of the Java packages in the Configuration Object API and a discussion of related TIBCO Hawk APIs.

Topics

• Overview of the TIBCO Hawk Enterprise Monitor System, page 2 • Configuration Objects, page 4 • How the TIBCO Hawk Configuration Object API Fits In, page 5 • Structure of the TIBCO Hawk Configuration Object API, page 6 • Related TIBCO Hawk APIs, page 8

TIBCO Hawk Configuration Object API Reference 2 | Chapter 1 Overview

Overview of the TIBCO Hawk Enterprise Monitor System

The TIBCO Hawk Enterprise Monitor is a scalable tool for monitoring and management of distributed systems. It consists of agents running on nodes throughout the network. These agents autonomously monitor various system and application parameters and take actions based on their values. Rulebases, authored by users, direct the monitoring behavior and the actions to take. These rulebases are easy to build and can be very simple or very complex. The rules get their data from microagents. Microagents represent managed entities such as the operating system's subsystems, log files, event logs, or applications. Each microagent runs within an agent, but the managed application it represents can be a separate process. Each agent can therefore be considered a collection of rulebases and microagents. The TIBCO Hawk Display is a console application that displays the status of all agents. It is used to view alerts, interact with agents and their microagents, and edit rulebases and other configuration objects. The status of the system can be viewed in either a node-centric or rulebase/application-centric manner. Color-coded alert conditions direct the user's attention to problems. The TIBCO Hawk Event Service is another console application that listens to all monitoring events and logs them to a file or a . All TIBCO Hawk components use TIBCO Rendezvous as their underlying communications mechanisms. This provides them with a great deal of flexibility and scalability. The following figure gives an overview of the TIBCO Hawk system architecture.

TIBCO Hawk Configuration Object API Reference Overview of the TIBCO Hawk Enterprise Monitor System | 3

Figure 1 TIBCO Hawk System Architecture

TIB/Hawk Display

Application AMI TIB/Hawk Agent Managed Node

publish/ Agent subscribe

TIB/Hawk Display publish/ TIB/Rendevous subscribe

TIB/Hawk Agent Managed Node Application API AMI

TIB/Hawk Event Service Adapter or Gateway

TIB/Hawk Agent TIB/Hawk Agent Managed Node Managed Node

TIBCO Hawk Configuration Object API Reference 4 | Chapter 1 Overview

Configuration Objects

There are three types of configuration objects in TIBCO Hawk: • Rulebase • Schedule • Rulebase Map A TIBCO Hawk Agent manages and monitors managed objects by processing rulebases. A rulebase is a named collections of rules that contain management logic. The management logic in a rule is defined by the tests and actions to be taken from data collected from a given data source. A rulebase can be loaded on a single agent, on a group of agents, or on every agent in the network depending on the TIBCO Hawk Agents' configuration mode. A schedule defines when a rulebase, rule, test or action is active. If schedule is not specified in a rulebase, the rulebase is always active when loaded. A schedule contains inclusion and/or exclusion periods that will determine if a schedule is in-schedule or out-of-schedule at a specified time. A rulebase map maps rulebases to TIBCO Hawk Agents on the network. It directs TIBCO Hawk Agents or groups of agents on the network to load particular rulebases at startup. It is used by TIBCO Hawk Agents running in either Manual Configuration Mode or Repository Configuration Mode. Together with the Console API, these configuration objects can be retrieved and sent to TIBCO Hawk Agents or Repositories from a Java application.

TIBCO Hawk Configuration Object API Reference How the TIBCO Hawk Configuration Object API Fits In | 5

How the TIBCO Hawk Configuration Object API Fits In

The TIBCO Configuration Object API provides classes to define configuration objects such as rulebases, schedules, and rulebase maps. These classes enable you you to write programs that can create and modify rulebases, schedules, and rulebase maps programmatically without using the editors in the TIBCO Hawk Display. Rulebases, schedules, and rulebase maps are used by TIBCO Hawk agents to monitor and manage systems and applications. The TIBCO Hawk Display uses the TIBCO Hawk Configuration Object API to build the editors for rulebases, schedules, and rulebase maps. When using the Rulebase Editor in the TIBCO Hawk Display, you would build a new rulebase by first building a rule. The rule requires a data source and a test, which is defined with a test expression and actions to be taken if the test evaluates to TRUE. In much the same fashion, you would use the TIBCO Hawk Configuration Object API to create custom rulebases using instances of the API’s rulebase, rule, test and action classes. When using the Rulebase Editor, the context of the rulebase is implied. Using this context, the Rulebase Editor presents you with the data sources and actions that are available to the agent. These data sources and actions are in the form of microagents, methods and arguments. When using the Configuration Object API, rulebase objects specify their data sources and actions using the MethodSubscription and MethodInvocation classes of the TIBCO Hawk Console API. When the TIBCO Hawk Configuration Object API is used with the TIBCO Hawk Console API, the application can dynamically create or update configuration objects on a TIBCO Hawk agent or repository.

Any complex tests with valid operators can be built using the rulebase related classes in Configuration Object API. However, not all the test conditions built using the Configuration Object API can be modified using the rulebase editor in TIBCO Hawk Display. In such cases, the rulebase editor will simply display the test as a string. However, such complex tests can be edited using a custom-built editor based on the TIBCO Configuration Object API.

TIBCO Hawk Configuration Object API Reference 6 | Chapter 1 Overview

Structure of the TIBCO Hawk Configuration Object API

There are five Java packages in the Configuration Object API. The packages are: • COM.TIBCO.hawk.config.rbengine • COM.TIBCO.hawk.config.rbengine.rulebase • COM.TIBCO.hawk.config.rbengine.rulebase.policy • COM.TIBCO.hawk.config.rbengine.rulebase.schedule • COM.TIBCO.hawk.config.rbengine.rulebase.rbmap These packages are described below.

COM.TIBCO.hawk.config.rbengine This package provides an interface and base classes for the other packages in this API. All TIBCO Hawk configuration objects (Rulebase, Schedule, and RulebaseMap) are stored in XML documents. The interface RBEConfigObject and base class RBEConfigObjectXML in this package provides methods for these objects to be saved and retrieved in XML representation. RBEConfigObject also provides methods to get the name and file extension for these objects.

COM.TIBCO.hawk.config.rbengine.rulebase This package provides classes for creating and processing rulebase used in TIBCO Hawk agents. Each rulebase holds a set of rule definitions. Each rule identifies a data source and a list of tests to be applied to the data. The tests in turn hold a list of actions which are conditionally executed based on test results. Thus, a rulebase can be represented as a tree structure with a single rulebase object as the root and action objects as the leaves.

COM.TIBCO.hawk.config.rbengine.rulebase.policy This package provides classes for creating and processing rulebase related policies. Rulebase policies fall into two groups - policies for Tests and policies for Actions. Policies for Tests are used determine when tests transition to a true or false state. Policies for Actions are used to determine when actions are executed.

TIBCO Hawk Configuration Object API Reference Structure of the TIBCO Hawk Configuration Object API | 7

COM.TIBCO.hawk.config.rbengine.rulebase.schedule This package provides classes for creating and processing schedules used in the rulebases. A Schedule is use to determine if a rulebase or part of the rulebase should be 'in-schedule' or 'out-of-schedule' at a given time. A Schedule contains inclusion and exclusion periods which may contain a number of Schedulable objects. A schedulable object can either be Period or PeriodGroupReference. A PeriodGroupReference is a reference to a PeriodGroup.

COM.TIBCO.hawk.config.rbengine.rulebase.rbmap This package provides classes for creating and processing RulebaseMap. A RulebaseMap is a configuration object that maps rulebases to agents. It contains three types of mapping - group, rulebase, and command mapping. If RulebaseMap is present when a TIBCO Hawk Agent is running in a Manual Configuration Mode or Repository Configuration Mode, a list of rulebases to be loaded at startup is generated. This list is based on the mapping defined in the RulebaseMap object.

TIBCO Hawk Configuration Object API Reference 8 | Chapter 1 Overview

Related TIBCO Hawk APIs

The following APIs are available and documented separately. References to the appropriate document are given in the following sections.

TIBCO Hawk Application Management Interface API The Application Management Interface (AMI) is a protocol based on TIBCO Rendezvous which is used to instrument an application in a way that allows it to be monitored and managed through a TIBCO Hawk agent. The AMI API simplifies this instrumentation process by shielding the user from the details of the protocol and eliminating the need to understand the TIBCO Rendezvous API to implement it. AMI allows an application to be instrumented in such a way that causes it to be represented as a microagent. The microagent is typically in the agent collocated on same node as the application. Applications use AMI to expose methods that are used to perform management operations or to collect management data. These methods are mapped into methods of the corresponding microagent and can then be used in rulebase monitoring or accessed directly from the TIBCO Hawk Display or the Console API. AMI is also used to build adapters to other management systems such as SNMP (Simple Network Management Protocol), which allows them to be represented as microagents. Thus, AMI effectively provides a facility for adding microagents to an agent. In contrast, the Console API is used to interact with an agent and its microagents. For more information on this interface, see the TIBCO Hawk Programmer’s Guide, and the appropriate language reference for your environment: TIBCO Hawk AMI C Reference, TIBCO Hawk AMI C++ Reference, or TIBCO Hawk AMI Java Reference.

TIBCO Hawk Console API The TIBCO Hawk Console API is a Java language interface for writing programs that can perform monitoring and management of TIBCO Hawk agents. It is an integral part of the TIBCO Hawk Enterprise Monitor system and is used by several of its components. It provides all the facilities required to perform discovery, monitoring of agent-alive status, monitoring of agent alerts, and the monitoring of agent configuration changes. It also allows you interact with agents and their managed objects through remote method invocations on microagents. For more information on this interface, see the TIBCO Hawk Console API Reference.

TIBCO Hawk Configuration Object API Reference Related TIBCO Hawk APIs | 9

TIBCO Hawk Security API The TIBCO Hawk Security API is used to build security plug-in modules used for secure interactions between agent and console. The security mechanism actually involves two modules: one that is used by the agent and another that is used by the console. To use the Console API to write console applications that will operate in a secure TIBCO Hawk environment, you need access to the console-side security plug-in class. Without access to this class, you cannot perform management operations on agents. This is the same class that the TIBCO Hawk Display requires to manage agents in a secure environment. For more information on this interface, see the TIBCO Hawk Programmer’s Guide.

TIBCO Hawk Configuration Object API Reference 10 | Chapter 1 Overview

TIBCO Hawk Configuration Object API Reference | 11

Chapter 2 Concepts

This chapter provides some background information on the configuration objects and the Configuration APIs.

Topics

• Configuration Objects, page 12 • Rulebases, page 13 • Schedule, page 21 • RulebaseMap, page 25 • Configuration Object Integrity, page 27 • Dependence on the Console API, page 28

TIBCO Hawk Configuration Object API Reference 12 | Chapter 2 Concepts

Configuration Objects

A TIBCO Hawk Agent manages and monitors applications and systems based on configuration objects such as rulebases, schedules, and a rulebase map loaded on the Agent. A rulebase map directs TIBCO Hawk agents or groups of agents on your network to load particular rulebases at startup. For example, using a rulebase map you can instruct an agent to load a rulebase designed specifically for the operating system where it runs. Every rulebase contains rules which are made up of data sources, tests, and actions. Each rule contains management logic. The management logic in a rule is defined by the tests and actions to be taken from data collected from a given data source. If a schedule is specified in a rulebase, rule, test or action, it will determine if these objects should be active or not at a specified time. Details of rulebases, schedules, and rulebase maps are described below.

TIBCO Hawk Configuration Object API Reference Rulebases | 13

Rulebases

A rulebase is a configuration object that provides the rules for the monitoring activities that are to be autonomously performed on an agent. At the core of all rulebase monitoring activity is the collection of data, testing of that data, and taking actions based on the test results. All monitored data is provided by the agent's microagents through microagent subscriptions. All actions taken by a rulebase are in the form of method invocations. Rulebase objects specify their data sources and actions using the MethodSubscription and MethodInvocation classes of the Console API. Therefore, understanding these, and related classes, is a prerequisite for using the Configuration API. For more information on these classes, refer to the TIBCO Hawk Console API Reference.

How Rulebases are interpreted by the RuleBaseEngine While rulebases are merely configuration objects, it is useful to think of them as having runtime behavior in order to understand how the RuleBaseEngine processes them. Thus this section discusses rulebases, rules, tests, and actions as if they contain logic which carries out their execution.

Structure of a Rulebase A rulebase object is primarily composed of a set of rule objects. Each rule has a Data Source and a list of Test objects. Each Test has a TestExpressionOperator object and a list of ConsequenceAction objects. Thus, a rulebase can be represented as a tree structure with a single Rulebase object as the root and Action objects as the leaves.

RuleBaseElement Class The RulebaseElement class is the super class of the following classes: • Rulebase •Rule •Test •Action

TIBCO Hawk Configuration Object API Reference 14 | Chapter 2 Concepts

The RulebaseElement class provides common methods to get and set the element's name and schedule parameters. The Rule, Test and Action classes do not require a name to be specified in the constructor. Only the Rulebase class requires a name specified in the constructor. In places where an array of RulebaseElement objects is required, all elements in the array must have unique names. These includes the constructors for: • Rulebase (requires array of Rule) • Rule (requires array of Test) • Test (requires array of Action) and the following methods: • Rulebase.setRules() • Rule.setTests() • Test.setConsequenceActions() • Test.setClearActions()

Rule Class A Rule consists of a data source and a list of tests. The DataSource of a rule specifies a MethodSubscription , which supplies a stream of data samples to be monitored. The method used in the MethodSubscription can be either synchronous or asynchronous. Every new data sample from a Rule Object 's Data Source is distributed to all Test objects contained within that Rule object. For more information on MethodSubscription refer to the TIBCO Hawk Console API Reference.

DataSource Class The data source for a Rule is its source of input data, and is always a method subscription to a microagent. The data source of a Rule provides information about some condition on a managed node. After information is received, one or more tests are applied to evaluate it. The MethodSubscription of a data source provides a stream of data objects. The microAgentName and the method name used to construct the DataSource can be obtained from MicroAgentDescriptor and MethodDescriptor , respectively. The MicroAgentDescriptor which is used to construct the MethodSubscription defines the type of data the subscription will yield. This data will be one of the following OpenData types:

TIBCO Hawk Configuration Object API Reference Rulebases | 15

•String •Char • Boolean •Byte •Short •Integer •Long •Float •Double • CompositeData • TabularData (represents a table composed of rows uniquely indexed by uniformly structured CompositeData objects)

Test Class Tests define the tests which are performed on the rule's data source and what actions to take. Each test uses the data to compute a true or false value which is used in determining when to trigger actions. Test objects have a state that is either true or false. The initial state of a new Test object is false. State transitions are caused by evaluating the received data based on the specified conditions and the policies of the test. The possible Test object state transitions are: • false to false (F->F) • false to true (F->T) • true to false (T->F) •true to true (T->T) All Test object state transitions cause its ConsequenceAction objects to be evaluated. The policy of the ConsequenceAction objects govern whether an evaluation results in an action execution. The ClearAction objects are a list of actions that will be executed when the Test object undergoes the T->F transition. State transitions resulting from the receipt of data start with an evaluation of the TestExpressionOperator against the data. The resulting true or false value of the TestExpression , in conjunction with the Test object's TrueConditionPolicy and ClearConditionPolicy , determines the type of Test object state transition, as follows: • F->F and T->T Test Object StateTransitions

TIBCO Hawk Configuration Object API Reference 16 | Chapter 2 Concepts

If the previous state of the Test object was false and the current evaluation of the Test Expression is false, then the Test object undergoes a F->F transition. If the previous state of the Test object was true and the current evaluation of the TestExpression is true, then the Test object undergoes a T->T transition. These two transitions are not affected by the true or clear policy. • F->T Test Object State Transitions This transition is governed by the TrueConditionPolicy . The policy TrueCountThreshold specifies how many sequential true evaluations of the TestExpression must occur before the Test object transitions F->T. • T->F Test Object Transitions - "Clearing" the Test object This transition is governed by the ClearConditionPolicy . This transition is synonymous with "Clearing" the Test object. The policy FirstFalse indicates that the T->F transition should occur upon the first false evaluation of the TestExpression operator. This is the default ClearConditionPolicy . The policy ClearTimer indicates the number of seconds which must elapse without a true evaluation of the TestExpression before the T->F occurs. A T->F transition caused as a result of a clear timer expiration occurs independently of the Test object's receipt of data. The ClearTest policy specifies an additional test expression (clear test expression), which governs when the T->F transition occurs. The Clear Test Expression receives data each time the Test object receives data. It will cause a T->F transition of the Test object if (the current state of the Test object is true and) the clear test expression evaluates to true.

TestExpressionOperators Class TestExpressionOperator are created using the Operator class. The static method Operator.getOperatorDescriptors() returns a list of descriptors describing all available operators. Using the information in the OperatorDescriptor , you can then build instances of the Operator class by supplying the operator name and a list of operands. The operands you supply must be of the same number and type as those specified by the corresponding descriptor. An operand of an operator may itself be another operator, as long as its stated return type matches the operand position it occupies. Operators can thus be nested to form more complex operators.

TIBCO Hawk Configuration Object API Reference Rulebases | 17

Although operators can return different types, only those which return a Boolean value may be used in tests (i.e. as arguments to Test.setTestExpressionOperator() ). The other non-Boolean operators are used only as nested operators. Test operators access the rule's data source through the COM.TIBCO.hawk.config.rbengine.rulebase.operators.getRuleData operator . This operator takes a name and returns the associated data. As described, if a data source produces TabularData then that data is decomposed into CompositeData objects before seen by the tests and thus the getRuleData operator. The name parameter to this operator references the corresponding data element of the CompositeData object which is then returned by the getRuleData operator. If the data source produces one of the remaining OpenData types (String, Char, Boolean, Byte, Short, Integer, Long, Float, Double) then that value is accessible via the getRuleData operator using the name assigned to the return type in the MethodDescriptor for this data source.

ConsequenceAction Class The ConsequenceAction object extends the Action object. The Test object invokes its ConsequenceAction objects each time the Test object makes a state transition. The type of transition along with the ConsequenceAction object's PerformActionPolicy and EscalationPeriod determines whether or not the action is executed. A True Series of transitions is defined as a series of transitions that begins with F->T and is followed by one or more T->T transitions. A T->F marks the end of a true series but is not part of it. Actions are not enabled during an entire true series. The EscalationPeriod specifies the number of seconds that must elapse since the start of a true series before the action becomes enabled. An EscalationPeriod of 0 indicates that the action is always enabled. Actions may only execute when enabled. The PerformActionPolicy controls how many times and how often the action executes during a true series, after the action has been enabled. The PerformOnceOnly policy causes the action to be executed only once during a true series. An exception to this rule involves variable substitution. If variable substitution would result in a different action than the last one that has executed within the current true series (For example, raise an alert with different text), then the action will also be re-executed on the current T->T transition. The PerformAlways policy causes the action to be executed upon every evaluation within a true series (after the action has become enabled).

TIBCO Hawk Configuration Object API Reference 18 | Chapter 2 Concepts

The PerformCountOnInterval policy is more involved. It causes the action to be executed at the start of a true series (or as soon as it becomes enabled), and on subsequent evaluations within the same series that occur at a time greater than Y seconds since the last action execution within the current true series. This continues until the action has executed for a maximum of X times within the current true series.

Alerts and Clears Alerts are generated when a ConsequenceAction invokes the sendAlertMessage on the RulebaseEngine microagent. The method takes a single argument named 'message'. The value of the argument may be one of the following objects: •AlertLow •AlertMedium • AlertHigh • Notification AlertLow , AlertMedium , and AlertHigh correspond to alert with level from low to high. They are useful for sending non-alert type messages. All methods take a single string argument called 'alertMsg'. Alerts are cleared when the Test Object (that generated the alert) transitions T->F. The following code fragment constructs a valid ConsequenceAction which generates a medium alert with text "process down": DataElement[] args = {new DataElement("message", new AlertMedium("process down"))}; MethodInvocation mi = new MethodInvocation("sendAlertMessage", args); ConsequenceAction ca = new ConsequenceAction("COM.TIBCO.hawk.microagent.RuleBaseEngine", mi);

Posted Conditions Posted Conditions are "posted" when a ConsequenceAction object invokes the method postCondition on the RuleBaseEngine microagent. A posted condition is an internal status message, similar to an alert message. It takes a single argument called 'condition'. The following code fragment constructs a valid ConsequenceAction which posts the condition "disk full": DataElement[] args = {new DataElement("condition", new PostedCondition("disk full"))}; MethodInvocation mi = new MethodInvocation("postCondition", args); ConsequenceAction ca =

TIBCO Hawk Configuration Object API Reference Rulebases | 19

new ConsequenceAction("COM.TIBCO.hawk.microagent.RuleBaseEngine", mi); new ConsequenceAction("COM.TIBCO.hawk.microagent.RuleBaseEngine", mi); A ClearAction may not contain a MethodInvocation with the postCondition method. Posted Conditions are "cleared" or "unposted" when the enclosing Test object transitions T->F. Posted conditions provide a mechanism for different rules within the same rulebase to communicate. One of the restrictions on posted conditions is that no two ConsequenceAction objects in the same rulebase may post the same condition ( conditionName ). This is enforced by the methods that construct and edit Rulebase objects. Another restriction is that a posted condition may not be referenced (used in a test operator) from within the same Rule that generates it. (Rules contain tests, tests contain actions, and actions can post conditions. Thus all posted conditions are posted within the context of a particular rule but may only be referenced in tests of other rules in the same rulebase.) This is enforced by the methods that construct and edit Rule objects. For more information on posted conditions, see the TIBCO Hawk Administrator's Guide.

Variable Substitution The string arguments of all action MethodInvocation objects may contain variables which are evaluated by the rules engine before invocation. By referencing variables, the rulebase can adapt to changes on multiple machines. For more information on variable substitution, see the TIBCO Hawk Administrator's Guide.

Legal Characters A rulebase name may contain any alphanumeric character (letter or digit), or the symbols _ (underscore) or - (dash). A character is considered to be alphanumeric if and only if it is specified to be a letter or a digit by the Unicode 2.0 standard (category "Lu", "Ll", "Lt", "Lm", "Lo", or "Nd" in the Unicode specification data file). The latest version of the Unicode specification data file can be found at http://www.unicode.org/ucd. For a more complete specification that encompasses all Unicode characters, see The Java Language Specification by Gosling, Joy, and Steele.

TIBCO Hawk Configuration Object API Reference 20 | Chapter 2 Concepts

Overruling Overruling is a way to have a rule in one rulebase override or overrule a rule in another rulebase in a way that causes only one to be active. Overruling is a way of setting precedence among similar rules. For more information on overruling, see the TIBCO Hawk Administrator's Guide.

Rulebase configuration management Rulebase use by the agent are maintained in a Rulebase object. Agent stores and retrieves the each Rulebase to and from a rulebase file. The filename of the rulebase correspond to name of the rulebase and has an extension of .hrb . If the filename of the rulebase does not correspond to the name of the rulebase, TIBCO Hawk Agents will not load the rulebase and an error is logged. When TIBCO Hawk Agents is running in auto config mode, rulebases are loaded from the autoconfig directory. When TIBCO Hawk Agents is running in repository config mode, rulebases are loaded from the specified repository.

TIBCO Hawk Configuration Object API Reference Schedule | 21

Schedule

A Schedule is a configuration object that can be used for determining if a rulebase or part of the rulebase should be 'in-schedule' or 'out-of-schedule' at a given time. If a schedule is not specified in a rulebase, then the rulebase is always in-schedule.

Structure of a Schedule A schedule object is primarily composed of a list of inclusion periods, and a list of exclusion periods. A schedule is in-schedule if at least one of its inclusion periods is in-schedule and none of its exclusion periods are in-schedule. Otherwise, the schedule is out-of-schedule. The inclusion and exclusion periods contain a list of Period objects or PeriodGroup objects.

Period Class A Period defines the time intervals, days or months that should be included or excluded in a schedule. It is composed of 4 distinct period components: MinutesInDay, DaysInWeek, DaysInMonth and MonthsInYear. A Period object is in-schedule only if all of its 4 components are in-schedule. Otherwise, it is out-of-schedule . MinutesInDay contains a set of 1440 continuous 1-minute intervals in a day. The MinutesInDay object is in-schedule if the time for checking the schedule is included in the MinutesInDay. DaysInWeek contains a set of 7 days in a week. A DaysInWeek is in-schedule if the day of date for checking the schedule is included in the DaysInWeek. DaysInMonth contains a set of 31 days in a month. A DaysInMonth is in-schedule if the day in the date for checking the schedule is included in the DaysInMonth. MonthsInYear contains a set of 12 months in a year. A MonthsInYear is in-schedule if the month of the date used for checking the schedule is included in the MonthsInYear.

PeriodGroup Class A PeriodGroup object is a logical group of Period object useful for defining an abstract group of periods. Period groups are useful when you use a set of periods regularly in defining schedules. It also eases the maintenance of those schedules because you can make a change in the period group and have it automatically reflected in all the schedules that use it.

TIBCO Hawk Configuration Object API Reference 22 | Chapter 2 Concepts

Use of Schedules in Rulebases Schedules may be used to control when a monitoring activity or action is performed. Schedules may be applied to a RuleBase, Rule, Test, and Action by specifying the schedule name in the attribute of these objects. If a RuleBase, Rule, Test, or Action makes use of a schedule name that is not defined either because the agent couldn't load the Schedule object or because the Schedule object does not exist then it will be flagged as an error. However, the rulebase processing will continue as if no schedule was specified for that component; the component will behave as if always in-schedule If the schedule name applied to a rulebase component begins with "!" then it refers to the inverse of a schedule. For example, if the schedule BusinessHours is defined in the schedules configuration, a rulebase component may use either BusinessHours or !BusinessHours to refer to it. When using BusinessHours, that component is in-schedule whenever the BusinessHours schedule is in-schedule. When using !BusinessHours, that component is in-schedule whenever the BusinessHours schedule is not in-schedule. If the schedule BusinessHours is not defined in the scheduler then components using either BusinessHours or !BusinessHours will behave as if no schedule is defined (they both will always be in-schedule). A rulebase is a hierarchical structure: rulebases contain rules, rules contain tests, and tests contain actions. Therefore, a schedule applied to one node in the hierarchy affects all nodes below it. The following sections describe the behavior of RuleBases, Rules, Tests, and Actions when valid schedules are applied.

RuleBase When a rulebase is loaded it is not activated unless its applied schedule is currently in-schedule. Thereafter, when its applied schedule transitions to an in-schedule state, the rulebase is activated. When its applied schedule transitions to an out-of-schedule state, the rulebase is deactivated. Before a rulebase becomes active, no rules are processed no monitoring is taking place by that rulebase. When a rulebase is activated, its rules are loaded and monitoring may begin. When a rulebase is deactivated, all of its rules are unloaded which results in the clearing of outstanding alerts (generated from those rules) and the cessation of all monitoring by that rulebase.

Rule When a rule is loaded it isn't activated unless its applied schedule is currently in-schedule. Thereafter, when its applied schedule transitions to an in-schedule state, the rule is activated. When its applied schedule transitions to an out-of-schedule state, the rule is deactivated. Before a rule becomes active, no tests are processed and no monitoring is performed by this rule. When a rule is

TIBCO Hawk Configuration Object API Reference Schedule | 23

activated, its tests are loaded and monitoring may begin. When a rule is deactivated, all of its tests are unloaded which results in the clearing of outstanding alerts (generated from those tests) and the cessation of all monitoring by that rule. When a rule is inactive, its enclosing rulebase behaves as if that rule is not there.

Test When a test is loaded it isn't activated unless its applied schedule is currently in-schedule. Thereafter, when its applied schedule transitions to an in-schedule state, the test is activated. When its applied schedule transitions to an out-of-schedule state, the test is deactivated. Before a test becomes active, no actions are loaded and no monitoring is performed by this test. When a test is activated, its actions are loaded and monitoring begins. When a test is deactivated, all of its actions are unloaded which results in the clearing of outstanding alerts (generated from those actions) and the cessation of all monitoring by that test. When a test is inactive, its enclosing rule behaves as if that test is not there.

Action When an action is loaded it isn't activated unless its applied schedule is currently in-schedule. Thereafter, when its applied schedule transitions to an in-schedule state, the action is activated. When its applied schedule transitions to an out-of-schedule state, the action is deactivated. Before an action becomes active, it performs no action and does not respond in any way to its test's state transitions. When an action is activated, it begins tracking and responding to its test's state transitions. When an action is deactivated, any outstanding alert it may have generated is cleared and the action ceases to track and respond to the state transitions of its test. When an action is inactive, its enclosing test behaves as if that action is not there.

Schedule Configuration Management In most respects, configuration management for Schedules is identical to that for rulebases (when in auto-config mode, the agent will load and store this file from auto-config-dir , etc.). However, all schedules use by the agent are maintained in a single Schedules object. Agent stores and retrieves the Schedules to and from the file schedules.hsf .

TIBCO Hawk Configuration Object API Reference 24 | Chapter 2 Concepts

Schedules and Agent Performance Because all schedules are stored in a single file, each agent will load the schedules at startup. However, the scheduler in the agent will evaluate a schedule only if the agent has loaded rulebases that reference that schedule. Such schedules are referred to as active because there is active interest in them. The scheduler evaluates active schedules at the following times: • Once each minute, when schedules are resolved. • When the agent receives a new schedule (such as when using SendTo from the schedule editor). • When a schedule first becomes active (such as the first time any rulebase references it). In general, having a large number of schedules defined in the schedule file may marginally affect the size of the agent but it does not affect the CPU performance.

TIBCO Hawk Configuration Object API Reference RulebaseMap | 25

RulebaseMap

RulebaseMap is a configuration object that maps rulebases to agents. It is used when agent is running in a manual configuration mode to determine which rulebases should be loaded on the agent. The RulebaseMap configuration object has three primary components: • Group mapping - to organize agents into groups for the purpose of rulebase assignment. • Rulebase mapping - to map rulebases to agents or groups of agents. • Command mapping - to delegate the rulebase mapping function to an external command. These components are described in the following sections.

Group Mapping There are two types of groups in RulebaseMap, user defined and automatic. A user defined group is a group that a user creates. Automatic groups are groups that agents automatically belong to. A user can define the names of user-defined groups but not that of the automatic groups. A user defined group name begin with "+" and automatic group names begin with "++". A user defined group can be composed of a number of agents, groups, or a combination of agents and groups. A user defined group may have both user defined and automatic groups as elements in its definition. The OS groups are automatic groups whose names correspond to the operating systems of the machines the agents are running on. The OS groups have the form "++OSName" where OSName is the value of the Java system property "os.name". Examples of automatic group names are ++Windows 2000, ++Solaris, and ++HPUX. Examples of user defined group names are "+servers" and "+clients". There is a special automatic group referred to as the ALL group. The ALL group includes every TIBCO Hawk Agent and is simply named "++". For example: +group1 agent1 agent2 agent3 +groupX agentX +group1

In the preceding example, agentX and +group1 belong to +groupX. Also, agent1 belongs to +group1 as well as +groupX.

TIBCO Hawk Configuration Object API Reference 26 | Chapter 2 Concepts

Rulebase Mapping Rulebase mapping defines which rulebases are assigned to an agent or a group. It defines which agents or groups use a particular rulebase. In the following rulebase mapping: rulebase agent1 agent2 ++Windows rulebase2 +group2 rulebase3 agent2 +group2 rulebase4 ++

agent1 uses rulebase1. Agents in +group2 uses rulebase2 and rulebase3. All agents uses rulebase4 as rulebase4 maps to "++", the all group. All agents that are running under Windows operating system will uses rulebase1.

Command Mapping Command mapping allows an external command or executable (script) to be specified for an agent or a group. If specified, it is executed and the returned string is parsed on white space to indicate which rulebases to load. When the executable is invoked, the agent name and its automatic group name are passed as parameters to the command. The use of command mapping depends on a setting of one of the attributes of the RulebaseMap. The command mapping can be used as the only mechanism to generate the rulebases to be loaded or as a supplement to the groups and rulebases mapping of the RulebaseMap. It can also be ignored for generating the rulebases.

Agent processing of RulebaseMap If the agent (more specifically, the RulebaseEngine MicroAgent) is configured in one of the manual configuration mode, it will attempt to load the RulebaseMap configuration object after initialization. It will first determine which automatic groups it belongs to. Then it will read and process the group definition component to determine which user defined groups it is also a member of. Next it will process the rulebase mapping component to determine which rulebases it should load. Finally it will use the command mapping mechanism, if one is specified, to get the names of additional rulebases it should load. Once the RulebaseMap has been fully processed, the agent will proceed to load the target rulebases.

The -rulebases option supported by the agent (RulebaseEngine MicroAgent) can be used together with the RulebaseMap to specify additional rulebases.

TIBCO Hawk Configuration Object API Reference Configuration Object Integrity | 27

Configuration Object Integrity

When constructing or modifying any of the configuration objects, copies of the supplied parameters are made and used. When accessing the data of any configuration objects through one of the get methods, copies of the internal data are returned. This insures the integrity of the configuration objects and ensures that proper validity checking can be performed. It also means that changing a configuration object requires that you use one of the set methods on that component. For example, if you extract the tests from a rule using the Rule.getTests() method and then modify one of the tests in the array, the change will not be reflected in the rule until you call Rule.setTests() with the modified test array.

TIBCO Hawk Configuration Object API Reference 28 | Chapter 2 Concepts

Dependence on the Console API

When a configuration object is created using the corresponding editor on the TIBCO Hawk Display, the context of the configuration object is implied by the agent or repository for which the configuration object is defined. For example, when creating rulebases in the rulebase editor, this context is used when presenting to you the choices for data sources and actions, in the form of the related microagents, methods and arguments. When creating rulebases using the Configuration Object API, the microagent name, method name and the data item names must be passed to the methods. These are obtained from the following classes of the COM.TIBCO.hawk.talon package of the Console API: •MethodSubscription •MethodInvocation • MicroAgentDescriptor • MethodDescriptor • OpenData The data source of a rule requires a microagent name and a MethodSubscription object. Actions require a microagent name and a MethodInvocation object. Microagent names, and the information required to build valid MethodSubscription and MethodInvocation objects, are available in MicroAgentDescriptor objects. The methods used as data sources must be Open Methods since the RuleBaseEngine can only process OpenData. A MicroAgentDescriptor holds MethodDescriptor objects for all methods of a microagent. The MethodDescriptor for the method chosen as the data source describes the data the method returns. This information is needed to construct test expression operators. The getRuleData operator is used by test expressions to access a method's data. It requires the name of a data item. This name needs to be one of the names of the elements in the method's return which are specified in the MethodDescriptor. Obtaining MicroAgentDescriptor objects is accomplished with the COM.TIBCO.hawk.hawkeye package of the Console API. Retrieving and updating configuration objects on a TIBCO Hawk agent or repository is accomplished by invoking methods on the RuleBaseEngine or Repository microagents. This involved both the monitoring and management components of the TIBCO Hawk Console API as agents and microagents need to be discovered and method invocations are performed on the required microagents. See Appendix A, Common Configuration Object API Methods, for commonly used methods on RuleBaseEngine or Repository microagent when using the Configuration Object API.

TIBCO Hawk Configuration Object API Reference Dependence on the Console API | 29

See the TIBCO Hawk Console API Reference and the TIBCO Hawk Methods Reference for more information.

TIBCO Hawk Configuration Object API Reference 30 | Chapter 2 Concepts

TIBCO Hawk Configuration Object API Reference | 31

Chapter 3 Programmer's Checklist

The TIBCO Hawk Java API provides a set of class packages implemented by the TIBCO Hawk AMI, to be used as components in building applications for the TIBCO Hawk monitoring system and invoking methods on the objects implemented by the classes.

Topics

• Overview, page 32

TIBCO Hawk Configuration Object API Reference 32 | Chapter 3 Programmer's Checklist

Overview

Install Install the latest TIBCO Hawk software and TIBCO Rendezvous software releases. We recommend using Java 1.3.1 to compile and run your application using Configuration API.

Code Your application using Configuration API source code file must contain the following imports: import COM.TIBCO.hawk.config.rbengine.*; and or one or more of the following depending whether rulebase, schedule, and/or rulebase mapclasses are used: import COM.TIBCO.hawk.config.rbengine.rulebase.*; import COM.TIBCO.hawk.config.rbengine.rulebase.policy*; import COM.TIBCO.hawk.config.rbengine.schedule.*; import COM.TIBCO.hawk.config.rbengine.rbmap.*;

Compile While compiling your application using the Configuration Object API, your CLASSPATH must include config.jar and util.jar from TIBCO Hawk Java.

Run While running your application using the Configuration Object API, your CLASSPATH must include config.jar and util.jar from the TIBCO Hawk Java directory and tibrvj.jar from the TIBCO Rendezvous /lib directory.

If your application uses the Console API, please refer to the checklist in the TIBCO Hawk Console API Reference.

TIBCO Hawk Configuration Object API Reference | 33

Chapter 4 Configuration Object API Class Structure

This chapter contains UML diagrams showing the structure of the Configuration Object API.

Topics

• Key to the UML diagrams, page 34 • Configuration Object API Classes, page 35

TIBCO Hawk Configuration Object API Reference 34 | Chapter 4 Configuration Object API Class Structure

Key to the UML diagrams

These class diagrams use a subset of UML notation. Here is a brief key: Classes and their methods are shown in rectangles:

Class Name method1(argName:type,…):methReturnType method2(argName:type,…):methReturnType ...

Some methods and argument names are omitted for clarity. A third part, between the class name and methods, may be used for class variables. Underlined members are static. Comments are shown in a rectangle with a turned down corner. A dotted line shows what the comment applies to.

Associations Associations are indicated with lines:

Inheritance Superclass Subclass

Interface Implementing Class

Navigation

ClassA ClassB An instance of Class A can be referenced from an instance of Class B

Aggregation

ClassA ClassB Composite aggregation. An instance of ClassA contains an aggregation of instances of ClassB. These instances of ClassB belong to only one composite at a time.

TIBCO Hawk Configuration Object API Reference Configuration Object API Classes | 35

Configuration Object API Classes

Figure 2 Package Level

COM.TIBCO.hawk.config.rbengine

COM.TIBCO.hawk.config.rbengine.rulebase COM.TIBCO.hawk.config.rbengine.rulebase.policy

COM.TIBCO.hawk.config.rbengine.schedule

COM.TIBCO.hawk.config.rbengine.rbmap

TIBCO Hawk Configuration Object API Reference 36 | Chapter 4 Configuration Object API Class Structure

Figure 3 Base Classes Extended by Rulebase, Schedule, and Rulebase Map Classes

<>RBEConfigObject

getName():String RBEConfigObjectException getFileExtension():String <> RBEConfigObjectException(String) toXML(java.io.Writer) getChecksum():long

RBEConfigObjectXML

<> RBEConfigObjectXML(RBEConfigObject)

getXMLString():String getXMLReader():java.io.Reader

<>RBEConfigObjectAttributes

getAuthor():String getLastModification():String getComment():String

setAuthor(String) setLastModification(String) setComment(String)

TIBCO Hawk Configuration Object API Reference Configuration Object API Classes | 37

Figure 4 Rulebase, Rule, and DataSource-related Classes

Rulebase RulebaseXML

<> <> Rulebase(String, Rule[]) RulebaseXML(Rulebase) Rulebase(Reader) getAuthor():String getCommands():String[] RBEConfigObject getComment():String getIncludedRuleBases():String[] getLastModification():String getRules():Rule[] Rule setAuthor(String) <> setCommands(String[]) 1*Rule(DataSource, Test[]) setComment(String) setIncludedRuleBases(String[]) getDataSource():DataSource setLastModification(String) getOverRuling():int setRules(Rule[]) getTests():Test[] setDataSource(DataSource) setOverRuling(int) setTests(Test[])

1 1

RulebaseElement * getName():String getSchedule():String Test setName(String) setSchedule(String)

Action

RulebaseException 1

<> DataSource RulebaseException(String) <> DataSource(String, MethodSubscription)

getMethodSubscription():MethodSubscription getMicroAgentName():String getDisplayName():String setMicroAgentName(String) setDisplayName(String) setSubscription(MethodSubscription)

TIBCO Hawk Configuration Object API Reference 38 | Chapter 4 Configuration Object API Class Structure

Figure 5 Test-Related Classes

TrueCountThreshold

<> TrueCountThreshold(int) <> TrueConditionPolicy getTrueCountThreshold():int

ClearOnFirstFalse ClearTimer

<> <> ClearOnFirstFalse() ClearTimer(int interval)

getTimerInterval():int

Test

<> Test(ConsequenceAction[] actions, Operator op)

getConsequenceActions():ConsequenceAction[] <> ClearConditionPolicy getClearActions():ClearAction[] getClearConditionPolicy():ClearConditionPolicy getTestExpressionOperator():Operator getTrueConditionPolicy():TrueConditionPolicy setConsequenceActions(ConsequenceAction[]) setClearActions(ClearAction[]) setClearConditionPolicy(ClearConditionPolicy) ClearTest setTrueConditionPolicy(TrueConditionPolicy) <> ClearTest(Operator test)

1 1 getTestExpression():Operator

*

ConsequenceAction Operator

*

ClearAction

TIBCO Hawk Configuration Object API Reference Configuration Object API Classes | 39

Figure 6 Operator-Related Classes

Operator OperandDescriptor

<> <> Operator(String, Object[]) OperandDescriptor(String, String, String)

<>getOperatorDescriptors():OperatorDescriptor[] 1 * getDescription():String evaluate():Object getName():String setRuleDataContext(RuleDataContext rdc) getType():String getName():String getDisplayName():String getOperands():Object[] getType():String VariableOperandDescriptor

<> VariableOperandDescriptor 1 * (String, String, String, int, int) getMax():int getMin():int

1

OperatorException <>RuleDataContext

<> getPostedCondition(String):int OperatorException(String) getRuleData(String):Object

* OperatorDescriptor

<> OperandDescriptor(String, String, String, String, OperandDescriptor[], VariableOperandDescriptor) getDescription():String getDisplayName():String getFixedOperatorDescriptors():OperatorDescriptor[] getName():String getType() :String getVariableOperandDescriptor():VariableOperandDescriptor

TIBCO Hawk Configuration Object API Reference 40 | Chapter 4 Configuration Object API Class Structure

Figure 7 Action-Related Classes

<> Action

getMethodInvocation():MethodInvocation MethodInvocation getMicroAgentName():String getProperties():java.util.Properties setMethodInvocation(MethodInvocation) setMicroAgentName(String) setProperties(java.util.Properties)

ConsequenceAction ClearAction

<> <> ConsequenceAction(String, MethodInvocation) ClearAction(String, MethodInvocation)

getEscalationTime():int getPerformActionPolicy():PerformActionPolicy setEscalationTime(int); setPerformActionPolicy(PerformActionPolicy)

PerformOnceOnly

<> PerformOnceOnly()

PerformAlways

<> PerformActionPolicy <> PerformAlways()

PerformCountOnInterval

<> PerformCountOnInterval(int, int)

getCount():int getInterval():int

TIBCO Hawk Configuration Object API Reference Configuration Object API Classes | 41

Figure 8 Schedules-Related Classes

Schedules Attributes <> Schedules() Schedules(Schedule[]) Schedules(Reader) getAttributes():Attributes RBEConfigObjectAttributes setAttributes(Attributes) addSchedule(Schedule) removeSchedule(String) SchedulesException getSchedules():Schedule[] <> getScheduleNames():String[] SchedulesException(String) getSchedule(String):Schedule setSchedules(Schedule[]) addPeriodGroup(PeriodGroup) RBEConfigObject removePeriodGroup(String) renamePeriodGroup(String, String) getPeriodGroups():PeriodGroup[] setSchedules(Schedule[]) Schedule

1 *

PeriodGroup 1*

SchedulesXML

<> SchedulesXML(Schedules)

RBEConfigObjectXML

TIBCO Hawk Configuration Object API Reference 42 | Chapter 4 Configuration Object API Class Structure

Figure 9 Schedule-Related Classes

Schedule PeriodGroupReference

<> <> Schedule(String) PeriodGroupReference(String) Schedule(String, Scheduleable[], Scheduleable[]) setName(String s) setName(String) getName():String getName():String setTimeZone(java.lang.String) inSchedule(GregorianCalendar):boolean

getInclusionPeriod():Scheduleable[] getExclusionPeriod():Scheduleable[] addInclusionPeriod(Scheduleable) removeInclusionPeriod(Scheduleable) addExclusionPeriod(Scheduleable) PeriodGroup removeExclusionPeriod(Scheduleable) 1 * <> PeriodGroup(String) inSchedule(Date):boolean PeriodGroup(String, Period[]) 1 setName(String s) getName():String * Period getPeriods():Period[] setPeriods(Period[]) <> Period() * 1

include(int, int) exclude(int, int) isIncluded(int, int):boolean isAlwaysExcluded(int, int):boolean includeAll(int) excludeAll(int)

Scheduleable inSchedule(java.util.GregorianCalendar ):boolean

TIBCO Hawk Configuration Object API Reference Configuration Object API Classes | 43

Figure 10 Rulebase Map-Related Classes

RBMap

<> RBEConfigObject RBMap() RBMap(Reader) getAgentRulebases(String, String):String[] RBMapException getAttributes():Attributes setAttributes(Attributes) <> RBMapException(String) getGroups():String[] getMembersInGroup(String):String[] setMembersInGroup(String, String[]) removeGroup(String) Attributes setUseCommandMapping(boolean, boolean) getRulebases():String[] getMembersForRulebase(String):String[] usingCommandMapping():boolean setMembersForRulebase(String, String[]) usingCommandMappingExclusively():boolean removeRulebase(String) getCommands():String[] getMembersForCommand(String):String[] setMembersForCommand(String, String[]) removeCommand(String): <>RBEConfigObjectAttributes

RBMapXML <> RBMapXML(RBMap)

RBEConfigObjectXML

TIBCO Hawk Configuration Object API Reference 44 | Chapter 4 Configuration Object API Class Structure

TIBCO Hawk Configuration Object API Reference | 45

Chapter 5 config.rbengine Package

This chapter describes the COM.TIBCO.hawk.config.rbengine package and its classes, interfaces, methods and exceptions.

Topics

• COM.TIBCO.hawk.config.rbengine, page 46 • RBEConfigObject, page 47 • RBEConfigObjectAttributes, page 52 • RBEConfigObjectXML, page 62 • RBEConfigObjectException, page 66

TIBCO Hawk Configuration Object API Reference 46 | Chapter 5 config.rbengine Package

COM.TIBCO.hawk.config.rbengine Package

Purpose Provides an interface and base classes for TIBCO Hawk configuration objects.

Interface Name Description Page Summary RBEConfigObject 47

This interface provides the facilities required to save RuleBaseEngine configuration objects to files. It provides methods to compute the file name as well as a method to produce an XML representation of the object.

Class Summary Name Description Page RBEConfigObjectAttributes 52

This class contains basic attributes of a rulebase configuration objects such as Rulebase, Schedules, or RBMap.

RBEConfigObjectXML 62

This class encapsulates the XML representation of a configuration object.

Exception Name Description Page Summary RBEConfigObjectException 66

RBEConfigObjectException is the superclass of all Configuration Object API expections.

TIBCO Hawk Configuration Object API Reference RBEConfigObject | 47

RBEConfigObject Interface

Package COM.TIBCO.hawk.config.rbengine

Purpose This interface provides the facilities required to save RuleBaseEngine configuration objects to files. It provides methods to compute the file name as well as a method to produce an XML representation of the object.

Remarks By convention, all classes that implement this interface should include a constructor that allows instances to be recreated from a reader containing an XML representation produced by the toXML() method.

Method Name Description Page Summary RBEConfigObject.getName() Returns the file name for this 48 RuleBaseEngine configuration object.

RBEConfigObject.getChecksum() Returns the checksum of the 49 RuleBaseEngine configuration item.

RBEConfigObject.getFileExtension() Returns the file extension for this 50 RuleBaseEngine configuration object.

RBEConfigObject.toXML() Writes the RuleBaseEngine 51 configuration object to writer in XML.

TIBCO Hawk Configuration Object API Reference 48 | Chapter 5 config.rbengine Package

RBEConfigObject.getName() Method

Package COM.TIBCO.hawk.config.rbengine

Declaration public String getName()

Purpose Returns the name for this RuleBaseEngine configuration object.

Remarks This name, together with the file extension returned by getFileExtention(), should be used as the file name if this object is saved to a file.

TIBCO Hawk Configuration Object API Reference RBEConfigObject.getChecksum() | 49

RBEConfigObject.getChecksum() Method

Package COM.TIBCO.hawk.config.rbengine

Declaration public long getChecksum()

Purpose Returns the checksum of the RuleBaseEngine configuration object.

TIBCO Hawk Configuration Object API Reference 50 | Chapter 5 config.rbengine Package

RBEConfigObject.getFileExtension() Method

Package COM.TIBCO.hawk.config.rbengine

Declaration public String getFileExtension()

Purpose Returns the file extension for the RuleBaseEngine configuration object.

TIBCO Hawk Configuration Object API Reference RBEConfigObject.toXML() | 51

RBEConfigObject.toXML() Method

Package COM.TIBCO.hawk.config.rbengine

Declaration public void toXML(Writer writer)

Purpose Writes the configuration object to writer in XML. Throws RBEConfigObjectException.

Parameters Parameter Description writer The character-stream writer object to which the configuration data will be written.

TIBCO Hawk Configuration Object API Reference 52 | Chapter 5 config.rbengine Package

RBEConfigObjectAttributes Class

Package COM.TIBCO.hawk.config.rbengine

Purpose This class contains basic attributes of a rulebase configuration objects such as Rulebase, Schedules, or RBMap. It includes author, last Modification and comment.

Remarks When a rulebase configuration object is created, the author and last modification attributes should be set. These two attributes should also be updated when the rulebase configuration object is changed. When comparing rulebase configuration objects, these attributes are not taken into consideration. For example, two schedules having identical list of schedules but have different comments and last modification are consider equal.

Method Name Description Page Summary RBEConfigObjectAttributes.clone() 54

Clone a copy of this object

RBEConfigObjectAttributes.constructChangedStamp() 55

A convenient method to create a time stamp for setting last modification record.

RBEConfigObjectAttributes.getAuthor() 56

Returns the author of this rulebase configuration object.

RBEConfigObjectAttributes.getComment() 57

Returns the comment of this rulebase configuration object.

RBEConfigObjectAttributes.getLastModification() 58

Returns the last modification record of this rulebase configuration object.

RBEConfigObjectAttributes.setAuthor() 59

Sets the author this rulebase configuration object.

TIBCO Hawk Configuration Object API Reference RBEConfigObjectAttributes | 53

Name Description Page RBEConfigObjectAttributes.setComment() 60

Sets the comment of this rulebase configuration object.

RBEConfigObjectAttributes.setLastModification() 61

Sets the last modification record this rulebase configuration object.

TIBCO Hawk Configuration Object API Reference 54 | Chapter 5 config.rbengine Package

RBEConfigObjectAttributes.clone() Method

Package COM.TIBCO.hawk.config.rbengine

Declaration public java.lang.Object clone()

Purpose Clone a copy of this object. Throws java.lang.CloneNotSupportedException.

Returns A copy of this object.

TIBCO Hawk Configuration Object API Reference RBEConfigObjectAttributes.constructChangedStamp() | 55

RBEConfigObjectAttributes.constructChangedStamp() Method

Package COM.TIBCO.hawk.config.rbengine

Declaration public static java.lang.String constructChangedStamp()

Purpose A convenient method to create a time stamp for setting last modification record. The format of the output string is as follows: userName on host hostName at HH:mm EE, MMM d, yyyy where userName is from the system property user.name, and hostName is the name from the machine where the JVM is running.

Returns A useful string for last modification record.

TIBCO Hawk Configuration Object API Reference 56 | Chapter 5 config.rbengine Package

RBEConfigObjectAttributes.getAuthor() Method

Package COM.TIBCO.hawk.config.rbengine

Declaration public java.lang.String getAuthor()

Purpose Returns the author of this rulebase configuration object.

Returns Returns the author of this rulebase configuration object.

TIBCO Hawk Configuration Object API Reference RBEConfigObjectAttributes.getComment() | 57

RBEConfigObjectAttributes.getComment() Method

Package COM.TIBCO.hawk.config.rbengine

Declaration public java.lang.String getComment()

Purpose The comment attribute is used to record user comments about the purpose of the rulebase configuration object. It also may serve as a place to record the rulebase configuration object change history.

Returns Returns the comment of this rulebase configuration object.

TIBCO Hawk Configuration Object API Reference 58 | Chapter 5 config.rbengine Package

RBEConfigObjectAttributes.getLastModification() Method

Package COM.TIBCO.hawk.config.rbengine

Declaration public java.lang.String getLastModification()

Purpose Returns the last modification record of this rulebase configuration object.

Returns Returns the last modification record of this rulebase configuration object.

TIBCO Hawk Configuration Object API Reference RBEConfigObjectAttributes.setAuthor() | 59

RBEConfigObjectAttributes.setAuthor() Method

Package COM.TIBCO.hawk.config.rbengine

Declaration public void setAuthor(java.lang.String name)

Purpose Sets the author of this rulebase configuration object.

TIBCO Hawk Configuration Object API Reference 60 | Chapter 5 config.rbengine Package

RBEConfigObjectAttributes.setComment() Method

Package COM.TIBCO.hawk.config.rbengine

Declaration public void setComment(java.lang.String name)

Purpose Sets the comment of this rulebase configuration object.

TIBCO Hawk Configuration Object API Reference RBEConfigObjectAttributes.setLastModification() | 61

RBEConfigObjectAttributes.setLastModification() Method

Package COM.TIBCO.hawk.config.rbengine

Declaration public void setLastModification(java.lang.String timeStamp)

Purpose Sets the last modification record of this rulebase configuration object, including who made the change and when. The method constructChangedStamp is provided to create such a record.

See Also constructChangedStamp()

TIBCO Hawk Configuration Object API Reference 62 | Chapter 5 config.rbengine Package

RBEConfigObjectXML Class

Package COM.TIBCO.hawk.config.rbengine

Purpose This class encapsulates the XML representation of a configuration object.

Method Name Description Page Summary RBEConfigObjectXML.RBEConfigObjectXML() 63

Creates an instance of the RBEConfigObjectXML object.

RBEConfigObjectXML.getXMLString() 64

Returns the string representation of this RBEConfigObjectXML.

RBEConfigObjectXML.getXMLReader() 65

Returns the XML representation of the configuration object as a string.

TIBCO Hawk Configuration Object API Reference RBEConfigObjectXML.RBEConfigObjectXML() | 63

RBEConfigObjectXML.RBEConfigObjectXML() Constructor

Package COM.TIBCO.hawk.config.rbengine

Declaration public RBEConfigObjectXML(RBEConfigObject co)

Purpose This method creates an instance of the RBEConfigObjectXML object.

Parameters Name Description

co RBEConfigObject used to create an instance of the RBEConfigObjectXML object.

TIBCO Hawk Configuration Object API Reference 64 | Chapter 5 config.rbengine Package

RBEConfigObjectXML.getXMLString() Method

Package COM.TIBCO.hawk.config.rbengine

Declaration public String getXMLString()

Purpose This method returns the XML representation of the configuration object as a string.

TIBCO Hawk Configuration Object API Reference RBEConfigObjectXML.getXMLReader() | 65

RBEConfigObjectXML.getXMLReader() Method

Package COM.TIBCO.hawk.config.rbengine

Declaration public java.io.Reader getXMLReader()

Purpose Returns a Reader that can be used to obtain the XML format of a configuration object.

TIBCO Hawk Configuration Object API Reference 66 | Chapter 5 config.rbengine Package

RBEConfigObjectException Exception

Package COM.TIBCO.hawk.config.rbengine

Purpose RBEConfigObjectException is the superclass of all Configuration Object API expections.

Method Name Description Page Summary RBEConfigObjectException.RBEConfigObjectException() 67

Constructs a RBEConfigObjectException object.

TIBCO Hawk Configuration Object API Reference RBEConfigObjectException.RBEConfigObjectException() | 67

RBEConfigObjectException.RBEConfigObjectException() Constructor

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Declaration public RBEConfigObjectException(string s)

Purpose This method constructs a TrueCountThreshold policy.

Parameters Name Description s The error message used to construct the RBEConfigObjectException object.

TIBCO Hawk Configuration Object API Reference 68 | Chapter 5 config.rbengine Package

TIBCO Hawk Configuration Object API Reference | 69

Chapter 6 config.rbengine.rulebase Package

This chapter describes the COM.TIBCO.hawk.config.rbengine.rulebase package and its classes, interfaces, methods and exceptions.

Topics

• COM.TIBCO.hawk.config.rbengine.rulebase, page 71 • RuleDataContext, page 74 • Action, page 77 • ClearAction, page 86 • ConsequenceAction, page 89 • DataSource, page 96 • OperandDescriptor, page 106 • Operator, page 112 • OperatorDescriptor, page 122 • Rule, page 132 • Rulebase, page 142 • RulebaseElement, page 162 • COM.TIBCO.hawk.config.rbengine.rulebase.policy, page 167 • ClearConditionPolicy(), page 169 • PerformActionPolicy(), page 170 • TrueConditionPolicy(), page 171 • ClearOnFirstFalse, page 172 • ClearTest, page 175 • ClearTimer, page 178 • PerformAlways, page 181

TIBCO Hawk Configuration Object API Reference 70 | Chapter 6 config.rbengine.rulebase Package

• PerformCountOnInterval, page 183 • PerformOnlyOnce, page 187 • TrueCountThreshold, page 189 • RulebaseXML, page 192 • Test, page 196 • VariableOperandDescriptor, page 209 • OperatorException, page 214 • RulebaseException, page 216

TIBCO Hawk Configuration Object API Reference COM.TIBCO.hawk.config.rbengine.rulebase | 71

COM.TIBCO.hawk.config.rbengine.rulebase Package

Purpose Provides classes for creating and processing rulebase used in TIBCO Hawk agents.

Interface Name Description Page Summary RuleDataContext 74

Used by the Rulebase engine to supply data to the Operator in the Test of a rulebase.

Class Summary Name Description Page Action 77

Superclass of the ConsequenceAction and ClearActions classes.

ClearAction 86

Represents an action that may be executed when a test makes a T->F state transition

ConsequenceAction 89

Represents an action that may be executed when a test makes a F->T or T->T state transition.

DataSource 96

Represent a rule’s data source. Contains all the information required to create a microagent subscription

OperandDescriptor 106

describe operands.

Operator 112

Builds all operators for use as testExpressionOperator in Test objects.

OperatorDescriptor 122

TIBCO Hawk Configuration Object API Reference 72 | Chapter 6 config.rbengine.rulebase Package

Name Description Page

Describe operators for use as testExpressionOperators in Test objects.

Rule 132

Rule objects are the primary components of a rulebase. A Rule object consists primarily of a data source and a list of tests.

Rulebase 142

Represents a rulebase. A rulebase is a configuration object for the RulebaseEngine microagent of a TIBCO Hawk agent.

RulebaseElement 162

Super class of the major rulebase elements: Rulebase, Rule, Test, and Action.

RulebaseXML 192

Encapsulates the XML representation of a Rulebase object.

Test 196

Test objects define the tests which are performed on the rule's data and what actions to take.

VariableOperandDescriptor 209

Describes the variable list operands.

Exception Name Description Page Summary OperatorException 214

Signals exceptions in the creation or evaluation of Operators.

RulebaseException 216

Signals that an error occurred while processing the rulebase.

TIBCO Hawk Configuration Object API Reference COM.TIBCO.hawk.config.rbengine.rulebase | 73

See Also For more details on rulebases and handling of rulebases in TIBCO Hawk Agents, please refer to: • TIBCO Hawk Administration Guide • TIBCO Hawk Console API

TIBCO Hawk Configuration Object API Reference 74 | Chapter 6 config.rbengine.rulebase Package

RuleDataContext Interface

Package COM.TIBCO.hawk.config.rbengine.rulebase

Purpose This interface is used by the Rulebase engine to supply data to the Operator in the Test of a rulebase. It allows the operators in a test to access data returned by a microagent.

Method Name Description Page Summary RuleDataContext.getRuleData() Returns the file name for this 75 RuleBase Engine configuration object.

RuleDataContext.getPostedConditions() Returns the file extension for this 76 RuleBase Engine configuration object.

TIBCO Hawk Configuration Object API Reference RuleDataContext.getRuleData() | 75

RuleDataContext.getRuleData() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public Object getRuleData(String field)

Purpose Returns the data associated with the referred data item in a rule.

Parameters Parameter Description field Name of the data item for which data is requested.

TIBCO Hawk Configuration Object API Reference 76 | Chapter 6 config.rbengine.rulebase Package

RuleDataContext.getPostedConditions() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public int getPostedConditions(String Condition)

Purpose Returns the value of the specified posted condition in the rule.

Parameters Parameter Description Condition Name of the condition whose posted conditions are required.

TIBCO Hawk Configuration Object API Reference Action | 77

Action Class

Package COM.TIBCO.hawk.config.rbengine.rulebase

Purpose This class is the superclass of the ConsequenceAction and ClearActions classes.

Method Name Description Page Summary Action.equals() Compares two Action object for 78 equality.

Action.getMethodInvocation() Returns the method invocation of 79 the Action.

Action.setMethodInvocation() Sets the method invocation of this 80 Action

Action.getMicroAgentName() Returns the microagent name of 81 the Action

Action.setMicroAgentName() Sets the microagent name of the 82 Action.

Action.getProperties() Returns the properties associate 83 with this action.

Action.setProperties() Sets the properties associate with 84 this action.

Action.toString() Returns the string representation of 85 the Action.

TIBCO Hawk Configuration Object API Reference 78 | Chapter 6 config.rbengine.rulebase Package

Action.equals() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public boolean equals(java.lang.Object obj)

Purpose Compares two Action object for equality.

Overrides equals in class RulebaseElement.

TIBCO Hawk Configuration Object API Reference Action.getMethodInvocation() | 79

Action.getMethodInvocation() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public MethodInvocation getMethodInvocation()

Purpose This method returns the method invocation of this action.

TIBCO Hawk Configuration Object API Reference 80 | Chapter 6 config.rbengine.rulebase Package

Action.setMethodInvocation() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setMethodInvocation(MethodInvocation mi)

Purpose This method sets the method invocation of this action.

Remarks Throws a IllegalArgumentException if the method invocation name is null.

Parameters Name Description

mi Method Invocation for the Action. This parameter must not be null.

TIBCO Hawk Configuration Object API Reference Action.getMicroAgentName() | 81

Action.getMicroAgentName() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getMicroAgentName()

Purpose This method returns the microagent name of this action.

TIBCO Hawk Configuration Object API Reference 82 | Chapter 6 config.rbengine.rulebase Package

Action.setMicroAgentName() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setMicroAgentName(String name)

Purpose Sets the microagent name for the method invocation of this action.

Remarks Throws a IllegalArgumentException if the microagent name is either null or an empty string.

Parameters Name Description name The microagent name. Must not be a null or empty string.

TIBCO Hawk Configuration Object API Reference Action.getProperties() | 83

Action.getProperties() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public java.util.Properties getProperties()

Purpose Returns the properties associate with this action.

TIBCO Hawk Configuration Object API Reference 84 | Chapter 6 config.rbengine.rulebase Package

Action.setProperties() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setProperties(java.util.Properties properties)

Purpose Sets the properties associate with this action.

Remarks Throws java.lang.IllegalArgumentException if properties is null.

Parameters Name Description properties The properties for this action. Must not be a null or empty string.

TIBCO Hawk Configuration Object API Reference Action.toString() | 85

Action.toString() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String toString()

Purpose This method returns a string representation of this Action.

Remarks This method overrides the toString() method in the Object class.

TIBCO Hawk Configuration Object API Reference 86 | Chapter 6 config.rbengine.rulebase Package

ClearAction Class

Package COM.TIBCO.hawk.config.rbengine.rulebase

Purpose The ClearAction class represents an action that may be executed when a test makes a T->F state transition.

Remarks Throws an IllegalArgumentException if the microagent name is null or empty, or if the method invocation is null.

Method Name Description Page Summary ClearAction.ClearAction() Constructs a ClearAction objects. 87

ClearAction.toString() Returns a string representation of the 88 Action.

TIBCO Hawk Configuration Object API Reference ClearAction.ClearAction() | 87

ClearAction.ClearAction() Constructor

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public ClearAction(String microAgentName, MethodInvocation mi)

Purpose Constructs a ClearAction.

Remarks Throws a IllegalArgumentException if the microagent name is null or empty, or if the method invocation is null.

Parameters Name Description

microAgentName Microagent name for this Action, must not be null or empty string

mi Method Invocation for the Action.

TIBCO Hawk Configuration Object API Reference 88 | Chapter 6 config.rbengine.rulebase Package

ClearAction.toString() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String toString()

Purpose This method returns a string representation of this ClearAction object.

Remarks This method overrides the toString() method in the class Action.

TIBCO Hawk Configuration Object API Reference ConsequenceAction | 89

ConsequenceAction Class

Package COM.TIBCO.hawk.config.rbengine.rulebase

Purpose The ConsequenceAction class represents an action that may be executed when a test makes a F->T or T->T state transition.

Remarks This method throws an IllegalArgumentException if the microagent name is null or empty, or if the method invocation is null.

TIBCO Hawk Configuration Object API Reference 90 | Chapter 6 config.rbengine.rulebase Package

ConsequenceAction.ConsequenceAction() Constructor

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public ConsequenceAction(String microAgentName, MethodInvocation mi)

Purpose This method constructs a ConsequenceAction object with default values for the PerformActionPolicy (PerformOnceOnly) and escalation period (0).

Remarks This method throws an IllegalArgumentException if the microagent name is null or empty, or if the method invocation is null.

Parameters Name Description microAgentName The microagent name for this action, must not be null or empty string

mi The method invocation for this action.

TIBCO Hawk Configuration Object API Reference ConsequenceAction.getEscalationTime() | 91

ConsequenceAction.getEscalationTime() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public int getEscalationTime()

Purpose This method returns the escalation time of this Action.

TIBCO Hawk Configuration Object API Reference 92 | Chapter 6 config.rbengine.rulebase Package

ConsequenceAction.getPerformActionPolicy() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public PerfomActionPolicy getPerformActionPolicy()

Purpose This method returns the perform action policy.

TIBCO Hawk Configuration Object API Reference ConsequenceAction.setEscalationTime() | 93

ConsequenceAction.setEscalationTime() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setEscalationTime(int sec)

Purpose This method sets the escalation time of this Action.

Remarks This method throws an IllegalArgumentException if the time specified is negative.

Parameters Name Description sec The escalation time in seconds.

TIBCO Hawk Configuration Object API Reference 94 | Chapter 6 config.rbengine.rulebase Package

ConsequenceAction.setPerformActionPolicy() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setPerformActionPolicy(PerfomActionPolicy policy)

Purpose This method sets the perform action policy. The only supported perform action policy types are PerformOnceOnly, PerformAlways, and PerformCountOnInterval.

Remarks This method throws an IllegalArgumentException if the perform action policy is not supported.

Parameters Name Description

policy The PerfomActionPolicy object..

TIBCO Hawk Configuration Object API Reference ConsequenceAction.toString() | 95

ConsequenceAction.toString() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String toString()

Purpose This method returns a string representation of this Action.

Remarks This method overrides the toString() method in class Action.

TIBCO Hawk Configuration Object API Reference 96 | Chapter 6 config.rbengine.rulebase Package

DataSource Class

Package COM.TIBCO.hawk.config.rbengine.rulebase

Purpose This method is used to represent a rule’s data source. It contains all the information required to create a microagent subscription.

Method Name Description Page Summary DataSource.DataSource() Constructs a DataSource 97 object.

DataSource.getDisplayName() Returns the display name for this 99 data source.

DataSource.getMethodSubscription() Returns string representation of 100 this data source.

DataSource.getMicroAgentName() Returns the microagent name. 101

DataSource.setDisplayName() Sets the display name for this 102 data source.

DataSource.setMethodSubscription() Sets the methodSubscription. 103

DataSource.toString() Returns string representation of 105 this object.

TIBCO Hawk Configuration Object API Reference DataSource.DataSource() | 97

DataSource.DataSource() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public DataSource(java.lang.String microAgentName, COM.TIBCO.hawk.talon.MethodSubscription ms)

Purpose This method constructs a DataSource object.

Remarks This method throws an IllegalArgumentException if either paramter is null.

Parameters Name Description microAgentName The name identifying the microagent providing the rule's data

ms The MethodSubcription which will be used to provide the rule's data

TIBCO Hawk Configuration Object API Reference 98 | Chapter 6 config.rbengine.rulebase Package

DataSource.DataSource() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration protected DataSource(java.lang.String microAgentName, COM.TIBCO.hawk.talon.MethodSubscription ms)

Purpose This method constructs a DataSource object.

Remarks This method throws an IllegalArgumentException if the xmlNode paramter is null.

Parameters Name Description microAgentName The name identifying the microagent providing the rule's data.

ms The name identifying the microagent providing the rule's data.

TIBCO Hawk Configuration Object API Reference DataSource.getDisplayName() | 99

DataSource.getDisplayName() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getDisplayName()

Purpose This method returns the display name for this DataSource object.

TIBCO Hawk Configuration Object API Reference 100 | Chapter 6 config.rbengine.rulebase Package

DataSource.getMethodSubscription() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public MethodSubscription getMethodSubscription()

Purpose This method returns string representation DataSource object.

TIBCO Hawk Configuration Object API Reference DataSource.getMicroAgentName() | 101

DataSource.getMicroAgentName() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getMicroAgent()

Purpose This method returns the string representation of the DataSource object.

TIBCO Hawk Configuration Object API Reference 102 | Chapter 6 config.rbengine.rulebase Package

DataSource.setDisplayName() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setDisplayName(String name)

Purpose This method returns string representation of the DataSource object.

TIBCO Hawk Configuration Object API Reference DataSource.setMethodSubscription() | 103

DataSource.setMethodSubscription() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public MethodSubscription setMethodSubscription(COM.TIBCO.hawk.talon.MethodSubscription ms)

Purpose This method sets the string representation of the DataSource object.

Remarks This method throws an IllegalArgumentException if the ms parameter is null.

Parameters Name Description ms The methodSubscription for this DataSource object, may not be null

TIBCO Hawk Configuration Object API Reference 104 | Chapter 6 config.rbengine.rulebase Package

DataSource.setMicroAgentName() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setMicroAgent(String name)

Purpose This method sets the microagent name for the DataSource object.

Remarks This method throws an IllegalArgumentException if name is null.

Parameters Name Description name The microagent name, may not be null

TIBCO Hawk Configuration Object API Reference DataSource.toString() | 105

DataSource.toString() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String toString()

Purpose This method returns the string representation of the DataSource object.

Remarks This method overrides the equals() method in the class Object.

TIBCO Hawk Configuration Object API Reference 106 | Chapter 6 config.rbengine.rulebase Package

OperandDescriptor Class

Package COM.TIBCO.hawk.config.rbengine.rulebase

Purpose This class is used to describe operands.

Method Name Description Page Summary OperandDescriptor.OperandDescrip Constructs an OperandDescriptor 107 tor() object.

OperandDescriptor.getName() Retrieves the operand name. 108

OperandDescriptor.getDescription() Retrieves the operand description. 109

OperandDescriptor.toString() Returns a string representation of 110 this object

OperandDescriptor.getType() Retrieves the operand type. 111

TIBCO Hawk Configuration Object API Reference OperandDescriptor.OperandDescriptor() | 107

OperandDescriptor.OperandDescriptor() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public OperandDescriptor(String name, String type, String desc)

Purpose Constructs an OperandDescriptor object.

Remarks This method throws an IllegalArgumentException if any of the arguments are null.

Parameters Name Description

name The name of the operand.

type The fully qualified classname of the operand’s type.

desc The description of the operand’s purpose.

TIBCO Hawk Configuration Object API Reference 108 | Chapter 6 config.rbengine.rulebase Package

OperandDescriptor.getName() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getName()

Purpose This method returns the operand’s name.

TIBCO Hawk Configuration Object API Reference OperandDescriptor.getDescription() | 109

OperandDescriptor.getDescription() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getDescription()

Purpose This method returns the operand description.

TIBCO Hawk Configuration Object API Reference 110 | Chapter 6 config.rbengine.rulebase Package

OperandDescriptor.toString() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String toString()

Purpose This method returns the string representation of this object.

TIBCO Hawk Configuration Object API Reference OperandDescriptor.getType() | 111

OperandDescriptor.getType() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getType()

Purpose This method returns the operand’s type.

TIBCO Hawk Configuration Object API Reference 112 | Chapter 6 config.rbengine.rulebase Package

Operator Class

Package COM.TIBCO.hawk.config.rbengine.rulebase

Purpose This class is used to build all operators for use as testExpressionOperator in Test objects.

Method Name Description Page Summary Operator.Operator() Constructs an Operator object. 113

Operator.evaluate() Evaluates the operator and returns 114 the results.

Operator.getDisplayName() Retrieves the operator display 115 name

Operator.getName() Retrieves the operator display 116 name

Operator.getOperands() Retrieves the operands 117

Operator.getOperatorDescriptors() Describes all available operators. 118

Operator.getType() Retrieves the return type of this 119 Operator.

Operator.setRuleDataContext() Sets the RuleDataContext. 120

Operator.toString() Returns the string representation of 121 this Operator

TIBCO Hawk Configuration Object API Reference Operator.Operator() | 113

Operator.Operator() Constructor

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public Operator(String name, Object[] operandList)

Purpose This method constructs an Operator object. The supplied operands are checked against the corresponding operator descriptor for validity. This insures that the correct number and types of operands are used. If an Operator object is supplied as one of the operands, it’s advertised type is used in the type checking. If the advertised type is java.lang.Object, then it is accepted here and type checking of the result is performed at runtime.

Remarks This method throws an IllegalArgumentException in the following cases: • the named operator is not supported •the operands in operandList do not match the descriptor of the named operator • the name is null •the operandList array contains null elements

Parameters Name Description name The name of the operand.

operandList The operands of the operator. May be null or empty array to indicate no operands.

TIBCO Hawk Configuration Object API Reference 114 | Chapter 6 config.rbengine.rulebase Package

Operator.evaluate() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String evaluate()

Purpose This method evaluates two Operator objects and returns results.

TIBCO Hawk Configuration Object API Reference Operator.getDisplayName() | 115

Operator.getDisplayName() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getDisplayName()

Purpose This method returns the Operator display name.

TIBCO Hawk Configuration Object API Reference 116 | Chapter 6 config.rbengine.rulebase Package

Operator.getName() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getName()

Purpose This method returns the Operator name.

TIBCO Hawk Configuration Object API Reference Operator.getOperands() | 117

Operator.getOperands() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getOperands()

Purpose This method returns the operands of the Operator object.

TIBCO Hawk Configuration Object API Reference 118 | Chapter 6 config.rbengine.rulebase Package

Operator.getOperatorDescriptors() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getOperatorDescriptors()

Purpose This method describes all the available operators of the Operator object.

TIBCO Hawk Configuration Object API Reference Operator.getType() | 119

Operator.getType() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getType()

Purpose This method returns the return type of the Operator.

TIBCO Hawk Configuration Object API Reference 120 | Chapter 6 config.rbengine.rulebase Package

Operator.setRuleDataContext() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setRuleDataContext(RuleDataContext rdc)

Purpose This method sets the RuleDataContext of the Operator object. This method is intended for use by the rules engine which evaluates this operator. The RuleDataContext allows the operators to access the rule engine's data. When invoked on an instance of this class, this method will be recursively applied to any operands that also happen to be instances of this class.

Parameters Name Description rdc The RuleDataContext .

TIBCO Hawk Configuration Object API Reference Operator.toString() | 121

Operator.toString() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String toString()

Purpose This method returns the string representation of the Operator object.

Remarks This method overrides the toString() method in the class Object.

Returns The string representation of the Operator object.

TIBCO Hawk Configuration Object API Reference 122 | Chapter 6 config.rbengine.rulebase Package

OperatorDescriptor Class

Package COM.TIBCO.hawk.config.rbengine.rulebase

Purpose This class is used to describe operators for use as testExpressionOperators in Test objects. If the operator being described supports only a fixed number of operands, then the getFixedOperandDescriptors() method should return an array of OperandDescriptor objects (one for each required operand in the corresponding position) and the getVariableOperandDescriptor() should return null. If the operator being described supports only a variable-number of operands, then the getFixedOperandDescriptors() method should return null or an empty array and the getVariableOperandDescriptor() should return a single descriptor describing all operands including the min/max count. If the operator being described supports both a fixed number of operands and a variable number of operands, then both methods should return descriptors. Such operators always expect the fixed-number operands before the variable number operands when considering the order of the operands presented at evaluation time. If the operator being described doesn't require any operands, then the getFixedOperandDescriptors() method should return null or an empty array and the getVariableOperandDescriptor() should return null.

Method Name Description Page Summary OperatorDescriptor.OperatorDescripto Constructs an Operator object. 124 r()

OperatorDescriptor.getDescription() Retrieves the operator description. 125

OperatorDescriptor.getDisplayName() Retrieves the operator display 126 name.

OperatorDescriptor.getFixedOperand Retrieves the fixed-number 127 Descriptors() operand descriptors.

OperatorDescriptor.getName() Retrieves the Operator name. 128

OperatorDescriptor.getType() Retrieves the Operator return 129 type.

OperatorDescriptor.getVariableOpera Retrieves the variable-number 130 ndDescriptor() operand descriptor.

TIBCO Hawk Configuration Object API Reference OperatorDescriptor | 123

Name Description Page OperatorDescriptor.toString() Returns a string representation of 131 this object

TIBCO Hawk Configuration Object API Reference 124 | Chapter 6 config.rbengine.rulebase Package

OperatorDescriptor.OperatorDescriptor() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public OperandDescriptor(String name, String displayName, String type, String desc, OperandDescriptor fixedOperands[], VariableOperandDescriptor variableOperands)

Purpose This method constructs an OperatorDescriptor object. The supplied operands are checked against the corresponding operator descriptor for validity. This insures that the correct number and types of operands are used. If an Operator object is supplied as one of the operands, its advertised type is used in the type checking. If its advertised type is java.lang.Object, then it is accepted here and type checking of the result is performed at runtime.

Remarks This method throws an IllegalArgumentException in the following cases if either the name, type or desc are null.

Parameters Name Description

name The name of the OperatorDescriptor object.

displayName The displayName of the OperatorDescriptor object.

type The fully qualified classname of the OperatorDescriptor’s type.

desc A description of the OperatorDescriptor’s purpose.

fixedOperands An array of descriptors describing the fixed-number operands. May be null or empty array to indicate no fixed-number operands.

variableOperands A single descriptor describing all variable-number operands. May be null to indicate no variable-number operands.

TIBCO Hawk Configuration Object API Reference OperatorDescriptor.getDescription() | 125

OperatorDescriptor.getDescription() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getDescription()

Purpose This method returns the description of the OperatorDescriptor object.

TIBCO Hawk Configuration Object API Reference 126 | Chapter 6 config.rbengine.rulebase Package

OperatorDescriptor.getDisplayName() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getDisplayName()

Purpose This method returns the displayName of the OperatorDescriptor object.

TIBCO Hawk Configuration Object API Reference OperatorDescriptor.getFixedOperandDescriptors() | 127

OperatorDescriptor.getFixedOperandDescriptors() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getFixedOperandDescriptors()

Purpose This method returns the fixed-number operand descriptors.

TIBCO Hawk Configuration Object API Reference 128 | Chapter 6 config.rbengine.rulebase Package

OperatorDescriptor.getName() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getName()

Purpose This method returns the operator name of the OperatorDescriptor object.

TIBCO Hawk Configuration Object API Reference OperatorDescriptor.getType() | 129

OperatorDescriptor.getType() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getType()

Purpose This method returns the operator return type of the OperatorDescriptor object.

TIBCO Hawk Configuration Object API Reference 130 | Chapter 6 config.rbengine.rulebase Package

OperatorDescriptor.getVariableOperandDescriptor() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getVariableOperandDescriptor()

Purpose This method returns the variable-number VariableOperatorDescriptor object. All variable-number operands share the same descriptor.

TIBCO Hawk Configuration Object API Reference OperatorDescriptor.toString() | 131

OperatorDescriptor.toString() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String toString()

Purpose This method returns the string representation of the OperatorDescriptor object.

TIBCO Hawk Configuration Object API Reference 132 | Chapter 6 config.rbengine.rulebase Package

Rule Class

Package COM.TIBCO.hawk.config.rbengine.rulebase

Purpose Rule objects are the primary components of a rulebase. A Rule object consists primarily of a data source and a list of tests.

Method Name Description Page Summary Rule.Rule() Constructs a Rule object. 133

Rule.getDataSource() Returns the rule's data source. 135

Rule.getOverRuling() Returns the rule's precedence level used in 136 overruling.

Rule.getTests() Returns the array of Test objects used by this 137 rule.

Rule.setDataSource() Sets the rule's data source. 138

Rule.setOverRuling() Sets the rule's precedence level used in 139 overruling.

Rule.setTests() Sets the array of Test objects used by this 140 rule.

Rule.toString() Returns string representation of this rule. 141

TIBCO Hawk Configuration Object API Reference Rule.Rule() | 133

Rule.Rule() Constructor

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public Rule(DataSource ds, Test tests[])

Purpose This method constructs an Rule object.

Remarks This method throws an IllegalArgumentException if either the DataSource or Test parameters is null or if any of the test names are not unique.

Parameters Name Description ds The Rule’s data source.

tests An array of Test objects. All tests must have unique names.

TIBCO Hawk Configuration Object API Reference 134 | Chapter 6 config.rbengine.rulebase Package

Rule.clearTests() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void clearTests()

Purpose This method removes all the tests in this rule.

TIBCO Hawk Configuration Object API Reference Rule.getDataSource() | 135

Rule.getDataSource() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public DataSource getDataSource()

Purpose This method returns the Rule’s data source.

TIBCO Hawk Configuration Object API Reference 136 | Chapter 6 config.rbengine.rulebase Package

Rule.getOverRuling() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public int getOverRuling()

Purpose This method gets the Rule’s precedence level used in overruling.

TIBCO Hawk Configuration Object API Reference Rule.getTests() | 137

Rule.getTests() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public Test[] getTests()

Purpose This method returns the array of Test objects used by this Rule object.

TIBCO Hawk Configuration Object API Reference 138 | Chapter 6 config.rbengine.rulebase Package

Rule.setDataSource() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setDataSource(DataSource ds)

Purpose This method sets the Rule’s data source.

Remarks This method throws an IllegalArgumentException if the data source is null.

TIBCO Hawk Configuration Object API Reference Rule.setOverRuling() | 139

Rule.setOverRuling() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setOverRuling(int precedence)

Purpose This method sets the Rule’s precedence level used in overruling.

TIBCO Hawk Configuration Object API Reference 140 | Chapter 6 config.rbengine.rulebase Package

Rule.setTests() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setTests(Test tests[])

Purpose This method sets the array of Test objects used by this Rule object.

TIBCO Hawk Configuration Object API Reference Rule.toString() | 141

Rule.toString() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String toString()

Purpose This method returns the string representation of the Rule object.

Remarks This method overrides the toString() method in the Object class.

TIBCO Hawk Configuration Object API Reference 142 | Chapter 6 config.rbengine.rulebase Package

Rulebase Class

Package COM.TIBCO.hawk.config.rbengine.rulebase

Purpose This class represents a rulebase. A rulebase is a configuration object for the RulebaseEngine microagent of a TIBCO Hawk agent. It provides the instructions for the monitoring activities that are to be autonomously performed. 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.

Method Name Description Page Summary Rulebase.Rulebase() Returns a copy of this object 144

Rulebase.getAuthor() Returns the author of the rulebase. 145

Rulebase.getCheckSum() Returns the checksum of the config 146 object

Rulebase.getCommands() Returns the command list of a rulebase. 147

Rulebase.getComment() Returns the rulebase comment. 148

Rulebase.getFileExtension() Returns file extension based on the 149 configuration object type.

Rulebase.getIncludedRulebases() Returns the rulebase include list. 150

Rulebase.getLastModification() Returns the last modification string. 151

Rulebase.getRules() Returns the list of Rule objects that make 152 up this rulebase.

Rulebase.setAuthor() Sets the author 153

Rulebase.setCommands() Sets the commands. 154

Rulebase.setComment() Sets the comment. 155

Rulebase.setIncludedRulebases() Sets the include rulebase list. 156

Rulebase.setLastModification() Sets the last modification record. 157

Rulebase.setName() Sets the name of this rulebase element. 158

TIBCO Hawk Configuration Object API Reference Rulebase | 143

Name Description Page Rulebase.setRules() Sets the list of Rule objects that make up 159 this rulebase.

Rulebase.toString() Returns the string representation of the 160 parameter.

Rulebase.toXML() Writes the configuration object to 161 Writer in XML.

Constants Name Description Summary FILE_EXTENSION The File_Extension used for the Rulebase.

TIBCO Hawk Configuration Object API Reference 144 | Chapter 6 config.rbengine.rulebase Package

Rulebase.Rulebase() Constructor

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public Rulebase(Reader reader) public Rulebase(String name, Rule rules[])

Purpose This method constructs the Rulebase object from a Reader. The Reader should contain the rulebase represented in XML. This is a convenient way to construct the object from a file via FileInputStream.

Remarks The first constructor form throws a RulebaseException if an error is encountered when creating a rulebase from the Reader. The second constructor form throws a RulebaseException in case of the following conditions: • any argument is null, • if the rulebase name contains illegal characters, • if any of the Rulebase names are not unique.

Parameters Name Description reader The input reader of the configuration object in XML representation.

name The rulebase name, it must contain only alpha-numeric characters, "_", "-", and no spaces.

rules The array of Rule objects, all rules must have unique names.

xmlNode The XML node that contain the Rulebase.

TIBCO Hawk Configuration Object API Reference Rulebase.getAuthor() | 145

Rulebase.getAuthor() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getAuthor()

Purpose This method returns the author of the Rulebase object.

TIBCO Hawk Configuration Object API Reference 146 | Chapter 6 config.rbengine.rulebase Package

Rulebase.getCheckSum() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public long getCheckSum()

Purpose This method returns the checksum of the Rulebase object.

Remarks This method overrides the RulebaseElement.getCheckSum() method.

TIBCO Hawk Configuration Object API Reference Rulebase.getCommands() | 147

Rulebase.getCommands() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String[] getCommands()

Purpose This method returns the command list of the Rulebase object.

TIBCO Hawk Configuration Object API Reference 148 | Chapter 6 config.rbengine.rulebase Package

Rulebase.getComment() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getComment()

Purpose Returns the comments of the Rulebase object. The comment attribute is used to record user comments about the purpose of the rulebase. It also may serve as a place to record the rulebase change history.

TIBCO Hawk Configuration Object API Reference Rulebase.getFileExtension() | 149

Rulebase.getFileExtension() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getFileExtension()

Purpose Returns the file extension based on the configuration object type.

TIBCO Hawk Configuration Object API Reference 150 | Chapter 6 config.rbengine.rulebase Package

Rulebase.getIncludedRulebases() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String[] getIncludedRulebases()

Purpose This method returns the rulebase include list. This is the list of rulebases that the RulebaseEngine will attempt to load when it loads the current rulebase.

TIBCO Hawk Configuration Object API Reference Rulebase.getLastModification() | 151

Rulebase.getLastModification() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getLastModification()

Purpose This method returns the last modification list. This attribute is used to record information about the last edit made to the rulebase.

TIBCO Hawk Configuration Object API Reference 152 | Chapter 6 config.rbengine.rulebase Package

Rulebase.getRules() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public Rule[] getRules()

Purpose This method returns the list of Rule objects that make up this rulebase.

TIBCO Hawk Configuration Object API Reference Rulebase.setAuthor() | 153

Rulebase.setAuthor() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setAuthor()

Purpose This method sets the author of the rulebase object.

TIBCO Hawk Configuration Object API Reference 154 | Chapter 6 config.rbengine.rulebase Package

Rulebase.setCommands() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setCommands(String commands[])

Purpose This method sets the command list of the rulebase object.

TIBCO Hawk Configuration Object API Reference Rulebase.setComment() | 155

Rulebase.setComment() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setComment(String commands[])

Purpose This method sets the command list of the rulebase object.

TIBCO Hawk Configuration Object API Reference 156 | Chapter 6 config.rbengine.rulebase Package

Rulebase.setIncludedRulebases() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setIncludedRulebases()

Purpose This method sets the rulebase include list. This is the list of rulebases that the RulebaseEngine will attempt to load when it loads the current rulebase.

TIBCO Hawk Configuration Object API Reference Rulebase.setLastModification() | 157

Rulebase.setLastModification() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setLastModification(String mod)

Purpose This method sets the last modification record for the rulebase object.

Parameters Name Description mod The string used to set the last modification record.

TIBCO Hawk Configuration Object API Reference 158 | Chapter 6 config.rbengine.rulebase Package

Rulebase.setName() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setName(String name)

Purpose This method sets the name of this rulebase object.

Remarks Throws an IllegalArgumentException if the name contains illegal arguments.

Parameters Name Description name The name of this rulebase element.

TIBCO Hawk Configuration Object API Reference Rulebase.setRules() | 159

Rulebase.setRules() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setRules(Rules[])

Purpose This method sets the list of Rule objects that make up this rulebase.

Remarks Throws an IllegalArgumentException is any of the rules are null or if the rule names are not unique.

Parameters Name Description rules The array of rules. May not be null and all the names must be unique.

TIBCO Hawk Configuration Object API Reference 160 | Chapter 6 config.rbengine.rulebase Package

Rulebase.toString() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String toString()

Purpose This method returns a string representation of this Rulebase.

Remarks This method overrides the toString() method in the class Object.

TIBCO Hawk Configuration Object API Reference Rulebase.toXML() | 161

Rulebase.toXML() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void toXML(Writer writer)

Purpose This method writes the configuration object to the writer in XML.

Remarks This method overrides the toXML() method in the RulebaseElement class. Throws a RBEConfigObjectException.

Parameters Name Description

writer The input writer of the configuration object in XML representation.

TIBCO Hawk Configuration Object API Reference 162 | Chapter 6 config.rbengine.rulebase Package

RulebaseElement Class

Package COM.TIBCO.hawk.config.rbengine.rulebase

Purpose 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.

Method Name Description Page Summary RulebaseElement.getName() Returns the name for this rulebase 163 element.

RulebaseElement.getSchedule() Returns the schedule name for this 164 rulebase element.

RulebaseElement.setName() Sets the name of this rulebase element. 165

RulebaseElement.setSchedule() Set the schedule name of this rulebase 166 element.

TIBCO Hawk Configuration Object API Reference RulebaseElement.getName() | 163

RulebaseElement.getName() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getName()

Purpose This method returns the name for this RulebaseElement object.

TIBCO Hawk Configuration Object API Reference 164 | Chapter 6 config.rbengine.rulebase Package

RulebaseElement.getSchedule() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String getSchedule()

Purpose This method returns the schedule name for this RulebaseElement object.

TIBCO Hawk Configuration Object API Reference RulebaseElement.setName() | 165

RulebaseElement.setName() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setName(String name)

Purpose This method sets the name of this RulebaseElement object.

TIBCO Hawk Configuration Object API Reference 166 | Chapter 6 config.rbengine.rulebase Package

RulebaseElement.setSchedule() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public setSchedule(String schedule)

Purpose This method sets the schedule name for this RulebaseElement object.

TIBCO Hawk Configuration Object API Reference COM.TIBCO.hawk.config.rbengine.rulebase.policy | 167

COM.TIBCO.hawk.config.rbengine.rulebase.policy Package

Purpose Provides classes for creating and processing rulebase related policies.

Interface Name Page Summary ClearConditionPolicy() 169

The ClearConditionPolicy objects are used in tests to determine when a test should transition to a false state.

PerformActionPolicy() 170

The PerformActionPolicy objects are used in actions to determine when the actions are actually executed.

TrueConditionPolicy() 171

The TrueConditionPolicy objects are used in tests to determine when a test transitions to a true state.

Class Summary Name Description Page ClearOnFirstFalse 172

Indicates that a test should transition to the false state upon the first false evaluation of its test expression.

ClearTest 175

Indicates that a test should transition to the false state upon the true evaluation of the clear test expression contained in the ClearTest policy object.

ClearTimer 178

Indicates that a test should transition to the false state upon the expiration of a timer.

PerformAlways 181

Indicates that a test should transition to the false state upon the expiration of a timer.

PerformCountOnInterval 183

TIBCO Hawk Configuration Object API Reference 168 | Chapter 6 config.rbengine.rulebase Package

Name Description Page Indicates that an action should be executed a fixed number of times with a minimum pause between executions.

PerformOnlyOnce 187

Indicates that an action should be executed only once during a true series.

TrueCountThreshold 189

Indicates that a test should transition to the true state after a certain number of true evaluations of its test expression, the true count threshold.

TIBCO Hawk Configuration Object API Reference ClearConditionPolicy() | 169

ClearConditionPolicy() Interface

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Purpose The ClearConditionPolicy objects are used in tests to determine when a test should transition to a false state.

TIBCO Hawk Configuration Object API Reference 170 | Chapter 6 config.rbengine.rulebase Package

PerformActionPolicy() Interface

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Purpose The PerformActionPolicy objects are used in actions to determine when the actions are actually executed.

TIBCO Hawk Configuration Object API Reference TrueConditionPolicy() | 171

TrueConditionPolicy() Interface

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Purpose The TrueConditionPolicy objects are used in tests to determine when a test transitions to a true state.

TIBCO Hawk Configuration Object API Reference 172 | Chapter 6 config.rbengine.rulebase Package

ClearOnFirstFalse Class

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Purpose A ClearOnFirstFalse policy indicates that a test should transition to the false state upon the first false evaluation of its test expression.

Method Name Description Page Summary ClearOnFirstFalse.ClearOnFirstFalse() Construct a new 173 ClearOnFirstFalse policy

ClearOnFirstFalse.equals() Compares two 174 ClearOnFirstFalse objects for equality.

TIBCO Hawk Configuration Object API Reference ClearOnFirstFalse.ClearOnFirstFalse() | 173

ClearOnFirstFalse.ClearOnFirstFalse() Constructor

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Declaration public ClearOnFirstFalse()

Purpose This method constructs a ClearOnFirstFalse object.

TIBCO Hawk Configuration Object API Reference 174 | Chapter 6 config.rbengine.rulebase Package

ClearOnFirstFalse.equals() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Declaration public equals(Object obj)

Purpose This method compares two ClearOnFirstFalse objects for equality.

Remarks This method returns true if the objects are the same and false otherwise. The method overrides the equals() method in the class object.

Parameters Name Description obj The object used to compare with this instance of the ClearOnFirstFalse object.

TIBCO Hawk Configuration Object API Reference ClearTest | 175

ClearTest Class

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Purpose A ClearTest policy indicates that a test should transition to the false state upon the true evaluation of the clear test expression contained in the ClearTest policy object.

Method Name Description Page Summary ClearTest.ClearTest() Constructs a ClearTest object 176

ClearTest.getTestExpression() Returns the test for the clear test. 177

TIBCO Hawk Configuration Object API Reference 176 | Chapter 6 config.rbengine.rulebase Package

ClearTest.ClearTest() Constructor

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Declaration public ClearTest(Operator test)

Purpose This method constructs a ClearTest object.

Remarks The method throws an IllegalArgumentException if the test is null.

Parameters Name Description test The policy's test expression

TIBCO Hawk Configuration Object API Reference ClearTest.getTestExpression() | 177

ClearTest.getTestExpression() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Declaration public Operator getTestExpression()

Purpose This method returns the test for the ClearTest object.

TIBCO Hawk Configuration Object API Reference 178 | Chapter 6 config.rbengine.rulebase Package

ClearTimer Class

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Purpose A ClearTimer policy indicates that a test should transition to the false state upon the expiration of a timer. The timer is reset each time the test's test expression evaluates to true.

Method Name Description Page Summary ClearTimer.ClearTimer() Constructs a ClearTimer policy. 179

ClearTimer.getTimerInterval() Returns the timer interval 180

TIBCO Hawk Configuration Object API Reference ClearTimer.ClearTimer() | 179

ClearTimer.ClearTimer() Constructor

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Declaration public ClearTimer(int interval)

Purpose This method constructs a ClearTimer policy.

Remarks The method throws an IllegalArgumentException if the interval is not greater than 0.

Parameters Name Description interval The timer interval in seconds.

TIBCO Hawk Configuration Object API Reference 180 | Chapter 6 config.rbengine.rulebase Package

ClearTimer.getTimerInterval() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Declaration public int getTimerInterval()

Purpose This method returns the timer interval.

TIBCO Hawk Configuration Object API Reference PerformAlways | 181

PerformAlways Class

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Purpose A ClearTimer policy indicates that a test should transition to the false state upon the expiration of a timer. The timer is reset each time the test's test expression evaluates to true.

Method Name Description Page Summary PerformAlways.PerformAlways() Constructs a PerformAlways policy 182

TIBCO Hawk Configuration Object API Reference 182 | Chapter 6 config.rbengine.rulebase Package

PerformAlways.PerformAlways() Constructor

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Declaration public PerformAlways()

Purpose This method constructs a PerformAlways policy.

TIBCO Hawk Configuration Object API Reference PerformCountOnInterval | 183

PerformCountOnInterval Class

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Purpose This policy is used to indicate that an action should be executed a fixed number of times with a minimum pause between executions.

Method Name Description Page Summary PerformCountOnInterval.PerformCountOnI Construct a 184 nterval() PerformCountOnInterval policy.

PerformCountOnInterval.getCount() Returns the count value of 185 this policy.

PerformCountOnInterval.getInterval() Returns the interval value of 186 this policy.

TIBCO Hawk Configuration Object API Reference 184 | Chapter 6 config.rbengine.rulebase Package

PerformCountOnInterval.PerformCountOnInterval() Constructor

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Declaration public PerformCountOnInterval(int count int interval)

Purpose This method constructs a PerformCountOnInterval policy.

Remarks Throws java.lang.IllegalArgumentException if either count or interval are negative.

Parameters Name Description count Maximum number of times this action should execute during a true test series.

interval Minimum amount of time in seconds that must elapse between executions.

TIBCO Hawk Configuration Object API Reference PerformCountOnInterval.getCount() | 185

PerformCountOnInterval.getCount() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Declaration public int getCount()

Purpose This method returns the count value of this PerformCountOnInterval policy.

TIBCO Hawk Configuration Object API Reference 186 | Chapter 6 config.rbengine.rulebase Package

PerformCountOnInterval.getInterval() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Declaration public int getInterval()

Purpose This method returns the interval value of this PerformCountOnInterval policy.

TIBCO Hawk Configuration Object API Reference PerformOnlyOnce | 187

PerformOnlyOnce Class

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Purpose This policy is used to indicate that an action should be executed only once during a true series.

Method Name Description Page Summary PerformOnlyOnce.PerformOnlyOnce() Constructs a 188 PerformOnceOnly policy

TIBCO Hawk Configuration Object API Reference 188 | Chapter 6 config.rbengine.rulebase Package

PerformOnlyOnce.PerformOnlyOnce() constructor

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Declaration public PerformOnlyOnce()

Purpose This method constructs a PerformOnlyOnce policy.

TIBCO Hawk Configuration Object API Reference TrueCountThreshold | 189

TrueCountThreshold Class

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Purpose A TrueCountThreshold policy indicates that a test should transition to the true state after a certain number of true evaluations of its test expression, the true count threshold.

Method Name Description Page Summary TrueCountThreshold.TrueCountThreshold() Constructs a 190 TrueCountThreshold policy.

TrueCountThreshold.getTrueCountThresho Returns the true count 191 ld() threshold value of this policy

TIBCO Hawk Configuration Object API Reference 190 | Chapter 6 config.rbengine.rulebase Package

TrueCountThreshold.TrueCountThreshold() Constructor

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Declaration public TrueCountThreshold(int truecount)

Purpose This method constructs a TrueCountThreshold policy.

Remarks The method throws an IllegalArgumentException if trueCount is not greater than 0.

Parameters Name Description trueCount The policy's true count threshold value

TIBCO Hawk Configuration Object API Reference TrueCountThreshold.getTrueCountThreshold() | 191

TrueCountThreshold.getTrueCountThreshold() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Declaration public boolean getTrueCountThreshold(Object obj)

Purpose Returns the true count threshold value of this policy.

TIBCO Hawk Configuration Object API Reference 192 | Chapter 6 config.rbengine.rulebase Package

RulebaseXML Class

Package COM.TIBCO.hawk.config.rbengine

Purpose This class encapsulates the XML representation of a Rulebase object.

Method Name Description Page Summary RulebaseXML.RulebaseXML() Creates an instance of the 193 RBEConfigObjectXML object.

RulebaseXML.getXMLString() Returns the string representation of this 194 RBEConfigObjectXML.

RulebaseXML.getXMLReader() Returns the XML representation of the 195 configuration object as a string.

TIBCO Hawk Configuration Object API Reference RulebaseXML.RulebaseXML() | 193

RulebaseXML.RulebaseXML() Constructor

Package COM.TIBCO.hawk.config.rbengine

Declaration public RulebaseXML( Rulebase r)

Purpose This method creates an instance of the RulebaseXML object.

Parameters Name Description

r Rulebase object used to create an instance of the RulebaseXML object.

TIBCO Hawk Configuration Object API Reference 194 | Chapter 6 config.rbengine.rulebase Package

RulebaseXML.getXMLString() Method

Package COM.TIBCO.hawk.config.rbengine

Declaration public String getXMLString()

Purpose This method returns the XML representation of the Rulebase object as a string.

TIBCO Hawk Configuration Object API Reference RulebaseXML.getXMLReader() | 195

RulebaseXML.getXMLReader() Method

Package COM.TIBCO.hawk.config.rbengine

Declaration public java.io.Reader getXMLReader()

Purpose This method returns the XML representation of the Rulebase object from the character-stream reader.

TIBCO Hawk Configuration Object API Reference 196 | Chapter 6 config.rbengine.rulebase Package

Test Class

Package COM.TIBCO.hawk.config.rbengine.rulebase

Purpose Test objects define the tests which are performed on the rule's data and what actions to take. A Test object consists primarily of a test expression and a list of actions.

Method Name Description Page Summary Test.Test() Constructs a Test object 197

Test.getClearActions() Returns the clear actions. 198

Test.getClearConditionPolicy() Returns the clear condition 199 policy

Test.getConsequenceActions() Returns the consequence 200 actions.

Test.getTestExpressionOperator() Returns the test expression 201 operator.

Test.getTrueConditionPolicy() Returns the true condition 202 policy

Test.setClearActions() Sets the clear actions. 203

Test.setClearConditionPolicy() Sets the clear condition policy . 204

Test.setConsequenceActions() Sets the consequence actions. 205

Test.setTestExpressionOperator() Sets the test expression operator. 206

Test.setTrueConditionPolicy() Sets the true condition policy. 207

Test.toString() Returns string representation of 208 this test.

TIBCO Hawk Configuration Object API Reference Test.Test() | 197

Test.Test() Constructor

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public Test(ConsequenceAction actions[], Operator Op)

Purpose This method constructs an instance of a Test object.

Remarks The method throws a RulebaseException if either argument is null or if the test expression operator doesn't return a Boolean value.

Parameters Name Description actions The consequence actions of the test

op The Operator object forming the test expression, must be an Operator object that returns a Boolean value.

TIBCO Hawk Configuration Object API Reference 198 | Chapter 6 config.rbengine.rulebase Package

Test.getClearActions() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public ClearAction[] getClearActions()

Purpose This method returns the clear actions for the Test object.

TIBCO Hawk Configuration Object API Reference Test.getClearConditionPolicy() | 199

Test.getClearConditionPolicy() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public ClearConditionPolicy getClearConditionPolicy()

Purpose This method returns the clear condition policies for the Test object.

TIBCO Hawk Configuration Object API Reference 200 | Chapter 6 config.rbengine.rulebase Package

Test.getConsequenceActions() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public ConsequenceAction[] getConsequenceActions()

Purpose This method returns the consequence actions for the Test object.

TIBCO Hawk Configuration Object API Reference Test.getTestExpressionOperator() | 201

Test.getTestExpressionOperator() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public Operator getTestExpressionOperator()

Purpose This method returns the test expression operator for the Test object.

TIBCO Hawk Configuration Object API Reference 202 | Chapter 6 config.rbengine.rulebase Package

Test.getTrueConditionPolicy() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public TrueConditionPolicy getTrueConditionPolicy()

Purpose This method returns the true condition policy for the Test object.

TIBCO Hawk Configuration Object API Reference Test.setClearActions() | 203

Test.setClearActions() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setClearActions(ClearAction clearactions[])

Purpose This method sets the clear actions for the Test object.

Remarks The method throws a IllegalArgumentException if the actions do not have unique names.

Parameters Name Description clearactions The array of clear actions

TIBCO Hawk Configuration Object API Reference 204 | Chapter 6 config.rbengine.rulebase Package

Test.setClearConditionPolicy() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setClearConditionPolicy(ClearConditionPolicy policy)

Purpose This method sets the clear condition policies for the Test object.

Remarks The method throws an IllegalArgumentException if the policy is not supported.

Parameters Name Description policy The clear condition policy.

TIBCO Hawk Configuration Object API Reference Test.setConsequenceActions() | 205

Test.setConsequenceActions() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setConsequenceActions(ConsequenceAction action[])

Purpose This method sets the consequence actions for the Test object.

Remarks The method throws an IllegalArgumentException if the actions do not have unique names.

Parameters Name Description action The array of consequence actions, all actions must have unique names.

TIBCO Hawk Configuration Object API Reference 206 | Chapter 6 config.rbengine.rulebase Package

Test.setTestExpressionOperator() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setTestExpressionOperator(Operator op)

Purpose This method sets the test expression operator for the Test object.

Remarks The method throws an IllegalArgumentException if the operator is null or doesn’t return a boolean value.

Parameters Name Description op The Operator object forming the test expression, must be an Operator object that returns a Boolean value.

TIBCO Hawk Configuration Object API Reference Test.setTrueConditionPolicy() | 207

Test.setTrueConditionPolicy() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public void setTrueConditionPolicy(TrueConditionPolicy policy)

Purpose This method sets the true condition policy for the Test object. The only supported TrueConditionPolicy type is TrueCountThreshold.

Remarks The method throws an IllegalArgumentException if the policy is null or doesn’t return a boolean value.

Parameters Name Description policy The true condition policy.

TIBCO Hawk Configuration Object API Reference 208 | Chapter 6 config.rbengine.rulebase Package

Test.toString() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String toString()

Purpose This method returns a string representation of this Test.

Remarks This method overrides the toString() method in the class Object.

TIBCO Hawk Configuration Object API Reference VariableOperandDescriptor | 209

VariableOperandDescriptor Class

Package COM.TIBCO.hawk.config.rbengine.rulebase

Purpose This class is used to describe the variable list operands.

Method Name Description Page Summary VariableOperandDescriptor.Variable Constructs a 210 OperandDescriptor() VariableOperandDescriptor

VariableOperandDescriptor.getMax() Retrieves the max value 211

VariableOperandDescriptor.getMin() Retrieves the min value 212

VariableOperandDescriptor.toString() Returns a string representation of 213 this object

TIBCO Hawk Configuration Object API Reference 210 | Chapter 6 config.rbengine.rulebase Package

VariableOperandDescriptor.VariableOperandDescriptor() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public VariableOperandDescriptor(String name, String type, String desc, int min, int max)

Purpose This method constructs a VariableOperandDescriptor object.

Remarks The method throws a IllegalArgumentException in the following cases • any of the arguments is null • negative numbers are used for the min and min parameters • min > min

Parameters Name Description name The name of the operand.

type The fully qualified classname of the operand's type.

desc A description of the operand's purpose

min The minimum number of required variable operands.

max The maximum number of required variable operands.

TIBCO Hawk Configuration Object API Reference VariableOperandDescriptor.getMax() | 211

VariableOperandDescriptor.getMax() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public int getMax()

Purpose This method the max value of the VariableOperandDescriptor object.

TIBCO Hawk Configuration Object API Reference 212 | Chapter 6 config.rbengine.rulebase Package

VariableOperandDescriptor.getMin() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public int getMin()

Purpose This method the min value of the VariableOperandDescriptor object.

TIBCO Hawk Configuration Object API Reference VariableOperandDescriptor.toString() | 213

VariableOperandDescriptor.toString() Method

Package COM.TIBCO.hawk.config.rbengine.rulebase

Declaration public String toString()

Purpose This method returns a string representation of this VariableOperandDescriptor object.

Remarks This method overrides the OperandDescriptor.toString() method.

TIBCO Hawk Configuration Object API Reference 214 | Chapter 6 config.rbengine.rulebase Package

OperatorException Class

Package COM.TIBCO.hawk.config.rbengine.rulebase

Purpose Used to signal exceptions in the creation or evaluation of Operators.

Method Name Description Page Summary OperatorException.OperatorException() Constructs a 215 OperatorException object.

TIBCO Hawk Configuration Object API Reference OperatorException.OperatorException() | 215

OperatorException.OperatorException() Constructor

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Declaration public OperatorException(string s)

Purpose This method constructs a TrueCountThreshold policy.

Parameters Name Description s The error message used to construct the RBEConfigObjectException object.

TIBCO Hawk Configuration Object API Reference 216 | Chapter 6 config.rbengine.rulebase Package

RulebaseException Class

Package COM.TIBCO.hawk.config.rbengine.rulebase

Purpose Signals that an error occurred while processing the rulebase.

Method Name Description Page Summary RulebaseException.RulebaseException() Constructs a 217 RulebaseException object.

TIBCO Hawk Configuration Object API Reference RulebaseException.RulebaseException() | 217

RulebaseException.RulebaseException() Constructor

Package COM.TIBCO.hawk.config.rbengine.rulebase.policy

Declaration public RulebaseException(string s)

Purpose Constructs a RulebaseException with the specified message.

Parameters Name Description s The string used to construct the RulebaseException object.

TIBCO Hawk Configuration Object API Reference 218 | Chapter 6 config.rbengine.rulebase Package

TIBCO Hawk Configuration Object API Reference | 219

Chapter 7 config.rbengine.schedule Package

This chapter describes the COM.TIBCO.hawk.config.rbengine.schedule package and its classes, interfaces, methods and exceptions.

Topics

• COM.TIBCO.hawk.config.rbengine.schedule, page 220 • Schedulable, page 222 • Attributes, page 224 • Period, page 225 • PeriodGroup, page 279 • PeriodGroupReference, page 290 • Schedule, page 299 • Schedules, page 319 • SchedulesXML, page 345 • ScheduleException, page 348

TIBCO Hawk Configuration Object API Reference 220 | Chapter 7 config.rbengine.schedule Package

COM.TIBCO.hawk.config.rbengine.schedule Package

Purpose Provides classes for creating and processing schedules used in the rulebases of TIBCO Hawk agents.

Interface Name Description Page Summary Scheduleable 222

Implemented by a scheduleable object to check if the scheduleable object is in-schedule.

Class Summary Name Description Page Attributes 224

This class provides methods for accessing attributes in a Schedules object.

Period 225

A Period defines the time intervals, days or months that should be included or excluded in a schedule.

PeriodGroup 279

A PeriodGroup is a logical group of Periods useful for defining an abstract group of Periods.

PeriodGroupReference 290

A PeriodGroupReference object references to a PeriodGroup in the Schedules.

Schedule 299

A Schedule is configuration object that can be used to determine if a rulebase or part of the rulebase should be in-schedule or out-of-schedule at a given time.

Schedules 319

A Schedules contains a list of Schedule and PeriodGroup objects.

TIBCO Hawk Configuration Object API Reference COM.TIBCO.hawk.config.rbengine.schedule | 221

Name Description Page SchedulesXML 345

The SchedulesXML provides methods for accessing XML representation of a Schedules.

Exception Name Description Page Summary ScheduleException 348

Signals that an error occurred while processing schedule.

See Also For more details on rulebases and interaction of schedule with RulebaseEngine microagent, please refer to: • TIBCO Hawk Administration Guide • TIBCO Hawk Console API Reference

TIBCO Hawk Configuration Object API Reference 222 | Chapter 7 config.rbengine.schedule Package

Schedulable Interface

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public interface Scheduleable

Purpose This interface is implemented by a scheduleable object to check if the scheduleable object is in-schedule.

Method Name Description Page Summary Schedulable.inSchedule() 223

This interface is implemented by a scheduleable object to check if the scheduleable object is in-schedule.

See Also Period PeriodGroup PeriodGroupReference

TIBCO Hawk Configuration Object API Reference Schedulable.inSchedule() | 223

Schedulable.inSchedule() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public boolean inSchedule(java.util.GregorianCalendar gc)

Purpose Check to see if this object is in schedule based on the specified GregorianCalendar.

Parameters Name Description gc GregorianCalendar for checking if the object is in-schedule

Returns true if this Scheduleable object is in schedule.

TIBCO Hawk Configuration Object API Reference 224 | Chapter 7 config.rbengine.schedule Package

Attributes Class

Package COM.TIBCO.hawk.config.rbengine.schedule

Purpose This class provides methods for accessing attributes in a Schedules object.

See Also Schedules

TIBCO Hawk Configuration Object API Reference Period | 225

Period Class

Package COM.TIBCO.hawk.config.rbengine.schedule

Purpose A Period defines the time intervals, days or months that should be included or excluded in a schedule. It contains four schedule components, described below: • MinutesInDay • DaysInMonth • WeekDaysInMonth •MonthsInYear A Period is in-schedule only if all of its four components are in-schedule. Otherwise, a Period is out-of-schedule. A Period can be used as an inclusion period or exclusion period in a Schedule. • When a Period is used as an inclusion period, the Schedule is in-schedule when the Period is in-schedule. • When a Period is used as an exclusion period, the Schedule is out-of-schedule when the Period is in-schedule.

Schedule Components MinutesInDay contains a set of 1440 continuous 1-minute intervals in a 24 hour period. Intervals of MinutesInDay can be accessed using an integer index value. The first interval starts at 12:00am has an index value of 0. The last interval is from 11:59pm with an index value of 1439. A MinutesInDay is in-schedule if the time for checking the schedule is included in the MinutesInDay. Otherwise, it is out-of-schedule. DaysInMonth contains a set of 31 days in a month. A newly created period includes every day of the month. A day in DaysInMonth can be accessed using an integer index value. The first day starts at first of the month with an index value of 0. The last day is the 31st day with an index value of 30. Use the constant LAST_DAY_OF_MONTH for the last day of a month.

TIBCO Hawk Configuration Object API Reference 226 | Chapter 7 config.rbengine.schedule Package

A DaysInMonth is in-schedule if the day in the date for checking the schedule is included in the DaysInMonth. Otherwise, it is out-of-schedule.

Including or excluding a day that a month does not contain has no effect in the schedule. For example, excluding the 31st day of February has no effect on the schedule.

WeekDaysInMonth contains a set of 7 days in a week. The first day of the week is Sunday and the last day is Saturday. To include a day in WeekDaysInMonth in the schedule, use the integer index value of 0 to 6 or a constant as described below: • The index value of 0 corresponds to Sunday and the value of 6 corresponds to Saturday. • Five constants can be used to indicate a particular weekday within a month: — FIRST_WEEKDAY_OF_MONTH is the first weekday of the month. — SECOND_WEEKDAY_OF_MONTH is the second weekday of the month. — THIRD_WEEKDAY_OF_MONTH is the third weekday of the month. — FOURTH_WEEKDAY_OF_MONTH is the fourth weekday of the month. — LAST_WEEKDAY_OF_MONTH is the last weekday of the month. A WeekDaysInMonth is in-schedule if the day of date for checking the schedule is included in the WeekDaysInMonth. Otherwise, it is out-of-schedule. If any of the five constants listed above are not included in the schedule, that corresponding weekday of the month is excluded. MonthsInYear contains a set of 12 months in a year. The first month of the year is January and the last month is December. To include a month in MonthsInYear in the schedule, use an integer value of 0 to 11 or a constant as described below: • The index value of 0 corresponds to January and the value of 11 corresponds to December. • The twelve constants January through December correspond to the twelve months of the year.

TIBCO Hawk Configuration Object API Reference Period | 227

A MonthsInYear is in-schedule if the month of the date used for checking the schedule is included in the MonthsInYear. Otherwise, it is out-of-schedule.

DaysInMonth and WeekDaysInMonth both contain day definitions for the schedule: one in terms of the day of week, and the other in terms of the day of month. When a particular day in DaysInMonth or WeekDaysInMonth is out-of-schedule, that schedule is considered out-of-schedule. For example, assume a schedule with the following inclusion periods: • For WeekDaysInMonth, Monday to Friday is selected. • For DaysInMonth, 1st day of the month is selected. This schedule will be out-of-schedule in months when the 1st day of the month is a Sunday. Even though the DaysInMonth specifies the 1st of the month, WeekDaysInMonth specifies only Monday through Friday, and not Sunday. Because WeekDaysInMonth is out-of-schedule, the entire schedule is considered out-of-schedule.

Common Methods The 4 components of the period are accessed from 5 common methods: • include(int, int) • exclude(int, int) • includeAll(int) • excludeAll(int) • isIncluded(int, int) These methods take an argument to indicate which component that method is intended for. A constant is provided for each component to be used for the argument. They are: • MINUTES_IN_DAY for MinutesInDay • WEEKDAYS_IN_MONTH for WeekDaysInMonth • DAYS_IN_MONTH for DaysInMonth • MONTHS_IN_YEAR for MonthsInYear The following code fragment shows how to include Monday in WeekDaysInMonth: Period period = new Period(); period.include(WEEKDAYS_IN_MONTH, MONDAY);

TIBCO Hawk Configuration Object API Reference 228 | Chapter 7 config.rbengine.schedule Package

Field Summary Name Description Page Period.APRIL() 233

A constant for including or excluding April.

Period.AUGUST() 234

A constant for including or excluding August.

Period.DAYS_IN_MONTH() 235

A constant for days in month component in the period.

Period.DECEMBER() 236

A constant for including or excluding December.

Period.FEBRUARY() 237

A constant for including or excluding February.

Period.FIRST_WEEKDAY_OF_MONTH() 238

A constant for including first weekday in a month.

Period.FOURTH_WEEKDAY_OF_MONTH() 239

A constant for including fourth weekday in a month

Period.FRIDAY() 240

A constant for including or excluding Friday.

Period.JANUARY() 241

A constant for including or excluding January.

Period.JULY() 242

A constant for including or excluding July.

Period.JUNE() 243

A constant for including or excluding June.

Period.LAST_DAY_OF_MONTH() 244

TIBCO Hawk Configuration Object API Reference Period | 229

Name Description Page A constant for including last day of a month.

Period.LAST_WEEKDAY_OF_MONTH() 245

A constant for including last weekday in a month.

Period.MARCH() 246

A constant for including or excluding March.

Period.MAY() 247

A constant for including or excluding May.

Period.MINUTES_IN_DAY() 248

A constant for time of day component in the period.

Period.MONDAY() 249

A constant for including or excluding Monday.

Period.MONTHS_IN_YEAR() 250

A constant for months in year component in the period.

Period.NOVEMBER() 251

A constant for including or excluding November.

Period.NUM_OF_DAYS_IN_MONTH() 252

A constant for the number of days in a DaysInMonth.

Period.NUM_OF_DAYS_IN_WEEK() 253

A constant for the number of days in a WeekDaysInMonth.

Period.NUM_OF_INTERVALS() 254

A constant for the number 15-minute intervals in MinutesInDay.

Period.NUM_OF_MINUTES() 255

TIBCO Hawk Configuration Object API Reference 230 | Chapter 7 config.rbengine.schedule Package

Name Description Page A constant for the number of minutes in MinutesInDay.

Period.NUM_OF_MONTHS() 256

A constant for number of months in MonthsInYear.

Period.OCTOBER() 257

A constant for including or excluding October.

Period.SATURDAY() 258

A constant for including or excluding Saturday.

Period.SECOND_WEEKDAY_OF_MONTH() 259

A constant for including second weekday in a month.

Period.SEPTEMBER() 260

A constant for including or excluding September.

Period.SUNDAY() 261

A constant for including or excluding Sunday.

Period.THIRD_WEEKDAY_OF_MONTH() 262

A constant for including third weekday in a month.

Period.THURSDAY() 263

A constant for including or excluding Thursday.

Period.TIME_OF_DAY() 264

A constant for time of day component in the period.

Period.TUESDAY() 265

A constant for including or excluding Tuesday.

Period.WEDNESDAY() 266

A constant for including or excluding Wednesday.

TIBCO Hawk Configuration Object API Reference Period | 231

Name Description Page Period.WEEKDAYS_IN_MONTH() 267

A constant for weekdays in month component in the period.

Constructor Name Description Page Summary Period.Period() 268

Creates a Period. The new Period has no time, day, or month included.

Method Name Description Page Summary Period.clone() 269

A copy of this Period.

Period.equals() 270

Compares the specified object with this Period.

Period.exclude() 271

Excludes the specific time period of a component in this Period.

Period.excludeAll() 272

Excludes the entire time period of a component in this Period.

Period.include() 273

Includes the specific time period of a component in this Period.

Period.includeAll() 274

Includes the entire time period of a component in this Period.

Period.inSchedule() 275

TIBCO Hawk Configuration Object API Reference 232 | Chapter 7 config.rbengine.schedule Package

Name Description Page Checks to see if this object is in schedule based on passed GregorianCalendar.

Period.isAlwaysExcluded() 276

Returns false if the definition of the schedule components in the Period will cause it to be always excluded in the schedule.

Period.isIncluded() 277

Checks to see if a period within a component is included in this Period.

Period.toString() 278

The string is a concatenation of the string representation of the schedule components MinutesInDay, DaysInMonth, WeekDaysInMonth and MonthsInYear.

See Also Schedule

TIBCO Hawk Configuration Object API Reference Period.APRIL() | 233

Period.APRIL() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int APRIL

Purpose A constant for including or excluding April.

TIBCO Hawk Configuration Object API Reference 234 | Chapter 7 config.rbengine.schedule Package

Period.AUGUST() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int AUGUST

Purpose A constant for including or excluding August.

TIBCO Hawk Configuration Object API Reference Period.DAYS_IN_MONTH() | 235

Period.DAYS_IN_MONTH() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int DAYS_IN_MONTH

Purpose A constant for days in month component in the period.

TIBCO Hawk Configuration Object API Reference 236 | Chapter 7 config.rbengine.schedule Package

Period.DECEMBER() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int DECEMBER

Purpose A constant for including or excluding December.

TIBCO Hawk Configuration Object API Reference Period.FEBRUARY() | 237

Period.FEBRUARY() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int FEBRUARY

Purpose A constant for including or excluding February.

TIBCO Hawk Configuration Object API Reference 238 | Chapter 7 config.rbengine.schedule Package

Period.FIRST_WEEKDAY_OF_MONTH() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int FIRST_WEEKDAY_OF_MONTH

Purpose A constant for including first weekday in a month.

TIBCO Hawk Configuration Object API Reference Period.FOURTH_WEEKDAY_OF_MONTH() | 239

Period.FOURTH_WEEKDAY_OF_MONTH() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int FOURTH_WEEKDAY_OF_MONTH

Purpose A constant for including fourth weekday in a month.

TIBCO Hawk Configuration Object API Reference 240 | Chapter 7 config.rbengine.schedule Package

Period.FRIDAY() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int FRIDAY

Purpose A constant for including or excluding Friday.

TIBCO Hawk Configuration Object API Reference Period.JANUARY() | 241

Period.JANUARY() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int JANUARY

Purpose A constant for including or excluding January.

TIBCO Hawk Configuration Object API Reference 242 | Chapter 7 config.rbengine.schedule Package

Period.JULY() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int JULY

Purpose A constant for including or excluding July.

TIBCO Hawk Configuration Object API Reference Period.JUNE() | 243

Period.JUNE() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int JUNE

Purpose A constant for including or excluding June.

TIBCO Hawk Configuration Object API Reference 244 | Chapter 7 config.rbengine.schedule Package

Period.LAST_DAY_OF_MONTH() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int LAST_DAY_OF_MONTH

Purpose A constant for including last day of a month.

TIBCO Hawk Configuration Object API Reference Period.LAST_WEEKDAY_OF_MONTH() | 245

Period.LAST_WEEKDAY_OF_MONTH() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int LAST_WEEKDAY_OF_MONTH

Purpose A constant for including last weekday in a month.

TIBCO Hawk Configuration Object API Reference 246 | Chapter 7 config.rbengine.schedule Package

Period.MARCH() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int MARCH

Purpose A constant for including or excluding March.

TIBCO Hawk Configuration Object API Reference Period.MAY() | 247

Period.MAY() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int MAY

Purpose A constant for including or excluding May.

TIBCO Hawk Configuration Object API Reference 248 | Chapter 7 config.rbengine.schedule Package

Period.MINUTES_IN_DAY() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int MINUTES_IN_DAY

Purpose A constant for time of day component in the period.

TIBCO Hawk Configuration Object API Reference Period.MONDAY() | 249

Period.MONDAY() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int MONDAY

Purpose A constant for including or excluding Monday.

TIBCO Hawk Configuration Object API Reference 250 | Chapter 7 config.rbengine.schedule Package

Period.MONTHS_IN_YEAR() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int MONTHS_IN_YEAR

Purpose A constant for months in year component in the period.

TIBCO Hawk Configuration Object API Reference Period.NOVEMBER() | 251

Period.NOVEMBER() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int NOVEMBER

Purpose A constant for including or excluding November.

TIBCO Hawk Configuration Object API Reference 252 | Chapter 7 config.rbengine.schedule Package

Period.NUM_OF_DAYS_IN_MONTH() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int NUM_OF_DAYS_IN_MONTH

Purpose A constant for the number of days in a DaysInMonth.

TIBCO Hawk Configuration Object API Reference Period.NUM_OF_DAYS_IN_WEEK() | 253

Period.NUM_OF_DAYS_IN_WEEK() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int NUM_OF_DAYS_IN_WEEK

Purpose A constant for the number of days in a WeekDaysInMonth.

TIBCO Hawk Configuration Object API Reference 254 | Chapter 7 config.rbengine.schedule Package

Period.NUM_OF_INTERVALS() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int NUM_OF_INTERVALS

Purpose A constant for the number 15-minute intervals in MinutesInDay.

TIBCO Hawk Configuration Object API Reference Period.NUM_OF_MINUTES() | 255

Period.NUM_OF_MINUTES() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int NUM_OF_MINUTES

Purpose A constant for the number of minutes in MinutesInDay.

TIBCO Hawk Configuration Object API Reference 256 | Chapter 7 config.rbengine.schedule Package

Period.NUM_OF_MONTHS() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int NUM_OF_MONTHS

Purpose A constant for number of months in MonthsInYear.

TIBCO Hawk Configuration Object API Reference Period.OCTOBER() | 257

Period.OCTOBER() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int OCTOBER

Purpose A constant for including or excluding October.

TIBCO Hawk Configuration Object API Reference 258 | Chapter 7 config.rbengine.schedule Package

Period.SATURDAY() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int SATURDAY

Purpose A constant for including or excluding Saturday.

TIBCO Hawk Configuration Object API Reference Period.SECOND_WEEKDAY_OF_MONTH() | 259

Period.SECOND_WEEKDAY_OF_MONTH() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int SECOND_WEEKDAY_OF_MONTH

Purpose A constant for including second weekday in a month.

TIBCO Hawk Configuration Object API Reference 260 | Chapter 7 config.rbengine.schedule Package

Period.SEPTEMBER() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int SEPTEMBER

Purpose A constant for including or excluding September.

TIBCO Hawk Configuration Object API Reference Period.SUNDAY() | 261

Period.SUNDAY() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int SUNDAY

Purpose A constant for including or excluding Sunday.

TIBCO Hawk Configuration Object API Reference 262 | Chapter 7 config.rbengine.schedule Package

Period.THIRD_WEEKDAY_OF_MONTH() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int THIRD_WEEKDAY_OF_MONTH

Purpose A constant for including third weekday in a month.

TIBCO Hawk Configuration Object API Reference Period.THURSDAY() | 263

Period.THURSDAY() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int THURSDAY

Purpose A constant for including or excluding Thursday.

TIBCO Hawk Configuration Object API Reference 264 | Chapter 7 config.rbengine.schedule Package

Period.TIME_OF_DAY() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int TIME_OF_DAY

Purpose A constant for time of day component in the period.

TIBCO Hawk Configuration Object API Reference Period.TUESDAY() | 265

Period.TUESDAY() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int TUESDAY

Purpose A constant for including or excluding Tuesday.

TIBCO Hawk Configuration Object API Reference 266 | Chapter 7 config.rbengine.schedule Package

Period.WEDNESDAY() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int WEDNESDAY

Purpose A constant for including or excluding Wednesday.

TIBCO Hawk Configuration Object API Reference Period.WEEKDAYS_IN_MONTH() | 267

Period.WEEKDAYS_IN_MONTH() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final int WEEKDAYS_IN_MONTH

Purpose A constant for weekdays in month component in the period.

TIBCO Hawk Configuration Object API Reference 268 | Chapter 7 config.rbengine.schedule Package

Period.Period() Constructor

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public Period()

Purpose Creates a Period. The new Period has no time, day, or month included.

TIBCO Hawk Configuration Object API Reference Period.clone() | 269

Period.clone() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public java.lang.Object clone()

Purpose Returns a copy of this Period. Throws java.lang.CloneNotSupportedException.

Returns A copy of this Period.

TIBCO Hawk Configuration Object API Reference 270 | Chapter 7 config.rbengine.schedule Package

Period.equals() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public boolean equals(java.lang.Object o)

Purpose Compares the specified object with this Period.

Overrides equals in class java.lang.Object

Parameters Name Description o Object to compare

Returns true if objects are equal, false otherwise.

TIBCO Hawk Configuration Object API Reference Period.exclude() | 271

Period.exclude() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void exclude(int component, int index)

Purpose Excludes the specific time period of a component in this Period.

Parameters Name Description component the component of this Period.

index specific period to be included for the specified component.

See Also Period

TIBCO Hawk Configuration Object API Reference 272 | Chapter 7 config.rbengine.schedule Package

Period.excludeAll() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void excludeAll(int component)

Purpose Excludes the entire time period of a component in this Period.

Parameters Name Description component the component of this Period.

See Also Period

TIBCO Hawk Configuration Object API Reference Period.include() | 273

Period.include() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void include(int component, int index)

Purpose Includes the specific time period of a component in this Period.

Parameters Name Description component the component of this Period.

index specific period to be included for the specified component.

See Also Period

TIBCO Hawk Configuration Object API Reference 274 | Chapter 7 config.rbengine.schedule Package

Period.includeAll() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void includeAll(int component)

Purpose Includes the entire time period of a component in this Period.

Parameters Name Description component the component of this Period.

See Also Period

TIBCO Hawk Configuration Object API Reference Period.inSchedule() | 275

Period.inSchedule() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public boolean inSchedule(java.util.GregorianCalendar gc)

Purpose Checks to see if this object is in schedule based on passed GregorianCalendar.

Specified by inSchedule in interface Scheduleable

Parameters Name Description gc GregorianCalendar for checking if the object is in-schedule

Returns true Period is in schedule, false otherwise.

TIBCO Hawk Configuration Object API Reference 276 | Chapter 7 config.rbengine.schedule Package

Period.isAlwaysExcluded() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public boolean isAlwaysExcluded()

Purpose Returns false if the definition of the schedule components in the Period will cause it to be always excluded in the schedule.

Returns Returns false if the definition of the schedule components in the Period will cause it to be always excluded in the schedule.

TIBCO Hawk Configuration Object API Reference Period.isIncluded() | 277

Period.isIncluded() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public boolean isIncluded(int component, int index)

Purpose Checks to see if a period within a component is included in this Period.

Parameters Name Description component the component of this Period.

index specific period of the specified component.

Returns true if the period is included, false otherwise.

TIBCO Hawk Configuration Object API Reference 278 | Chapter 7 config.rbengine.schedule Package

Period.toString() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public java.lang.String toString()

Purpose The string is a concatenation of the string representation of the schedule components MinutesInDay, DaysInMonth, WeekDaysInMonth and MonthsInYear.

Overrides toString in class java.lang.Object

Returns Returns a string representation of this Period.

TIBCO Hawk Configuration Object API Reference PeriodGroup | 279

PeriodGroup Class

Package COM.TIBCO.hawk.config.rbengine.schedule

Purpose A PeriodGroup is a logical group of Periods useful for defining an abstract group of Periods.

Remarks For example, a PeriodGroup named Holiday may contain periods that include all the holidays within a year. To use a PeriodGroup in the inclusion or exclusion of a Schedule, the PeriodGroup is referenced by a PeriodGroupReference added to inclusion or exclusion periods of a schedule. A PeriodGroup is in-schedule only if all of its periods are in-schedule. Otherwise, a PeriodGroup is out-of-schedule.

Constructor Name Description Page Summary PeriodGroup.PeriodGroup() 281

The first constructor creates an empty PeriodGroup with the specified name. The second constructor creates a PeriodGroup with specified name and periods.

Method Name Description Page Summary PeriodGroup.clone() 282

Returns a copy of this PeriodGroup.

PeriodGroup.equals() 283

Compares the specified object with this PeriodGroup.

PeriodGroup.getName() 284

Returns the name of this PeriodGroup.

PeriodGroup.getPeriods() 285

Returns the periods in this PeriodGroup.

PeriodGroup.inSchedule() 286

Checks to see if this PeriodGroup is in schedule based on the specified GregorianCalendar.

TIBCO Hawk Configuration Object API Reference 280 | Chapter 7 config.rbengine.schedule Package

Name Description Page PeriodGroup.setName() 287

Sets the name of this PeriodGroup

PeriodGroup.setPeriods() 288

Replaces the periods in this PeriodGroup with the specified periods.

PeriodGroup.toString() 289

Returns a string representation of this PeriodGroup.

See Also Period Schedule PeriodGroupReference

TIBCO Hawk Configuration Object API Reference PeriodGroup.PeriodGroup() | 281

PeriodGroup.PeriodGroup() Constructor

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public PeriodGroup(java.lang.String name) public PeriodGroup(java.lang.String name, Period[] periods)

Purpose The first constructor creates an empty PeriodGroup with the specified name. The second constructor creates a PeriodGroup with specified name and periods. Throws ScheduleException if invalid periods are specified.

TIBCO Hawk Configuration Object API Reference 282 | Chapter 7 config.rbengine.schedule Package

PeriodGroup.clone() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public java.lang.Object clone()

Purpose Returns a copy of this PeriodGroup. Throws java.lang.CloneNotSupportedException.

Returns a copy of this PeriodGroup.

TIBCO Hawk Configuration Object API Reference PeriodGroup.equals() | 283

PeriodGroup.equals() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public boolean equals(java.lang.Object o)

Purpose Compares the specified object with this PeriodGroup.

Overrides equals in class java.lang.Object

Parameters Name Description o Object to compare

Returns true if objects are equal, false otherwise.

TIBCO Hawk Configuration Object API Reference 284 | Chapter 7 config.rbengine.schedule Package

PeriodGroup.getName() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public java.lang.String getName()

Purpose Returns the name of this PeriodGroup.

Returns The name of this PeriodGroup.

TIBCO Hawk Configuration Object API Reference PeriodGroup.getPeriods() | 285

PeriodGroup.getPeriods() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public Period[] getPeriods()

Purpose Returns the periods in this PeriodGroup.

Returns The periods in this PeriodGroup. MethodName

TIBCO Hawk Configuration Object API Reference 286 | Chapter 7 config.rbengine.schedule Package

PeriodGroup.inSchedule() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public boolean inSchedule(java.util.GregorianCalendar gc)

Purpose Checks to see if this PeriodGroup is in schedule based on the specified GregorianCalendar.

Specified by inSchedule in interface Scheduleable

Parameters Name Description gc GregorianCalendar for checking if the object is in-schedule

Returns true Period is in schedule.

TIBCO Hawk Configuration Object API Reference PeriodGroup.setName() | 287

PeriodGroup.setName() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void setName(java.lang.String name)

Purpose Sets the name of this PeriodGroup.

TIBCO Hawk Configuration Object API Reference 288 | Chapter 7 config.rbengine.schedule Package

PeriodGroup.setPeriods() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void setPeriods(Period[] periods)

Purpose Replaces the periods in this PeriodGroup with the specified periods. Throws ScheduleException if invalid periods are specified.

Parameters Name Description periods an array of Periods.

TIBCO Hawk Configuration Object API Reference PeriodGroup.toString() | 289

PeriodGroup.toString() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public java.lang.String toString(int iType)

Purpose Returns a string representation of this PeriodGroup.

Returns A string representation of this PeriodGroup.

TIBCO Hawk Configuration Object API Reference 290 | Chapter 7 config.rbengine.schedule Package

PeriodGroupReference Class

Package COM.TIBCO.hawk.config.rbengine.schedule

Purpose A PeriodGroupReference object references to a PeriodGroup in the Schedules. It can be used as a schedulable object in the inclusion or exclusion list of a Schedule.

Constructor Name Description Page Summary PeriodGroupReference.PeriodGroupReference() 292

Creates a PeriodGroupReference with the specified name.

Method Name Description Page Summary PeriodGroupReference.clone() 293

Returns a copy of this PeriodGroupReference.

PeriodGroupReference.equals() 294

Compares the specified object with this PeriodGroupReference.

PeriodGroupReference.getName() 295

Returns the name of the PeriodGroup that this PeriodGroupReference is referenced to.

PeriodGroupReference.inSchedule() 296

Checks to see if this PeriodGroupReference is in schedule based on passed GregorianCalendar.

PeriodGroupReference.setName() 297

Sets the name of the PeriodGroup that this PeriodGroupReference is referenced to.

PeriodGroupReference.toString() 298

Returns a string representation of this PeriodGroupReference.

TIBCO Hawk Configuration Object API Reference PeriodGroupReference | 291

See Also Schedule PeriodGroup

TIBCO Hawk Configuration Object API Reference 292 | Chapter 7 config.rbengine.schedule Package

PeriodGroupReference.PeriodGroupReference() Constructor

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public PeriodGroupReference(java.lang.String name)

Purpose Creates an PeriodGroupReference with the specified name.

TIBCO Hawk Configuration Object API Reference PeriodGroupReference.clone() | 293

PeriodGroupReference.clone() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public java.lang.Object clone()

Purpose Returns a copy of this PeriodGroupReference. Throws java.lang.CloneNotSupportedException.

Returns A copy of this PeriodGroupReference.

TIBCO Hawk Configuration Object API Reference 294 | Chapter 7 config.rbengine.schedule Package

PeriodGroupReference.equals() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public boolean equals(java.lang.Object o)

Purpose Compares the specified object with this PeriodGroupReference.

Overrides equals in class java.lang.Object

Parameters Name Description o Object to compare.

Returns true if objects are equal, false otherwise.

TIBCO Hawk Configuration Object API Reference PeriodGroupReference.getName() | 295

PeriodGroupReference.getName() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public java.lang.String getName()

Purpose Returns the name of the PeriodGroup that this PeriodGroupReference is referenced to.

Parameters Name Description getName The name of the PeriodGroup that this PeriodGroupReference is referenced to.

Returns The name of the PeriodGroup that this PeriodGroupReference is referenced to.

TIBCO Hawk Configuration Object API Reference 296 | Chapter 7 config.rbengine.schedule Package

PeriodGroupReference.inSchedule() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public boolean inSchedule(java.util.GregorianCalendar gc)

Purpose Check to see if this PeriodGroupReference is in schedule based on passed GregorianCalendar. The call is passed to the referenced PeriodGroup.

Specified by: inSchedule in interface Scheduleable

Parameters Name Description gc GregorianCalendar for checking if the object is in-schedule

Returns true PeriodGroupReference is in schedule. Otherwise it is out-of-schedule.

TIBCO Hawk Configuration Object API Reference PeriodGroupReference.setName() | 297

PeriodGroupReference.setName() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void setName(java.lang.String name)

Purpose Sets the name of the PeriodGroup that this PeriodGroupReference is referenced to.

Parameters Name Description name The name of the PeriodGroup that this PeriodGroupReference is referenced to.

TIBCO Hawk Configuration Object API Reference 298 | Chapter 7 config.rbengine.schedule Package

PeriodGroupReference.toString() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public java.lang.String toString(int iType)

Purpose Returns a string representation of this PeriodGroupReference.

Returns A string representation of this PeriodGroupReference.

TIBCO Hawk Configuration Object API Reference Schedule | 299

Schedule Class

Package COM.TIBCO.hawk.config.rbengine.schedule

Purpose A Schedule is configuration object that can be used to determine if a rulebase or part of the rulebase should be in-schedule or out-of-schedule at a given time.

Remarks A Schedule can be specified in any rulebase element such as Rulebase, Rule, Test, or an Action. When an element of the rulebase is out-of-schedule, that element and all its nodes are out-of-schedule. For example, if a Test is out-of-schedule, then the Test and all its actions are out-of-schedule. When a rulebase element is out-of-schedule, the rulebase element is suspended and will not be active until the element is back in-schedule. A Schedule has a name, a list of inclusion periods and a list of exclusion periods. A Schedule is in-schedule if at least one of its inclusion periods is in-schedule and none of its exclusion periods are in-schedule. If a Schedule does not have any inclusion period, then it is in-schedule if none of its exclusion periods are in-schedule. If a Schedule does not have any inclusion period or exclusion period, then it is out-of-schedule. The inclusion periods and exclusion periods may contain Period or PeriodGroupReference objects.

Constructor Name Description Page Summary Schedule.Schedule() 302

Creates a schedule with the specified name. The new Schedule does not has any inclusion or exclusion period.

Method Name Description Page Summary Schedule.addExclusionPeriod() 303

Adds an period to existing a list of exclusion periods.

Schedule.addInclusionPeriod() 304

Adds an inclusion periods to existing a list of inclusion periods.

Schedule.clone() 305

Returns a copy of this Schedule.

TIBCO Hawk Configuration Object API Reference 300 | Chapter 7 config.rbengine.schedule Package

Name Description Page Schedule.equals() 306

Compares with the specified schedule for equality.

Schedule.getExclusionPeriods() 307

Returns all exclusion periods in this Schedule.

Schedule.getInclusionPeriods() 308

Returns all inclusion periods in this Schedule.

Schedule.getName() 309

Returns the name of the schedule.

Schedule.getSecondTillNextScheduleChange() 310

Returns seconds until next schedule change.

Schedule.getTimeZone() 311

Returns the TimeZone for this schedule.

Schedule.inSchedule() 312

Checks to see if the schedule is in-schedule using the specified date.

Schedule.isUsingPeriodGroup() 313

Checks if the specified PeriodGroup is used by this schedule.

Schedule.removeExclusionPeriod() 314

Removes a period from an existing list of exclusion periods.

Schedule.removeInclusionPeriod() 315

Removes a period from an existing list of inclusion periods.

Schedule.setName() 316

TIBCO Hawk Configuration Object API Reference Schedule | 301

Name Description Page Sets the name of the Schedule.

Schedule.setTimeZone() 317

Sets the timezone of the Schedule.

Schedule.toString() 318

Returns a string representation of the Schedule object.

See Also COM.TIBCO.hawk.config.rbengine.schedule Schedules Scheduleable Period PeriodGroup PeriodGroupReference

TIBCO Hawk Configuration Object API Reference 302 | Chapter 7 config.rbengine.schedule Package

Schedule.Schedule() Constructor

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public Schedule(java.lang.String name)

Purpose Creates a schedule with the specified name. The new Schedule does not has any inclusion or exclusion period.

Parameters Name Description name the schedule name

TIBCO Hawk Configuration Object API Reference Schedule.addExclusionPeriod() | 303

Schedule.addExclusionPeriod() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void addExclusionPeriod(Scheduleable period)

Purpose Adds an period to existing a list of exclusion periods.

Parameters Name Description period Period or PeriodGroupReference to be added.

Throws java.lang.IllegalArgumentException - if period is null

TIBCO Hawk Configuration Object API Reference 304 | Chapter 7 config.rbengine.schedule Package

Schedule.addInclusionPeriod() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void addInclusionPeriod(Scheduleable period)

Purpose c

Parameters Name Description period Period or PeriodGroupReference to be added.

Throws java.lang.IllegalArgumentException - if period is null

TIBCO Hawk Configuration Object API Reference Schedule.clone() | 305

Schedule.clone() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public java.lang.Object clone()

Purpose Returns a copy of this Schedule. Throws java.lang.CloneNotSupportedException.

Returns A copy of this Schedule.

TIBCO Hawk Configuration Object API Reference 306 | Chapter 7 config.rbengine.schedule Package

Schedule.equals() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public boolean equals(java.lang.Object o)

Purpose Compares with the specified schedule for equality. Note that two Schedule objects with identical inclusion and exclusion periods but with different comments and last modification string are consider equals.

Overrides equals in class java.lang.Object

Parameters Name Description o the Schedule to be compared

Returns true if the Schedule objects are equal.

TIBCO Hawk Configuration Object API Reference Schedule.getExclusionPeriods() | 307

Schedule.getExclusionPeriods() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public Scheduleable[] getExclusionPeriods()

Purpose Returns all exclusion periods in this Schedule.

Returns All exclusion periods in this Schedule.

TIBCO Hawk Configuration Object API Reference 308 | Chapter 7 config.rbengine.schedule Package

Schedule.getInclusionPeriods() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public Scheduleable[] getInclusionPeriods()

Purpose Returns all inclusion periods in this Schedule.

Returns All inclusion periods in this Schedule.

TIBCO Hawk Configuration Object API Reference Schedule.getName() | 309

Schedule.getName() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public java.lang.String getName()

Purpose Returns the name of the schedule.

Returns The name of the schedule.

TIBCO Hawk Configuration Object API Reference 310 | Chapter 7 config.rbengine.schedule Package

Schedule.getSecondTillNextScheduleChange() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public long getSecondTillNextScheduleChange()

Purpose Returns seconds until next schedule change. If the next schedule is after mid night (12:00 am), then seconds till midnight is returned.

Returns seconds until next schedule change.

TIBCO Hawk Configuration Object API Reference Schedule.getTimeZone() | 311

Schedule.getTimeZone() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public java.lang.String getTimeZone()

Purpose Returns the TimeZone for this schedule.

Returns The TimeZone for this schedule.

TIBCO Hawk Configuration Object API Reference 312 | Chapter 7 config.rbengine.schedule Package

Schedule.inSchedule() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public boolean inSchedule(java.util.Date date)

Purpose Checks to see if the schedule is in-schedule using the specified date.

Parameters Name Description date date to be checked.

Returns true if date is in-schedule.

TIBCO Hawk Configuration Object API Reference Schedule.isUsingPeriodGroup() | 313

Schedule.isUsingPeriodGroup() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public boolean isUsingPeriodGroup(java.lang.String periodGroupName)

Purpose Checks if the specified PeriodGroup is used by this schedule.

Returns true if this Schedule uses the given PeriodGroup.

TIBCO Hawk Configuration Object API Reference 314 | Chapter 7 config.rbengine.schedule Package

Schedule.removeExclusionPeriod() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void removeExclusionPeriod(Scheduleable period)

Purpose Removes a period from an existing list of exclusion periods.

TIBCO Hawk Configuration Object API Reference Schedule.removeInclusionPeriod() | 315

Schedule.removeInclusionPeriod() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void removeInclusionPeriod(Scheduleable period)

Purpose Removes a period from an existing list of inclusion periods.

TIBCO Hawk Configuration Object API Reference 316 | Chapter 7 config.rbengine.schedule Package

Schedule.setName() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void setName(java.lang.String name)

Purpose Sets the name of the Schedule.

Throws java.lang.IllegalArgumentException - if name is null

TIBCO Hawk Configuration Object API Reference Schedule.setTimeZone() | 317

Schedule.setTimeZone() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void setTimeZone(java.lang.String timeZone)

Purpose Sets the timezone of the Schedule.

Throws java.lang.IllegalArgumentException - if name is null

TIBCO Hawk Configuration Object API Reference 318 | Chapter 7 config.rbengine.schedule Package

Schedule.toString() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public java.lang.String toString()

Purpose Returns a string representation of the Schedule object.

Overrides toString in class java.lang.Object

Returns A string representation of the Schedule object.

TIBCO Hawk Configuration Object API Reference Schedules | 319

Schedules Class

Package COM.TIBCO.hawk.config.rbengine.schedule

Purpose A Schedules contains a list of Schedule and PeriodGroup objects.

Remarks The PeriodGroup is referenced in a Schedules using a PeriodGroupReference. Unlike rulebases, All the schedules which is used by the TIBCO Hawk Agent is kept in a single file instead of individual files as in the case of rulebases. The Agent transfer the entire list of Schedule objects in a Schedules to and from a Console API application. For example to retrieve and send a Schedules to and from an agent, see SchedulesXML.

Field Summary Name Description Page Schedules.FILE_EXTENSION() 322

The default file extension of a schedule file.

Schedules.SchedulesFileName() 323

The file name of a schedule file.

Schedules.SchedulesName() 324

The default name of a schedules.

Constructor Name Description Page Summary Schedules.Schedules() 325

The first constructor creates a Schedules. The second constructor creates a Schedules from the reader.

Method Name Description Page Summary Schedules.addPeriodGroup() 326

Adds a period group to the current list of PeriodGroup in this Schedules.

Schedules.addSchedule() 327

TIBCO Hawk Configuration Object API Reference 320 | Chapter 7 config.rbengine.schedule Package

Name Description Page Adds a schedule to the current list of schedules. If a schedule of the same name exists, it will be replaced.

Schedules.clone() 328

Returns a copy of this Schedules object.

Schedules.equals() 329

Compares the specified Schedules objects for equality.

Schedules.getAttributes() 330

Returns the attributes for this Schedules.

Schedules.getFileExtension() 331

Returns file extension based on the schedules.

Schedules.getPeriodGroup() 332

Returns a PeriodGroup of the specified name.

Schedules.getPeriodGroups() 333

Returns a list of PeriodGroup in this Schedules.

Schedules.getSchedule() 334

Returns a schedule of the specified name.

Schedules.getSchedules() 335

Schedules has a list of PeriodGroups. This method returns one of them.

Schedules.getScheduleUsingPeriodGroup() 336

Gets the schedule that uses the specified PeriodGroup.

Schedules.removePeriodGroup() 337

Removes a period group from the current list of PeriodGroup in this Schedules.

Schedules.removeSchedule() 338

TIBCO Hawk Configuration Object API Reference Schedules | 321

Name Description Page Removes a schedule from the current list of schedules.

Schedules.renamePeriodGroup() 339

Renames a PeriodGroup.

Schedules.setAttributes() 340

Sets the attributes for this Schedules.

Schedules.setPeriodGroups() 341

Replaces a list of PeriodGroup in this Schedules with the specified list.

Schedules.setSchedules() 342

Replaces the list of schedules with the specified list.

Schedules.toString() 343

Returns the string representation of the Schedules object.

Schedules.toXML() 344

Writes the Schedules object to Writer in XML format. Throws RBEConfigObjectException.

See Also Schedule PeriodGroup PeriodGroupReference SchedulesXML

TIBCO Hawk Configuration Object API Reference 322 | Chapter 7 config.rbengine.schedule Package

Schedules.FILE_EXTENSION() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static final java.lang.String FILE_EXTENSION

Purpose The default file extension of a schedule file.

TIBCO Hawk Configuration Object API Reference Schedules.SchedulesFileName() | 323

Schedules.SchedulesFileName() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static java.lang.String SchedulesFileName

Purpose The file name of a schedule file. This is the file name used by Agent and repository when loading and saving a schedule file.

TIBCO Hawk Configuration Object API Reference 324 | Chapter 7 config.rbengine.schedule Package

Schedules.SchedulesName() Field

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public static java.lang.String SchedulesName

Purpose The default name of a schedules.

TIBCO Hawk Configuration Object API Reference Schedules.Schedules() | 325

Schedules.Schedules() Constructor

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public Schedules() public Schedules(java.io.Reader reader) public Schedules(Schedule[] schedules)

Purpose The first constructor creates a Schedules. The new Schedules object has no Schedule object. The second constructor creates a Schedules from the reader. The reader contains a schedules in an XML format. This constructor is useful when recreating a Schedules from SchedulesXML object: Schedules schedules = new Schedules(aScheduleXML.getXMLReader()); Throws ScheduleException if not able to create schedules from the reader. The third constructor creates a Schedules with the specified name and list of schedules. Throws java.lang.IllegalArgumentException if schedules is null.

Parameters Name Description reader a reader which contain the schedule in XML format.

schedules a list of schedule.

TIBCO Hawk Configuration Object API Reference 326 | Chapter 7 config.rbengine.schedule Package

Schedules.addPeriodGroup() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void addPeriodGroup(PeriodGroup periodGroup)

Purpose Adds a period group to the current list of PeriodGroup in this Schedules. If the period group of the same name exist, it will be replaced.

Parameters Name Description periodGroup period group to be added

Throws java.lang.IllegalArgumentException - if periodGroup is null

TIBCO Hawk Configuration Object API Reference Schedules.addSchedule() | 327

Schedules.addSchedule() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void addSchedule(Schedule schedule)

Purpose Adds a schedule to the current list of schedules. If a schedule of the same name exists, it will be replaced.

Parameters Name Description schedule schedule to be added.

Throws java.lang.IllegalArgumentException - if schedule is null

TIBCO Hawk Configuration Object API Reference 328 | Chapter 7 config.rbengine.schedule Package

Schedules.clone() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public java.lang.Object clone()

Purpose Returns a copy of this Schedules object. Throws java.lang.CloneNotSupportedException.

Returns A copy of this Schedules object

TIBCO Hawk Configuration Object API Reference Schedules.equals() | 329

Schedules.equals() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public boolean equals(java.lang.Object o)

Purpose Compares the specified Schedules objects for equality.

Overrides equals in class java.lang.Object

Parameters Name Description o Schedules to be compared

Returns true if objects are equal

TIBCO Hawk Configuration Object API Reference 330 | Chapter 7 config.rbengine.schedule Package

Schedules.getAttributes() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public Attributes getAttributes()

Purpose Returns the attributes for this Schedules. The Attributes contains attributes such as author, last modification record, and comment.

Returns The attributes for this Schedules.

See Also Attributes

TIBCO Hawk Configuration Object API Reference Schedules.getFileExtension() | 331

Schedules.getFileExtension() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public java.lang.String getFileExtension()

Purpose Returns file extension based on the schedules.

Specified by getFileExtension in interface RBEConfigObject

Returns the file extension of the schedules.

TIBCO Hawk Configuration Object API Reference 332 | Chapter 7 config.rbengine.schedule Package

Schedules.getPeriodGroup() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public PeriodGroup getPeriodGroup(java.lang.String name)

Purpose Returns a PeriodGroup of the specified name.

Returns The instance of PeriodGroup in this Schedules object with the specified name.

TIBCO Hawk Configuration Object API Reference Schedules.getPeriodGroups() | 333

Schedules.getPeriodGroups() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public PeriodGroup[] getPeriodGroups()

Purpose Returns a list of PeriodGroup in this Schedules.

Returns A list of PeriodGroup in this Schedules.

TIBCO Hawk Configuration Object API Reference 334 | Chapter 7 config.rbengine.schedule Package

Schedules.getSchedule() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public Schedule getSchedule(java.lang.String name)

Purpose Returns a schedule of the specified name.

Returns The instance of Schedule in this Schedules object with the specified name.

TIBCO Hawk Configuration Object API Reference Schedules.getSchedules() | 335

Schedules.getSchedules() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public Schedule[] getSchedules()

Purpose Schedules has a list of PeriodGroups. This method returns one of them.

Returns A list of schedules.

TIBCO Hawk Configuration Object API Reference 336 | Chapter 7 config.rbengine.schedule Package

Schedules.getScheduleUsingPeriodGroup() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public java.lang.String getScheduleUsingPeriodGroup(java.lang.String periodGroupName)

Purpose Gets the schedule that uses the specified PeriodGroup.

Returns The name of the first schedule found to use the given PeriodGroup.

TIBCO Hawk Configuration Object API Reference Schedules.removePeriodGroup() | 337

Schedules.removePeriodGroup() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void removePeriodGroup(PeriodGroup periodGroup)

Purpose Removes a period group from the current list of PeriodGroup in this Schedules. If the period group does not exist, no action is taken.

Parameters Name Description periodGroup period group to be removed.

Throws java.lang.IllegalArgumentException - if periodGroupName is null or used by a schedule.

TIBCO Hawk Configuration Object API Reference 338 | Chapter 7 config.rbengine.schedule Package

Schedules.removeSchedule() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void removeSchedule(java.lang.String name)

Purpose Removes a schedule from the current list of schedules.

TIBCO Hawk Configuration Object API Reference Schedules.renamePeriodGroup() | 339

Schedules.renamePeriodGroup() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void renamePeriodGroup(java.lang.String oldName, java.lang.String newName)

Purpose Renames a PeriodGroup. If the PeriodGroup to be renamed is referenced by a schedule, the schedule will be updated to used the new PeriodGroup name.

TIBCO Hawk Configuration Object API Reference 340 | Chapter 7 config.rbengine.schedule Package

Schedules.setAttributes() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void setAttributes(Attributes attributes)

Purpose Sets the attributes for this Schedules.

Throws java.lang.IllegalArgumentException - if attributes is null

TIBCO Hawk Configuration Object API Reference Schedules.setPeriodGroups() | 341

Schedules.setPeriodGroups() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void setPeriodGroups(PeriodGroup[] periodGroups)

Purpose Replaces a list of PeriodGroup in this Schedules with the specified list.

Parameters Name Description periodGroup the new period groups for this Schedules. s

Throws java.lang.IllegalArgumentException - if schedules is null

TIBCO Hawk Configuration Object API Reference 342 | Chapter 7 config.rbengine.schedule Package

Schedules.setSchedules() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void setSchedules(Schedule[] schedules)

Purpose Replaces the list of schedules with the specified list.

Throws java.lang.IllegalArgumentException - if schedules is null

TIBCO Hawk Configuration Object API Reference Schedules.toString() | 343

Schedules.toString() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public java.lang.String toString()

Purpose Returns the string representation of the Schedules object.

Overrides toString in class java.lang.Object

Returns The string representation of the Schedules object.

TIBCO Hawk Configuration Object API Reference 344 | Chapter 7 config.rbengine.schedule Package

Schedules.toXML() Method

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public void toXML(java.io.Writer writer)

Purpose Writes the Schedules object to Writer in XML format. Throws RBEConfigObjectException.

Specified by toXML in interface RBEConfigObject

Parameters Name Description writer the writer where the XML output will be written.

TIBCO Hawk Configuration Object API Reference SchedulesXML | 345

SchedulesXML Class

Package COM.TIBCO.hawk.config.rbengine.schedule

Purpose The SchedulesXML provides methods for accessing XML representation of a Schedules.

Remarks A SchedulesXML object is used when sending Schedules to or receiving from a TIBCO Hawk Agent within an application written using Console API. For example, the following code fragment shows how to get a Schedules from an agent:

MicroAgent maidRepo = getRulebaseMicroagentID(); MethodInvocation mi = new MethodInvocation("getSchedules", null); MicroAgentData mad = agentManager.invoke( maidRepo, mi );

Object o = mad.getData(); if (o instanceof SchedulesXML) { SchedulesXML rbXMLs = (SchedulesXML)mad.getData();

// return the retrieved Schedules return new Schedules(rbXMLs.getXMLReader()); } // if error occurred on the agent, the returned object will be // a MicroAgentException else if (o instanceof MicroAgentException) throw (MicroAgentException)o;

To send a Schedules to an agent:

Schedules schedules = getSchedules(); MicroAgent maidRepo = getRepositoryMicroagentID(); DataElement[] dataElements = new DataElement[2] dataElements[0] = new DataElement("SchedulesXML", new SchedulesXML(schedules)); dataElements[1] = new DataElement("Notify" , new Boolean(false)); MethodInvocation mi = new MethodInvocation("setSchedules", dataElements); MicroAgentData mad = agentManager.invoke( maidRepo, mi );

For a complete list of methods in RepositoryMicroagent, refer to TIBCO Hawk Console API Method's Reference For a complete sample for retrieving and sending a Schedules, see the Schedule API samples in TIBCO Hawk installation samples.

TIBCO Hawk Configuration Object API Reference 346 | Chapter 7 config.rbengine.schedule Package

Constructor Summary Name Description Page SchedulesXML.SchedulesXML() 347

See Also Serialized Form

TIBCO Hawk Configuration Object API Reference SchedulesXML.SchedulesXML() | 347

SchedulesXML.SchedulesXML() Constructor

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public SchedulesXML(Schedules schedules)

Purpose Creates a schedules XML wrapper from the specified Schedules.

TIBCO Hawk Configuration Object API Reference 348 | Chapter 7 config.rbengine.schedule Package

ScheduleException Exception

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public class ScheduleException

Purpose Signals that an error occurred while processing schedule.

Constructor Summary Name Description Page ScheduleException.ScheduleException() 349

See Also Serialized Form

TIBCO Hawk Configuration Object API Reference ScheduleException.ScheduleException() | 349

ScheduleException.ScheduleException() Constructor

Package COM.TIBCO.hawk.config.rbengine.schedule

Declaration public ScheduleException(java.lang.String sMsg)

Purpose Constructs a ScheduleException with the specified detail message.

TIBCO Hawk Configuration Object API Reference 350 | Chapter 7 config.rbengine.schedule Package

TIBCO Hawk Configuration Object API Reference | 351

Chapter 8 config.rbengine.rbmap Package

This chapter describes the COM.TIBCO.hawk.config.rbengine.rbmap package and its classes, interfaces, methods and exceptions.

Topics

• COM.TIBCO.hawk.config.rbengine.rbmap, page 352 • Attributes, page 353 • RBMap, page 358 • RBMapXML, page 386 • RBMapXML.RBMapException, page 389

TIBCO Hawk Configuration Object API Reference 352 | Chapter 8 config.rbengine.rbmap Package

COM.TIBCO.hawk.config.rbengine.rbmap Package

Purpose Provides classes for creating and processing RulebaseMap used by TIBCO Hawk Agents. Rulebase map is used by TIBCO Hawk Agents running in either one of the two manual configuration modes called Manual Configuration Mode and Repository Configuration Mode.

The -rulebases option supported by the agent (RulebaseEngine MicroAgent) can be used together with the RulebaseMap to specify additional rulebases.

Class Summary Name Description Page Attributes 353

The Attributes provides methods for accessing attributes in an RBMap object.

RBMap 358

RBMap represents a rulebase.

RBMapXML 386

The RBMapXML provides methods for accessing XML representation of an RBMap.

Exception Name Description Page Summary RBMapXML.RBMapException 389

Signals that an error occurred while processing RBMap.

See Also For more details on rulebases and interaction of schedule with rulebase engine, please refer to: • TIBCO Hawk Administration Guide • TIBCO Hawk Console API • COM.TIBCO.hawk.config.rbengine.rulebase

TIBCO Hawk Configuration Object API Reference Attributes | 353

Attributes Class

Package COM.TIBCO.hawk.config.rbengine.rbmap

Purpose The Attributes provides methods for accessing attributes in an RBMap object. In addition to basic attributes of a rulebase configuration object, it include a flags to indicate whether the RBMap should use command mapping when generating rulebases for an agent.

Method Name Description Page Summary Attributes.clone 354

Returns a copy of this object.

Attributes.setUseCommandMapping 355

Sets the flag to indicate if the agent should use the command mapping to generate the rulebase list.

Attributes.usingCommandMapping 356

Returns true if the RBMap should use the command mapping when generate the rulebase list.

Attributes.usingCommandMappingOnly 357

Returns true if the agent should use only the command mapping when generating the rulebase list, ignoring the group and rulebase mapping.

TIBCO Hawk Configuration Object API Reference 354 | Chapter 8 config.rbengine.rbmap Package

Attributes.clone Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public java.lang.Object clone()

Purpose Returns a copy of this object. Throws java.lang.CloneNotSupportedException.

Overrides clone in class RBEConfigObjectAttributes

Returns Returns a copy of this object.

TIBCO Hawk Configuration Object API Reference Attributes.setUseCommandMapping | 355

Attributes.setUseCommandMapping Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public void setUseCommandMapping(boolean use, boolean exclusively)

Purpose Sets the flag to indicate if the agent should use the command mapping to generate the rulebase list.

Parameters Parameter Description use If true, RBMap will use command mapping when it generates the list of rulebases for an agent. If false, command mapping is not used when generating the list.

exclusively If true, RBMap will only use command mapping when it generates rulebase for an agent. It will ignore the group and rulebase mapping. If false, exclusively is ignored.

See Also RBMap.getAgentRulebases(java.lang.String, java.lang.String)

TIBCO Hawk Configuration Object API Reference 356 | Chapter 8 config.rbengine.rbmap Package

Attributes.usingCommandMapping Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public boolean usingCommandMapping()

Purpose Returns true if the RBMap should use the command mapping when generate the rulebase list.

Returns True if the RBMap should use the command mapping when generate the rulebase list.

See Also setUseCommandMapping(boolean, boolean)

TIBCO Hawk Configuration Object API Reference Attributes.usingCommandMappingOnly | 357

Attributes.usingCommandMappingOnly Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public boolean usingCommandMappingOnly()

Purpose Returns true if the agent should use only the command mapping when generating the rulebase list, ignoring the group and rulebase mapping.

Returns True if the agent should use only the command mapping when generating the rulebase list.

See Also setUseCommandMapping(boolean, boolean)

TIBCO Hawk Configuration Object API Reference 358 | Chapter 8 config.rbengine.rbmap Package

RBMap Class

Package COM.TIBCO.hawk.config.rbengine.rbmap

Purpose RBMap represents a rulebase.

Remarks An RBMap is a configuration object for the RulebaseEngine microagent of a TIB/Hawk agent. It can be viewed as having three distinct set of mappings: • Group mapping - to organize agents into groups for the purpose of rulebase assignment. Groups mapping contains a set of group mappings. Each group mapping maps a group name to a list of agents or groups, or combination agents and groups. • Rulebase mapping - to map rulebases to agents or groups of agents. Rulebases mapping contains a set of rulebase mappings. A rulebase mapping maps a rulebase to a list of agents or groups, or combination agents and groups. • Command mapping - to delegate the rulebase mapping function to an external command. Commands mapping contains a set of command mappings. A command mapping maps a command to a list of agents or groups, or combination agents and groups. The agents and/or groups in a mapping are referred to as members of that mapping. Methods that involve using a member may use an agent or a group as an argument. For example, in setMembersInGroup(String group, String[] members), each member in the array can represent either an agent or a group. The Command mapping can be used as an alternate or a supplement to the main mapping portion of the RBMap. To use command mapping, it is required to turn on the 'useCommandMapping' flag in the RBMap attributes by calling Attributes.setUseCommandMapping(boolean, boolean).

Field Summary Name Description Page RBMap.FILE_EXTENSION 362

File extension for the RBMap.

RBMap.RBMapFileName 363

Default filename for RBMap.

RBMap.RBMapName 364

Default name for RBMap.

TIBCO Hawk Configuration Object API Reference RBMap | 359

Constructor Name Description Page Summary RBMap.RBMap 365

The first constructor constructs an empty RBMap. The second constructor creates an RBMap from the reader. The reader contains an RBMap in an XML format. This constructor is useful when recreating an RBMap from RBMapXML object:

Method Name Description Page Summary RBMap.clone 366

Returns a copy of this object. Throws java.lang.CloneNotSupportedException.

RBMap.equals 366

Compares two rulebase maps. The result is true if the argument is not null and is an RBMap object has the same group, rulebase, and command mappings.

RBMap.getAgentRulebases 368

This method is use by the RulebaseEngine MicroAgent to generate the list of rulebases that will be loaded during startup.

RBMap.getAttributes 369

The attributes of this RBMap.

RBMap.getChecksum 370

Returns the checksum of this RBMap.

RBMap.getCommands 371

Returns the commands in the set of commands mapping. The commands returned can be used for getting members for a command.

RBMap.getFileExtension 372

TIBCO Hawk Configuration Object API Reference 360 | Chapter 8 config.rbengine.rbmap Package

Name Description Page Returns file extension based on the configuration object type.

RBMap.getGroups 373

Returns the group names that has a group mapping. The groups returned can be used for getting members in the groups.

RBMap.getMemberForCommand 374

Returns the agent or group that uses the command.

RBMap.getMembersForRulebase 375

Returns all the members that use the specified rulebase.

RBMap.getMembersInGroup 376

Returns all the members in the specified group.

RBMap.getRulebases 377

Returns the rulebases that has a rulebase mapping. The rulebases returned can be used for getting members in the rulebases.

RBMap.removeCommand 378

Removes a command mapping for the specified command.

RBMap.removeGroup 379

Removes a group mapping for the specified group.

RBMap.removeRulebase 380

Removes a rulebase mapping for the specified rulebase.

RBMap.setAttributes 381

Sets the attributes of this RBMap.

RBMap.setMemberForCommand 382

TIBCO Hawk Configuration Object API Reference RBMap | 361

Name Description Page Maps a command to the specified agent or group. If the same command is used for another agent or group, it will be replaced by the new mapping.

RBMap.setMembersForRulebase 383

Maps rulebases to the specified list of agents or groups.

RBMap.setMembersInGroup 384

Maps a group to the specified list of agents or groups.

RBMap.toXML 385

Writes the RBMap in XML representation to Writer in XML. Throws RBEConfigObjectException.

See Also COM.TIBCO.hawk.config.rbengine.rbmap.Attributes

TIBCO Hawk Configuration Object API Reference 362 | Chapter 8 config.rbengine.rbmap Package

RBMap.FILE_EXTENSION Field

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public static final java.lang.String FILE_EXTENSION

Purpose File extension for the RBMap.

TIBCO Hawk Configuration Object API Reference RBMap.RBMapFileName | 363

RBMap.RBMapFileName Field

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public static java.lang.String RBMapFileName

Purpose Default filename for RBMap.

TIBCO Hawk Configuration Object API Reference 364 | Chapter 8 config.rbengine.rbmap Package

RBMap.RBMapName Field

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public static java.lang.String RBMapName

Purpose Default name for RBMap.

TIBCO Hawk Configuration Object API Reference RBMap.RBMap | 365

RBMap.RBMap Constructor

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public RBMap() public RBMap(java.io.Reader reader)

Purpose The first constructor constructs an empty RBMap. The second constructor creates an RBMap from the reader. The reader contains an RBMap in an XML format. This constructor is useful when recreating an RBMap from RBMapXML object: RBMap schedules = new RBMap(aRBMapXML.getXMLReader()); Throws RBMapException if not able to create RBMap from the reader.

Parameters Parameter Description reader A reader that contains the RBMap in XML format.

TIBCO Hawk Configuration Object API Reference 366 | Chapter 8 config.rbengine.rbmap Package

RBMap.clone Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public java.lang.Object clone()

Purpose Returns a copy of this object. Throws java.lang.CloneNotSupportedException.

Returns A copy of this object.

TIBCO Hawk Configuration Object API Reference RBMap.equals | 367

RBMap.equals Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public boolean equals(java.lang.Object obj)

Purpose Compares two rulebase maps. The result is true if the argument is not null and is an RBMap object has the same group, rulebase, and command mappings.

Overrides equals in class java.lang.Object

Parameters Parameter Description obj the object to compare with

Returns true if the objects are the same; false otherwise.

TIBCO Hawk Configuration Object API Reference 368 | Chapter 8 config.rbengine.rbmap Package

RBMap.getAgentRulebases Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public java.lang.String[] getAgentRulebases (java.lang.String member, java.lang.String autoGroup)

Purpose This method is use by the RulebaseEngine MicroAgent to generate the list of rulebases that will be loaded during startup. The list of rulebases for an agent include rulebases for all the groups that agent belongs. If a group is specified, then the rulebases for the group is returned and the autogroup is ignored. When generating the rulebases, the RBMap may or may not use command mapping to generate the rulebases. This depends on the setting in the Attributes. Refer to Attributes.setUseCommandMapping(boolean, boolean) for more details.

Overrides

Parameters Parameter Description member The agent or group whose rulebases to be retrieved.

autoGroup The automatic group that the agent is in.

Returns A list of rulebases for specified agent and the default group that this agent is belongs to.

See Also Attributes.setUseCommandMapping(boolean, boolean)

TIBCO Hawk Configuration Object API Reference RBMap.getAttributes | 369

RBMap.getAttributes Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public Attributes getAttributes()

Returns The attributes of this RBMap.

TIBCO Hawk Configuration Object API Reference 370 | Chapter 8 config.rbengine.rbmap Package

RBMap.getChecksum Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public long getChecksum()

Purpose Returns the checksum of this RBMap.

Specified by getChecksum in interface RBEConfigObject

Returns

TIBCO Hawk Configuration Object API Reference RBMap.getCommands | 371

RBMap.getCommands Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public java.lang.String[] getCommands()

Purpose Returns the commands in the set of commands mapping. The commands returned can be used for getting members for a command.

Returns An array of commands that has a mapping defined for that commands. Empty array if no commands mapping is defined.

See Also getMemberForCommand(java.lang.String) setMemberForCommand(java.lang.String, java.lang.String)

TIBCO Hawk Configuration Object API Reference 372 | Chapter 8 config.rbengine.rbmap Package

RBMap.getFileExtension Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public java.lang.String getFileExtension()

Purpose Returns file extension based on the configuration object type.

Specified by getFileExtension in interface RBEConfigObject

Returns The file extension of the configuration object

TIBCO Hawk Configuration Object API Reference RBMap.getGroups | 373

RBMap.getGroups Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public java.lang.String[] getGroups()

Purpose Returns the group names that has a group mapping. The groups returned can be used for getting members in the groups.

Returns An array of group names that has a mapping defined for that group. Empty array if no group mapping is defined.

See Also getMembersInGroup(java.lang.String) setMembersInGroup(java.lang.String, java.lang.String[])

TIBCO Hawk Configuration Object API Reference 374 | Chapter 8 config.rbengine.rbmap Package

RBMap.getMemberForCommand Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public java.lang.String getMemberForCommand(java.lang.String command)

Purpose Returns the agent or group that uses the command.

Parameters Parameter Description command the command whose agent or group will be retrieved.

Returns The agent or group that uses the specified command for generating rulebases.

Throws java.lang.IllegalArgumentException - if command is null.

See Also getCommands() setMemberForCommand(java.lang.String, java.lang.String)

TIBCO Hawk Configuration Object API Reference RBMap.getMembersForRulebase | 375

RBMap.getMembersForRulebase Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public java.lang.String[] getMembersForRulebase(java.lang.String rulebase)

Purpose Returns all the members that use the specified rulebase.

Parameters Parameter Description rulebase the rulebase whose members will be retrieved.

Returns An array of member names that uses the specified rulebase. Empty array if the specified rulebase has no mapping defined.

Throws java.lang.IllegalArgumentException - if rulebase is null.

See Also getRulebases() setMembersForRulebase(java.lang.String java.lang.String[])

TIBCO Hawk Configuration Object API Reference 376 | Chapter 8 config.rbengine.rbmap Package

RBMap.getMembersInGroup Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public java.lang.String[] getMembersInGroup(java.lang.String group)

Purpose Returns all the members in the specified group.

Parameters Parameter Description group the group whose members will be retrieved.

Returns An array of member names that belongs to the specified group. Empty array if the specified group has no mapping defined.

Throws java.lang.IllegalArgumentException - if group is null or does not start with a "+".

See Also getGroups() setMembersInGroup(java.lang.String, java.lang.String[])

TIBCO Hawk Configuration Object API Reference RBMap.getRulebases | 377

RBMap.getRulebases Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public java.lang.String[] getRulebases()

Purpose Returns the rulebases that has a rulebase mapping. The rulebases returned can be used for getting members in the rulebases.

Returns An array of rulebases that has a mapping defined for that rulebase. Empty array if no rulebase mapping is defined.

See Also getMembersForRulebase(java.lang.String) setMembersForRulebase(java.lang.String, java.lang.String[])

TIBCO Hawk Configuration Object API Reference 378 | Chapter 8 config.rbengine.rbmap Package

RBMap.removeCommand Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public void removeCommand(java.lang.String command)

Purpose Removes a command mapping for the specified command.

Parameters Parameter Description command the command of which the mapping to be removed. If command is null or does not exist, the operation is ignored.

See Also setMemberForCommand(java.lang.String, java.lang.String)

TIBCO Hawk Configuration Object API Reference RBMap.removeGroup | 379

RBMap.removeGroup Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public void removeGroup(java.lang.String group)

Purpose Removes a group mapping for the specified group.

Parameters Parameter Description group the group of which the mapping to be removed. If group is null or does not exist, the operation is ignored.

See Also setMembersInGroup(java.lang.String, java.lang.String[])

TIBCO Hawk Configuration Object API Reference 380 | Chapter 8 config.rbengine.rbmap Package

RBMap.removeRulebase Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public void removeRulebase(java.lang.String rulebase)

Purpose Removes a rulebase mapping for the specified rulebase.

Parameters Parameter Description rulebase the rulebase of which the mapping to be removed. If rulebase is null or does not exist, the operation is ignored.

See Also setMembersForRulebase(java.lang.String, java.lang.String[])

TIBCO Hawk Configuration Object API Reference RBMap.setAttributes | 381

RBMap.setAttributes Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public void setAttributes(Attributes p)

Purpose Sets the attributes of this RBMap.

TIBCO Hawk Configuration Object API Reference 382 | Chapter 8 config.rbengine.rbmap Package

RBMap.setMemberForCommand Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public void setMemberForCommand(java.lang.String command, java.lang.String member)

Purpose Maps a command to the specified agent or group. If the same command is used for another agent or group, it will be replaced by the new mapping.

Parameters Parameter Description command the command for the mapping

members an agent or group that will use the command

Throws java.lang.IllegalArgumentException - if the command or the members is null.

See Also getCommands() getMemberForCommand(java.lang.String)

TIBCO Hawk Configuration Object API Reference RBMap.setMembersForRulebase | 383

RBMap.setMembersForRulebase Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public void setMembersForRulebase(java.lang.String rulebase, java.lang.String[] members)

Purpose Maps rulebases to the specified list of agents or groups.

Parameters Parameter Description group the group name for the mapping.

members a list of agents or group that will use the rulebase.

Throws java.lang.IllegalArgumentException - if the rulebase or the members is null.

See Also getRulebases() getMembersForRulebase(java.lang.String)

TIBCO Hawk Configuration Object API Reference 384 | Chapter 8 config.rbengine.rbmap Package

RBMap.setMembersInGroup Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public void setMembersInGroup(java.lang.String group, java.lang.String[] members)

Purpose Maps a group to the specified list of agents or groups.

Parameters Parameter Description group the group name for the mapping

members a list of agents or group that the group will contains.

Throws java.lang.IllegalArgumentException - if the group or the members is null. A group must start with a "+".

See Also getGroups() getMembersInGroup(java.lang.String)

TIBCO Hawk Configuration Object API Reference RBMap.toXML | 385

RBMap.toXML Method

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public void toXML(java.io.Writer writer)

Purpose Writes the RBMap in XML representation to Writer in XML. Throws RBEConfigObjectException.

Specified by toXML in interface RBEConfigObject

TIBCO Hawk Configuration Object API Reference 386 | Chapter 8 config.rbengine.rbmap Package

RBMapXML Class

Package COM.TIBCO.hawk.config.rbengine.rbmap

Purpose The RBMapXML provides methods for accessing XML representation of an RBMap.

Remarks An RBMapXML object is used when sending an RBMap to or receiving from a TIBCO Hawk Agent within an application written using Console API. For example, the following code fragment shows how to get an RBMap from a repository microagent:

MicroAgent maidRepo = getRepositoryMicroagentID(); MethodInvocation mi = new MethodInvocation("getRBMap", null); MicroAgentData mad = agentManager.invoke( maidRepo, mi );

Object o = mad.getData(); if (o instanceof RBMapXML) { RBMapXML rbXMLs = (RBMapXML)mad.getData();

// return the retrieved RBMap return new RBMap(rbXMLs.getXMLReader()); } // if error occurred on the agent, the returned object will be a MicroAgentException else if (o instanceof MicroAgentException) throw (MicroAgentException)o;

To send an RBMap to a repository microagent:

RBMap rbMap = getRBMap(); MicroAgent maidRepo = getRepositoryMicroagentID(); DataElement[] dataElements = new DataElement[2]; dataElements[0] = new DataElement("RBMapXML", new RBMapXML(rbMap)); dataElements[1] = new DataElement("Notify" , new Boolean(false)); MethodInvocation mi = new MethodInvocation("setRBMap", dataElements); MicroAgentData mad = agentManager.invoke( maidRepo, mi );

For a complete list of methods in RepositoryMicroagent, refer to TIBCO Hawk Console API Method's Reference. For a complete sample for retrieving and sending an RBMap, see the RBMap API samples in TIBCO Hawk installation samples.

TIBCO Hawk Configuration Object API Reference RBMapXML | 387

Constructor Name Description Page Summary RBMapXML.RBMapXML 388

See Also Serialized Form

TIBCO Hawk Configuration Object API Reference 388 | Chapter 8 config.rbengine.rbmap Package

RBMapXML.RBMapXML Constructor

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public RBMapXML(RBMap rbMap)

Purpose Constructs an RBMapXML for a specified RBMap.

TIBCO Hawk Configuration Object API Reference RBMapXML.RBMapException | 389

RBMapXML.RBMapException Class

Package COM.TIBCO.hawk.config.rbengine.rbmap

Purpose Signals that an error occurred while processing RBMap.

Constructor Summary Name Description Page RBMapXML.RBMapException 390

See Also Serialized Form

TIBCO Hawk Configuration Object API Reference 390 | Chapter 8 config.rbengine.rbmap Package

RBMapXML.RBMapException Exception

Package COM.TIBCO.hawk.config.rbengine.rbmap

Declaration public RBMapException(java.lang.Exception e) public RBMapException(java.lang.String sMsg)

Purpose The first constructor constructs an RBMapException from the specified exception. The second constructor constructs an RBMapException with the specified error message.

TIBCO Hawk Configuration Object API Reference | 391

Appendix A Common Configuration Object API Methods

This chapter describes the common RulebaseEngine and TIBCO Repository microagent methods that are used with the Configuration Object API.

Topics

• Microagent and Method Invocation used in ConsequenceAction, page 392 • Interaction with Agent and Repository using the Console API, page 394 • RuleBaseEngine:sendAlertMessage, page 396 • RuleBaseEngine:execute, page 397 • RuleBaseEngine:sendMail, page 398 • RuleBaseEngine:addRuleBase, page 399 • RuleBaseEngine:deleteRuleBase, page 400 • RuleBaseEngine:setSchedules, page 401 • RuleBaseEngine:getSchedules, page 402 • RuleBaseEngine:getRBMap, page 403 • Repository:addRuleBase, page 404 • Repository:deleteRuleBase, page 405 • Repository:setSchedules, page 406 • Repository:getSchedules, page 407 • Repository:setRBMap, page 408 • Repository:getRBMap, page 409

TIBCO Hawk Configuration Object API Reference 392 | Appendix A Common Configuration Object API Methods

Microagent and Method Invocation used in ConsequenceAction

A ConsequenceAction in a rulebase executes an action when the condition of the test is satisfied. The action taken is in the form of method invocation. The following are common actions performed by a ConsequenceAction of a rulebase: • send a notification or an alert • execute a custom command or script • send an email Since a ConsequenceAction invokes a method invocation on a specific microagent, any known method invocation with ACTION or INFO type can be specified. However, caution must be taken on methods that may potentially take a long time to execute. When constructing a ConsequenceAction object, two arguments are needed: the name of a microagent and the method invocation that will be performed on that microagent. Hence, before constructing a ConsequenceAction, first construct a MethodInvocation. A MethodInvocation requires a method name. Depending on the method, it may also take arguments. For a complete list of built-in microagents and their open methods, please refer to the TIBCO Hawk Methods Reference. The follow methods show how the common ConsequenceActions can be created. Note that the sendAlertMessage method is a proprietary method of the RulebaseEngine microagent and is not listed in the TIBCO Hawk Methods Reference.

/** * Create an alert action. */ ConsequenceAction createAlertAction(String state, String alert) throws RBEConfigObjectException { DataElement[] args = new DataElement[1]; if ( state.equals("High") ) args[0] = new DataElement("message", new COM.TIBCO.hawk.config.rbengine.rulebase.util.AlertHigh(alert)); else if ( state.equals("Medium") ) args[0] = new DataElement("message", new COM.TIBCO.hawk.config.rbengine.rulebase.util.AlertMedium(alert)); else if ( state.equals("Low") ) args[0] = new DataElement("message", new COM.TIBCO.hawk.config.rbengine.rulebase.util.AlertLow(alert));

TIBCO Hawk Configuration Object API Reference Microagent and Method Invocation used in ConsequenceAction | 393

MethodInvocation mi = new MethodInvocation( "sendAlertMessage", args); return new ConsequenceAction("COM.TIBCO.hawk.microagent.RuleBaseEngine", mi); }

/** * Create an email action */ ConsequenceAction createEmailAction(String to, String from, String cc, String subject, String server, String content) throws RBEConfigObjectException { DataElement[] args = new DataElement[6]; args[0] = new DataElement("To", to); args[1] = new DataElement("From", from); args[2] = new DataElement("CC",cc); args[3] = new DataElement("Subject", subject); args[4] = new DataElement("Mail Server", server); args[5] = new DataElement("Content", content); MethodInvocation mi = new MethodInvocation( "sendMail", args); return new ConsequenceAction("COM.TIBCO.hawk.microagent.RuleBaseEngine", mi); }

/** * Create a custom execute action. */ ConsequenceAction createCustomAction(String cmdStr) throws RBEConfigObjectException { DataElement[] args = new DataElement[1]; args[0] = new DataElement("command", cmdStr); MethodInvocation mi = new MethodInvocation( "execute", args); return new ConsequenceAction("COM.TIBCO.hawk.microagent.Custom", mi); }

TIBCO Hawk Configuration Object API Reference 394 | Appendix A Common Configuration Object API Methods

Interaction with Agent and Repository using the Console API

An application that uses the Configuration Object API often needs to retrieve, update, or replace such configuration objects. To retrieve and send the configuration objects from the application to the agent or repository, the application needs to use the Console API.

When an agent is running in the repository configuration mode, configuration objects (such as a rulebase or schedule) updated on the agent are not permanent and the rulebase map can only be updated on a repository.

The following steps illustrate one possible way that an application using the Console API and Configuration Object API can update a configuration object of an agent or repository. 1. Create a TIBHawkConsole. 2. Listen to AgentMonitorEvent of the AgentMonitor. 3. Wait until the AgentMonitorEvent from the desire agent is received by examining the AgentInstance of the AgentMonitorEvent. 4. Retrieve the MicroAgentID of the RulebaseEngine or Repository from the AgentInstance. 5. Retrieve the configuration object from the RulebaseEngine or Repository microagent using the AgentManager. 6. Update or modified the configuration object. 7. Update the configuration object on the RulebaseEngine or Repository microagent. For convenience, the rest of this section lists the methods in RulebaseEngine and Repository microagent that are useful for retrieving and updating Rulebase, Schedule, and Rulebase Map. The complete list of methods can be found in the TIBCO Hawk Methods Reference. For details and code samples, refer to the Java sample descriptions in Appendix B, Sample Programs, and the sample Java files described there. For details on TIBHawkConsole, AgentMonitor, AgentMonitorEvent, AgentInstance, and other Console API classes, please refer to the TIBCO Hawk Console API Reference.

TIBCO Hawk Configuration Object API Reference Methods Reference | 395

Methods Reference

The following COM.TIBCO.hawk.microagent.RuleBaseEngine methods are commonly use in ConsequenceActions: • MicroAgentDescriptorXML, page 418 • RuleBaseEngine:sendAlertMessage, page 396 • RuleBaseEngine:execute, page 397 • RuleBaseEngine:sendMail, page 398 The following COM.TIBCO.hawk.microagent.RuleBaseEngine methods are used for updating configuration objects in the agent: • RuleBaseEngine:addRuleBase, page 399 • RuleBaseEngine:deleteRuleBase, page 400 • RuleBaseEngine:setSchedules, page 401 • RuleBaseEngine:getSchedules, page 402 • RuleBaseEngine:getRBMap, page 403 The following COM.TIBCO.hawk.microagent.Repository methods are used for updating configuration objects in the repository: • Repository:addRuleBase, page 404 • Repository:deleteRuleBase, page 405 • Repository:setSchedules, page 406 • Repository:getSchedules, page 407 • Repository:setRBMap, page 408 • Repository:getRBMap, page 409

TIBCO Hawk Configuration Object API Reference 396 | Appendix A Common Configuration Object API Methods

RuleBaseEngine:sendAlertMessage Method

Purpose This method sends an alert.

Type Proprietary, Synchronous, IMPACT_INFO

Remarks This method can be invoked only from a rulebase action, because an alert is associated with the rulebase that triggersthe alert.

Arguments Name Type Description command COM.TIBCO.hawk.config.rbengine.rulebase.util. The alert AlertHigh message to be sent. COM.TIBCO.hawk.config.rbengine.rulebase.util. AlertMedium COM.TIBCO.hawk.config.rbengine.rulebase.util. AlertLow COM.TIBCO.hawk.config.rbengine.rulebase.util. Notification

Returns None

TIBCO Hawk Configuration Object API Reference RuleBaseEngine:execute | 397

RuleBaseEngine:execute Method

Purpose This method executes a command and ignores the result.

Type Open, Synchronous, IMPACT_ACTION

Arguments Name Type Description command String The command to execute. External and Internal variables can be used.

Returns None

TIBCO Hawk Configuration Object API Reference 398 | Appendix A Common Configuration Object API Methods

RuleBaseEngine:sendMail Method

Purpose Sends a mail.

Type Open, Synchronous, IMPACT_ACTION

Arguments Name Type Description To String Send this mail to.

From String None

CC String CC (carbon copy) recipients of this mail.

Subject String Subject of this mail.

Mail Server String Send this mail via this Mail Server.

Content String Content of this mail.

Returns None

TIBCO Hawk Configuration Object API Reference RuleBaseEngine:addRuleBase | 399

RuleBaseEngine:addRuleBase Method

Purpose This method adds a rulebase to the agent.

Remarks Timeout (millisecs): 10000

Type Proprietary, Synchronous, IMPACT_ACTION

Arguments Name Type Description RulebaseXML COM.TIBCO.hawk.config.rbengine. An Object that rulebase.RulebaseXML contains XML formatted string that represent the rulebase.

Returns None

TIBCO Hawk Configuration Object API Reference 400 | Appendix A Common Configuration Object API Methods

RuleBaseEngine:deleteRuleBase Method

Purpose This method deletes a rulebase from the agent.

Type Open, Synchronous, IMPACT_ACTION

Arguments Name Type Description RuleBaseName String The name of the rulebase to be deleted.

Returns None

TIBCO Hawk Configuration Object API Reference RuleBaseEngine:setSchedules | 401

RuleBaseEngine:setSchedules Method

Purpose This method replaces the schedules in the agent.

Type Proprietary, Synchronous, IMPACT_ACTION

Arguments Name Type Description SchedulesXML COM.TIBCO.hawk.config.rbengine. An Object that schedule.SchedulesXML contains XML formatted string that represent the schedule.

Returns None

TIBCO Hawk Configuration Object API Reference 402 | Appendix A Common Configuration Object API Methods

RuleBaseEngine:getSchedules Method

Purpose This method returns the currently loaded Schedules.

Type Proprietary, Synchronous, IMPACT_INFO

Arguments None

Returns Name Type Description SchedulesXML COM.TIBCO.hawk.config.rbengine. An Object that schedule.SchedulesXML contains XML formatted string that represent the schedules.

TIBCO Hawk Configuration Object API Reference RuleBaseEngine:getRBMap | 403

RuleBaseEngine:getRBMap Method

Purpose This method returns the currently loaded RBMap.

Remarks Timeout (millisecs): 10000

Type Proprietary, Synchronous, IMPACT_INFO

Arguments None

Returns Name Type Description RBMapXML COM.TIBCO.hawk.config.rbengine. An Object that contains rbmap.RBMapXML XML formatted string that represent the rulebase map.

TIBCO Hawk Configuration Object API Reference 404 | Appendix A Common Configuration Object API Methods

Repository:addRuleBase Method

Purpose This method adds a rulebase to the repository.

Remarks Timeout (millisecs): 10000

Type Proprietary, Synchronous, IMPACT_ACTION

Arguments Name Type Description RulebaseXML COM.TIBCO.hawk.config.rbengine. An Object that rulebase.RulebaseXML contains XML formatted string that represent the rulebase.

Returns None

TIBCO Hawk Configuration Object API Reference Repository:deleteRuleBase | 405

Repository:deleteRuleBase Method

Purpose This method deletes a rulebase from the repository.

Type Open, Synchronous, IMPACT_ACTION

Arguments Name Type Description RuleBaseName String The name of the rulebase to be deleted.

Returns None

TIBCO Hawk Configuration Object API Reference 406 | Appendix A Common Configuration Object API Methods

Repository:setSchedules Method

Purpose This method set the schedules in the repository.

Type Proprietary, Synchronous, IMPACT_ACTION

Arguments Name Type Description SchedulesXML COM.TIBCO.hawk.config.rbengine. An Object that schedule.SchedulesXML contains XML formatted string that represent the schedule.

Returns None

TIBCO Hawk Configuration Object API Reference Repository:getSchedules | 407

Repository:getSchedules Method

Purpose This method returns the schedules in the repository.

Type Proprietary, Synchronous, IMPACT_INFO

Arguments None

Returns Name Type Description SchedulesXML COM.TIBCO.hawk.config.rbengine. An Object that schedule.SchedulesXML contains XML formatted string that represent the schedule.

TIBCO Hawk Configuration Object API Reference 408 | Appendix A Common Configuration Object API Methods

Repository:setRBMap Method

Purpose This method set the rulebase map in the repository.

Type Proprietary, Synchronous, IMPACT_ACTION

Arguments Name Type Description RBMapXML COM.TIBCO.hawk.config.rbengine. An Object that contains rbmap.RBMapXML XML formatted string that represent the rulebase map.

Returns None

TIBCO Hawk Configuration Object API Reference Repository:getRBMap | 409

Repository:getRBMap Method

Purpose This method returns the rulebase map in the repository.

Type Proprietary, Synchronous, IMPACT_INFO

Arguments None

Returns Name Type Description RBMapXML COM.TIBCO.hawk.config.rbengine. An Object that contains rbmap.RBMapXML XML formatted string that represent the rulebase map.

TIBCO Hawk Configuration Object API Reference 410 | Appendix A Common Configuration Object API Methods

TIBCO Hawk Configuration Object API Reference | 411

Appendix B Sample Programs

This appendix describes the sample programs provided in the /samples/rulebase_api, /samples/schedule_api, and /samples/rbmap_api directories.

Topics

• Rulebase Samples, page 412 • Schedule Samples, page 414 • Rulebase Map Samples, page 416

TIBCO Hawk Configuration Object API Reference 412 | Appendix B Sample Programs

Rulebase Samples

The example Java source files in samples/rulebase_api show how to use the Rulebase-related classes of the Configuration Object API. For details of the code, refer to the Java source files.

RBIsample1.java This sample shows how to create a simple rulebase and save it to a file. The rulebase uses the Spot microagent that is created using the provided sample application. In the rulebase, the data source is the current color of the Spot microagent. The test in the rulebase checks the color of the Spot microagent. If the color is blue, it performs an action that changes the color to green.

RBIsample2.java This sample extends RBIsample1.java to show how to use a compound test in a rulebase. In this example, the rulebase created in RBIsample1.java is save to a file. After reading the rulebase from the file, RBIsample2.java replaces the test with a compound test. The compound test checks if the current color is either blue or red. If this condition is satisfied, it performs an action that changes the color to green.

RBIsample3.java This sample demonstrates how an application can create, add, update, and delete a rulebase dynamically on an agent using the Configuration Object API and Console API. Refer to Appendix A, Common Configuration Object API Methods, for methods related to communication between a Console application and the TIBCO Hawk agent. When running this sample, the Spot microagent should also be running. This allows you to see the effect of the action performed by the rulebase after being updated on the TIBCO Hawk agent. The sample performs the following steps: 1. Creates a rulebase using the color of the SPOT microagent as the data source, which changes to green if the current color is blue.

TIBCO Hawk Configuration Object API Reference Rulebase Samples | 413

2. Adds the created rulebase to the agent. 3. Changes the color of SPOT to blue. (At runtime, a few second after this call, the color on the Spot microagent will change to green due to the test in the rulebase.) 4. Retrieves the rulebase, modifies it to change the color of SPOT to green if the current color is either blue or red, and updates the rulebase on the agent. 5. Sets the color of SPOT on the agent to red. (At runtime, a few second later after this call, the color on the Spot microagent will change to green due to the test in the rulebase.) 6. Sets the color of SPOT on the agent to blue. (At runtime, a few second later after this call, the color on the Spot microagent should change to green due to the test in the rulebase.) 7. Deletes the rulebase from the agent.

TIBCO Hawk Configuration Object API Reference 414 | Appendix B Sample Programs

Schedule Samples

The example Java source files in samples/schedule_api show how to use the Schedule-related classes of the Configuration Object API. For details of the code, refer to the Java source files.

ScheduleCreateAndSave.java This sample shows how to create a simple schedule and save it to a file. The schedule created contains a period which is in-schedule from 8:00am to 5:59pm every Monday.

ScheduleUsingExclusion.java This sample creates a schedule named BusinessHourInSummer. The purpose is to show the use of both inclusion and exclusion periods. This schedule is in-schedule from Monday to Friday, 8:00 AM to 5:59 PM. The hours between 12:00 PM and 2:00 PM in June, July and August are excluded. This schedule definition uses both inclusion and exclusion period even though the same schedule could be created without using the exclusion period but using a more specific inclusion period.

ScheduleWithPeriodGroup.java This sample extends ScheduleUsingExclusion to demonstrate the use of PeriodGroup and PeriodGroupReference. The exclusion period in ScheduleWithPeriodGroup.java is replaced by a period group that specifies the same time period. The resulting schedule contains an exclusion period equivalent to the one in ScheduleUsingExclusion.

ScheduleGetAndSet.java This sample demonstrates how an application can get and set schedules dynamically on a repository using the Configuration Object API and Console API. The sample performs the following steps: 1. Gets the schedules from the repository.

TIBCO Hawk Configuration Object API Reference Schedule Samples | 415

2. Creates and adds a schedule to the existing schedules. 3. Replaces the schedules in the repository.

TIBCO Hawk Configuration Object API Reference 416 | Appendix B Sample Programs

Rulebase Map Samples

The example Java source files in samples/rbmap_api show how to use the Rulebase Map-related classes of the Configuration Object API. For details of the code, refer to the Java source files.

RBMapCreateAndSave.java This sample shows how to create a simple Rulebase Map and save it to a file. It also shows the use of the method getAgentRulebases() to retrieve rulebases maps to an agent in the Rulebase Map.

Based on the rulebase map, getAgentRulebases() returns a list of rulebases that an agent should load during startup if the agent is running in the repository configuration mode. It does not return a rulebase map.

RBMapUseCommand.java This sample extends RBMapCreateAndSave to include an external command that generates a list of rulebases for an agent.

This example uses RBMapUseCommand.exe and will run on Microsoft Windows only.

RBMapUseCommand.java This sample demonstrates how an application can get and set a Rulebase Map dynamically on a repository using the Configuration Object API and Console API. The sample performs the following steps: 1. Gets the Rulebase Map from the repository. 2. Updates the Rulebase Map. 3. Replaces the Rulebase Map in the repository.

TIBCO Hawk Configuration Object API Reference | 417

Appendix C MicroAgentDescriptorXML

This appendix describes the MicroAgentDescriptorXML class.

Topics

• MicroAgentDescriptorXML, page 418

TIBCO Hawk Configuration Object API Reference 418 | Appendix C MicroAgentDescriptorXML

MicroAgentDescriptorXML Class

Package COM.TIBCO.hawk.config.rbengine.util

Purpose This class allow a MicroAgentDescriptor to be exported and restored from its XML representation.

Method Name Description Page Summary MicroAgentDescriptorXML.saveToPath() Save the 419 MicroAgentDescriptor to a file in the given path.

MicroAgentDescriptorXML.toXML() Returns the XML 420 representation of the specified MicroAgentDescriptor.

MicroAgentDescriptorXML.fromXML() Returns a 421 MicroAgentDescriptor object from a Reader.

TIBCO Hawk Configuration Object API Reference MicroAgentDescriptorXML.saveToPath() | 419

MicroAgentDescriptorXML.saveToPath() Constructor

Package COM.TIBCO.hawk.config.rbengine.util

Declaration public static void saveToPath(String path, MicroAgentDescriptor mad)

Purpose Saves the MicroAgentDescriptor to a file in the given path.

Parameters Name Description

path The path where the MicroAgentDescriptor XML representation is written to. The name of the file created is obtain from the method

getDisplayName The display name of the MicroAgentDescriptor

mad The MicroAgentDescriptor to be written.

TIBCO Hawk Configuration Object API Reference 420 | Appendix C MicroAgentDescriptorXML

MicroAgentDescriptorXML.toXML() Constructor

Package COM.TIBCO.hawk.config.rbengine.util

Declaration public static String ToXML(MicroAgentDescriptor mad)

Purpose Returns the XML representation of the specified MicroAgentDescriptor.

Parameters Name Description

mad The MicroAgentDescriptor to obtain the XML representation..

TIBCO Hawk Configuration Object API Reference MicroAgentDescriptorXML.fromXML() | 421

MicroAgentDescriptorXML.fromXML() Constructor

Package COM.TIBCO.hawk.config.rbengine.util

Declaration public static String fromXML(java.io.Reader reader) throws java.io.IOException

Purpose Returns a MicroAgentDescriptor object from a Reader.

Parameters Name Description

reader The MicroAgentDescriptor to obtain the XML representation..

TIBCO Hawk Configuration Object API Reference 422 | Appendix C MicroAgentDescriptorXML

TIBCO Hawk Configuration Object API Reference | 423 Index

A ule 220 ConsequenceAction 89 Action 77 ConsequenceAction.getEscalationTime() 9 Action.getMethodInvocation() 79 1 Action.getMicroAgentName() 81 ConsequenceAction.getPerformActionPoli Action.setMethodInvocation() 80, 80 cy() 92, 92 Action.setMicroAgentName() 82 ConsequenceAction.setEscalationTime() 9 Action.toString() 85 3 Attributes 224, 353 ConsequenceAction.setPerformActionPoli Attributes.clone 354 cy() 94 Attributes.setUseCommandMapping 355 ConsequenceAction.toString() 95 Attributes.usingCommandMapping 356 ConsequenceAction() 90 Attributes.usingCommandMappingOnly customer support xxi 357

D C DataSource 96 changes from the previous release xvi DataSource.DataSource() 97, 98 ClearAction 86 DataSource.getDisplayName() 99 ClearAction.toString() 88 DataSource.getMethodSubscription() 100 ClearAction() 87 ClearConditionPolicy 169, 169 ClearOnFirstFalse 172, 172 ClearOnFirstFalse.ClearOnFirstFalse() 173 O , 173 ClearOnFirstFalse.equals() 174, 174 Operator.getName() 116 ClearTest 175, 175 Operator.getOperands() 117 ClearTest.ClearTest() 176, 176 Operator.getOperatorDescriptors() 118 ClearTest.getTestExpression() 177, 177 Operator.getType() 119 ClearTimer 178, 178 Operator.setRuleDataContext() 120 ClearTimer.ClearTimer() 179, 179 Operator.toString() 121 ClearTimer.getTimerInterval() 180, 180 OperatorDescriptor 122, 130 COM.TIBCO.hawk.config.rbengine.rbmap OperatorDescriptor.getDescription() 125 352 OperatorDescriptor.getDisplayName() 12 COM.TIBCO.hawk.config.rbengine.ruleba 6 se.policy 167 OperatorDescriptor.getFixedOperandDesc COM.TIBCO.hawk.config.rbengine.sched riptors() 127

TIBCO Hawk Configuration Object API Reference 424 | Index

OperatorDescriptor.getName() 128 Period.isAlwaysExcluded 276 OperatorDescriptor.getType() 129 Period.isIncluded 277 OperatorDescriptor.getVariableOperandD Period.JANUARY 241 escriptor() 130 Period.JULY 242 OperatorDescriptor.toString() 131 Period.JUNE 243 OperatorDescriptor() 124 Period.LAST_DAY_OF_MONTH 244 OperatorException 214 Period.LAST_WEEKDAY_OF_MONTH 2 OperatorException.OperatorException() 2 45 15 Period.MARCH 246 Period.MAY 247 Period.MINUTES_IN_DAY 248 Period.MONDAY 249 P Period.MONTHS_IN_YEAR 250 Period.NOVEMBER 251 PerformActionPolicy 170, 170 Period.NUM_OF_DAYS_IN_MONTH 252 PerformAlways 181, 181 Period.NUM_OF_DAYS_IN_WEEK 253 PerformAlways.PerformAlways() 182, 182 Period.NUM_OF_INTERVALS 254 PerformCountOnInterval 183, 183 Period.NUM_OF_MINUTES 255 PerformCountOnInterval.getCount() 185, Period.NUM_OF_MONTHS 256 185 Period.OCTOBER 257 PerformCountOnInterval.getInterval() 186 Period.Period 268 , 186 Period.SATURDAY 258 PerformCountOnInterval.PerformCountO Period.SECOND_WEEKDAY_OF_MONT nInterval() 184, 184 H 259 PerformOnlyOnce 187, 187 Period.SEPTEMBER 260 PerformOnlyOnce.PerformOnlyOnce() 18 Period.SUNDAY 261 8, 188 Period.THIRD_WEEKDAY_OF_MONTH Period 225 262 Period.APRIL 233 Period.THURSDAY 263 Period.AUGUST 234 Period.TIME_OF_DAY 264 Period.clone 269 Period.toString 278 Period.DAYS_IN_MONTH 235 Period.TUESDAY 265 Period.DECEMBER 236 Period.WEDNESDAY 266 Period.equals 270 Period.WEEKDAYS_IN_MONTH 267 Period.exclude 271 PeriodGroup 279 Period.excludeAll 272 PeriodGroup.clone 282 Period.FEBRUARY 237 PeriodGroup.equals 283 Period.FIRST_WEEKDAY_OF_MONTH 2 PeriodGroup.getName 284 38 PeriodGroup.getPeriods 285 Period.FOURTH_WEEKDAY_OF_MONT PeriodGroup.inSchedule 286 H 239 PeriodGroup.PeriodGroup 281 Period.FRIDAY 240 PeriodGroup.setName 287 Period.include 273 PeriodGroup.setPeriods 288 Period.includeAll 274 PeriodGroup.toString 289 Period.inSchedule 275 PeriodGroupReference 290

TIBCO Hawk Configuration Object API Reference Index | 425

PeriodGroupReference.clone 293 RBMap.removeGroup 379 PeriodGroupReference.equals 294 RBMap.removeRulebase 380 PeriodGroupReference.getName 295 RBMap.setAttributes 381 PeriodGroupReference.inSchedule 296 RBMap.setMemberForCommand 382 PeriodGroupReference.PeriodGroupRefere RBMap.setMembersForRulebase 383 nce 292 RBMap.setMembersInGroup 384 PeriodGroupReference.setName 297 RBMap.toXML 385 PeriodGroupReference.toString 298 RBMapXML 386 RBMapXML.RBMapException 389, 390 RBMapXML.RBMapXML 388 Rule 132 R Rule.clearTests() 134 Rule.getDataSource() 135 RBEConfigObject 47 Rule.getOverRuling() 136 RBEConfigObject.getChecksum() 49 Rule.getTests() 137 RBEConfigObject.getFileExtension() 50 Rule.setDataSource() 138 RBEConfigObject.getName 48 Rule.setOverRuling() 139 RBEConfigObject.toXML() 51 Rule.setTests() 140 RBEConfigObjectException 66 Rule.toString() 141 RBEConfigObjectException.RBEConfigObj Rule() 133 ectException() 67 Rulebase 142 RBEConfigObjectXML.getXMLReader() 6 Rulebase.getAuthor() 145 5 Rulebase.getCheckSum() 146 RBEConfigObjectXML.getXMLString() 64, Rulebase.getCommands() 147 64 Rulebase.getComment() 148 RBEConfigObjectXML.RBEConfigObjectX Rulebase.getFileExtension() 149 ML() 63 Rulebase.getIncludedRulebases() 150 RBMap 358 Rulebase.getLastModification() 151 RBMap.clone 366 Rulebase.getRules() 152 RBMap.equals 367 Rulebase.setAuthor() 153 RBMap.FILE_EXTENSION 362 Rulebase.setCommands() 154 RBMap.getAgentRulebases 368 Rulebase.setComment() 155 RBMap.getAttributes 369 Rulebase.setIncludedRulebases() 156 RBMap.getChecksum 370 Rulebase.setLastModification() 157 RBMap.getCommands 371 Rulebase.setName() 158 RBMap.getFileExtension 372 Rulebase.setRules() 159 RBMap.getGroups 373 Rulebase.toString() 160 RBMap.getMemberForCommand 374 Rulebase.toXML() 161 RBMap.getMembersForRulebase 375 Rulebase() 144 RBMap.getMembersInGroup 376 RulebaseElement 162 RBMap.getRulebases 377 RulebaseElement.getName() 163 RBMap.RBMap 365 RulebaseElement.getSchedule() 164 RBMap.RBMapFileName 363 RulebaseElement.setName() 165 RBMap.RBMapName 364 RulebaseElement.setSchedule() 166 RBMap.removeCommand 378 RulebaseException 216

TIBCO Hawk Configuration Object API Reference 426 | Index

RulebaseException.RulebaseException() 2 Schedules.getAttributes 330 17 Schedules.getFileExtension 331 RulebaseXML 192 Schedules.getPeriodGroup 332 RulebaseXML.getXMLReader() 195 Schedules.getPeriodGroups 333 RulebaseXML.getXMLString() 194 Schedules.getSchedule 334 RulebaseXML.RulebaseXML() 193 Schedules.getSchedules 335 RuleDataContext 74 Schedules.getScheduleUsingPeriodGroup RuleDataContext.getPostedConditions() 7 336 6 Schedules.removePeriodGroup 337 RuleDataContext.getRuleData() 75 Schedules.removeSchedule 338 Schedules.renamePeriodGroup 339 Schedules.Schedules 325 Schedules.SchedulesFileName 323 S Schedules.SchedulesName 324 Schedules.setAttributes 340 Schedulable 222 Schedules.setPeriodGroups 341 Schedulable.inSchedule 223 Schedules.setSchedules 342 Schedule 299 Schedules.toString 343 Schedule.addExclusionPeriod 303 Schedules.toXML 344 Schedule.addInclusionPeriod 304 SchedulesXML 345 Schedule.clone 305 SchedulesXML.SchedulesXML 347 Schedule.equals 306 support, contacting xxi Schedule.getExclusionPeriods 307 Schedule.getInclusionPeriods 308 Schedule.getName 309 Schedule.getSecondTillNextScheduleChan T ge 310 Schedule.getTimeZone 311 technical support xxi Schedule.inSchedule 312 Test 196 Schedule.isUsingPeriodGroup 313 Test.getClearActions() 198 Schedule.removeExclusionPeriod 314 Test.getClearConditionPolicy() 199 Schedule.removeInclusionPeriod 315 Test.getConsequenceActions() 200 Schedule.Schedule 302 Test.getTestExpressionOperator() 201 Schedule.setName 316 Test.getTrueConditionPolicy() 202 Schedule.setTimeZone 317 Test.setClearActions() 203 Schedule.toString 318 Test.setClearConditionPolicy() 204 ScheduleException 221, 348 Test.setConsequenceActions() 205 ScheduleException.ScheduleException 34 Test.setTestExpressionOperator() 206 9 Test.setTrueConditionPolicy() 207 Schedules (class) 319 Test.Test() 197 Schedules.addPeriodGroup 326 Test.toString() 208 Schedules.addSchedule 327 TIBCO_HOME xix Schedules.clone 328 TrueConditionPolicy 171, 171 Schedules.equals 329 TrueCountThreshold 189, 189 Schedules.FILE_EXTENSION 322 TrueCountThreshold.getTrueCountThresh

TIBCO Hawk Configuration Object API Reference Index | 427

old() 191, 191 TrueCountThreshold.TrueCountThreshold () 190, 190

V

VariableOperandDescriptor.getMax() 211 VariableOperandDescriptor.getMin() 212 VariableOperandDescriptor.toString() 213 VariableOperandDescriptor.VariableOpera ndDescriptor() 210 VariableOperandDescriptor() 209

TIBCO Hawk Configuration Object API Reference