|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.altlinux.jabbix.JabbixMetric<T>
org.altlinux.jabbix.JabbixActiveMetric<T>
T
- the type of a metric valuepublic class JabbixActiveMetric<T>
A metric with additional information to be used for active metric reporting.
Constructor Summary | |
---|---|
JabbixActiveMetric(String key,
Class<T> type,
T value,
long period,
boolean active)
Creates a new active metric entry with the specified parameters. |
Method Summary | |
---|---|
int |
compareTo(Delayed o)
Indicates if the current metric is less than, equal to or greater than the given Delayed object. |
int |
compareTo(JabbixActiveMetric<?> m)
Indicates if the current metric is less than, equal to or greater than the given one. |
long |
getDelay(TimeUnit unit)
Returns the remaining time for the next refresh of the metric. |
Date |
getNextCheck()
Returns the date and time this metric value should be refreshed (on the target server). |
long |
getPeriod()
Returns the value refresh period (in milliseconds). |
Date |
getUpdated()
Indicates when (and whether) the metric value was updated. |
boolean |
isActive()
Indicates either the metric is "active". |
void |
setActive(boolean active)
Sets the metric "activity" status. |
Methods inherited from class org.altlinux.jabbix.JabbixMetric |
---|
equals, getKey, getValue, getValueType, toString, updateValue |
Methods inherited from class java.lang.Object |
---|
getClass, hashCode, notify, notifyAll, wait, wait, wait |
Constructor Detail |
---|
public JabbixActiveMetric(String key, Class<T> type, T value, long period, boolean active)
key
- the name of the metricperiod
- the refresh period in millisecondsactive
- the count-down statusMethod Detail |
---|
public boolean isActive()
getNextCheck()
property is non-null.
public void setActive(boolean active)
nextCheck
property is set to the sum of current time value and the
period value specified for the metric (
getPeriod()
). If the status of a metric
changes form active to inactive then the
nextCheck
is set to null. Otherwise the nextCheck
is leaved unchanged.
active
- the status value to be setpublic Date getNextCheck()
public long getPeriod()
public int compareTo(JabbixActiveMetric<?> m)
nextCheck
properties are
compared. Otherwise the active metric is always less that the inactive
one (so the inactive entries are always sit at the end of the queue).
m
- active metric to compare to
ActiveMetricTable
public long getDelay(TimeUnit unit)
nextCheck
value is not set) then the maximal long value
Long.MAX_VALUE
is returned. Otherwise the difference between
current time and nextCheck
value is returned represented in the specified units.
getDelay
in interface Delayed
public int compareTo(Delayed o)
Delayed
object. Active metric objects are compared
using the compareTo(JabbixActiveMetric)
method. If the given object is not an active metric then the metric is
supposed to be less (sooner) than the given object.
compareTo
in interface Comparable<Delayed>
o
- the object to compare to
public Date getUpdated()
JabbixMetric.updateValue(java.lang.Object)
|
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |