public class TokenCacheImpl extends java.lang.Object implements TokenCache
Modifier and Type | Field and Description |
---|---|
private com.google.common.cache.Cache<java.lang.String,java.lang.String> |
cache |
Constructor and Description |
---|
TokenCacheImpl(com.google.common.cache.Cache<java.lang.String,java.lang.String> cache) |
Modifier and Type | Method and Description |
---|---|
boolean |
existsTokenFor(java.lang.String shopId)
Determines whether or not an token for the passed shop
identifier exists within the cache.
|
java.lang.String |
get(java.lang.String shopId)
Returns the access token for the shop with
the passed identifier.
|
void |
put(java.lang.String shopId,
java.lang.String accessToken)
Stores the passed access token in the cache mapped by the
specified shop identifier.
|
public TokenCacheImpl(com.google.common.cache.Cache<java.lang.String,java.lang.String> cache)
public java.lang.String get(java.lang.String shopId) throws javax.persistence.EntityNotFoundException
TokenCache
get
in interface TokenCache
javax.persistence.EntityNotFoundException
- in case no access token was found.public void put(java.lang.String shopId, java.lang.String accessToken) throws javax.persistence.PersistenceException
TokenCache
put
in interface TokenCache
javax.persistence.PersistenceException
- in case an error occurred while
trying to store to the cache.public boolean existsTokenFor(java.lang.String shopId)
TokenCache
existsTokenFor
in interface TokenCache