Exemple #1
0
        // Token: 0x06000B70 RID: 2928 RVA: 0x0002EC1C File Offset: 0x0002CE1C
        internal void QueueQueryItem(TokenRenewQueryContext queryContext)
        {
            GetTokens getTokens = null;

            lock (this.queryQueueLockObject)
            {
                if (this.queryQueue.Count > 500)
                {
                    TokenRenewSubmitter.Tracer.TraceError <IExchangePrincipal>(0L, "Query for {0} not added to the query queue because queue is full.", queryContext.ExchangePrincipal);
                    ExtensionDiagnostics.Logger.LogEvent(ApplicationLogicEventLogConstants.Tuple_ExtensionTokenQueryMaxExceeded, null, new object[]
                    {
                        "ProcessTokenRenew",
                        ExtensionDiagnostics.GetLoggedMailboxIdentifier(queryContext.ExchangePrincipal)
                    });
                    return;
                }
                TokenRenewSubmitter.Tracer.TraceDebug <IExchangePrincipal>(0L, "Adding query for {0} to the query queue.", queryContext.ExchangePrincipal);
                this.queryQueue.Enqueue(queryContext);
                if (this.GetTokensCount < 50)
                {
                    getTokens = new GetTokens(this.urlsCache, this);
                    this.GetTokensCount++;
                    TokenRenewSubmitter.Tracer.TraceDebug <int>(0L, "Creating a new instance of GetTokens. GetTokens Count {0}", this.GetTokensCount);
                }
                else
                {
                    TokenRenewSubmitter.Tracer.TraceDebug <int>(0L, "Too many GetTokens commands. Query will be handled from pool. GetTokens Count {0}", this.GetTokensCount);
                }
            }
            if (getTokens != null)
            {
                this.ExecuteTokenRenewQuery(getTokens);
            }
        }
Exemple #2
0
        // Token: 0x06000B71 RID: 2929 RVA: 0x0002ED38 File Offset: 0x0002CF38
        internal void ExecuteTokenRenewQuery(GetTokens getTokens)
        {
            TokenRenewQueryContext tokenRenewQueryContext = null;

            lock (this.queryQueueLockObject)
            {
                if (this.queryQueue.Count > 0)
                {
                    tokenRenewQueryContext = this.queryQueue.Dequeue();
                }
                else
                {
                    this.GetTokensCount--;
                    if (this.GetTokensCount < 0)
                    {
                        throw new InvalidOperationException("GetTokensCount can't be less than 0.");
                    }
                    TokenRenewSubmitter.Tracer.TraceDebug <int>(0L, "Query queue is empty. GetTokens Count {0}", this.GetTokensCount);
                }
            }
            if (tokenRenewQueryContext != null)
            {
                TokenRenewSubmitter.Tracer.TraceDebug <IExchangePrincipal>(0L, "Starting query for {0}.", tokenRenewQueryContext.ExchangePrincipal);
                getTokens.Execute(tokenRenewQueryContext);
            }
        }