INDEX

setEventListeners

With setEventListener method client connections can listen events from the core. Clients implement the event listeners as exposed RPC methods with specific names, e.g. "ApplicationInstalled" to listen application installation events.

Request

Parameter Type Description
events array An array of event listener RPC method name strings.
sessionId string Log in session id returned by the adminLogIn method..

The events array contains all the events client wants to listen. Non-admin clients can not set event listeners for some of the events and the sessionId parameter is required for those events. The core sends the RPC event requests to clients as notifications. The parameters for the requests vary depending of the event.

Spaceify core currently emits these events.


  • "SpaceletInstalled"
  • "SpaceletRemoved"
  • "SpaceletStopped"
  • "ApplicationInstalled"
  • "ApplicationRemoved"
  • "ApplicationStopped"
  • "NativeApplicationInstalled"
  • "NativeApplicationRemoved"
  • "NativeApplicationStopped"

These events are emitted when spacelet, application or native application is installed, removed or stopped. The core sends to listeners a JSON result object containing the manifest object of the spacelet, application or native application.

{
manifest: object
}

  • "SpaceletStarted"
  • "ApplicationStarted"
  • "NativeApplicationStarted"

These events are emitted when spacelet, application or native application is started. The core sends to listeners a JSON result object containing a manifest object and an array of service objects. For spacelets the services are of type open and for applications and native applications the services are of type open, open_locale or both.

{
manifest: object,
openRuntimeServices: array
}

  • "EdgeSettingsChanged"

This event is emitted when the edge settings change. This event listener can be set only if administrator is logged in. The sessionId must be passed when the setEventListener is called. The RPC event request contains the EdgeSettings object.


  • "CoreSettingsChanged"

This event is emitted when the core settings change. This event listener can be set only if administrator is logged in. The sessionId must be passed when the setEventListener is called. The RPC event request contains the CoreSettings object.

Result response

Type Desription
boolean Returns always true.

Error response

Close
copyright © Spaceify.org 2014