Package | com.pushtechnology.diffusion |
Class | public class TopicMessage |
Inheritance | TopicMessage ![]() |
This is used to send information to Diffusion, by default the encoding is NONE, a user must set other encoding if encoding is required.
Property | Defined By | ||
---|---|---|---|
theMessage : ByteArray | TopicMessage |
Method | Defined By | ||
---|---|---|---|
TopicMessage(topic:String, message:String = null) | TopicMessage | ||
addHeader(header:String):void | TopicMessage | ||
displayFormat():String | TopicMessage | ||
getAckID():String | TopicMessage | ||
getAckRequired():Boolean | TopicMessage | ||
getAckTimeout():int | TopicMessage | ||
getBaseTopic():String | TopicMessage | ||
getEncoding():int | TopicMessage | ||
getFields(index:int):Array | TopicMessage | ||
getHeader(index:int):String | TopicMessage | ||
getHeaders():Array | TopicMessage | ||
getMessage():ByteArray | TopicMessage | ||
getMessageAsString():String | TopicMessage | ||
getMessageType():int | TopicMessage | ||
getNumberOfRecords():int | TopicMessage | ||
TopicMessage | |||
getRecords():Array | TopicMessage | ||
getTimestamp():Date | TopicMessage | ||
getTopic():String | TopicMessage | ||
getXMLMessage():XML | TopicMessage | ||
internalSetAck(ackID:String):void | TopicMessage | ||
isAckMessage():Boolean | TopicMessage | ||
isDeltaMessage():Boolean | TopicMessage | ||
isFetchMessage():Boolean | TopicMessage | ||
isInitialTopicLoad():Boolean | TopicMessage | ||
isPagedLoad():Boolean | TopicMessage | ||
isServiceLoad():Boolean | TopicMessage | ||
isServiceRequest():Boolean | TopicMessage | ||
needsAcknowledgement():Boolean | 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 | ||
setAcknowledged():void | 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 |
Constant | Defined 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 |
theMessage | property |
protected var theMessage:ByteArray
TopicMessage | () | Constructor |
public function TopicMessage(topic:String, message:String = null)
Parameters
topic:String — the topic if the message
| |
message:String (default = null ) — the message
|
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 |
Array |
getHeader | () | method |
public function getHeader(index:int):String
Parameters
index:int |
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
Returnsint |
getNumberOfRecords | () | method |
public function getNumberOfRecords():int
Returns
int — the number of Diffusion records held in this message
|
getRecord | () | method |
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
|
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 |
ACK_DELTA | Constant |
public static const ACK_DELTA:int = 31
ACK_ITL | Constant |
public static const ACK_ITL:int = 30
ACK_RESPONSE | Constant |
public static const ACK_RESPONSE:int = 32
BASE64_ENCODING | Constant |
public static const BASE64_ENCODING:int = 19
CLIENT_ABORT | Constant |
public static const CLIENT_ABORT:int = 28
CLIENT_CLOSE | Constant |
public static const CLIENT_CLOSE:int = 29
CLIENT_PING | Constant |
public static const CLIENT_PING:int = 25
COMMAND_LOAD | Constant |
public static const COMMAND_LOAD:int = 40
COMMAND_NOTIFICATION | Constant |
public static const COMMAND_NOTIFICATION:int = 41
COMMAND_VALUE | Constant |
public static const COMMAND_VALUE:int = 36
COMPRESSED_ENCODING | Constant |
public static const COMPRESSED_ENCODING:int = 18
DELTA | Constant |
public static const DELTA:int = 21
ENCRYPTED_ENCODING | Constant |
public static const ENCRYPTED_ENCODING:int = 17
FETCH | Constant |
public static const FETCH:int = 33
FETCH_REPLY | Constant |
public static const FETCH_REPLY:int = 34
FIELD_DELIMETER | Constant |
public static const FIELD_DELIMETER:String
INITIAL_TOPIC_LOAD | Constant |
public static const INITIAL_TOPIC_LOAD:int = 20
MESSAGE_DELIMETER | Constant |
public static const MESSAGE_DELIMETER:String
NONE_ENCODING | Constant |
public static const NONE_ENCODING:int = 0
PROTOCOL | Constant |
public static const PROTOCOL:int = 35
RECORD_DELIMETER | Constant |
public static const RECORD_DELIMETER:String
SEND_CREDENTIALS | Constant |
public static const SEND_CREDENTIALS:int = 26
SERVER_PING | Constant |
public static const SERVER_PING:int = 24
SERVER_REJECTED_CREDENTIALS | Constant |
public static const SERVER_REJECTED_CREDENTIALS:int = 27
TOPIC_STATUS | Constant |
public static const TOPIC_STATUS:int = 35