Пример #1
0
        internal static UserContextKey CreateNew(OwaContext owaContext)
        {
            string uniqueId = owaContext.LogonIdentity.UniqueId;
            string text     = owaContext.IsDifferentMailbox ? owaContext.MailboxIdentity.UniqueId : null;

            return(UserContextKey.Create(Guid.NewGuid(), uniqueId, text));
        }
Пример #2
0
        internal static UserContext TryGetUserContextFromCache(UserContextKey userContextKey)
        {
            ExTraceGlobals.UserContextCallTracer.TraceDebug(0L, "UserContextManager.TryGetUserContextFromCache");
            UserContext userContext = null;

            try
            {
                ExTraceGlobals.UserContextTracer.TraceDebug <UserContextKey>(0L, "Attempting to fetch user context from the cache.  Key={0}", userContextKey);
                UserContextManager.UserContextCacheWrapper userContextCacheWrapper = (UserContextManager.UserContextCacheWrapper)HttpRuntime.Cache.Get(userContextKey.ToString());
                if (userContextCacheWrapper != null && userContextCacheWrapper.UserContext != null)
                {
                    userContext = userContextCacheWrapper.UserContext;
                    ExTraceGlobals.UserContextTracer.TraceDebug <UserContextKey, UserContext>(0L, "User context found in cache. Key={0}, User context instance={1}", userContextKey, userContext);
                    userContext.UpdateLastAccessedTime();
                    userContext.Lock(true);
                }
                else
                {
                    ExTraceGlobals.UserContextTracer.TraceDebug <string>(0L, "An object for this user context ID value is not present in the cache (probably was expired), so we are going to reuse the user context ID value for the new session", userContextKey.UserContextId);
                }
            }
            finally
            {
                if (userContext != null && userContext.State != UserContextState.Active && userContext.LockedByCurrentThread())
                {
                    userContext.Unlock();
                    userContext = null;
                }
            }
            return(userContext);
        }
 // Token: 0x060014FE RID: 5374 RVA: 0x0007F880 File Offset: 0x0007DA80
 internal UserContextBase(UserContextKey key)
 {
     this.key = key;
     this.sessionBeginTime        = Stopwatch.GetTimestamp();
     this.sessionLastAccessedTime = this.sessionBeginTime;
     this.writerLock = UserContextManager.GetUserContextKeyLock(key.ToString());
 }
Пример #4
0
 // Token: 0x0600164B RID: 5707 RVA: 0x0008326E File Offset: 0x0008146E
 internal static UserContextCookie CreateFromKey(string cookieId, UserContextKey userContextKey)
 {
     return(new UserContextCookie(cookieId, userContextKey.Canary, userContextKey.MailboxUniqueKey));
 }