Package org.infinispan.container.entries
Interface CacheEntry<K,V>
-
- All Superinterfaces:
Cloneable,Map.Entry<K,V>,MetadataAware
- All Known Subinterfaces:
InternalCacheEntry<K,V>,MVCCEntry<K,V>
- All Known Implementing Classes:
AbstractInternalCacheEntry,ClearCacheEntry,EntryWrapper,ForwardingCacheEntry,ImmortalCacheEntry,L1InternalCacheEntry,L1MetadataInternalCacheEntry,MetadataImmortalCacheEntry,MetadataMortalCacheEntry,MetadataTransientCacheEntry,MetadataTransientMortalCacheEntry,MortalCacheEntry,NullCacheEntry,ReadCommittedEntry,RepeatableReadEntry,TransientCacheEntry,TransientMortalCacheEntry,VersionedRepeatableReadEntry
public interface CacheEntry<K,V> extends Cloneable, Map.Entry<K,V>, MetadataAware
An entry that is stored in the data container- Since:
- 4.0
- Author:
- Manik Surtani, Galder ZamarreƱo
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Deprecated Methods Modifier and Type Method Description CacheEntry<K,V>clone()voidcommit(DataContainer<K,V> container)Commits changesdefault voidcommit(DataContainer<K,V> container, Metadata metadata)Deprecated.since 9.1default longgetCreated()KgetKey()Retrieves the key to this entrydefault longgetLastUsed()longgetLifespan()longgetMaxIdle()VgetValue()Retrieves the value of this entrybooleanisChanged()booleanisCreated()booleanisEvicted()default booleanisLoaded()Deprecated.since 8.1booleanisNull()Tests whether the entry represents a null value, typically used for repeatable read.booleanisRemoved()default booleanisValid()Deprecated.since 9.2default voidrollback()Deprecated.since 9.0voidsetChanged(boolean changed)voidsetCreated(boolean created)default voidsetCreated(long created)voidsetEvicted(boolean evicted)default voidsetLastUsed(long lastUsed)default voidsetLoaded(boolean loaded)Deprecated.since 8.1voidsetRemoved(boolean removed)voidsetSkipLookup(boolean skipLookup)SeeskipLookup().default voidsetValid(boolean valid)Deprecated.since 9.2VsetValue(V value)Sets the value of the entry, returning the previous valuebooleanskipLookup()default booleanundelete(boolean doUndelete)Deprecated.-
Methods inherited from interface org.infinispan.container.entries.metadata.MetadataAware
getMetadata, setMetadata
-
-
-
-
Method Detail
-
isNull
boolean isNull()
Tests whether the entry represents a null value, typically used for repeatable read.- Returns:
- true if this represents a null, false otherwise.
-
isChanged
boolean isChanged()
- Returns:
- true if this entry has changed since being read from the container, false otherwise.
-
isCreated
boolean isCreated()
- Returns:
- true if this entry has been newly created, false otherwise.
-
isRemoved
boolean isRemoved()
- Returns:
- true if this entry has been removed since being read from the container, false otherwise.
-
isEvicted
boolean isEvicted()
- Returns:
- true if this entry has been evicted since being read from the container, false otherwise.
-
isValid
@Deprecated default boolean isValid()
Deprecated.since 9.2
-
isLoaded
@Deprecated default boolean isLoaded()
Deprecated.since 8.1
-
getKey
K getKey()
Retrieves the key to this entry
-
getValue
V getValue()
Retrieves the value of this entry
-
getLifespan
long getLifespan()
- Returns:
- retrieves the lifespan of this entry. -1 means an unlimited lifespan.
-
getMaxIdle
long getMaxIdle()
- Returns:
- the maximum allowed time for which this entry can be idle, after which it is considered expired.
-
skipLookup
boolean skipLookup()
- Returns:
trueif the value must not be fetch from an external source
-
getCreated
default long getCreated()
- Returns:
- timestamp when the entry was created
-
getLastUsed
default long getLastUsed()
- Returns:
- timestamp when the entry was last used
-
commit
@Deprecated default void commit(DataContainer<K,V> container, Metadata metadata)
Deprecated.since 9.1Commits changes- Parameters:
container- data container to commit to
-
commit
void commit(DataContainer<K,V> container)
Commits changes- Parameters:
container- data container to commit to
-
rollback
@Deprecated default void rollback()
Deprecated.since 9.0Rolls back changes
-
setChanged
void setChanged(boolean changed)
-
setCreated
void setCreated(boolean created)
-
setRemoved
void setRemoved(boolean removed)
-
setEvicted
void setEvicted(boolean evicted)
-
setValid
@Deprecated default void setValid(boolean valid)
Deprecated.since 9.2
-
setLoaded
@Deprecated default void setLoaded(boolean loaded)
Deprecated.since 8.1
-
setSkipLookup
void setSkipLookup(boolean skipLookup)
SeeskipLookup().- Parameters:
skipLookup-
-
undelete
@Deprecated default boolean undelete(boolean doUndelete)
Deprecated.If the entry is marked as removed and doUndelete==true then the "valid" flag is set to true and "removed" flag is set to false.
-
clone
CacheEntry<K,V> clone()
-
setCreated
default void setCreated(long created)
-
setLastUsed
default void setLastUsed(long lastUsed)
-
-