コード例 #1
0
  /** @param contextId */
  public static void removeAuthenticationContextFromCache(String contextId) {

    if (contextId != null) {
      AuthenticationContextCacheKey cacheKey = new AuthenticationContextCacheKey(contextId);
      AuthenticationContextCache.getInstance().clearCacheEntry(cacheKey);
    }
  }
コード例 #2
0
  /**
   * @param contextId
   * @param context
   */
  public static void addAuthenticationContextToCache(
      String contextId, AuthenticationContext context) {

    AuthenticationContextCacheKey cacheKey = new AuthenticationContextCacheKey(contextId);
    AuthenticationContextCacheEntry cacheEntry = new AuthenticationContextCacheEntry(context);
    AuthenticationContextCache.getInstance().addToCache(cacheKey, cacheEntry);
  }
コード例 #3
0
  /**
   * @param contextId
   * @return
   */
  public static AuthenticationContext getAuthenticationContextFromCache(String contextId) {

    AuthenticationContext authenticationContext = null;
    AuthenticationContextCacheKey cacheKey = new AuthenticationContextCacheKey(contextId);
    AuthenticationContextCacheEntry authenticationContextCacheEntry =
        AuthenticationContextCache.getInstance().getValueFromCache(cacheKey);

    if (authenticationContextCacheEntry != null) {
      authenticationContext = authenticationContextCacheEntry.getContext();
    }

    if (log.isDebugEnabled() && authenticationContext == null) {
      log.debug("Authentication Context is null");
    }

    return authenticationContext;
  }