Class CacheInfo

java.lang.Object
org.deltava.util.cache.CacheInfo
All Implemented Interfaces:
Serializable, Comparable<CacheInfo>, ViewEntry

public class CacheInfo extends Object implements Serializable, ViewEntry, Comparable<CacheInfo>
A bean to store information about a cache.
Since:
2.6
Version:
11.2
Author:
Luke
See Also:
  • Constructor Details

    • CacheInfo

      CacheInfo(String id, Cache<?> c, boolean getRemoteSize)
      Initializes the information bean from a Cache.
      Parameters:
      id - the Cache ID
      c - the Cache
      getRemoteSize - TRUE to fetch remote cache sizes, otherwise FALSE
    • CacheInfo

      public CacheInfo(String prefix, CacheInfo ci)
      Initializes the information bean from a CacheInfo bean. This is used when combining cache info from multiple web applications.
      Parameters:
      prefix - the prefix to prepend in front of the Cache ID
      ci - the CacheInfo bean
  • Method Details

    • getType

      public String getType()
      Returns the cache type.
      Returns:
      the type
    • getHits

      public long getHits()
      Returns the number of cache hits.
      Returns:
      the number of hits
    • getErrors

      public long getErrors()
      Returns the number of cache errors. This is typically only used in remote caches.
      Returns:
      the number of errors
    • getID

      public String getID()
      Returns the cache ID.
      Returns:
      the ID
    • getRequests

      public long getRequests()
      Returns the number of cache requests.
      Returns:
      the number of requests
    • getSize

      public long getSize()
      Returns the number of objects in the caches.
      Returns:
      the number of objects
    • getMaxSize

      public long getMaxSize()
      Returns the maximum size of the caches.
      Returns:
      the maximum number of objects
    • getIsRemote

      public boolean getIsRemote()
      Returns whether this is a remote cache.
      Returns:
      TRUE if remote, otherwise FALSE
    • getIsGeo

      public boolean getIsGeo()
      Returns whether this is a geolocation cache.
      Returns:
      TRUE if geolocation, otherwise FALSE
    • hashCode

      public int hashCode()
      Overrides:
      hashCode in class Object
    • compareTo

      public int compareTo(CacheInfo ci2)
      Specified by:
      compareTo in interface Comparable<CacheInfo>
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • getRowClassName

      public String getRowClassName()
      Description copied from interface: ViewEntry
      Returns the CSS class for this object if rendered in a view table.
      Specified by:
      getRowClassName in interface ViewEntry
      Returns:
      the CSS class name, or NULL if none