Class Index | File Index

Classes


Class finesse.clientservices.ClientServices

Allow clients to make Finesse API requests and consume Finesse events by calling a set of exposed functions. The Services layer will do the dirty work of establishing a shared BOSH connection (for designated Master modules), consuming events for client subscriptions, and constructing API requests.
Defined in: finesse.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
Method Summary
Method Attributes Method Name and Description
 
init(config)
Initiates the Client Services with the specified config parameters.
 
Add a callback to be invoked when all of the following conditions are met:
  • When Finesse goes IN_SERVICE
  • The BOSH connection is established
  • The Finesse user presence becomes available
If all these conditions are met at the time this function is called, then the handler will be invoked immediately.
 
Add a callback to be invoked when any of the following occurs:
  • Finesse is no longer IN_SERVICE
  • The BOSH connection is lost
  • The presence of the Finesse user is no longer available
If any of these conditions are met at the time this function is called, the callback will be invoked immediately.
Class Detail
finesse.clientservices.ClientServices()
Method Detail
init(config)
Initiates the Client Services with the specified config parameters. Enabling the Client Services as Master will trigger the establishment of a BOSH event connection.
     finesse.clientservices.ClientServices.init(finesse.gadget.Config);
Parameters:
{finesse.gadget.Config} config
Configuration object containing properties used for making REST requests:
  • host: The Finesse server IP/host as reachable from the browser
  • restHost: The Finesse API IP/host as reachable from the gadget container
  • id: The ID of the user. This is an optional param as long as the appropriate authorization string is provided, otherwise it is required.
  • password: The password belonging to the user. This is an optional param as long as the appropriate authorization string is provided, otherwise it is required.
  • authorization: The base64 encoded "id:password" authentication string. This param is provided to allow the ability to hide the password param. If provided, the id and the password extracted from this string will be used over the config.id and config.password.
Throws:
{Error}
If required constructor parameter is missing.

registerOnConnectHandler(handler)
Add a callback to be invoked when all of the following conditions are met: If all these conditions are met at the time this function is called, then the handler will be invoked immediately.
     finesse.clientservices.ClientServices.registerOnConnectHandler(gadget.myCallback);
Parameters:
{Function} handler
An empty param function to be invoked on connect. Only one handler can be registered at a time. Handlers already registered will be overwritten.

registerOnDisconnectHandler(handler)
Add a callback to be invoked when any of the following occurs: If any of these conditions are met at the time this function is called, the callback will be invoked immediately.
     finesse.clientservices.ClientServices.registerOnDisconnectHandler(gadget.myCallback);
Parameters:
{Function} handler
An empty param function to be invoked on disconnected. Only one handler can be registered at a time. Handlers already registered will be overwritten.

Documentation generated by JsDoc Toolkit 2.3.2 on Mon Nov 06 2017 08:00:55 GMT-0500 (EST)