java.lang.Cloneable
public class CacheItem
extends java.lang.Object
implements java.lang.Cloneable
Constructor | Description |
---|---|
CacheItem() |
Initialize new instance of cache item.
|
CacheItem(java.lang.Object value) |
Initialize new instance of cache item.
|
Modifier and Type | Method | Description |
---|---|---|
void |
addCacheDataNotificationListener(CacheDataModificationListener listener,
java.util.EnumSet<EventType> eventType,
EventDataFilter datafilter) |
You can use this to notify applications when their objects are updated or removed in the cache.
|
java.lang.Object |
clone() |
Creates a shallow copy of CacheItem
|
CacheItemPriority |
getCacheItemPriority() |
Gets the relative priority for cache item which is kept under consideration whenever cache starts to free up space and evicts items.
|
CacheItemVersion |
getCacheItemVersion() |
Gets the version associated with the cache item.Version is basically a numeric value that is used to represent the version of the cached item which changes
with every update to an item.
|
java.util.Date |
getCreationTime() |
Gets the time when the item was added in cache for the first time.
|
CacheDependency |
getDependency() |
Gets the Cache Dependency instance that contains all dependencies associated with cache item.
|
Expiration |
getExpiration() |
Gets the expiration mechanism for cache item.
|
java.lang.String |
getGroup() |
Gets the group associated with the cache item.
|
java.util.Date |
getLastModifiedTime() |
Gets the lastModifiedTime of the cache item.CacheItem stores the last modified time of the cache item.
|
NamedTagsDictionary |
getNamedTags() |
Gets the NamedTags information associated with the cache item, it can be queried on the basis of NamedTags provided.
|
ResyncOptions |
getResyncOptions() |
Gets the ResyncOptions specific to the cache item.
|
CacheSyncDependency |
getSyncDependency() |
Synchronizes two separate caches so that an item updated or removed from one cache can
have the same effect on the synchronized cache.
|
java.util.List<Tag> |
getTags() |
Gets the tags information associated with the cache item, it can be queried on the basis of Tags provided.
|
<T> T |
getValue(java.lang.Class<?> cls) |
Returns the value stored in the cache item.
|
void |
removeCacheDataNotificationListener(CacheDataModificationListener listener,
java.util.EnumSet<EventType> eventEnumSet) |
Unregisters the user from cache data modification notifications.
|
void |
setCacheItemPriority(CacheItemPriority value) |
Sets the relative priority for cache item which is kept under consideration whenever cache starts to free up space and evicts items.
|
void |
setCacheItemVersion(CacheItemVersion value) |
Sets the version associated with the cache item.Version is basically a numeric value that is used to represent the version of the cached item which changes
with every update to an item.
|
void |
setDependency(CacheDependency value) |
Sets the Cache Dependency instance that contains all dependencies associated with cache item.
|
void |
setExpiration(Expiration value) |
Sets the expiration mechanism for cache item.
|
void |
setGroup(java.lang.String value) |
Sets the group associated with the cache item.
|
void |
setNamedTags(NamedTagsDictionary value) |
Sets the NamedTags information associated with the cache item, it can be queried on the basis of NamedTags provided.
|
void |
setResyncOptions(ResyncOptions value) |
Sets the ResyncOptions specific to the cache item.
|
void |
setSyncDependency(CacheSyncDependency value) |
Synchronizes two separate caches so that an item updated or removed from one cache can
have the same effect on the synchronized cache.
|
void |
setTags(java.util.List<Tag> value) |
Sets the tags information associated with the cache item, it can be queried on the basis of Tags provided.
|
void |
setValue(java.lang.Object value) |
Sets the value of the cache item.
|
public CacheItem()
public CacheItem(java.lang.Object value)
value
- Actual object to be stored in cache.public final Expiration getExpiration()
Expiration
instance that contains info about cache item expiration mechanism.public final void setExpiration(Expiration value)
value
- Expiration object that specifies the expiration mechanism for cache item.public final CacheItemPriority getCacheItemPriority()
public final void setCacheItemPriority(CacheItemPriority value)
value
- CacheItemPriority to be associated with cache item.public final CacheItemVersion getCacheItemVersion()
public final void setCacheItemVersion(CacheItemVersion value)
value
- The version to be associated with the cache itempublic final java.util.Date getCreationTime()
public final java.util.Date getLastModifiedTime()
public final java.util.List<Tag> getTags()
public final void setTags(java.util.List<Tag> value)
value
- List of Tags to be associated with cache item.public final NamedTagsDictionary getNamedTags()
public final void setNamedTags(NamedTagsDictionary value)
value
- NamedTags to be associated with cache item.public final ResyncOptions getResyncOptions()
public final void setResyncOptions(ResyncOptions value)
value
- ResyncOptions specific to the cache item.public final java.lang.String getGroup()
public final void setGroup(java.lang.String value)
value
- The group to be associated with cache item.public final CacheSyncDependency getSyncDependency()
public final void setSyncDependency(CacheSyncDependency value)
value
- CacheSyncDependency to be associated with cache item.public final CacheDependency getDependency()
public final void setDependency(CacheDependency value)
value
- The Cache Dependency instance to be associated with cache item.public final void addCacheDataNotificationListener(CacheDataModificationListener listener, java.util.EnumSet<EventType> eventType, EventDataFilter datafilter)
listener
- Listener to be raised when an item is updated or removed.eventType
- Event type/types the listener is registered against.datafilter
- Tells whether to receive metadata, data with metadata or none when a notification is triggered.public void removeCacheDataNotificationListener(CacheDataModificationListener listener, java.util.EnumSet<EventType> eventEnumSet)
listener
- The listener that is registered for notifications.eventEnumSet
- Event type/types the listener is unregistered against.public final <T> T getValue(java.lang.Class<?> cls) throws OperationFailedException
T
- Specifies the type of value obtained from the cache item.cls
- Specifies the class of value obtained from the cache item.OperationFailedException
public void setValue(java.lang.Object value)
value
- object to be stored in cache item.public final java.lang.Object clone()
clone
in class java.lang.Object