Example #1
0
        protected override void ParseResponse(byte[] responseBuffer, int responseBufferSize)
        {
            XDocument responseXDocument;

            try
            {
                using (MemoryStream memoryStream = new MemoryStream(responseBuffer, 0, responseBufferSize))
                {
                    responseXDocument = XDocument.Load(memoryStream);
                }
            }
            catch (XmlException exception)
            {
                this.InternalFailureCallback(exception, null);
                return;
            }
            List <AppStateResponseAsset> list = GetAppState.CreateAppStateResponseAssets(responseXDocument, new BaseAsyncCommand.LogResponseParseFailureEventCallback(this.LogResponseParseFailureEvent));

            if (list.Count == 0)
            {
                ExtensionDiagnostics.Logger.LogEvent(ApplicationLogicEventLogConstants.Tuple_EmptyAppStateResponse, null, new object[]
                {
                    this.scenario,
                    this.requestId,
                    base.GetLoggedMailboxIdentifier(),
                    this.uri
                });
                this.InternalFailureCallback(null, "GetAppState.ParseResponse: No asset responses were returned");
                return;
            }
            base.LogResponseParsed();
            this.successCallback(list, this.uri);
        }
Example #2
0
        private void InternalExecute(IEnumerable <IAppStateRequestAsset> requestAssets, string deploymentId)
        {
            string arg = GetAppState.CreateQueryString(requestAssets);
            Uri    uri = new Uri(this.urlsCache.AppStateUrl + string.Format("?ma={0}&deployId={1}&corr={2}", arg, deploymentId, this.requestId));

            base.InternalExecute(uri);
        }
        // Token: 0x06000BE9 RID: 3049 RVA: 0x00030B20 File Offset: 0x0002ED20
        internal void Execute(UpdateQueryContext queryContext)
        {
            if (queryContext == null)
            {
                throw new ArgumentNullException("queryContext");
            }
            if (queryContext.UpdateRequestAssets == null)
            {
                throw new ArgumentNullException("QueryContext.UpdateRequestAssets");
            }
            if (queryContext.UpdateRequestAssets.Count == 0)
            {
                throw new ArgumentException("QueryContext.UpdateRequestAssets must include 1 or more extensions");
            }
            this.queryContext = queryContext;
            if (queryContext.UpdateRequestAssets.Count > 100)
            {
                GetUpdates.Tracer.TraceError <int, int>(0L, "GetUpdates.Execute: Too many extensions passed. Passed: {0}  Supported: {1}", queryContext.UpdateRequestAssets.Count, 100);
                string[] array = queryContext.UpdateRequestAssets.Keys.ToArray <string>();
                for (int i = 100; i < array.Length; i++)
                {
                    GetUpdates.Tracer.TraceDebug <string>(0L, "GetUpdates.Execute: Too many extensions. Removing {0}.", array[i]);
                    queryContext.UpdateRequestAssets.Remove(array[i]);
                }
                ExtensionDiagnostics.Logger.LogEvent(ApplicationLogicEventLogConstants.Tuple_TooManyExtensionsForAutomaticUpdate, null, new object[]
                {
                    "ProcessUpdates",
                    this.GetLoggedMailboxIdentifier()
                });
            }
            GetUpdates.Tracer.TraceDebug <int>(0L, "GetUpdates.Execute: Getting update information for {0} extensions.", queryContext.UpdateRequestAssets.Count);
            this.updateRequestAssets = queryContext.UpdateRequestAssets;
            GetAppState getAppState = new GetAppState(this.urlsCache);

            using (ActivityContext.SuppressThreadScope())
            {
                getAppState.Execute(queryContext.UpdateRequestAssets.Values, queryContext.DeploymentId, new BaseAsyncCommand.GetLoggedMailboxIdentifierCallback(this.GetLoggedMailboxIdentifier), new GetAppState.SuccessCallback(this.GetAppStateSuccessCallback), new BaseAsyncCommand.FailureCallback(this.GetAppStateFailureCallback));
            }
        }