Specifying Configuration Metadata for Polling Notifications
The next step for implementing a polling notification is to create the metadata constructs that the users of the adapter use for entering data when they create polling notification nodes. To do this, you perform the following:
Create metadata parameters appropriate for the function of the polling notification. Each parameter has:
A variable to hold the configured values.
A String constant containing the name of the parameter.
An accessor method.
Describe presentation for those metadata parameters.
Set the data entry rules for those metadata parameters.
The example implementation includes three metadata parameters that the users of the adapter use to create polling notification nodes. The following table describes the purpose of each of these parameters for data entry:
Parameter | Description |
directory | Directory to monitor. |
checkAdded | Indicates whether notifications must be sent when files are added to the specified directory. |
checkDeleted | Indicates whether notifications must be sent when files are deleted from the specified directory. |
Specifying the Display and Data Entry Attributes of the Data Entry Parameters
After creating the parameters, specify the display and data entry attributes by calling various methods of the
WmTemplateDescriptor interface from the service's
fillWmTemplateDescriptor method.
The example code places each data entry parameter into a single group (in display order) referenced by the
NOTIFICATION_SETUP_GROUP constant. A constant instead of a string is used to name the group, because the same value is used in the resource bundle to specify a localizable group name.