You are viewing an old version of this page. View the current version.

Compare with Current View Page History

« Previous Version 3 Next »

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 OptionOption Parameters
Notify When Run From
  • Workbench
  • Command Line
  • Both
Attached Report
  • None
  • CSV
  • XML
  • HTML
  • PDF
  • RTF
Send Notification
  • Always
  • Only on Success
  • Only on Failure

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:

Create a plugin project

In order to start building a plugin, you need to create a new plugin platform in Eclipse.

To create a plugin project

  1. Select File > New > Other.
    The Select a Wizard dialog appears.
  2. Select Plugin Project, and then click Next.
  3. Type a name for the plugin in the appropriate field, and leave the remainder of the parameters as they appear.
  4. Click Next.
  5. Retain the default parameters on the next dialog, and then click Finish.
    The new plugin project is created in Eclipse and is ready for plugin development.

Configure the target platform

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

  1. Select Window > Preferences.
    The Preferences dialog appears.
  2. Choose the Plugin Development > Target Platform node, and then click Browse.
  3. Navigate to the install directory for DB Change Manager.
  4. Click Apply, and then click OK.
    The Preferences dialog closes and the target platform of the plugin is now indicated.

Define dependencies

The new plugin requires a pair of dependency definitions on the DB Change Manager Notification plugin:

  • com.idera.change.notifications
  • org.eclipse.ui.forms
  1. Navigate to the META-INF folder in your project and double-click MANIFEST.MF.
    The MANIFEST.MF file opens in Eclipse.
  2. Select the Dependencies tab, and then click Add.
  3. Choose com.idera.change.notifications, and then click OK.
    The dependency is added.
  4. Choose org.eclipse.ui.forms, and then click OK.
    The dependency is added.
  5. Press Ctrl+S to save the changes; or choose File>Save from the menu to retain the new dependencies, and then close the editor.

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.

If AbstractNotifier or INotifier cannot be found in Eclipse, the target platform or plugin dependencies are not configured properly. Ensure that you have configured these prerequisites and then search again for the notifier classes.

To implement a notifier class

  1. Right-click on your project, and then select New > Class.
    The New Java Class dialog appears.
  2. Enter the appropriate information in the fields provided to define the new Java class:
    1. In the Name field, type “DirectoryNotifier”.
    2. In the Package field, type “org.acme.directorynotifier”.
    3. In the Superclass field, type “com.idera.change.notifications.api.AbstractNotifier”.
  3. 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:

    ParameterTypeDescription
    notifierDataiNotifierDataThis instance contains the configuration for the notification of the job just run.
    jobMetaDataMap<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())

    notificationInfoiReportGenerator


IDERA |  Products | Purchase | Support |  Community |  Resources |  About Us  | Legal
  • No labels