public abstract class AbstractEventHandler
extends java.lang.Object
DefaultEventHandler.
One or more event handlers can be configured per Rule.| Constructor and Description |
|---|
AbstractEventHandler()
Default constructor
|
AbstractEventHandler(java.util.Map<java.lang.String,java.lang.String> attributes)
Constructor with the Map of all attributes of the event handler.
|
| Modifier and Type | Method and Description |
|---|---|
java.util.HashMap<java.lang.String,java.lang.String> |
getAttributes()
Returns a Map containing the event handler's attributes and their values.
|
java.util.HashMap<java.lang.String,java.lang.String> |
getRuleAttributes()
Returns a Map containing rule attributes and their values.
|
abstract boolean |
handleEvent(AbstractEvent event)
Abstract method to handle an event.
|
void |
setAttributes(java.util.HashMap<java.lang.String,java.lang.String> attributes)
Sets the Map of all attributes of the event handler.
|
void |
setRuleAttributes(java.util.HashMap<java.lang.String,java.lang.String> ruleAttributes)
Sets the attributes from rule containing this event handler, for the event handler to access.
|
void |
throwException(java.lang.String message,
java.util.List<java.lang.Object> parameters,
java.lang.Throwable cause,
Context apiContext)
Allows the trigger to throw a formatted exception object and
stop the execution of the current operation.
|
public AbstractEventHandler()
public AbstractEventHandler(java.util.Map<java.lang.String,java.lang.String> attributes)
attributes - a Map of attributes that provide configuration to the Event Handlerpublic abstract boolean handleEvent(AbstractEvent event) throws java.lang.Exception
event - the event for the event handler to handlejava.lang.Exceptionpublic void setAttributes(java.util.HashMap<java.lang.String,java.lang.String> attributes)
attributes - a Map of attributes that provide configuration to the event handlerpublic java.util.HashMap<java.lang.String,java.lang.String> getAttributes()
public java.util.HashMap<java.lang.String,java.lang.String> getRuleAttributes()
public void setRuleAttributes(java.util.HashMap<java.lang.String,java.lang.String> ruleAttributes)
ruleAttributes - a Map of attributes that provide configuration to rule, which can be used by the event handlerpublic void throwException(java.lang.String message,
java.util.List<java.lang.Object> parameters,
java.lang.Throwable cause,
Context apiContext)
throws GRCTriggerException
message - (required) an application text key (e.g.
"com.triggers.ext.MyMessage") or a string containing error
message text "My Error Message". Parameters may be specified with
braces surrounding the index of the parameter, such as
"{0}, {1}, {2}...". See java.text.MessageFormat.parameters - (optional) a list containing objects to pass as message
parameters. If a list is not specified, you can provide
java.util.Collections.EMPTY_LIST.cause - (optional) original exception that caused the trigger to
error.apiContext - (required) API contextGRCTriggerExceptionjava.text.MessageFormat,
java.util.Collections#EMPTY_LIST
Licensed Materials - Property of IBM
OpenPages with Watson (PID: 5725-D51)
© Copyright IBM Corporation 2013, 2021. All Rights Reserved.
US Government Users Restricted Rights -
Use, duplication or disclosure restricted by GSA ADP Schedule Contract with IBM Corp.