Class HistoryStore
java.lang.Object
org.jolokia.service.history.HistoryStore
Store for remembering values which has been fetched through a previous
request.
- Since:
- Jun 12, 2009
- Author:
- roland
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidconfigure(HistoryKey pKey, HistoryLimit pHistoryLimit) Configure the history length for a specific entry.intGet the maximum number of entries stored.intgetSize()Get the size of this history store in bytesvoidreset()Reset the complete store.voidsetGlobalMaxEntries(int pGlobalMaxEntries) Set the global maximum limit for history entries.voidupdateAndAdd(org.jolokia.server.core.request.JolokiaRequest pJmxReq, JSONObject pJson) Update the history store with the value of an an read, write or execute operation.
-
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
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 keypHistoryLimit- limit to apply ornullif no history should be recored for this entry
-
reset
public void reset()Reset the complete store. -
updateAndAdd
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 storepJson- 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
-