stella.sensor
Class WeatherTrigger

java.lang.Object
  extended by util.PropertyContainer
      extended by util.PropertyResources
          extended by util.PropertyBundles
              extended by stella.parameter.AbstractParameter
                  extended by stella.parameter.AbstractRemoteParameter
                      extended by stella.parameter.AbstractRemoteTrigger
                          extended by stella.sensor.WeatherTrigger
All Implemented Interfaces:
Cloneable, Remote, Parameter, RemoteParameter, RemoteTrigger, Trigger, WeatherDependingParameter, ExitCleaning, Initializable, LocalizedSupplying, PropertySupplying, ResourceSupplying, RmiCaster

public class WeatherTrigger
extends AbstractRemoteTrigger
implements WeatherDependingParameter

The weather trigger exports the weather from a local WeatherSurveying instance to remote listeners.


Nested Class Summary
 
Nested classes/interfaces inherited from class util.PropertyResources
PropertyResources.URLResource
 
Field Summary
private  WeatherSurveying station
          Normal action will register a weather station after construct.
 
Fields inherited from class stella.parameter.AbstractRemoteParameter
DEFBIND, KEY_BIND
 
Fields inherited from class stella.parameter.AbstractParameter
KEY_FORMAT, KEY_NAME, KEY_PRESERVE, UNKNOWN
 
Fields inherited from class util.PropertyBundles
KEY_LOCALECOUNTRY, KEY_LOCALELANGUAGE, KEY_RESOURCEBUNDLES
 
Fields inherited from class util.PropertyResources
KEY_NOINITONCREATE, localurl, locate, POSTFIX_DIR, POSTFIX_EXT, POSTFIX_FILE, POSTFIX_LIST, POSTFIX_URL, urlset
 
Fields inherited from class util.PropertyContainer
KEY_LISTSEPARATOR, KEY_MAPKEYVALUECHAR, KEY_MAPSEPARATOR
 
Fields inherited from interface util.PropertySupplying
CONFIG, KEY_CLASS
 
Fields inherited from interface stella.rmi.RemoteTrigger
NAMING_EXTENSION
 
Fields inherited from interface util.ResourceSupplying
KEY_URLRESOURCES, KEY_URLUSECONFIG, KEY_URLUSECURRENT, KEY_URLUSEHOME
 
Constructor Summary
WeatherTrigger(Map prop)
          Constructs a enw weather trigger.
 
Method Summary
 Object get()
          Diverts to #getFor with the currently registered weather station.
 long getElapsedToggleTime()
          Returns the time elapsed since the last toggle event.
 Object getForWeather(WeatherSurveying weather)
          Returns true if the weather is clear according to the weather station handed over.
 Date getLastToggleTime()
          Returns the last toggle time of the weather station if registered.
 Boolean getTrigger()
          Gets the value of this parameter.
 boolean isTrue()
          Shortcut to getTrigger().
 void registerWeather(WeatherSurveying operator)
          Sets the roof operator where queries are diverted to.
 Object set(Object newval)
          Not allowed.
 Boolean setTrigger(Boolean newval)
          Not allowed.
 Boolean toggleTrigger()
          Not allowed.
 
Methods inherited from class stella.parameter.AbstractRemoteTrigger
remoteGetTrigger, remoteIsTrue, remoteToggleTime
 
Methods inherited from class stella.parameter.AbstractRemoteParameter
addRmiListener, bindToRegistry, exit, init, isValid, remoteGet, removeRmiListener, rescanned, unbindFromRegistry
 
Methods inherited from class stella.parameter.AbstractParameter
createParameter, delivers, getFormatted, getFormatted, getName, getPreserveFile, getString, getString, register, setName, toString
 
Methods inherited from class util.PropertyBundles
clone, getLocalized, getLocalized, getLocalizedString, getLocalizedString, loadResource
 
Methods inherited from class util.PropertyResources
createFrom, createFrom, createFrom, getApplet, getAsResources, getLocalClassLoader, getPropertiesToKey, getPropertiesToKey, getResource, getResourceAsStream, getResourceFromKey, getResources, keyCreate, keyCreate, reload, setApplet
 
Methods inherited from class util.PropertyContainer
augment, augment, augment, defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsEnums, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, isNew, parseObject, reload, removeProperty, setObject, setProperties, setProperty, stringProperties
 
Methods inherited from class java.lang.Object
equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface stella.Parameter
getFormatted, getName, getString
 
Methods inherited from interface util.PropertySupplying
defaultBoolean, defaultChar, defaultDouble, defaultFloat, defaultInt, defaultLong, defaultObject, defaultObject, defaultProperties, defaultProperty, getAsBoolean, getAsChar, getAsDouble, getAsFloat, getAsInt, getAsList, getAsLong, getAsMap, getAsObject, getAsObject, getProperties, getProperty, has, parseObject, removeProperty, setObject, setProperty, stringProperties
 
Methods inherited from interface util.Initializable
init
 
Methods inherited from interface stella.rmi.RemoteParameter
addRmiListener, remoteGet, removeRmiListener
 
Methods inherited from interface util.rmi.RmiCaster
bindToRegistry, isValid, unbindFromRegistry
 
Methods inherited from interface util.ResourceSupplying
getResource, getResourceAsStream, getResources
 

Field Detail

station

private WeatherSurveying station
Normal action will register a weather station after construct.

Constructor Detail

WeatherTrigger

public WeatherTrigger(Map prop)
               throws RemoteException
Constructs a enw weather trigger. It can be queried only after a weather station has been registered.

Throws:
RemoteException
Method Detail

registerWeather

public void registerWeather(WeatherSurveying operator)
Sets the roof operator where queries are diverted to.

Specified by:
registerWeather in interface WeatherDependingParameter

getForWeather

public Object getForWeather(WeatherSurveying weather)
Returns true if the weather is clear according to the weather station handed over.

Specified by:
getForWeather in interface WeatherDependingParameter

get

public Object get()
Diverts to #getFor with the currently registered weather station.

Specified by:
get in interface Parameter

getTrigger

public Boolean getTrigger()
Gets the value of this parameter. Depending on the #KEY_FLAVOR of the trigger, either the operators is open or is closed method is queried.

Specified by:
getTrigger in interface Trigger

isTrue

public boolean isTrue()
Shortcut to getTrigger().

Specified by:
isTrue in interface Trigger

set

public Object set(Object newval)
Not allowed.

Specified by:
set in interface Parameter
Returns:
The previous value of this parameter.

setTrigger

public Boolean setTrigger(Boolean newval)
Not allowed.

Specified by:
setTrigger in interface Trigger

toggleTrigger

public Boolean toggleTrigger()
Not allowed.

Specified by:
toggleTrigger in interface Trigger

getLastToggleTime

public Date getLastToggleTime()
Returns the last toggle time of the weather station if registered.

Specified by:
getLastToggleTime in interface Trigger

getElapsedToggleTime

public long getElapsedToggleTime()
Returns the time elapsed since the last toggle event. If the method getLastToggleTime() returns null, -1 is returned.

Specified by:
getElapsedToggleTime in interface Trigger