Interface HistoryMBean
- All Known Implementing Classes:
History
public interface HistoryMBean
JMX interface for the history store
- Since:
- 11.06.13
- Author:
- roland
-
Field Summary
Fields -
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) Deprecated.use insteadvoidsetHistoryEntriesForOperation(String pMBean, String pOperation, String pTarget, int pMaxEntries) Deprecated.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, JSONObject pJson) Update the history store with the value of an an read, write or execute operation.
-
Field Details
-
OBJECT_NAME
- See Also:
-
-
Method Details
-
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. This operation must be called only internally.- Parameters:
pJmxReq- request for which an entry should be added in this history storepJson- the JSONObject to which to add the history.
-
setHistoryEntriesForAttribute
void setHistoryEntriesForAttribute(String pMBean, String pAttribute, String pPath, String pTarget, int pMaxEntries) throws MalformedObjectNameException Deprecated.use insteadSwitch on history tracking for a specific attribute. IfpMaxEntriesis 0 history tracking is switched off.- 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
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.- 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
void setHistoryEntriesForOperation(String pMBean, String pOperation, String pTarget, int pMaxEntries) throws MalformedObjectNameException Deprecated.Switch on history tracking for an operation. IfpMaxEntriesis 0 history tracking is switched off. The return value of the operation will be tracked.- 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
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.- 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
void resetHistoryEntries()Remove all history entries and switch off history tracking globally. -
getHistorySize
Get the size in bytes which the history mechanism requires in total if serialized.- Returns:
- size of the complete history in bytes
- Throws:
IOException- if serialization (which is required for the size determination) fails.
-
getHistoryMaxEntries
int getHistoryMaxEntries()Number of global limit for history entries. No attribute historization can exceed this limit (i.e if insetHistoryLimitForAttribute(String, String, String, String, int, long)thepMaxEntriesis set larger than this limit, the global limit will be taken}- Returns:
- the global history limit
-
setHistoryMaxEntries
void setHistoryMaxEntries(int pLimit) Set the global history limit- Parameters:
pLimit- limit to set
-