Notifications can be set to alert you if a job is successful, unsuccessful, or either result. Additionally, a notification can also indicate if a job was launched from the Workbench or from a command line, and can produce a report in a number of different file formats.
You can select the following options and option parameters using the job notification plugin:
Notification Option | Option Parameters |
---|---|
Notify When Run From |
|
Attached Report |
|
Send Notification |
|
Notification parameters are set independently on each job configured in DB Change Manager. Additionally, each set of notification options apply individually per job selected.
The notification plugin must be defined in Eclipse and then activated in DB Change Manager. The following tasks provide a high-level overview of defining and implementing the notification plugin:
In order to start building a plugin, you need to create a new plugin platform in Eclipse.
To create a plugin project
The target platform for the plugin development process needs to be identified in DB Change Manager. This indicates to the new plugin for what product it extends, and grants the plugin access to the system.
To configure the target platform
The new plugin requires a pair of dependency definitions on the DB Change Manager Notification plugin:
com.idera.change.notifications
org.eclipse.ui.forms
META-INF
folder in your project and double-click MANIFEST.MF
.MANIFEST.MF
file opens in Eclipse.com.idera.change.notifications
, and then click OK.org.eclipse.ui.forms
, and then click OK.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.
If |
To implement a notifier 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())” NOTE: The keys are the tag of the enum entries, so ensure that getTag() is called when accessing jobMetaData. |
notificationInfo | iReportGenerator | Used to generate the report and access any DDL or sync script output. |
Each notifier can be configured for a job in DB Change Manager.
The notifier enables a user to select a target directory in which to put results. The email notifier that is supplied with the application enables users to select the email template that will be used to generate the message as well as the addresses of those who will receive it.
In order to add a directory field to the job editor, you write a class that implements the interface named com.idera.change.notifications.api.INotifierViewerContribution.
The notifier only allows users to select a directory in which reports and outcomes are written whenever jobs are executed.
The DirectoryNotifierConstants class is a small constants class that stores the property name for storage and retrieval purposes.
| | | | | | | |