Class MetadataTransientCacheValue
- java.lang.Object
-
- org.infinispan.container.entries.ImmortalCacheValue
-
- org.infinispan.container.entries.metadata.MetadataTransientCacheValue
-
- All Implemented Interfaces:
Cloneable
,InternalCacheValue
,MetadataAware
public class MetadataTransientCacheValue extends ImmortalCacheValue implements MetadataAware
A transient cache value, to correspond withTransientCacheEntry
which isMetadataAware
- Since:
- 5.3
- Author:
- Galder ZamarreƱo
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
MetadataTransientCacheValue.Externalizer
-
Field Summary
-
Fields inherited from class org.infinispan.container.entries.ImmortalCacheValue
value
-
-
Constructor Summary
Constructors Constructor Description MetadataTransientCacheValue(Object value, Metadata metadata, long lastUsed)
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
canExpire()
long
getExpiryTime()
long
getLastUsed()
long
getMaxIdle()
Metadata
getMetadata()
Get metadata of this cache entry.boolean
isExpired()
boolean
isExpired(long now)
boolean
isMaxIdleExpirable()
void
setMetadata(Metadata metadata)
Set the metadata in the cache entry.InternalCacheEntry
toInternalCacheEntry(Object key)
-
Methods inherited from class org.infinispan.container.entries.ImmortalCacheValue
clone, equals, getCreated, getLifespan, getValue, hashCode, setValue, toString
-
-
-
-
Method Detail
-
toInternalCacheEntry
public InternalCacheEntry toInternalCacheEntry(Object key)
- Specified by:
toInternalCacheEntry
in interfaceInternalCacheValue
- Overrides:
toInternalCacheEntry
in classImmortalCacheValue
-
getMaxIdle
public long getMaxIdle()
- Specified by:
getMaxIdle
in interfaceInternalCacheValue
- Overrides:
getMaxIdle
in classImmortalCacheValue
- Returns:
- max idle time allowed
-
getLastUsed
public long getLastUsed()
- Specified by:
getLastUsed
in interfaceInternalCacheValue
- Overrides:
getLastUsed
in classImmortalCacheValue
- Returns:
- timestamp when the entry was last used
-
isExpired
public final boolean isExpired(long now)
- Specified by:
isExpired
in interfaceInternalCacheValue
- Overrides:
isExpired
in classImmortalCacheValue
- Parameters:
now
- the current time as expressed bySystem.currentTimeMillis()
- Returns:
- true if the entry has expired; false otherwise
-
isExpired
public final boolean isExpired()
- Specified by:
isExpired
in interfaceInternalCacheValue
- Overrides:
isExpired
in classImmortalCacheValue
- Returns:
- true if the entry has expired; false otherwise
-
canExpire
public boolean canExpire()
- Specified by:
canExpire
in interfaceInternalCacheValue
- Overrides:
canExpire
in classImmortalCacheValue
- Returns:
- true if the entry can expire, false otherwise
-
isMaxIdleExpirable
public boolean isMaxIdleExpirable()
- Specified by:
isMaxIdleExpirable
in interfaceInternalCacheValue
- Returns:
- true if this entry can expire via max idle, false otherwise
-
getMetadata
public Metadata getMetadata()
Description copied from interface:MetadataAware
Get metadata of this cache entry.- Specified by:
getMetadata
in interfaceInternalCacheValue
- Specified by:
getMetadata
in interfaceMetadataAware
- Overrides:
getMetadata
in classImmortalCacheValue
- Returns:
- a Metadata instance
-
setMetadata
public void setMetadata(Metadata metadata)
Description copied from interface:MetadataAware
Set the metadata in the cache entry.- Specified by:
setMetadata
in interfaceMetadataAware
- Parameters:
metadata
- to apply to the cache entry
-
getExpiryTime
public long getExpiryTime()
- Specified by:
getExpiryTime
in interfaceInternalCacheValue
- Overrides:
getExpiryTime
in classImmortalCacheValue
-
-