/** @param contextId */
  public static void removeAuthenticationContextFromCache(String contextId) {

    if (contextId != null) {
      AuthenticationContextCacheKey cacheKey = new AuthenticationContextCacheKey(contextId);
      AuthenticationContextCache.getInstance().clearCacheEntry(cacheKey);
    }
  }
  /**
   * @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);
  }
  /**
   * @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;
  }