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
ConstructorsModifierConstructorDescriptionprotectedMetadataTransientCacheValue(Object value, PrivateMetadata internalMetadata, Metadata metadata, long lastUsed) MetadataTransientCacheValue(Object value, Metadata metadata, long lastUsed) protectedMetadataTransientCacheValue(org.infinispan.marshall.protostream.impl.MarshallableObject<?> wrappedValue, PrivateMetadata internalMetadata, org.infinispan.marshall.protostream.impl.MarshallableObject<Metadata> wrappedMetadata, long lastUsed) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidappendFieldsToString(StringBuilder builder) booleanlongfinal longlongGet metadata of this cache entry.final booleanisExpired(long now) booleanvoidsetMetadata(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:
getLastUsedin interfaceInternalCacheValue- Overrides:
getLastUsedin classImmortalCacheValue- Returns:
- timestamp when the entry was last used
-
toInternalCacheEntry
- Specified by:
toInternalCacheEntryin interfaceInternalCacheValue- Overrides:
toInternalCacheEntryin classImmortalCacheValue
-
getMaxIdle
public long getMaxIdle()- Specified by:
getMaxIdlein interfaceInternalCacheValue- Overrides:
getMaxIdlein classImmortalCacheValue- Returns:
- max idle time allowed
-
isExpired
public final boolean isExpired(long now) - Specified by:
isExpiredin interfaceInternalCacheValue- Overrides:
isExpiredin 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:
canExpirein interfaceInternalCacheValue- Overrides:
canExpirein classImmortalCacheValue- Returns:
- true if the entry can expire, false otherwise
-
isMaxIdleExpirable
public boolean isMaxIdleExpirable()- Specified by:
isMaxIdleExpirablein interfaceInternalCacheValue- Returns:
- true if this entry can expire via max idle, false otherwise
-
getMetadata
Description copied from interface:MetadataAwareGet metadata of this cache entry.- Specified by:
getMetadatain interfaceInternalCacheValue- Specified by:
getMetadatain interfaceMetadataAware- Overrides:
getMetadatain classImmortalCacheValue- Returns:
- a Metadata instance
-
setMetadata
Description copied from interface:MetadataAwareSet the metadata in the cache entry.- Specified by:
setMetadatain interfaceMetadataAware- Parameters:
metadata- to apply to the cache entry
-
getExpiryTime
public long getExpiryTime()- Specified by:
getExpiryTimein interfaceInternalCacheValue- Overrides:
getExpiryTimein classImmortalCacheValue
-
appendFieldsToString
- Overrides:
appendFieldsToStringin classImmortalCacheValue
-