home *** CD-ROM | disk | FTP | other *** search
- package mx.messaging.messages
- {
- import flash.utils.getQualifiedClassName;
- import mx.utils.ObjectUtil;
- import mx.utils.StringUtil;
- import mx.utils.UIDUtil;
-
- public class AbstractMessage implements IMessage
- {
- public static const DESTINATION_CLIENT_ID_HEADER:String = "DSDstClientId";
-
- public static const ENDPOINT_HEADER:String = "DSEndpoint";
-
- public static const REMOTE_CREDENTIALS_HEADER:String = "DSRemoteCredentials";
-
- public static const REQUEST_TIMEOUT_HEADER:String = "DSRequestTimeout";
-
- private var _body:Object;
-
- private var _messageId:String;
-
- private var _destination:String = "";
-
- private var _timestamp:Number = 0;
-
- private var _timeToLive:Number = 0;
-
- private var _headers:Object;
-
- private var _clientId:String;
-
- public function AbstractMessage()
- {
- _body = {};
- _destination = "";
- _headers = {};
- _messageId = UIDUtil.createUID();
- _timestamp = 0;
- _timeToLive = 0;
- super();
- }
-
- public function set body(param1:Object) : void
- {
- _body = param1;
- }
-
- public function get clientId() : String
- {
- return _clientId;
- }
-
- public function get messageId() : String
- {
- return _messageId;
- }
-
- public function set clientId(param1:String) : void
- {
- _clientId = param1;
- }
-
- public function get destination() : String
- {
- return _destination;
- }
-
- final protected function getDebugString() : String
- {
- var _loc1_:* = null;
- var _loc2_:Object = null;
- var _loc3_:Array = null;
- var _loc4_:String = null;
- var _loc5_:uint = 0;
- var _loc6_:String = null;
- var _loc7_:String = null;
- _loc1_ = "(" + getQualifiedClassName(this) + ")";
- _loc2_ = new Object();
- addDebugAttributes(_loc2_);
- _loc3_ = new Array();
- for(_loc4_ in _loc2_)
- {
- _loc3_.push(_loc4_);
- }
- _loc3_.sort();
- _loc5_ = 0;
- while(_loc5_ < _loc3_.length)
- {
- _loc6_ = String(_loc3_[_loc5_]);
- _loc7_ = ObjectUtil.toString(_loc2_[_loc6_]);
- _loc1_ += StringUtil.substitute("\n {0}={1}",_loc6_,_loc7_);
- _loc5_++;
- }
- return _loc1_;
- }
-
- public function toString() : String
- {
- return ObjectUtil.toString(this);
- }
-
- public function set headers(param1:Object) : void
- {
- _headers = param1;
- }
-
- public function get headers() : Object
- {
- return _headers;
- }
-
- public function get body() : Object
- {
- return _body;
- }
-
- public function set destination(param1:String) : void
- {
- _destination = param1;
- }
-
- public function set messageId(param1:String) : void
- {
- _messageId = param1;
- }
-
- public function set timestamp(param1:Number) : void
- {
- _timestamp = param1;
- }
-
- public function set timeToLive(param1:Number) : void
- {
- _timeToLive = param1;
- }
-
- protected function addDebugAttributes(param1:Object) : void
- {
- param1["body"] = body;
- param1["clientId"] = clientId;
- param1["destination"] = destination;
- param1["headers"] = headers;
- param1["messageId"] = messageId;
- param1["timestamp"] = timestamp;
- param1["timeToLive"] = timeToLive;
- }
-
- public function get timeToLive() : Number
- {
- return _timeToLive;
- }
-
- public function get timestamp() : Number
- {
- return _timestamp;
- }
- }
- }
-
-