Package org.infinispan.container.entries
Class ClearCacheEntry<K,V>
- java.lang.Object
-
- org.infinispan.container.entries.ClearCacheEntry<K,V>
-
- All Implemented Interfaces:
Cloneable
,Map.Entry<K,V>
,CacheEntry<K,V>
,MetadataAware
public class ClearCacheEntry<K,V> extends Object implements CacheEntry<K,V>
Used inClearInvocationContext
to process theClearCommand
.- Since:
- 7.2
- Author:
- Pedro Ruivo
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description CacheEntry<K,V>
clone()
void
commit(DataContainer<K,V> container)
Commits changesstatic <K,V>
ClearCacheEntry<K,V>getInstance()
K
getKey()
Retrieves the key to this entrylong
getLifespan()
long
getMaxIdle()
Metadata
getMetadata()
Get metadata of this cache entry.V
getValue()
Retrieves the value of this entryboolean
isChanged()
boolean
isCreated()
boolean
isEvicted()
boolean
isNull()
Tests whether the entry represents a null value, typically used for repeatable read.boolean
isRemoved()
void
setChanged(boolean changed)
void
setCreated(boolean created)
void
setEvicted(boolean evicted)
void
setMetadata(Metadata metadata)
Set the metadata in the cache entry.void
setRemoved(boolean removed)
void
setSkipLookup(boolean skipLookup)
V
setValue(V value)
Sets the value of the entry, returning the previous valueboolean
skipLookup()
String
toString()
-
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface org.infinispan.container.entries.CacheEntry
commit, getCreated, getLastUsed, isLoaded, isValid, rollback, setCreated, setLastUsed, setLoaded, setValid, undelete
-
-
-
-
Method Detail
-
getInstance
public static <K,V> ClearCacheEntry<K,V> getInstance()
-
isNull
public boolean isNull()
Description copied from interface:CacheEntry
Tests whether the entry represents a null value, typically used for repeatable read.- Specified by:
isNull
in interfaceCacheEntry<K,V>
- Returns:
- true if this represents a null, false otherwise.
-
isChanged
public boolean isChanged()
- Specified by:
isChanged
in interfaceCacheEntry<K,V>
- Returns:
- true if this entry has changed since being read from the container, false otherwise.
-
setChanged
public void setChanged(boolean changed)
- Specified by:
setChanged
in interfaceCacheEntry<K,V>
-
isCreated
public boolean isCreated()
- Specified by:
isCreated
in interfaceCacheEntry<K,V>
- Returns:
- true if this entry has been newly created, false otherwise.
-
setCreated
public void setCreated(boolean created)
- Specified by:
setCreated
in interfaceCacheEntry<K,V>
-
isRemoved
public boolean isRemoved()
- Specified by:
isRemoved
in interfaceCacheEntry<K,V>
- Returns:
- true if this entry has been removed since being read from the container, false otherwise.
-
setRemoved
public void setRemoved(boolean removed)
- Specified by:
setRemoved
in interfaceCacheEntry<K,V>
-
isEvicted
public boolean isEvicted()
- Specified by:
isEvicted
in interfaceCacheEntry<K,V>
- Returns:
- true if this entry has been evicted since being read from the container, false otherwise.
-
setEvicted
public void setEvicted(boolean evicted)
- Specified by:
setEvicted
in interfaceCacheEntry<K,V>
-
getKey
public K getKey()
Description copied from interface:CacheEntry
Retrieves the key to this entry
-
getValue
public V getValue()
Description copied from interface:CacheEntry
Retrieves the value of this entry
-
getLifespan
public long getLifespan()
- Specified by:
getLifespan
in interfaceCacheEntry<K,V>
- Returns:
- retrieves the lifespan of this entry. -1 means an unlimited lifespan.
-
getMaxIdle
public long getMaxIdle()
- Specified by:
getMaxIdle
in interfaceCacheEntry<K,V>
- Returns:
- the maximum allowed time for which this entry can be idle, after which it is considered expired.
-
skipLookup
public boolean skipLookup()
- Specified by:
skipLookup
in interfaceCacheEntry<K,V>
- Returns:
true
if the value must not be fetch from an external source
-
setValue
public V setValue(V value)
Description copied from interface:CacheEntry
Sets the value of the entry, returning the previous value
-
commit
public void commit(DataContainer<K,V> container)
Description copied from interface:CacheEntry
Commits changes- Specified by:
commit
in interfaceCacheEntry<K,V>
- Parameters:
container
- data container to commit to
-
setSkipLookup
public void setSkipLookup(boolean skipLookup)
Description copied from interface:CacheEntry
- Specified by:
setSkipLookup
in interfaceCacheEntry<K,V>
-
clone
public CacheEntry<K,V> clone()
-
getMetadata
public Metadata getMetadata()
Description copied from interface:MetadataAware
Get metadata of this cache entry.- Specified by:
getMetadata
in interfaceMetadataAware
- 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
-
-