Class MemcachedStorageRecord<T>
- java.lang.Object
-
- org.opensaml.storage.StorageRecord<T>
-
- org.opensaml.storage.impl.memcached.MemcachedStorageRecord<T>
-
- Type Parameters:
T- type of object
public class MemcachedStorageRecord<T> extends StorageRecord<T>
Storage record implementation for use withMemcachedStorageService.
-
-
Constructor Summary
Constructors Constructor Description MemcachedStorageRecord(String val, Long exp)Creates a new instance with specific record version.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static intexpiry(Long exp)Converts aStorageRecord.getExpiration()value in milliseconds to the corresponding value in seconds.intgetExpiry()Gets the expiration date as an integer representing seconds since the Unix epoch, 1970-01-01T00:00:00.protected voidsetVersion(long version)Sets the record version.-
Methods inherited from class org.opensaml.storage.StorageRecord
getExpiration, getValue, getValue, getVersion, incrementVersion, setExpiration, setValue, setValue
-
-
-
-
Method Detail
-
expiry
public static int expiry(Long exp)
Converts aStorageRecord.getExpiration()value in milliseconds to the corresponding value in seconds.- Parameters:
exp- the expiration value- Returns:
- 0 if given expiration is null, otherwise
exp/1000.
-
getExpiry
public int getExpiry()
Gets the expiration date as an integer representing seconds since the Unix epoch, 1970-01-01T00:00:00. The value provided by this method is suitable for representing the memcached entry expiration.- Returns:
- 0 if expiration is null, otherwise
getExpiration()/1000.
-
setVersion
protected void setVersion(@Positive long version)
Sets the record version.- Overrides:
setVersionin classStorageRecord<T>- Parameters:
version- Record version; must be positive.
-
-