|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectorg.altlinux.jabbix.ActiveMetricTable
public class ActiveMetricTable
An updatable queue of JabbixActiveMetric entries with an expiration
period for the whole queue. The refreshPeriod property and the getDelay(TimeUnit)
method of the Delayed interface can be used to
set and track the expiration date of the queue. As the information for
the active checks is server-originated it is provident to make
periodical updates for the set of active metric objects not to run out
of date.
| Constructor Summary | |
|---|---|
ActiveMetricTable(long refreshPeriod)
Creates the table with the specified expiration period. |
|
| Method Summary | |
|---|---|
int |
compareTo(ActiveMetricTable a)
Indicates if the current table is less than, equal to or greater than the given one. |
int |
compareTo(Delayed o)
Indicates if the current table is less than, equal to or greater than the given Delayed object. |
long |
getDelay(TimeUnit unit)
Returns the remaining time for the queue data assumed to be fresh. |
Date |
getNextRefresh()
Returns the queue expiration date and time. |
DelayQueue<JabbixActiveMetric<?>> |
getQueue()
Returns the queue with the active metric objects placed in accordance with their expiration dates. |
long |
getRefreshPeriod()
Returns the refresh period of the queue. |
boolean |
isExpired()
Indicates whether the queue data is expired. |
void |
setRefreshPeriod(long refreshPeriod)
Sets the refresh period for the whole queue to the specified value. |
void |
updateMetric(JabbixActiveMetric<?> freshMetric)
Adds the given metric to the queue. |
| Methods inherited from class java.lang.Object |
|---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public ActiveMetricTable(long refreshPeriod)
refreshPeriod - the queue expiration period| Method Detail |
|---|
public void updateMetric(JabbixActiveMetric<?> freshMetric)
updateMetric in interface MetricTable<JabbixActiveMetric<?>>freshMetric - a metric to addJabbixMetric.equals(Object)public void setRefreshPeriod(long refreshPeriod)
nextRefresh value is set in
accordance with the old value or the current system time.
If the given value is 0 then the nextRefresh value is set to null
and no periodical refreshes of the table are provided.
refreshPeriod - the refresh period in millisecondspublic long getRefreshPeriod()
public Date getNextRefresh()
public boolean isExpired()
public long getDelay(TimeUnit unit)
getDelay in interface Delayedpublic int compareTo(Delayed o)
Delayed object. Tables are compared using the
compareTo(ActiveMetricTable) method. If the
given object is not a table then the table is supposed to be less
(sooner) than the given object.
compareTo in interface Comparable<Delayed>o - the object to compare to
public int compareTo(ActiveMetricTable a)
nextCheck properties of the
tables.
a - another table to compare with
public DelayQueue<JabbixActiveMetric<?>> getQueue()
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||