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(java.lang.String shopId)
Determines whether or not an timestamp for the
passed shop identifier exists within the cache.
|
java.sql.Timestamp |
get(java.lang.String shopId)
Returns the timestamp for the shop with
the passed identifier.
|
void |
put(java.lang.String shopId,
java.sql.Timestamp timestamp)
Stores the passed timestamp in the cache mapped by the
specified shop identifier.
|
void |
remove(java.lang.String shopId)
Removes the timestamp for the shop with the passed
shop identifiert from the cache.
|
public TimestampCacheImpl(com.google.common.cache.Cache<java.lang.String,java.sql.Timestamp> cache)
public boolean existsTimestampFor(java.lang.String shopId)
TimestampCache
existsTimestampFor
in interface TimestampCache
public java.sql.Timestamp get(java.lang.String shopId) throws TimestampLostException
TimestampCache
get
in interface TimestampCache
TimestampLostException
- in case no timestamp was found.public void put(java.lang.String shopId, java.sql.Timestamp timestamp) throws javax.persistence.PersistenceException
TimestampCache
put
in interface TimestampCache
javax.persistence.PersistenceException
- in case an error occurred while
trying to store to the cache.public void remove(java.lang.String shopId)
TimestampCache
remove
in interface TimestampCache