AbstractThirdPartyApplicationService

AbstractThirdPartyApplicationService ⇐ Abstract

Kind: global abstract class
Extends: Abstract
Mixes: MServiceCache
Service:
Properties

NameTypeDescription
applicationListArray.<ThirdPartyApplication>

the list of available application

AbstractThirdPartyApplicationService()

A service to control third party apps (start, stop, …)

init() ⇒ Promise.<Array, Error>

Init the service (listen events…)

Kind: instance method of AbstractThirdPartyApplicationService
Returns: Promise.<Array, Error> - A promise resolved to a list of Applications

getApplicationList(options) ⇒ Promise.<Array, Error>

Get the Application list

Kind: instance method of AbstractThirdPartyApplicationService
Returns: Promise.<Array, Error> - A promise resolved to a list of Applications

ParamTypeDefaultDescription
optionsMap

Additional options

[options.force]booleanfalse

If true, don't use the cache

[options.duration]number

Duration in milliseconds before invalidation of cache (if null, $$maxAge value is used by default)

getApplicationById(id) ⇒ Application

Returns the application corresponding to the given ID.

Kind: instance method of AbstractThirdPartyApplicationService
Returns: Application - Returns the application corresponding to the given ID

ParamTypeDescription
idstring

The application ID you want to get

start(application, options) ⇒ Promise

Start the application

Kind: instance method of AbstractThirdPartyApplicationService
Returns: Promise - A promise resolved if application has been started

ParamTypeDescription
applicationAbstractThirdPartyApplication

the application to start

optionsMap

Additional options

[options.args]Array

Extra parameters to pass to third app at launch (will we added to params from ThirdPartyApplication model)

stop(application, options) ⇒ Promise.<Boolean, Error>

Stop the application

Kind: instance method of AbstractThirdPartyApplicationService
Returns: Promise.<Boolean, Error> - A promise resolved to true if application has been stopped

ParamTypeDescription
applicationAbstractThirdPartyApplication

the application to stop

optionsMap

Additional options

getInformation(application, options) ⇒ Promise.<Object, Error>

Return the application information

Kind: instance method of AbstractThirdPartyApplicationService
Returns: Promise.<Object, Error> - A promise resolved with application information

ParamTypeDescription
applicationAbstractThirdPartyApplication

the application to get information

optionsMap

Additional options

reset(application, options) ⇒ Promise.<Boolean, Error>

Reset the application

Kind: instance method of AbstractThirdPartyApplicationService
Returns: Promise.<Boolean, Error> - A promise resolved to true if application has been resetted

ParamTypeDescription
applicationAbstractThirdPartyApplication

the application to reset

optionsMap

Additional options

getApplicationByChannelId(channelId, options) ⇒ Promise.<Application, Error>

Get application for channelId

Kind: instance method of AbstractThirdPartyApplicationService
Returns: Promise.<Application, Error> - A promise resolved with application if channel has an application

ParamTypeDescription
channelIdString

The channel id

optionsMap

Additional options

_init() ⇒ Promise.<Array, Error>

Init the service (listen events…)

Kind: instance method of AbstractThirdPartyApplicationService
Returns: Promise.<Array, Error> - A promise resolved to a list of Applications

_getApplicationList(options) ⇒ Promise.<Array, Error>

Vendor implementation to get the application list

Kind: instance abstract method of AbstractThirdPartyApplicationService
Returns: Promise.<Array, Error> - A promise resolved to a list of Applications

ParamTypeDescription
optionsMap

Additional options

_start(application, options) ⇒ Promise.<Boolean, Error>

Vendor implementation to start an application

Kind: instance abstract method of AbstractThirdPartyApplicationService
Returns: Promise.<Boolean, Error> - A promise resolved to true if application has been started

ParamTypeDescription
applicationAbstractThirdPartyApplication

the application to start

optionsMap

Additional options

_stop(application, options) ⇒ Promise.<Boolean, Error>

Vendor implementation to stop an application

Kind: instance abstract method of AbstractThirdPartyApplicationService
Returns: Promise.<Boolean, Error> - A promise resolved to true if application has been stopped

ParamTypeDescription
applicationAbstractThirdPartyApplication

the application to start

optionsMap

Additional options

_getInformation(application, options) ⇒ Promise.<Object, Error>

Vendor implementation to get application information

Kind: instance abstract method of AbstractThirdPartyApplicationService
Returns: Promise.<Object, Error> - A promise resolved with application information

ParamTypeDescription
applicationAbstractThirdPartyApplication

the application

optionsMap

Additional options

_reset(application, options) ⇒ Promise.<Boolean, Error>

Vendor implementation to reset an application

Kind: instance abstract method of AbstractThirdPartyApplicationService
Returns: Promise.<Boolean, Error> - A promise resolved to true if application has been resetted

ParamTypeDescription
applicationAbstractThirdPartyApplication

the application to reset

optionsMap

Additional options

_getApplicationByChannelId(channelId, options) ⇒ Promise.<Application, Error>

Vendor implementation to get application by channel id

Kind: instance abstract method of AbstractThirdPartyApplicationService
Returns: Promise.<Application, Error> - A promise resolved with application if channel has an application

ParamTypeDescription
channelIdString

the channel id

optionsMap

Additional options

_onStart(application) ⇒ Promise

Kind: instance method of AbstractThirdPartyApplicationService
Emits: applicationStart
Access: protected

ParamTypeDescription
applicationAbstractThirdPartyApplication

the started application

_onStop(application, options) ⇒ Promise

Kind: instance method of AbstractThirdPartyApplicationService
Emits: applicationStop
Access: protected

ParamTypeDescription
applicationAbstractThirdPartyApplication

the stopped application

optionsObject

the options

_onReset(application) ⇒ Promise

Kind: instance method of AbstractThirdPartyApplicationService
Emits: applicationReset
Access: protected

ParamTypeDescription
applicationAbstractThirdPartyApplication

the resetted application

_onError(application, error) ⇒ Promise

Kind: instance method of AbstractThirdPartyApplicationService
Emits: applicationError
Access: protected

ParamTypeDescription
applicationAbstractThirdPartyApplication

The application which throws an error

errorObject

the error

“applicationStart” (application)

Fired when the application has been started

Kind: event emitted by AbstractThirdPartyApplicationService

ParamTypeDescription
applicationAbstractThirdPartyApplication

The started application

“applicationError” (application, error)

Fired when the application throw an error

Kind: event emitted by AbstractThirdPartyApplicationService

ParamTypeDescription
applicationAbstractThirdPartyApplication

The application who throw an error

errorObject

the error

“applicationReset” (application)

Fired when the application has been resetted

Kind: event emitted by AbstractThirdPartyApplicationService

ParamTypeDescription
applicationAbstractThirdPartyApplication

The resetted application

“applicationStop” (application)

Fired when the application has been stopped

Kind: event emitted by AbstractThirdPartyApplicationService

ParamTypeDescription
applicationAbstractThirdPartyApplication

The stopped application

“applicationLaunch”

Event that allows the UI to launch a third app

Kind: event emitted by AbstractThirdPartyApplicationService