org.surfnet.oaaas.model
Class TokenResponseCacheImpl

java.lang.Object
  extended by org.surfnet.oaaas.model.TokenResponseCacheImpl
All Implemented Interfaces:
TokenResponseCache

public class TokenResponseCacheImpl
extends Object
implements TokenResponseCache

Very simple - but highly effective - TokenResponseCache implementation. Please carefully monitor the performance / cache hit-ratio in production as the maxSize in combination with the expireTimeSeconds is important. If the maxSize is too small and the expireTimeSeconds to low it will result in a cache that with each addition will try to make space (e.g. effectively only removing the oldes entry each time).


Constructor Summary
TokenResponseCacheImpl(int maxSize, long expireTimeSeconds)
           
 
Method Summary
 VerifyTokenResponse getVerifyToken(String accessToken)
           
 void storeVerifyToken(String accessToken, VerifyTokenResponse tokenResponse)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TokenResponseCacheImpl

public TokenResponseCacheImpl(int maxSize,
                              long expireTimeSeconds)
Method Detail

getVerifyToken

public VerifyTokenResponse getVerifyToken(String accessToken)
Specified by:
getVerifyToken in interface TokenResponseCache

storeVerifyToken

public void storeVerifyToken(String accessToken,
                             VerifyTokenResponse tokenResponse)
Specified by:
storeVerifyToken in interface TokenResponseCache


Copyright © 2012-2013 SURFnet bv, The Netherlands. All Rights Reserved.