Class MemcachedStorageRecord<T>
java.lang.Object
org.opensaml.storage.StorageRecord<T>
org.opensaml.storage.impl.memcached.MemcachedStorageRecord<T>
- Type Parameters:
T- type of object
Storage record implementation for use with
MemcachedStorageService.-
Constructor Summary
ConstructorsConstructorDescriptionMemcachedStorageRecord(String val, Long exp) Creates a new instance with specific record version. -
Method Summary
Modifier and TypeMethodDescriptionstatic intConverts aStorageRecord.getExpiration()value in milliseconds to the corresponding value in seconds.intGets 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, isExpired, isValid, setExpiration, setValue, setValue
-
Constructor Details
-
MemcachedStorageRecord
Creates a new instance with specific record version.- Parameters:
val- Stored value.exp- Expiration instant in milliseconds, null for infinite expiration.
-
-
Method Details
-
expiry
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
Sets the record version.- Overrides:
setVersionin classStorageRecord<T>- Parameters:
version- Record version; must be positive.
-