Class Index | File Index

Classes


Class MessagingREST.Client


Defined in: restmsg.js.

Class Summary
Constructor Attributes Constructor Name and Description
 
MessagingREST.Client(host, port, path, clientid, username, password)
The JavaScript application communicates with IBM MessageSight via http plug-in using a MessagingREST.Client object.
Method Summary
Method Attributes Method Name and Description
 
createTopicSubscription(topicName, persist, retain, onSuccess, onFailure)
Publish a message to a specific topic.
 
deleteRetained(topicName, onSuccess, onFailure)
Invoke action to delete retained message from a given topic.
 
getRetainedMsg(topicName, onSuccess, onFailure)
Invoke action to obtain retained messages from topic.
Class Detail
MessagingREST.Client(host, port, path, clientid, username, password)
The JavaScript application communicates with IBM MessageSight via http plug-in using a MessagingREST.Client object. The methods are implemented as asynchronous JavaScript methods (even though the underlying protocol exchange might be synchronous in nature). This means they signal their completion by calling back to the application via Success or Failure callback functions provided by the application on the method in question. These callbacks are called at most once per method invocation and do not persist beyond the lifetime of the script that made the invocation.
Parameters:
{string} host
- the address of the IBM MessageSight host, as a DNS name or dotted decimal IP address.
{number} port
- the port number to connect to
{string} path
- the alias on the IBM MessageSight host.
{string} clientid
- the MessagingREST client identifier
{string} username
- the username to authenticate with
{string} password
- the password for the username provided
Method Detail
createTopicSubscription(topicName, persist, retain, onSuccess, onFailure)
Publish a message to a specific topic.
Parameters:
{string} topicName
- the topic filter that the subscription should be set to
{boolean} persist
- if the message should persist
{boolean} retain
- if the message should be retained
{function} onSuccess
- Called after a response with a status code of 200 is received from the server. A single response parameter is passed to the onSuccess callback:
  1. a string that contains any response from the request
{function} onFailure
- Called when a status code other than 200 is received from the server. Two response parameters are passed to the onFailure callback:
  1. a number that indicates the response code from the server
  2. a string that contains any response text from the server

deleteRetained(topicName, onSuccess, onFailure)
Invoke action to delete retained message from a given topic.
Parameters:
{string} topicName
- The topic that the retained message should be removed from.
{function} onSuccess
- Called after a response with a status code of 200 is received from the server. A single response parameter is passed to the onSuccess callback:
  1. a string that contains any response from the request
{function} onFailure
- Called when a status code other than 200 is received from the server. Two response parameters are passed to the onFailure callback:
  1. a number that indicates the response code from the server
  2. a string that contains any response text from the server

getRetainedMsg(topicName, onSuccess, onFailure)
Invoke action to obtain retained messages from topic. This API will invoke an asynchronous call on the IBM MessageSight server that will attempt to obtain a retained message. After successful callback from this API a check for the retained message can be done with a call to MessagingREST.Client#retrieveMessages
Parameters:
{string} topicName
- The topic name to obtain a retained message from.
{function} onSuccess
- Called after a response with a status code of 200 is received from the server. A single response parameter is passed to the onSuccess callback:
  1. a string that contains the topic
  2. a string that contains any response from the request
{function} onFailure
- Called when a status code other than 200 is received from the server. Two response parameters are passed to the onFailure callback:
  1. a number that indicates the response code from the server
  2. a string that contains any response text from the server

Documentation generated by JsDoc Toolkit 2.4.0 on Wed May 25 2016 22:00:53 GMT+0100 (BST)