Constructor
new module:ct-alerts /testing /Trigger Service Stub()
- Implements:
- ct-alerts/TriggerService
Methods
add Trigger(properties, {@link) → {module:ct-alerts /Trigger}
A stub method used for adding triggers without having to respond to a request for creation.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
properties |
map |
The properties of the trigger being added. Properties
|
|||||||||
{@link |
module:ct-alerts/TriggerStates} state The current state of the trigger. |
Returns:
The added trigger.
create(properties, error, success)
Fires a CREATE_REQUESTED event (see module:ct-alerts/testing/TriggerServiceStubEvents
) if the service status is
AVAILABLE, or fires the error callback otherwise.
Parameters:
Name | Type | Description | |||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
properties |
Map |
The properties of the trigger to be created. Properties
|
|||||||||
error |
function | A callback that will be invoked if the request fails. |
|||||||||
success |
function | A callback that will be invoked when the request succeeds. |
disable Trigger(trigger, error, success)
Parameters:
Name | Type | Description |
---|---|---|
trigger |
module:ct-alerts |
The trigger to dispose. |
error |
function | A callback that will be invoked if the request fails. |
success |
function | A callback that will be invoked when the request succeeds. |
dispose(trigger, error, success)
Fires a DISPOSE_REQUESTED event (see module:ct-alerts/testing/TriggerServiceStubEvents
) if the service status is
AVAILABLE, or fires the error callback otherwise.
Parameters:
Name | Type | Description |
---|---|---|
trigger |
module:ct-alerts |
The trigger to dispose. |
error |
function | A callback that will be invoked if the request fails. |
success |
function | A callback that will be invoked when the request succeeds. |
enable Trigger(trigger, error, success)
Parameters:
Name | Type | Description |
---|---|---|
trigger |
module:ct-alerts |
The trigger to dispose. |
error |
function | A callback that will be invoked if the request fails. |
success |
function | A callback that will be invoked when the request succeeds. |
remove Trigger(trigger)
A stub method used for removing triggers without having to respond to a request for disposal.
Parameters:
Name | Type | Description |
---|---|---|
trigger |
module:ct-alerts |
The removed trigger. |
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. |
trigger Trigger(trigger)
A stub method used for triggering triggers. This is used to represent a trigger's condition having been met, and will
set the trigger's state to TRIGGERED (see module:ct-alerts/TriggerStates
).
Parameters:
Name | Type | Description |
---|---|---|
trigger |
module:ct-alerts |
The triggered trigger. |