1.0.0

org.eclipse.soda.dk.device.service
Interface DeviceListener

All Superinterfaces:
ErrorListener
All Known Implementing Classes:
Adapter, AdapterTest, AgentTest, DeviceAdapter, DeviceListeners, DeviceProfile, DeviceTest, DeviceTestcase, Profile, TestAdapter

public interface DeviceListener
extends ErrorListener

The DeviceListener interface defines the methods to be called when event notification occurs. The DeviceListener interface should be implemented by any class which wishes to be notified of changes in the configuration of a DeviceService. This includes the addition of Contols, the removal of Controls, and The modification of Controls.

Version:
1.0.0
See Also:
CommandService, CommandListener, ControlService, DeviceService, ErrorListener, MeasurementService, MeasurementListener, SignalService, SignalListener

Field Summary
static int ADDED
          Define the added (int) constant.
static int CHANGED
          Define the changed (int) constant.
static int REMOVED
          Define the removed (int) constant.
 
Method Summary
 void controlChanged(DeviceService device, java.lang.Object timestamp, ControlService control, int code)
          The controlChanged method is called when a control was changed.
 void deviceChanged(DeviceService source, java.lang.Object timestamp, int newState, int oldState)
          This method will be called when the state of the DeviceService changes.
 
Methods inherited from interface org.eclipse.soda.dk.transport.service.ErrorListener
errorOccurred
 

Field Detail

ADDED

static final int ADDED
Define the added (int) constant.

See Also:
Constant Field Values

REMOVED

static final int REMOVED
Define the removed (int) constant.

See Also:
Constant Field Values

CHANGED

static final int CHANGED
Define the changed (int) constant.

See Also:
Constant Field Values
Method Detail

controlChanged

void controlChanged(DeviceService device,
                    java.lang.Object timestamp,
                    ControlService control,
                    int code)
The controlChanged method is called when a control was changed. A notification method to all DeviceListeners that a ControlService, specified by the control argument, and contained within the DeviceService, specified in the device arguement, was Added, Removed, or Modified, specified by the code argument in accordance with the above constants, at the time specified by the timestamp argument. In English : A control of the DeviceService was changed in the following manner at this time. Since other notifications are blocked until this method returns, implementors of this method should:

Parameters:
device - org.eclipse.soda.dk.device.service.DeviceService
timestamp - java.lang.Object
control - org.eclipse.soda.dk.device.service.ControlService
code - int
See Also:
deviceChanged(DeviceService,Object,int,int)

deviceChanged

void deviceChanged(DeviceService source,
                   java.lang.Object timestamp,
                   int newState,
                   int oldState)
This method will be called when the state of the DeviceService changes. Since other notifications are blocked until this method returns, implementors of this method should: Because of the multiple threads and quickly changing states, the current state of the device may not be the same as the newState input parameter.

Parameters:
source - org.eclipse.soda.dk.device.service.DeviceService
timestamp - java.lang.Object
newState - The new state of the DeviceService when the notification process started.
oldState - The old state of the DeviceService.
See Also:
controlChanged(DeviceService,Object,ControlService,int)

1.0.0

Copyright (c) 1999, 2007 IBM