Constructor
new module:ct-alerts /testing /Notification Service Stub()
- Implements:
- ct-alerts/NotificationService
Methods
create Notification(source, time Created, additional Fields) → {module:ct-alerts /Notification}
A stub method used for creating notifications.
Parameters:
Name | Type | Description |
---|---|---|
source |
String | The source of the notification. This can be anything, but would generally be the name of the server side component that created the notification. |
timeCreated |
Number | Seconds since epoch that the notification was generated. |
additionalFields |
Map | A map of additional fields (names to values) for the notification. |
Returns:
The created notification.
dismiss(notification, erroropt, successopt)
Fires a DISMISS_REQUESTED event (see
module:ct-alerts/testing/NotificationServiceStubEvents
) if the
service status is AVAILABLE, or fires the error callback otherwise.
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
notification |
module:ct-alerts |
The notification to dismiss. |
|
error |
function |
<optional> |
A callback that will be invoked when the request fails. |
success |
function |
<optional> |
A callback that will be invoked when the request succeeds. |
dispose()
Disposes of any listeners and resources that were used by the service.
remove Notification(removed Notification)
A stub method used for removing notifications without having to respond to a request for a dismiss.
Parameters:
Name | Type | Description |
---|---|---|
removedNotification |
module:ct-alerts |
The notification that has been removed. |
set Status(status)
A stub method used to set the status of the service, representing the availability of its data.
Parameters:
Name | Type | Description |
---|---|---|
status |
module:ct-services |
The new status of the service |