public class TimestampCacheImpl extends java.lang.Object implements TimestampCache
Modifier and Type | Field and Description |
---|---|
private com.google.common.cache.Cache<java.lang.String,java.sql.Timestamp> |
cache |
Constructor and Description |
---|
TimestampCacheImpl(com.google.common.cache.Cache<java.lang.String,java.sql.Timestamp> cache) |
Modifier and Type | Method and Description |
---|---|
boolean |
existsTimestampFor(GUID shopGuid)
Determines whether or not an timestamp for the passed shop identifier
exists within the cache.
|
java.sql.Timestamp |
get(GUID shopGuid)
Returns the timestamp for the shop with the passed identifier.
|
void |
put(GUID shopGuid,
java.sql.Timestamp timestamp)
Stores the passed timestamp in the cache mapped by the specified shop
identifier.
|
void |
remove(GUID shopGuid)
Removes the timestamp for the shop with the passed GUID from the cache.
|
public TimestampCacheImpl(com.google.common.cache.Cache<java.lang.String,java.sql.Timestamp> cache)
public boolean existsTimestampFor(GUID shopGuid)
TimestampCache
existsTimestampFor
in interface TimestampCache
shopGuid
- GUID of the shop.public java.sql.Timestamp get(GUID shopGuid) throws TimestampLostException
TimestampCache
get
in interface TimestampCache
shopGuid
- GUID of the shop to retrieve a timestamp for.TimestampLostException
- in case no timestamp was found.public void put(GUID shopGuid, java.sql.Timestamp timestamp)
TimestampCache
put
in interface TimestampCache
shopGuid
- GUID of the shop belonging to the timestamp to store.timestamp
- Timestamp to store.public void remove(GUID shopGuid)
TimestampCache
remove
in interface TimestampCache
shopGuid
- GUID of the shop.