As an object or collection is made governed and moved through its lifecycle, WSRR can send notifications to selected users informing them of the lifecycle changes that have occurred.
To enable notifications it is necessary to create and store a Subscription object in WSRR. The SDO DataFactory can be used to create the Subscription object and the ServiceRegistrySession EJB method create() can be used to store the subscription in WSRR.
The Subscription object provides the following properties that can be used to control the notifications generated as an object is progressed through its governance lifecycle.
| Property | Description |
|---|---|
| name | The unique name that you want to assign to the subscription. |
| namespace | The namespace of the subscription. |
| version | The version of the subscription. |
| description | A description of the subscription. |
| emailAddress | The email address to which any generated notifications
will be sent. Note: For the email notification (but not necessarily
other forms of notifiers) the emailAddress field must have a value
specified in the form "mailto:user@domain", "user@domain" will not
work.
|
| locale | A locale identifying the language in which the notification email must be generated. |
| _targetQuery | An XPath query that defines the set of objects for which you require event notifications. |
| _notifierType | The mechanism to be used for sending event notification
messages. This property can have any of the following values:
|
| _endPointReference | The URL to which you want notifications to be sent. Supply this property only if you are defining an HTTP POST subscription, in which case the value of the _notifierType property must be "httppost". |
| _endPointSecurityToken | A security token that is passed in events posted by the HTTP Post notifier (it is not used by the email notifier). You can define a string value to associate with the subscription object that you are creating. It is used by consumers of a posted event to confirm that the posted message is authentic and sent by WSRR. A consumer can use the bsrURI of the subscription object, which is posted with the event, to look up the expected security token for that subscription and confirm that it matches the posted token. |
| _endPointSecurityAuthAlias | An existing WebSphere Application Server authentication alias configured on the WSRR server. You can define an authentication alias in the administrative console (select ). You then specify the alias as a value for the _endPointSecurityAuthAlias property. The presence of an alias causes the HTTP Post notifier to post messages with an HTTP Basic Authorization header. The HTTP notifier accesses the user ID and the password that the alias represents, and then base64 encodes a string representing the authentication details in the form userID:password. The encoded authentication string is included in the Basic Authorization header. This property is not used by the email notifier. |
| _duration | The expiry interval, in days, for the subscription, after which it is deleted automatically. |
| _correlationID | A unique string of your choice, which is sent in the event notification message, and which you can therefore use to correlate the messages that are generated from this subscription. |
| _notifyPolicyUpdates | Set the value of this property to "true" if you want an event notification message to be generated when a user operation takes place on a policy that is attached to a subscribed object. |
| _notifyMonitoringPolicyUpdates | Set the value of this property to "true" if you want an event notification message to be generated when a user operation takes place on a policy, and that policy is attached to a Service Level Agreement applied to a WSDL document that is a subscribed object. |
| _enableBatchNotification | Set this value of this property to "true" if you want a notifier for this subscription to send notifications to the target endpoint in "batch" mode. This means that multiple notifications are sent in a single message to optimize notification message flow. |
| _referencedObjectMatchDepth | The object graph depth for which you want notifications to be sent. If you supply a non-zero value for this property then notifications are sent not only for the target objects that you specify in the subscription definition, but also for any other objects referenced from the target objects, to the specified graph depth. |
| _notifySavedSearchResultChanges | If you set the value of this property to "true", and the target objects that you define in your subscription include either a saved search or named query or both, then notifications are sent for any objects that are returned by running such pre-defined queries, provided that those objects satisfy all of the match criteria defined in the subscription. |
| subscribedTransitions | A list containing the classification URIs for the lifecycle transitions for which notifications are required. The ServiceRegistryGovernance EJB method getAllTransitions() can be used to help populate this list. If no transitions are specified, and the 'transition' operation is subscribed to, through the subscribedOperations property (see following), then the subscription will be assumed to apply to all transitions. |
| subscribedOperations | A list containing the object operation names for which notifications are required. The possible operation names are: 'create', 'delete', 'update', and 'transition'. If no operations are specified then the subscription will be assumed to apply to all operations. |
| targetClassifications | A list containing possible object classification URIs. Notifications will be generated only if the object is classified with either a classification URI specified explicitly in the list or a classification URI derived from a parent classification specified in the list. |
| targetBsrUri | The bsrURI of the root object of the governed collection for which notifications are required. If this field is specified then the targetName, targetNamespace and targetVersion fields will not be checked when attempting to match the subscription against a notified event. |
| targetName | The object name for which notifications are required. Notifications will be generated only for objects with this name. |
| targetNamespace | The object namespace for which notifications are required. Notifications will be generated only for objects with this namespace value. |
| targetVersion | The object version for which notifications are required. Notifications will be generated only for objects with this version value. |
Subscription aSubscription = (Subscription) DataFactory.INSTANCE.create
(TypeConstants.SR_GOVERNANCE_NS, TypeConstants.TYPE_SUBSCRIPTION);