Class HistoryStore

java.lang.Object
org.jolokia.service.history.HistoryStore

public class HistoryStore extends Object
Store for remembering values which has been fetched through a previous request.
Since:
Jun 12, 2009
Author:
roland
  • Constructor Summary

    Constructors
    Constructor
    Description
    HistoryStore(int pTotalMaxEntries)
    Constructor for a history store
  • Method Summary

    Modifier and Type
    Method
    Description
    void
    configure(HistoryKey pKey, HistoryLimit pHistoryLimit)
    Configure the history length for a specific entry.
    int
    Get the maximum number of entries stored.
    int
    Get the size of this history store in bytes
    void
    Reset the complete store.
    void
    setGlobalMaxEntries(int pGlobalMaxEntries)
    Set the global maximum limit for history entries.
    void
    updateAndAdd(org.jolokia.server.core.request.JolokiaRequest pJmxReq, org.jolokia.json.JSONObject pJson)
    Update the history store with the value of an an read, write or execute operation.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • HistoryStore

      public HistoryStore(int pTotalMaxEntries)
      Constructor for a history store
      Parameters:
      pTotalMaxEntries - number of entries to hold at max. Even when configured, this maximum can not be overwritten. This is a hard limit.
  • Method Details

    • getGlobalMaxEntries

      public int getGlobalMaxEntries()
      Get the maximum number of entries stored.
      Returns:
      the maximum number of entries
    • setGlobalMaxEntries

      public void setGlobalMaxEntries(int pGlobalMaxEntries)
      Set the global maximum limit for history entries.
      Parameters:
      pGlobalMaxEntries - limit
    • configure

      public void configure(HistoryKey pKey, HistoryLimit pHistoryLimit)
      Configure the history length for a specific entry. If the length is 0 disable history for this key. Please note, that this method might change the limit object so the ownership of this object goes over to the callee.
      Parameters:
      pKey - history key
      pHistoryLimit - limit to apply or null if no history should be recored for this entry
    • reset

      public void reset()
      Reset the complete store.
    • updateAndAdd

      public void updateAndAdd(org.jolokia.server.core.request.JolokiaRequest pJmxReq, org.jolokia.json.JSONObject pJson)
      Update the history store with the value of an an read, write or execute operation. Also, the timestamp of the insertion is recorded. Also, the recorded history values are added to the given json value.
      Parameters:
      pJmxReq - request for which an entry should be added in this history store
      pJson - the JSONObject to which to add the history.
    • getSize

      public int getSize()
      Get the size of this history store in bytes
      Returns:
      size in bytes