Creating a Class that Extends AbstractActionImpl
Procedure
-
Create a class that extends
AbstractActionImpl
class MyActionImpl extends AbstractActionImpl { public MyActionImpl(Rule rule, ActionDef actionDef) { super(rule, actionDef); }
-
Override the
getActionHandlerContext() method. This method returns the associated context handler. The method definition is as follows:
ActionHandlerContext getActionHandlerContext()
-
Override the performAction() method. This method is called by the engine when the filters associated to a rule meet the set criteria.
void performAction(Rule rule, MetricNodeEvent node) throws java.lang.Exception
- Override the getAlertText() method. This method should return the text associated with this alert. This alert text returned by this class is stored in the corresponding field of the alerts in the system.
-
Override the getAlertDetails() method. This method should return the alert details, such as e-mail ID. This string is specific to an action. The alert text returned by this method is stored in the corresponding field of the alerts in the system.
Actions may use values set in the action definition in their function parameters. These values may contain tokens recognized by the system. These tokens are substituted with their corresponding runtime values.
Copyright © 2022. Cloud Software Group, Inc. All Rights Reserved.