Packagecom.adobe.rtc.messaging
Classpublic class MessageItem
ImplementsIValueObjectEncodable

MessageItem is a "descriptor" for the properties of messages sent, received, and stored by a CollectionNode. See Example 86 of XEP-60's pubsub functionality. http://www.xmpp.org/extensions/xep-0060.html

See also

"AFCS Messaging and Permissions" in the docs
com.adobe.rtc.messaging.NodeConfiguration
com.adobe.rtc.sharedModel.CollectionNode


Public Properties
 PropertyDefined by
  associatedUserID : String
For nodeConfigurations with userDependentItems=true or modifyAnyItem=false, this property is used to determine the user associated with this item.
MessageItem
  body : *
Value actually being sent within this message.
MessageItem
  collectionName : String
[Read-only] The name of the CollectionNode this item belongs to.
MessageItem
  itemID : String
The ID for this stored item.
MessageItem
  nodeName : String
The name of the Node within a CollectionNode that this item belongs to.
MessageItem
  publisherID : String
[Read-only] userID of the user who published this item.
MessageItem
  recipientID : String
For nodes where allowPrivateMessages has been set to true, this field allows messages to be received by only nerecipient.
MessageItem
  timeStamp : Number = -1
[Read-only] The time this message was broadcast and written on the server.
MessageItem
Public Methods
 MethodDefined by
  
MessageItem(p_nodeName:String = null, p_body:String = null, p_itemID:* = null)
MessageItem
  
Creates a ValueObject representation of this MessageItem.
MessageItem
  
readValueObject(p_valueObject:Object):void
Takes in a valueObject and structure the MessageItem according to the values therein.
MessageItem
  
registerBodyClass(p_class:Class):void
[static] registerBodyClass allows the AFCS services to send fully-typed objects in the body of MessageItems.
MessageItem
Public Constants
 ConstantDefined by
  SINGLE_ITEM_ID : String = "item"
[static] If STORAGE_SCHEME_SINGLE_ITEM is used for a nodeConfiguration, this is the default itemID used.
MessageItem
Property detail
associatedUserIDproperty
public var associatedUserID:String

For nodeConfigurations with userDependentItems=true or modifyAnyItem=false, this property is used to determine the user associated with this item. This is typically the publisherID of the first userID to publish the item. Note that owners may also publish items associated with other users. associatedUserID almost never needs to be explicitly set.

bodyproperty 
public var body:*

Value actually being sent within this message.

collectionNameproperty 
public var collectionName:String

[Read-only] The name of the CollectionNode this item belongs to.

itemIDproperty 
public var itemID:String

The ID for this stored item. Note this must be unique within the node. Publishing an item with an existing itemID will overwrite the existing item.

nodeNameproperty 
public var nodeName:String

The name of the Node within a CollectionNode that this item belongs to.

publisherIDproperty 
public var publisherID:String

[Read-only] userID of the user who published this item. Depending on nodeConfigurations for this message, publishers may not be able to modify stored items they didn't publish themselves. Note that this variable is overwritten by the server to prevent spoofing.

recipientIDproperty 
public var recipientID:String

For nodes where allowPrivateMessages has been set to true, this field allows messages to be received by only nerecipient. Note that for cases where groups of people are recipients, you should use specialized nodes where those recipients have been promoted with the ability to subscribe. We do want to avoid the one-to-one private message case devolving to "one node per user," so recipientID allows this in a much simpler manner.

timeStampproperty 
public var timeStamp:Number = -1

[Read-only] The time this message was broadcast and written on the server.

Constructor detail
MessageItem()constructor
public function MessageItem(p_nodeName:String = null, p_body:String = null, p_itemID:* = null)Parameters
p_nodeName:String (default = null)
 
p_body:String (default = null)
 
p_itemID:* (default = null)
Method detail
createValueObject()method
public function createValueObject():Object

Creates a ValueObject representation of this MessageItem.

Returns
Object — An Object which represents the non-default values for this MessageItem, suitable for consumption by readValueObject.
readValueObject()method 
public function readValueObject(p_valueObject:Object):void

Takes in a valueObject and structure the MessageItem according to the values therein.

Parameters
p_valueObject:Object — An Object which represents the non-default values for this MessageItem.
registerBodyClass()method 
public static function registerBodyClass(p_class:Class):void

registerBodyClass allows the AFCS services to send fully-typed objects in the body of MessageItems. Similar to flash.net.registerClassAlias, this causes any message body of this type to be encoded as a ByteArray. Upon receipt, the body will be deserialized as a fully-typed object. Note that if your class contains other typed object as properties, those classes will need to be registered as well.

Parameters
p_class:Class — The class to register as a body.
Constant detail
SINGLE_ITEM_IDconstant
public static const SINGLE_ITEM_ID:String = "item"

If STORAGE_SCHEME_SINGLE_ITEM is used for a nodeConfiguration, this is the default itemID used. The value may be overriden in your items.





 

Send me an e-mail when comments are added to this page | Comment Report

Current page: http://livedocs.adobe.com/labs/acrobatcom/com/adobe/rtc/messaging/MessageItem.html