Page History
...
Implement a notifier class
Each notification plugin requires a Notifier class that must implement the interface com.idera.change.notifications.api.INotifier
. To do this, you subclass com.idera.change.notifications.api.AbstractNotifier
and customize it.
Info |
---|
If |
To implement a notifier class
- Right-click on your project, and then select New > Class.
The New Java Class dialog appears. - Enter the appropriate information in the fields provided to define the new Java class:
- In the Name field, type “DirectoryNotifier”.
- In the Package field, type “org.acme.directorynotifier”.
- In the Superclass field, type “com.idera.change.notifications.api.AbstractNotifier”.
- Click Finish to create the new class.
Once you have defined the DirectoryNotifier
class, two methods require implementation:
isReportSupported
returns a Boolean value indicating if the notification can include a report. The directory notifier returns true, because reports can be replaced in a directory, but a notification may not support reports. This method is called when creating job editors to determine if the reporting section is shown for this type of notification.sendNotification
is called after a job runs and is responsible for the notification. The three parameters are as follows:Parameter Type Description notifierData
iNotifierData This instance contains the configuration for the notification of the job just run. jobMetaData
Map<String, String> This map contains information about the job execution. The keys in the map correspond to entries in the NotificationPropertyEnum.
For example, to get the data and time of the execution, you would code:
“jobMetaData.get(NotificationPropertyEnum.DATE_TIME.getTag())
”notificationInfo
iReportGenerator