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(GUID shopGuid)
Determines whether or not an token for the passed shop
identifier exists within the cache.
|
java.lang.String |
get(GUID shopGuid)
Returns the access token for the shop with
the passed identifier.
|
void |
put(GUID shopGuid,
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(GUID shopGuid)
TokenCache
get
in interface TokenCache
shopGuid
- GUID of the shop to retrieve a access token for.public void put(GUID shopGuid, java.lang.String accessToken)
TokenCache
put
in interface TokenCache
shopGuid
- GUID of the shop belonging to the access token to store.accessToken
- Access token to store.public boolean existsTokenFor(GUID shopGuid)
TokenCache
existsTokenFor
in interface TokenCache
shopGuid
- GUID of the shop.