text: 'use strict';
  var __extends = (this && this.__extends) || function (d, b) {
      for (var p in b) if (b.hasOwnProperty(p)) d[p] = b[p];
      function __() { this.constructor = d; }
      d.prototype = b === null ? Object.create(b) : (__.prototype = b.prototype, new __());
  };
  var InMemoryMessageStorageContext_1 = require('./InMemoryMessageStorageContext');
  var IMessageStorageContext_1 = require('./IMessageStorageContext');
  var _ = require('lodash');
  var moment = require('moment');
  var InMemoryRequestIndices = (function () {
      function InMemoryRequestIndices() {
          this._tags = [];
      }
      Object.defineProperty(InMemoryRequestIndices.prototype, "duration", {
          get: function () {
              return this._duration;
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(InMemoryRequestIndices.prototype, "url", {
          get: function () {
              return this._url;
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(InMemoryRequestIndices.prototype, "method", {
          get: function () {
              return this._method;
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(InMemoryRequestIndices.prototype, "statusCode", {
          get: function () {
              return this._statusCode;
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(InMemoryRequestIndices.prototype, "dateTime", {
          get: function () {
              return this._dateTime;
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(InMemoryRequestIndices.prototype, "userId", {
          get: function () {
              return this._userId;
          },
          enumerable: true,
          configurable: true
      });
      Object.defineProperty(InMemoryRequestIndices.prototype, "tags", {
          get: function () {
              return this._tags;
          },
          enumerable: true,
          configurable: true
      });
      InMemoryRequestIndices.prototype.update = function (message) {
          if (message.indices) {
              var duration = message.indices['request-duration'];
              if (duration) {
                  this._duration = duration;
              }
              var url = message.indices['request-url'];
              if (url) {
                  this._url = url;
              }
              var method = message.indices['request-method'];
              if (method) {
                  this._method = method;
              }
              var userId = message.indices['request-userId'];
              if (userId) {
                  this._userId = userId;
              }
              var statusCode = message.indices['request-statuscode'];
              if (statusCode) {
                  this._statusCode = statusCode;
              }
              var dateTime = message.indices['request-datetime'];
              if (dateTime) {
                  this._dateTime = moment(dateTime);
              }
              var tags = message.indices['request-tags'];
              if (tags) {
                  this._tags = _.union(this._tags, tags);
              }
          }
      };
      return InMemoryRequestIndices;
  }());
  var InMemoryRequestStorageContext = (function (_super) {
      __extends(InMemoryRequestStorageContext, _super);
      function InMemoryRequestStorageContext() {
          _super.call(this, IMessageStorageContext_1.MessageStorageContextType.Request);
          this._indices = new InMemoryRequestIndices();
      }
      Object.defineProperty(InMemoryRequestStorageContext.prototype, "indices", {
          get: function () {
              return this._indices;
          },
          enumerable: true,
          configurable: true
      });
      InMemoryRequestStorageContext.prototype.persist = function (message) {
          _super.prototype.persist.call(this, message);
          this._indices.update(message);
      };
      return InMemoryRequestStorageContext;
  }(InMemoryMessageStorageContext_1.InMemoryMessageStorageContext));
  exports.InMemoryRequestStorageContext = InMemoryRequestStorageContext;
  
  //# sourceMappingURL=../../maps/storage/InMemoryRequestStorageContext.js.map
  