java.lang.Object | |
↳ | com.microstrategy.utils.cache.SimpleHint |
![]() |
![]() |
SimpleHint
is an implementation of the CacheHint
interface. It maintains a Map
of cache state IDs keyed by
cache names, and provides methods to save and restore this class
(see getState()
and restoreState(String)
).
The SimpleHint
can be used the Cache key as well.
It overrides the equals and hashCode methods so the hint becomes the id
of the element.
[Expand]
Inherited Fields | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() |
Public Constructors | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
SimpleHint(String str) | |||||||||||
SimpleHint() |
Public Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
boolean | equals(Object obj) | ||||||||||
Long |
getCacheStateId(String name)
Returns a value for the current state of the cache hint
This value is used in maintaining cache consistency across different caches
using the same hint object (for instance, session based cache across a web cluster where each
machine in the cluster holds a copy of the cache)
Whenever a change is made to the cached value in one cache, the stateId is incremented
| ||||||||||
Map | getCacheStates() | ||||||||||
String | getHint() | ||||||||||
String |
getState()
Used for persisting cache update counts.
| ||||||||||
int | hashCode() | ||||||||||
void |
restoreState(String state)
Restore cache update counts.
| ||||||||||
void |
setCacheStateId(String name, Long stateId)
Sets the stateId - see
getCacheStateId(String) . | ||||||||||
String | toString() |
Protected Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
void | setHint(String str) |
[Expand]
Inherited Methods | |||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|
![]() | |||||||||||
![]() |
Returns a value for the current state of the cache hint This value is used in maintaining cache consistency across different caches using the same hint object (for instance, session based cache across a web cluster where each machine in the cluster holds a copy of the cache) Whenever a change is made to the cached value in one cache, the stateId is incremented
name | cache name |
---|
Used for persisting cache update counts.
Restore cache update counts.
state | A String representation of the state of this hint to restore. |
---|
Sets the stateId - see getCacheStateId(String)
.
name | cache name |
---|---|
stateId | new cache state id |