home *** CD-ROM | disk | FTP | other *** search
/ Motor Sport Digital Archive Collection 1960s / Motor Sport Digital Archive Collection 1960s.iso / main.swf / scripts / mx / messaging / messages / AbstractMessage.as next >
Encoding:
Text File  |  2008-05-21  |  4.0 KB  |  160 lines

  1. package mx.messaging.messages
  2. {
  3.    import flash.utils.getQualifiedClassName;
  4.    import mx.utils.ObjectUtil;
  5.    import mx.utils.StringUtil;
  6.    import mx.utils.UIDUtil;
  7.    
  8.    public class AbstractMessage implements IMessage
  9.    {
  10.       public static const DESTINATION_CLIENT_ID_HEADER:String = "DSDstClientId";
  11.       
  12.       public static const ENDPOINT_HEADER:String = "DSEndpoint";
  13.       
  14.       public static const REMOTE_CREDENTIALS_HEADER:String = "DSRemoteCredentials";
  15.       
  16.       public static const REQUEST_TIMEOUT_HEADER:String = "DSRequestTimeout";
  17.       
  18.       private var _body:Object;
  19.       
  20.       private var _messageId:String;
  21.       
  22.       private var _destination:String = "";
  23.       
  24.       private var _timestamp:Number = 0;
  25.       
  26.       private var _timeToLive:Number = 0;
  27.       
  28.       private var _headers:Object;
  29.       
  30.       private var _clientId:String;
  31.       
  32.       public function AbstractMessage()
  33.       {
  34.          _body = {};
  35.          _destination = "";
  36.          _headers = {};
  37.          _messageId = UIDUtil.createUID();
  38.          _timestamp = 0;
  39.          _timeToLive = 0;
  40.          super();
  41.       }
  42.       
  43.       public function set body(param1:Object) : void
  44.       {
  45.          _body = param1;
  46.       }
  47.       
  48.       public function get clientId() : String
  49.       {
  50.          return _clientId;
  51.       }
  52.       
  53.       public function get messageId() : String
  54.       {
  55.          return _messageId;
  56.       }
  57.       
  58.       public function set clientId(param1:String) : void
  59.       {
  60.          _clientId = param1;
  61.       }
  62.       
  63.       public function get destination() : String
  64.       {
  65.          return _destination;
  66.       }
  67.       
  68.       final protected function getDebugString() : String
  69.       {
  70.          var _loc1_:* = null;
  71.          var _loc2_:Object = null;
  72.          var _loc3_:Array = null;
  73.          var _loc4_:String = null;
  74.          var _loc5_:uint = 0;
  75.          var _loc6_:String = null;
  76.          var _loc7_:String = null;
  77.          _loc1_ = "(" + getQualifiedClassName(this) + ")";
  78.          _loc2_ = new Object();
  79.          addDebugAttributes(_loc2_);
  80.          _loc3_ = new Array();
  81.          for(_loc4_ in _loc2_)
  82.          {
  83.             _loc3_.push(_loc4_);
  84.          }
  85.          _loc3_.sort();
  86.          _loc5_ = 0;
  87.          while(_loc5_ < _loc3_.length)
  88.          {
  89.             _loc6_ = String(_loc3_[_loc5_]);
  90.             _loc7_ = ObjectUtil.toString(_loc2_[_loc6_]);
  91.             _loc1_ += StringUtil.substitute("\n  {0}={1}",_loc6_,_loc7_);
  92.             _loc5_++;
  93.          }
  94.          return _loc1_;
  95.       }
  96.       
  97.       public function toString() : String
  98.       {
  99.          return ObjectUtil.toString(this);
  100.       }
  101.       
  102.       public function set headers(param1:Object) : void
  103.       {
  104.          _headers = param1;
  105.       }
  106.       
  107.       public function get headers() : Object
  108.       {
  109.          return _headers;
  110.       }
  111.       
  112.       public function get body() : Object
  113.       {
  114.          return _body;
  115.       }
  116.       
  117.       public function set destination(param1:String) : void
  118.       {
  119.          _destination = param1;
  120.       }
  121.       
  122.       public function set messageId(param1:String) : void
  123.       {
  124.          _messageId = param1;
  125.       }
  126.       
  127.       public function set timestamp(param1:Number) : void
  128.       {
  129.          _timestamp = param1;
  130.       }
  131.       
  132.       public function set timeToLive(param1:Number) : void
  133.       {
  134.          _timeToLive = param1;
  135.       }
  136.       
  137.       protected function addDebugAttributes(param1:Object) : void
  138.       {
  139.          param1["body"] = body;
  140.          param1["clientId"] = clientId;
  141.          param1["destination"] = destination;
  142.          param1["headers"] = headers;
  143.          param1["messageId"] = messageId;
  144.          param1["timestamp"] = timestamp;
  145.          param1["timeToLive"] = timeToLive;
  146.       }
  147.       
  148.       public function get timeToLive() : Number
  149.       {
  150.          return _timeToLive;
  151.       }
  152.       
  153.       public function get timestamp() : Number
  154.       {
  155.          return _timestamp;
  156.       }
  157.    }
  158. }
  159.  
  160.