Package org.jolokia.service.history
Class HistoryLimit
java.lang.Object
org.jolokia.service.history.HistoryLimit
- All Implemented Interfaces:
Serializable
Helper class used for specifying history entry limits
- Since:
- 05.03.12
- Author:
- roland
- See Also:
-
Constructor Summary
ConstructorsConstructorDescriptionHistoryLimit(int pMaxEntries, long pMaxDuration) Create a limit with either or both maxEntries and maxDuration set -
Method Summary
Modifier and TypeMethodDescriptionlongintrespectGlobalMaxEntries(int pGlobalMaxEntries) Return a limit whose max entries are smaller or equals the given upper limit.toString()
-
Constructor Details
-
HistoryLimit
public HistoryLimit(int pMaxEntries, long pMaxDuration) Create a limit with either or both maxEntries and maxDuration set- Parameters:
pMaxEntries- maximum number of entries to keeppMaxDuration- maximum duration for entries to keep (in seconds)
-
-
Method Details
-
getMaxEntries
public int getMaxEntries() -
getMaxDuration
public long getMaxDuration() -
respectGlobalMaxEntries
Return a limit whose max entries are smaller or equals the given upper limit. For effieciency reasons, this object's state might change with this method (i.e. the maxEntry number might be set or decreased)- Parameters:
pGlobalMaxEntries- upper limit- Returns:
- this if this limit already is below the upper limit or a new limit which lies in this limit
-
toString
-