DEPRECATED: DiffusionTM JavaScript Classic API
5.9.4

Classes

Class WebClientMessage


WebClientMessage This is the class that all normal messages from the server will be instantiated with.


Constructor Summary

null WebClientMessage

Method Summary

String displayFormat()
Get a string representation of the message, with human-readable delimiters
String getAckID()
If this message requires an acknowledgement, get the Ack ID
String getBaseTopic()
Get the final part of the topic name
String getBody()
Get the body of this message as String
Array getFields(index)
Get the fields contained within the specified record
String getHeader()
Get the header for this message
Object getJSONObject()
Get the JSON representation of this message, if sent as such
Number getMessageCount()
Get the sequence number of this message.
Number getNumberOfRecords()
Get the number of records in this message
DiffusionRecord getRecord(index)
Get the record at the specified index
Array getRecords()
Get the records contained within this message
Date getTimestampAsDate()
Get a date representing when this message was created
String getTopic()
Get the topic on which this message was sent
String getUserHeader(index)
Get the header at a particular index
Array getUserHeaders()
Get user headers
Boolean hasRemaining()
Checks to see if there is unread data in the message
Boolean isAckMessage()
Check if the message requires an Acknowledgement
Boolean isDeltaMessage()
Check if this message is a delta message
Boolean isFetchMessage()
Check if this message is a fetch message
Boolean isInitialTopicLoad()
Check if this message is an ITL message
String localeTimeString()
Get a localised String representation of when this message was created
Boolean needsAcknowledgement()
Check whether this message has been acknowledged
String nextField()
Returns the next available field if it exists
DiffusionRecord nextRecord()
Returns the next available record if it exists
null parseResponse(response)
Sets records and headers from response string
null rewind()
Reset all record and field pointers
null setAcknowledged()
This method is used internally when the message has been acknowledged
null setTopic(topic)
Set the topic for this message

Constructor Details

WebClientMessage

WebClientMessage

Parameters
response -
messageCount -

Method Details

displayFormat

String displayFormat()

Get a string representation of the message, with human-readable delimiters


getAckID

String getAckID()

If this message requires an acknowledgement, get the Ack ID


getBaseTopic

String getBaseTopic()

Get the final part of the topic name

Examples
if the topic name is a/b/c this function would return c

getBody

String getBody()

Get the body of this message as String


getFields

Array getFields(index)

Get the fields contained within the specified record

Parameters
index -

getHeader

String getHeader()

Get the header for this message


getJSONObject

Object getJSONObject()

Get the JSON representation of this message, if sent as such


getMessageCount

Number getMessageCount()

Get the sequence number of this message.

This is also the same as the number of messages that have been produced by this connection.


getNumberOfRecords

Number getNumberOfRecords()

Get the number of records in this message


getRecord

DiffusionRecord getRecord(index)

Get the record at the specified index

Parameters
index -

getRecords

Array getRecords()

Get the records contained within this message


getTimestampAsDate

Date getTimestampAsDate()

Get a date representing when this message was created


getTopic

String getTopic()

Get the topic on which this message was sent


getUserHeader

String getUserHeader(index)

Get the header at a particular index

Parameters
index -

getUserHeaders

Array getUserHeaders()

Get user headers


hasRemaining

Boolean hasRemaining()

Checks to see if there is unread data in the message


isAckMessage

Boolean isAckMessage()

Check if the message requires an Acknowledgement


isDeltaMessage

Boolean isDeltaMessage()

Check if this message is a delta message


isFetchMessage

Boolean isFetchMessage()

Check if this message is a fetch message


isInitialTopicLoad

Boolean isInitialTopicLoad()

Check if this message is an ITL message


localeTimeString

String localeTimeString()

Get a localised String representation of when this message was created


needsAcknowledgement

Boolean needsAcknowledgement()

Check whether this message has been acknowledged


nextField

String nextField()

Returns the next available field if it exists


nextRecord

DiffusionRecord nextRecord()

Returns the next available record if it exists


parseResponse

parseResponse(response)

Sets records and headers from response string

Parameters
response -

rewind

rewind()

Reset all record and field pointers


setAcknowledged

setAcknowledged()

This method is used internally when the message has been acknowledged


setTopic

setTopic(topic)

Set the topic for this message

Parameters
topic -