Exemplo n.º 1
0
        /// <summary>
        /// Gets an existing Profile object from the cache.
        /// </summary>
        /// <param name="token">
        /// Token identifying an existing cached entity.
        /// </param>
        /// <returns>A cached Profile object</returns>
        public object GetProfile(IToken token)
        {
            SecurityCacheItem item    = GetSecurityCacheItem(token);
            object            profile = item == null ? null : item.Profile;

            SecurityCacheReadEvent.Fire(profile != null);

            return(profile);
        }
Exemplo n.º 2
0
        /// <summary>
        /// Gets an existing IPrincipal object from the cache.
        /// </summary>
        /// <param name="token">
        /// Token identifying an existing cached entity.
        /// </param>
        /// <returns>A cached IPrincipal object</returns>
        public IPrincipal GetPrincipal(IToken token)
        {
            SecurityCacheItem item      = GetSecurityCacheItem(token);
            IPrincipal        principal = item == null ? null : item.Principal;

            SecurityCacheReadEvent.Fire(principal != null);

            return(principal);
        }
Exemplo n.º 3
0
        /// <summary>
        /// Gets an existing IIdentity object from the cache.
        /// </summary>
        /// <param name="token">
        /// Token identifying an existing cached entity.
        /// </param>
        /// <returns>A cached IIdentity object</returns>
        public IIdentity GetIdentity(IToken token)
        {
            SecurityCacheItem item     = GetSecurityCacheItem(token);
            IIdentity         identity = item == null ? null : item.Identity;

            SecurityCacheReadEvent.Fire(identity != null);

            return(identity);
        }
 private void FireCacheMissCounter()
 {
     SecurityCacheReadEvent.Fire(false);
 }
 private void FireCacheHitCounter()
 {
     SecurityCacheReadEvent.Fire(true);
 }