Package org.jolokia.service.history
Class History
java.lang.Object
org.jolokia.service.history.History
- All Implemented Interfaces:
HistoryMBean
MBean for exporting various configuration tuning opportunities
to the outside world.
- Since:
- Jun 12, 2009
- Author:
- roland
-
Field Summary
Fields inherited from interface org.jolokia.service.history.HistoryMBean
OBJECT_NAME -
Constructor Summary
ConstructorsConstructorDescriptionHistory(HistoryStore pStore) Constructor with the configurable objects as parameters. -
Method Summary
Modifier and TypeMethodDescriptionintNumber of global limit for history entries.intGet the size in bytes which the history mechanism requires in total if serialized.voidRemove all history entries and switch off history tracking globally.voidsetHistoryEntriesForAttribute(String pMBean, String pAttribute, String pPath, String pTarget, int pMaxEntries) Switch on history tracking for a specific attribute.voidsetHistoryEntriesForOperation(String pMBean, String pOperation, String pTarget, int pMaxEntries) Switch on history tracking for an operation.voidsetHistoryLimitForAttribute(String pMBean, String pAttribute, String pPath, String pTarget, int pMaxEntries, long pMaxDuration) Switch on history tracking for a specific attribute.voidsetHistoryLimitForOperation(String pMBean, String pOperation, String pTarget, int pMaxEntries, long pMaxDuration) Switch on history tracking for an operation.voidsetHistoryMaxEntries(int pLimit) Set the global history limitvoidupdateAndAdd(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.
-
Constructor Details
-
History
Constructor with the configurable objects as parameters.- Parameters:
pStore- history store where to hold historical values
-
-
Method Details
-
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. This operation must be called only internally.- Specified by:
updateAndAddin interfaceHistoryMBean- Parameters:
pJmxReq- request for which an entry should be added in this history storepJson- the JSONObject to which to add the history.
-
setHistoryEntriesForAttribute
public void setHistoryEntriesForAttribute(String pMBean, String pAttribute, String pPath, String pTarget, int pMaxEntries) throws MalformedObjectNameException Switch on history tracking for a specific attribute. IfpMaxEntriesis 0 history tracking is switched off.- Specified by:
setHistoryEntriesForAttributein interfaceHistoryMBean- Parameters:
pMBean- MBean object namepAttribute- attribute namepPath- inner path (optional)pTarget- remote target or null for a local mbeanpMaxEntries- max last entries to remember, if 0 history tracking is switched off.- Throws:
MalformedObjectNameException- if the given name is not proper object name
-
setHistoryLimitForAttribute
public void setHistoryLimitForAttribute(String pMBean, String pAttribute, String pPath, String pTarget, int pMaxEntries, long pMaxDuration) throws MalformedObjectNameException Switch on history tracking for a specific attribute. IfpMaxEntriesandpMaxDurationis 0 then history tracking is switched off. If eitherpMaxEntriesorpMaxDuration0, then the given limit applies. If both are != 0, then both limits are applied simultaneously.- Specified by:
setHistoryLimitForAttributein interfaceHistoryMBean- Parameters:
pMBean- MBean object namepAttribute- attribute namepPath- inner path (optional)pTarget- remote target or null for a local mbeanpMaxEntries- max last entries to remember, if 0 history tracking is switched off.pMaxDuration- maximum duration the maximum duration for how long to keep a value (in seconds)- Throws:
MalformedObjectNameException- if the given name is not proper object name
-
setHistoryEntriesForOperation
public void setHistoryEntriesForOperation(String pMBean, String pOperation, String pTarget, int pMaxEntries) throws MalformedObjectNameException Switch on history tracking for an operation. IfpMaxEntriesis 0 history tracking is switched off. The return value of the operation will be tracked.- Specified by:
setHistoryEntriesForOperationin interfaceHistoryMBean- Parameters:
pMBean- MBean object namepOperation- operation to trackpTarget- remote target or null for a loal mbeanpMaxEntries- max last entries to remember, if 0 history tracking is switched off.- Throws:
MalformedObjectNameException
-
setHistoryLimitForOperation
public void setHistoryLimitForOperation(String pMBean, String pOperation, String pTarget, int pMaxEntries, long pMaxDuration) throws MalformedObjectNameException Switch on history tracking for an operation. IfpMaxEntriesand pMaxDuration is 0 history tracking is switched off. The return value of the operation will be tracked. If eitherpMaxEntriesorpMaxDuration0, then the given limit applies. If both are != 0, then both limits are applied simultaneously.- Specified by:
setHistoryLimitForOperationin interfaceHistoryMBean- Parameters:
pMBean- MBean object namepOperation- operation to trackpTarget- remote target or null for a loal mbeanpMaxEntries- max last entries to remember, if 0 history tracking is switched off.pMaxDuration- maximum duration the maximum duration for how long to keep a value (in seconds)- Throws:
MalformedObjectNameException
-
resetHistoryEntries
public void resetHistoryEntries()Remove all history entries and switch off history tracking globally.- Specified by:
resetHistoryEntriesin interfaceHistoryMBean
-
getHistoryMaxEntries
public int getHistoryMaxEntries()Number of global limit for history entries. No attribute historization can exceed this limit (i.e if inHistoryMBean.setHistoryLimitForAttribute(String, String, String, String, int, long)thepMaxEntriesis set larger than this limit, the global limit will be taken}- Specified by:
getHistoryMaxEntriesin interfaceHistoryMBean- Returns:
- the global history limit
-
setHistoryMaxEntries
public void setHistoryMaxEntries(int pLimit) Set the global history limit- Specified by:
setHistoryMaxEntriesin interfaceHistoryMBean- Parameters:
pLimit- limit to set
-
getHistorySize
public int getHistorySize()Get the size in bytes which the history mechanism requires in total if serialized.- Specified by:
getHistorySizein interfaceHistoryMBean- Returns:
- size of the complete history in bytes
-