Code example for Cache

Methods: getIfPresent

0
   * 
   * @return The mapped OpenID {@link org.openid4java.consumer.ConsumerManager} created for that session token 
   */ 
  public Optional<ConsumerManager> getConsumerManager(UUID sessionToken) {
 
    return Optional.fromNullable(consumerManagerCache.getIfPresent(sessionToken));
 
  } 
 
  /** 
   * <h3>Note that this is not horizontally scalable</h3> 
   * 
   * @param sessionToken    The session token 
   * @param consumerManager The OpenID ConsumerManager for this UUID 
   */ 
  public void putConsumerManager(UUID sessionToken, ConsumerManager consumerManager) {
 
    consumerManagerCache.put(sessionToken, consumerManager);
 
  }