AbstractReminderService

AbstractReminderService ⇐ Abstract

Kind: global abstract class
Extends: Abstract
Service:
Properties

NameTypeDescription
paddingnumber

Reminder padding duration (integer).

AbstractReminderService()

A service to manage reminders, which are alarms that trigger actions

newReminder(properties) ⇒ Reminder

Create a new reminder model. Always prefer using these method instead of using new $Reminder(), as these method will always create the model with the right implementation.

Kind: instance method of AbstractReminderService
Returns: Reminder - The reminder model

ParamTypeDescription
propertiesObject

The reminder properties

add(reminder, options) ⇒ Promise.<Reminder, Error>

Add a new reminder to the reminders list (and from the resource where it is stored)

Kind: instance method of AbstractReminderService
Returns: Promise.<Reminder, Error> - A promise (reminder, error)

ParamTypeDescription
reminderReminder

The reminder to add

optionsObject

options object

options.doNotRemovePastRemindersBoolean

=> if true, do not remove the past reminders

remove(reminder, options) ⇒ Promise.<Reminder, Error>

Delete a reminder from the reminders list (and from the resource where it is stored) If the reminder id is null or reminder not exist, return a rejected promise (an error).

Kind: instance method of AbstractReminderService
Returns: Promise.<Reminder, Error> - A promise (reminder, error)

ParamTypeDescription
reminderReminder

The reminder to delete

optionsObject

options object

options.doNotRemovePastRemindersBoolean

=> if true, do not remove the past reminders

update(reminder, options) ⇒ Promise.<Reminder, Error>

Update a reminder (and from the resource where it is stored) If the reminder id is null or reminder not exist, return a rejected promise (an error).

Kind: instance method of AbstractReminderService
Returns: Promise.<Reminder, Error> - A promise (reminder, error)

ParamTypeDescription
reminderReminder

The reminder to update

optionsObject

options object

options.doNotRemovePastRemindersBoolean

=> if true, do not remove the past reminders

find([reminderFilterFunction]) ⇒ Promise.<Array.<Reminder>, Error>

Find reminder(s) using a function as filter. Return all the reminders if reminderFilterFunction is null.

Kind: instance method of AbstractReminderService
Returns: Promise.<Array.<Reminder>, Error> - A promise (reminder, error)

ParamTypeDescription
[reminderFilterFunction]function

A function that takes a reminder in arg and return true or false (true mean keep reminder)

getReminder(reminderId, [options]) ⇒ Promise.<Recording, Error>

Get the reminder referenced by it’s id

Kind: instance method of AbstractReminderService
Returns: Promise.<Recording, Error> - A promise (recording, error)

ParamTypeDefaultDescription
reminderIdString

the id of the reminder to get

[options]Object

Additional options

[options.force]booleanfalse

If true, renew the cache

getReminders([options]) ⇒ Promise

Return all the reminders.

Kind: instance method of AbstractReminderService

ParamTypeDefaultDescription
[options]Object

Additional options

[options.force]booleanfalse

If true, renew the cache

_onReminderBeforeStart(reminder) ⇒ Promise

Fired when the before reminder start (padding)

Kind: instance method of AbstractReminderService
Access: protected

ParamType
reminderReminder

_onReminderStart(reminder) ⇒ Promise

Fired when the reminder start

Kind: instance method of AbstractReminderService
Access: protected

ParamType
reminderReminder

_onReminderAdd(reminder) ⇒ Promise

Fired when a reminder is added

Kind: instance method of AbstractReminderService
Access: protected

ParamType
reminderReminder

_onReminderRemove(reminder) ⇒ Promise

Fired when a reminder is removed

Kind: instance method of AbstractReminderService
Access: protected

ParamType
reminderReminder

STATE_WAIT : number

Kind: static constant of AbstractReminderService

STATE_BEFORE_START : number

Kind: static constant of AbstractReminderService

STATE_START : number

Kind: static constant of AbstractReminderService

DEFAULT_PADDING : number

Kind: static constant of AbstractReminderService