Constructor
new module:caplin/alerts/testing/TriggerServiceStub()
- Implements:
- caplin/alerts/TriggerService
Methods
-
addTrigger(properties, {@link) → {module:caplin/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
Name Type Description subject
String The subject of the instrument to be monitored by the trigger. condition
String The condition that when met will trigger the trigger. {@link
module:caplin/alerts/TriggerStates} state The current state of the trigger. Returns:
The added trigger. -
create(properties, error, success)
-
Fires a CREATE_REQUESTED event (see
module:caplin/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
Name Type Description subject
String The subject of the instrument to be monitored by the trigger. condition
String The condition that when met will trigger the trigger. error
function A callback that will be invoked if the request fails. success
function A callback that will be invoked when the request succeeds. -
disableTrigger(trigger, error, success)
-
Parameters:
Name Type Description trigger
module:caplin/alerts/Trigger 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:caplin/alerts/testing/TriggerServiceStubEvents
) if the service status is AVAILABLE, or fires the error callback otherwise.Parameters:
Name Type Description trigger
module:caplin/alerts/Trigger 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. -
enableTrigger(trigger, error, success)
-
Parameters:
Name Type Description trigger
module:caplin/alerts/Trigger 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. -
removeTrigger(trigger)
-
A stub method used for removing triggers without having to respond to a request for disposal.
Parameters:
Name Type Description trigger
module:caplin/alerts/Trigger The removed trigger. -
setStatus(status)
-
A stub method used to set the status of the service, representing the availability of its data
Parameters:
Name Type Description status
module:caplin/services/ServiceStatus The new status of the service. -
triggerTrigger(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:caplin/alerts/TriggerStates
).Parameters:
Name Type Description trigger
module:caplin/alerts/Trigger The triggered trigger.