Class SimpleHint

  • All Implemented Interfaces:
    CacheHint
    Direct Known Subclasses:
    ConfigurationFilesCache.ConfigurationFileCacheHint, ResourceCacheHint

    public class SimpleHint
    extends java.lang.Object
    implements CacheHint
    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.
    Since:
    MicroStrategy Web 7.3.1 or earlier
    • Constructor Summary

      Constructors 
      Constructor Description
      SimpleHint()  
      SimpleHint​(java.lang.String str)  
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      boolean equals​(java.lang.Object obj)  
      java.lang.Long getCacheStateId​(java.lang.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
      java.util.Map getCacheStates()  
      java.lang.String getHint()  
      java.lang.String getState()
      Used for persisting cache update counts.
      int hashCode()  
      void restoreState​(java.lang.String state)
      Restore cache update counts.
      void setCacheStateId​(java.lang.String name, java.lang.Long stateId)
      Sets the stateId - see CacheHint.getCacheStateId(String).
      protected void setHint​(java.lang.String str)  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, notify, notifyAll, wait, wait, wait
    • Constructor Detail

      • SimpleHint

        public SimpleHint​(java.lang.String str)
      • SimpleHint

        public SimpleHint()
    • Method Detail

      • getHint

        public java.lang.String getHint()
      • setHint

        protected void setHint​(java.lang.String str)
        Since:
        MicroStrategy Web 9.0.0
      • getState

        public java.lang.String getState()
        Used for persisting cache update counts.
        Returns:
        A String representation of the hint.
      • restoreState

        public void restoreState​(java.lang.String state)
        Restore cache update counts.
        Parameters:
        state - A String representation of the state of this hint to restore.
      • toString

        public java.lang.String toString()
        Overrides:
        toString in class java.lang.Object
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class java.lang.Object
      • getCacheStateId

        public java.lang.Long getCacheStateId​(java.lang.String name)
        Description copied from interface: CacheHint
        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
        Specified by:
        getCacheStateId in interface CacheHint
        Parameters:
        name - cache name
        Returns:
        current state of the cache hint
        See Also:
        CacheHint.getCacheStateId(String)
      • getCacheStates

        public java.util.Map getCacheStates()