Packagecom.pushtechnology.diffusion
Classpublic class TopicMessage
InheritanceTopicMessage Inheritance Object

Topic Message.

This is used to send information to Diffusion, by default the encoding is NONE, a user must set other encoding if encoding is required.



Protected Properties
 PropertyDefined By
  theMessage : ByteArray
TopicMessage
Public Methods
 MethodDefined By
  
TopicMessage(topic:String, message:String = null)
TopicMessage
  
addHeader(header:String):void
TopicMessage
  
displayFormat():String
TopicMessage
  
getAckID():String
TopicMessage
  
getAckRequired():Boolean
TopicMessage
  
TopicMessage
  
getBaseTopic():String
TopicMessage
  
TopicMessage
  
getFields(index:int):Array
TopicMessage
  
getHeader(index:int):String
TopicMessage
  
getHeaders():Array
TopicMessage
  
getMessage():ByteArray
TopicMessage
  
TopicMessage
  
TopicMessage
  
TopicMessage
  
getRecord(index:int):Record
TopicMessage
  
getRecords():Array
TopicMessage
  
TopicMessage
  
getTopic():String
TopicMessage
  
TopicMessage
  
internalSetAck(ackID:String):void
TopicMessage
  
isAckMessage():Boolean
TopicMessage
  
isDeltaMessage():Boolean
TopicMessage
  
isFetchMessage():Boolean
TopicMessage
  
TopicMessage
  
isPagedLoad():Boolean
TopicMessage
  
isServiceLoad():Boolean
TopicMessage
  
TopicMessage
  
TopicMessage
  
putRecord(... strings):void
put one Record of Strings (Throws DiffusionProtocolError Exception)
TopicMessage
  
putRecords(... diffusionRecord):void
put one or more Record (Throws DiffusionProtocolError Exception)
TopicMessage
  
TopicMessage
  
setAckRequired(timeout:int = 2000):String
TopicMessage
  
setAckTimeout(timeout:int):void
TopicMessage
  
setEncoding(encoding:int):void
TopicMessage
  
setHeaders(headers:Array):void
TopicMessage
  
setMessage(message:String):void
TopicMessage
  
setMessageAsBytes(message:ByteArray):void
TopicMessage
  
setMessageType(messageType:int):void
TopicMessage
  
setTopic(topic:String):void
Set the topic for the message
TopicMessage
  
toString():String
TopicMessage
Public Constants
 ConstantDefined By
  ACK_DELTA : int = 31
[static]
TopicMessage
  ACK_ITL : int = 30
[static]
TopicMessage
  ACK_RESPONSE : int = 32
[static]
TopicMessage
  BASE64_ENCODING : int = 19
[static]
TopicMessage
  CLIENT_ABORT : int = 28
[static]
TopicMessage
  CLIENT_CLOSE : int = 29
[static]
TopicMessage
  CLIENT_PING : int = 25
[static]
TopicMessage
  COMMAND_LOAD : int = 40
[static]
TopicMessage
  COMMAND_NOTIFICATION : int = 41
[static]
TopicMessage
  COMMAND_VALUE : int = 36
[static]
TopicMessage
  COMPRESSED_ENCODING : int = 18
[static]
TopicMessage
  DELTA : int = 21
[static]
TopicMessage
  ENCRYPTED_ENCODING : int = 17
[static]
TopicMessage
  FETCH : int = 33
[static]
TopicMessage
  FETCH_REPLY : int = 34
[static]
TopicMessage
  FIELD_DELIMETER : String
[static]
TopicMessage
  INITIAL_TOPIC_LOAD : int = 20
[static]
TopicMessage
  MESSAGE_DELIMETER : String
[static]
TopicMessage
  NONE_ENCODING : int = 0
[static]
TopicMessage
  PROTOCOL : int = 35
[static]
TopicMessage
  RECORD_DELIMETER : String
[static]
TopicMessage
  SEND_CREDENTIALS : int = 26
[static]
TopicMessage
  SERVER_PING : int = 24
[static]
TopicMessage
  SERVER_REJECTED_CREDENTIALS : int = 27
[static]
TopicMessage
  TOPIC_STATUS : int = 35
[static]
TopicMessage
Property Detail
theMessageproperty
protected var theMessage:ByteArray

Constructor Detail
TopicMessage()Constructor
public function TopicMessage(topic:String, message:String = null)

Parameters
topic:String — the topic if the message
 
message:String (default = null) — the message
Method Detail
addHeader()method
public function addHeader(header:String):void

Parameters

header:String — add a header to the user headers

displayFormat()method 
public function displayFormat():String

Returns
String
getAckID()method 
public function getAckID():String

Returns
String — the Ack ID or null if not set
getAckRequired()method 
public function getAckRequired():Boolean

Returns
Boolean — true is this messages requires an ack.
getAckTimeout()method 
public function getAckTimeout():int

Returns
int — timeout, how long the message ack timeout is in milliseconds
getBaseTopic()method 
public function getBaseTopic():String

Returns
String
getEncoding()method 
public function getEncoding():int

Returns
int — encoding, the current requested encoding string for this message
getFields()method 
public function getFields(index:int):Array

Parameters

index:int

Returns
Array
getHeader()method 
public function getHeader(index:int):String

Parameters

index:int

Returns
String — the user header at a given index
getHeaders()method 
public function getHeaders():Array

Returns
Array — headers, the headers, if no headers have been set, then this could return null
getMessage()method 
public function getMessage():ByteArray

Returns
ByteArray — message, return the payload of the message in a ByteBuffer
getMessageAsString()method 
public function getMessageAsString():String

Returns
String — the message as a UTF-8 byte string
getMessageType()method 
public function getMessageType():int

Returns
int
getNumberOfRecords()method 
public function getNumberOfRecords():int

Returns
int — the number of Diffusion records held in this message
getRecord()method 
public function getRecord(index:int):Record

Parameters

index:int

Returns
Record
getRecords()method 
public function getRecords():Array

Returns
Array — an Array of Records
getTimestamp()method 
public function getTimestamp():Date

Returns
Date
getTopic()method 
public function getTopic():String

Returns
String — the topic
getXMLMessage()method 
public function getXMLMessage():XML

Returns
XML — a new XML(...) of the message
internalSetAck()method 
public function internalSetAck(ackID:String):void

Parameters

ackID:String

isAckMessage()method 
public function isAckMessage():Boolean

Returns
Boolean
isDeltaMessage()method 
public function isDeltaMessage():Boolean

Returns
Boolean
isFetchMessage()method 
public function isFetchMessage():Boolean

Returns
Boolean — true if the message is a fetch type message
isInitialTopicLoad()method 
public function isInitialTopicLoad():Boolean

Returns
Boolean — true if the message type is a Initial Topic Load message
isPagedLoad()method 
public function isPagedLoad():Boolean

Returns
Boolean
isServiceLoad()method 
public function isServiceLoad():Boolean

Returns
Boolean
isServiceRequest()method 
public function isServiceRequest():Boolean

Returns
Boolean
needsAcknowledgement()method 
public function needsAcknowledgement():Boolean

Returns
Boolean
putRecord()method 
public function putRecord(... strings):void

put one Record of Strings (Throws DiffusionProtocolError Exception)

Parameters

... strings

putRecords()method 
public function putRecords(... diffusionRecord):void

put one or more Record (Throws DiffusionProtocolError Exception)

Parameters

... diffusionRecord

setAcknowledged()method 
public function setAcknowledged():void

setAckRequired()method 
public function setAckRequired(timeout:int = 2000):String

Parameters

timeout:int (default = 2000) — how long (in milliseconds) to wait before a ack response from the server before the MessageNotAcknowledged event is thrown. If no timeout is specified, then a default of 2000 (ms) will be used

Returns
String — the unique ack key
setAckTimeout()method 
public function setAckTimeout(timeout:int):void

Parameters

timeout:int — how long (in milliseconds) to wait before a ack response from the server before the MessageNotAcknowledged event is thrown.

setEncoding()method 
public function setEncoding(encoding:int):void

Parameters

encoding:int — the requested encoding string this can be either None, Compress, Encrypt or Base64

setHeaders()method 
public function setHeaders(headers:Array):void

Parameters

headers:Array — set the user headers for the topic message

setMessage()method 
public function setMessage(message:String):void

Parameters

message:String — set the message of the topic message

setMessageAsBytes()method 
public function setMessageAsBytes(message:ByteArray):void

Parameters

message:ByteArray — set a binary message to send to Diffusion

setMessageType()method 
public function setMessageType(messageType:int):void

Parameters

messageType:int

setTopic()method 
public function setTopic(topic:String):void

Set the topic for the message

Parameters

topic:String

toString()method 
public function toString():String

Returns
String
Constant Detail
ACK_DELTAConstant
public static const ACK_DELTA:int = 31

ACK_ITLConstant 
public static const ACK_ITL:int = 30

ACK_RESPONSEConstant 
public static const ACK_RESPONSE:int = 32

BASE64_ENCODINGConstant 
public static const BASE64_ENCODING:int = 19

CLIENT_ABORTConstant 
public static const CLIENT_ABORT:int = 28

CLIENT_CLOSEConstant 
public static const CLIENT_CLOSE:int = 29

CLIENT_PINGConstant 
public static const CLIENT_PING:int = 25

COMMAND_LOADConstant 
public static const COMMAND_LOAD:int = 40

COMMAND_NOTIFICATIONConstant 
public static const COMMAND_NOTIFICATION:int = 41

COMMAND_VALUEConstant 
public static const COMMAND_VALUE:int = 36

COMPRESSED_ENCODINGConstant 
public static const COMPRESSED_ENCODING:int = 18

DELTAConstant 
public static const DELTA:int = 21

ENCRYPTED_ENCODINGConstant 
public static const ENCRYPTED_ENCODING:int = 17

FETCHConstant 
public static const FETCH:int = 33

FETCH_REPLYConstant 
public static const FETCH_REPLY:int = 34

FIELD_DELIMETERConstant 
public static const FIELD_DELIMETER:String

INITIAL_TOPIC_LOADConstant 
public static const INITIAL_TOPIC_LOAD:int = 20

MESSAGE_DELIMETERConstant 
public static const MESSAGE_DELIMETER:String

NONE_ENCODINGConstant 
public static const NONE_ENCODING:int = 0

PROTOCOLConstant 
public static const PROTOCOL:int = 35

RECORD_DELIMETERConstant 
public static const RECORD_DELIMETER:String

SEND_CREDENTIALSConstant 
public static const SEND_CREDENTIALS:int = 26

SERVER_PINGConstant 
public static const SERVER_PING:int = 24

SERVER_REJECTED_CREDENTIALSConstant 
public static const SERVER_REJECTED_CREDENTIALS:int = 27

TOPIC_STATUSConstant 
public static const TOPIC_STATUS:int = 35