stella.nut
Class UpsDriver.UpsRefresh

java.lang.Object
  extended by java.util.TimerTask
      extended by stella.nut.UpsDriver.UpsRefresh
All Implemented Interfaces:
Runnable
Enclosing class:
UpsDriver

private class UpsDriver.UpsRefresh
extends TimerTask

The task that queries the UPS demon for all served variables at certain time intervalls. The server, too, uses caching, which implies that the values are never totally up-to-date, but on the other hand reading is quick.


Field Summary
private  Map<String,String> cache
          The cache I serve.
 
Constructor Summary
private UpsDriver.UpsRefresh(Map<String,String> variables)
          Constructs a new refresh task where the cache to write the values to is specified.
 
Method Summary
 void run()
          Run the refresh task.
 
Methods inherited from class java.util.TimerTask
cancel, scheduledExecutionTime
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

cache

private Map<String,String> cache
The cache I serve.

Constructor Detail

UpsDriver.UpsRefresh

private UpsDriver.UpsRefresh(Map<String,String> variables)
Constructs a new refresh task where the cache to write the values to is specified. Variable names are the keys in the map.

Method Detail

run

public void run()
Run the refresh task. For each key found in the cache we issue a GET VAR and parse the response according to VAR "".

Specified by:
run in interface Runnable
Specified by:
run in class TimerTask