Class MetadataTransientCacheValue
java.lang.Object
org.infinispan.container.entries.ImmortalCacheValue
org.infinispan.container.entries.metadata.MetadataTransientCacheValue
- All Implemented Interfaces:
Cloneable
,InternalCacheValue
,MetadataAware
@ProtoTypeId(1126)
public class MetadataTransientCacheValue
extends ImmortalCacheValue
implements MetadataAware
A transient cache value, to correspond with
TransientCacheEntry
which is MetadataAware
- Since:
- 5.3
- Author:
- Galder Zamarreño
-
Field Summary
Fields inherited from class org.infinispan.container.entries.ImmortalCacheValue
internalMetadata, value
-
Constructor Summary
ConstructorsModifierConstructorDescriptionprotected
MetadataTransientCacheValue
(Object value, PrivateMetadata internalMetadata, Metadata metadata, long lastUsed) MetadataTransientCacheValue
(Object value, Metadata metadata, long lastUsed) protected
MetadataTransientCacheValue
(org.infinispan.marshall.protostream.impl.MarshallableObject<?> wrappedValue, PrivateMetadata internalMetadata, org.infinispan.marshall.protostream.impl.MarshallableObject<Metadata> wrappedMetadata, long lastUsed) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
appendFieldsToString
(StringBuilder builder) boolean
long
final long
long
Get metadata of this cache entry.final boolean
isExpired
(long now) boolean
void
setMetadata
(Metadata metadata) Set the metadata in the cache entry.InternalCacheEntry
<?, ?> Methods inherited from class org.infinispan.container.entries.ImmortalCacheValue
clone, equals, getCreated, getInternalMetadata, getLifespan, getValue, getWrappedValue, hashCode, setInternalMetadata, setValue, toString
-
Constructor Details
-
MetadataTransientCacheValue
-
MetadataTransientCacheValue
protected MetadataTransientCacheValue(Object value, PrivateMetadata internalMetadata, Metadata metadata, long lastUsed) -
MetadataTransientCacheValue
@ProtoFactory protected MetadataTransientCacheValue(org.infinispan.marshall.protostream.impl.MarshallableObject<?> wrappedValue, PrivateMetadata internalMetadata, org.infinispan.marshall.protostream.impl.MarshallableObject<Metadata> wrappedMetadata, long lastUsed)
-
-
Method Details
-
getLastUsed
@ProtoField(5) public final long getLastUsed()- Specified by:
getLastUsed
in interfaceInternalCacheValue
- Overrides:
getLastUsed
in classImmortalCacheValue
- Returns:
- timestamp when the entry was last used
-
toInternalCacheEntry
- 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
-
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
-
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
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
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
-
appendFieldsToString
- Overrides:
appendFieldsToString
in classImmortalCacheValue
-