1.0.0

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

All Superinterfaces:
ControlService
All Known Subinterfaces:
AdapterService, BaseDeviceService, DeviceRegistryService
All Known Implementing Classes:
Adapter, BaseDevice, Device, DeviceAdapter, DeviceProfile, DeviceRegistry, Profile, QueueDevice, TestAdapter, TestDevice, ThreadDevice, TransportDevice

public interface DeviceService
extends ControlService

The DeviceService interface defines the DeviceService concept. A DeviceService is an extension of ControlService which encapsulates multiple Controls.The DeviceService provides a uniform mechanism for accessing a heterogeneous grouping of Controls. In other words a DeviceService is a container for Commands, Measurements, and Signals, which has a simple, well- defined manner in which to access them.

Version:
1.0.0
See Also:
Device, ControlService

Field Summary
static int ACTIVE
          Define the ACTIVE state value.
static int ALIVE
          Define the ALIVE state value.
static java.lang.String[] ALL_COMMANDS
          Comprehensive list of all the command ids.
static java.lang.String[] ALL_MEASUREMENTS
          Comprehensive list of all the measurement ids.
static java.lang.String[] ALL_SIGNALS
          Comprehensive list of all the signal ids.
static short AUTOSTART
          Define the AUTOSTART style value.
static short BLOCKPROCESSING
          Define the BLOCKPROCESSING style value.
static java.lang.String Capabilities
          Defines the Capabilities measurement.
static java.lang.String CAPABILITIES_EXTERNAL_KEY
          Defines the Capabilities measurement.
static java.lang.String CAPABILITIES_GET_EXTERNAL_KEY
          Defines the Capabilities measurement.
static java.lang.String CAPABILITIES_READ_EXTERNAL_KEY
          Defines the Capabilities measurement.
static java.lang.String CAPABILITIES_WRITE_EXTERNAL_KEY
          Defines the Capabilities measurement.
static java.lang.String Configuration
          Defines the Configuration measurement.
static java.lang.String CONFIGURATION_DATA_KEY
          Define the configuration data key (String) constant.
static java.lang.String CONFIGURATION_EXTERNAL_KEY
          Defines the Configuration measurement.
static java.lang.String CONFIGURATION_GET_EXTERNAL_KEY
          Defines the Configuration measurement.
static java.lang.String CONFIGURATION_READ_EXTERNAL_KEY
          Defines the Configuration measurement.
static java.lang.String CONFIGURATION_WRITE_EXTERNAL_KEY
          Defines the Configuration measurement.
static int CONNECTED
          Define the CONNECTED state value.
static int CREATED
          Define the CREATED state value.
static int DEAD
          Define the DEAD state value.
static java.lang.String ERROR_EXTERNAL_KEY
          Define the error external key (String) constant.
static short EVENPROCESSING
          Define the EVENPROCESSING style value.
static java.lang.String EXECUTE_EXTERNAL_KEY
          Define the execute (String) constant.
static java.lang.String GET_EXTERNAL_KEY
          Define the get (String) constant.
static short INITIALIZEMEASUREMENTS
          Define the INITIALIZEMEASUREMENTS style value.
static java.lang.String KEYS_DATA_KEY
          Define the keys data key (String) constant.
static short NULL
          Define the NULL style value.
static java.lang.String READ_EXTERNAL_KEY
          Define the read (String) constant.
static java.lang.String RECEIVED_KEY_DATA_KEY
          Define the received key data key (String) constant.
static java.lang.String SERVICE_NAME
          Define the OSGi service name.
static java.lang.String SET_EXTERNAL_KEY
          Define the set external key (String) constant.
static java.lang.String SOURCE_DATA_KEY
          Define the source data key (String) constant.
static int STARTED
          Define the STARTED state value.
static java.lang.String STATE_DATA_KEY
          Define the state data key (String) constant.
static java.lang.String STATE_OLD_DATA_KEY
          Define the state old data key (String) constant.
static java.lang.String Status
          Defines the Status measurement.
static java.lang.String STATUS_EXTERNAL_KEY
          Defines the Status measurement.
static java.lang.String STATUS_GET_EXTERNAL_KEY
          Defines the Status measurement.
static java.lang.String STATUS_READ_EXTERNAL_KEY
          Defines the Status measurement.
static java.lang.String STATUS_WRITE_EXTERNAL_KEY
          Defines the Status measurement.
static java.lang.String TIMESTAMP_DATA_KEY
          Define the timestamp data key (String) constant.
static java.lang.String TRIGGER_EXTERNAL_KEY
          Define the trigger (String) constant.
static java.lang.String VALUE_DATA_KEY
          Define the value data key (String) constant.
static java.lang.String VALUE_OLD_DATA_KEY
          Define the value old data key (String) constant.
static java.lang.String WRITE_EXTERNAL_KEY
          Define the write (String) constant.
 
Method Summary
 void addDeviceListener(DeviceListener deviceListener)
          Adds the specified listener to receive device listener notification.
 java.util.Enumeration elements()
          Perform the elements method and return the Enumeration result.
 void exit()
          Request the device to exit.
 ControlService get(java.lang.String key)
          Perform the get method and return the ControlService result.
 CommandService getCommand(java.lang.String key)
          Perform the getCommand method and return the CommandService result.
 java.util.Dictionary getConfigurationInformation()
          Gets the configuration information.
 MeasurementService getMeasurement(java.lang.String key)
          Perform the getMeasurement method and return the MeasurementService result.
 NotificationService getNotificationService()
          Gets the notification service value.
 SignalService getSignal(java.lang.String key)
          Perform the getSignal method and return the SignalService result.
 int getState()
          Gets the int state of the DeviceService.
 TransportService getTransport()
          Gets the Transport transport property value.
 boolean isStarted()
          Gets the started (boolean) value.
 void put(java.lang.String key, ControlService control)
          Perform the put action method.
 void remove(java.lang.String key)
          Perform the remove action method.
 void removeDeviceListener(DeviceListener deviceListener)
          Removes the specified listener from receiving device listener notification.
 void send(MessageService message)
          Perform the send action method.
 void setConfigurationInformation(java.util.Dictionary configurationInformation)
          Set the configuration information.
 void setNotificationService(NotificationService notificationService)
          Sets the notification service value.
 void setTransport(TransportService transport)
          Sets the Transport transport property value.
 void start()
          Request the device to start.
 void stop()
          Request the device to stop.
 
Methods inherited from interface org.eclipse.soda.dk.device.service.ControlService
getKey
 

Field Detail

SERVICE_NAME

static final java.lang.String SERVICE_NAME
Define the OSGi service name.


AUTOSTART

static final short AUTOSTART
Define the AUTOSTART style value.

See Also:
Constant Field Values

NULL

static final short NULL
Define the NULL style value.

See Also:
Constant Field Values

INITIALIZEMEASUREMENTS

static final short INITIALIZEMEASUREMENTS
Define the INITIALIZEMEASUREMENTS style value. If this style is define, then the device will attempt to initialize all measurements when the device is started.

See Also:
Constant Field Values

EVENPROCESSING

static final short EVENPROCESSING
Define the EVENPROCESSING style value.

See Also:
Constant Field Values

BLOCKPROCESSING

static final short BLOCKPROCESSING
Define the BLOCKPROCESSING style value.

See Also:
Constant Field Values

GET_EXTERNAL_KEY

static final java.lang.String GET_EXTERNAL_KEY
Define the get (String) constant.

See Also:
Constant Field Values

READ_EXTERNAL_KEY

static final java.lang.String READ_EXTERNAL_KEY
Define the read (String) constant.

See Also:
Constant Field Values

WRITE_EXTERNAL_KEY

static final java.lang.String WRITE_EXTERNAL_KEY
Define the write (String) constant.

See Also:
Constant Field Values

SET_EXTERNAL_KEY

static final java.lang.String SET_EXTERNAL_KEY
Define the set external key (String) constant.

See Also:
Constant Field Values

EXECUTE_EXTERNAL_KEY

static final java.lang.String EXECUTE_EXTERNAL_KEY
Define the execute (String) constant.

See Also:
Constant Field Values

ERROR_EXTERNAL_KEY

static final java.lang.String ERROR_EXTERNAL_KEY
Define the error external key (String) constant.

See Also:
Constant Field Values

TRIGGER_EXTERNAL_KEY

static final java.lang.String TRIGGER_EXTERNAL_KEY
Define the trigger (String) constant.

See Also:
Constant Field Values

VALUE_DATA_KEY

static final java.lang.String VALUE_DATA_KEY
Define the value data key (String) constant.

See Also:
Constant Field Values

KEYS_DATA_KEY

static final java.lang.String KEYS_DATA_KEY
Define the keys data key (String) constant.

See Also:
Constant Field Values

VALUE_OLD_DATA_KEY

static final java.lang.String VALUE_OLD_DATA_KEY
Define the value old data key (String) constant.

See Also:
Constant Field Values

STATE_DATA_KEY

static final java.lang.String STATE_DATA_KEY
Define the state data key (String) constant.

See Also:
Constant Field Values

STATE_OLD_DATA_KEY

static final java.lang.String STATE_OLD_DATA_KEY
Define the state old data key (String) constant.

See Also:
Constant Field Values

TIMESTAMP_DATA_KEY

static final java.lang.String TIMESTAMP_DATA_KEY
Define the timestamp data key (String) constant.

See Also:
Constant Field Values

SOURCE_DATA_KEY

static final java.lang.String SOURCE_DATA_KEY
Define the source data key (String) constant.

See Also:
Constant Field Values

CONFIGURATION_DATA_KEY

static final java.lang.String CONFIGURATION_DATA_KEY
Define the configuration data key (String) constant.

See Also:
Constant Field Values

RECEIVED_KEY_DATA_KEY

static final java.lang.String RECEIVED_KEY_DATA_KEY
Define the received key data key (String) constant.

See Also:
Constant Field Values

ALL_COMMANDS

static final java.lang.String[] ALL_COMMANDS
Comprehensive list of all the command ids.


ALL_MEASUREMENTS

static final java.lang.String[] ALL_MEASUREMENTS
Comprehensive list of all the measurement ids.


ALL_SIGNALS

static final java.lang.String[] ALL_SIGNALS
Comprehensive list of all the signal ids.


Capabilities

static final java.lang.String Capabilities
Defines the Capabilities measurement.

See Also:
Constant Field Values

CAPABILITIES_EXTERNAL_KEY

static final java.lang.String CAPABILITIES_EXTERNAL_KEY
Defines the Capabilities measurement.

See Also:
Constant Field Values

CAPABILITIES_GET_EXTERNAL_KEY

static final java.lang.String CAPABILITIES_GET_EXTERNAL_KEY
Defines the Capabilities measurement.

See Also:
GET_EXTERNAL_KEY, Constant Field Values

CAPABILITIES_READ_EXTERNAL_KEY

static final java.lang.String CAPABILITIES_READ_EXTERNAL_KEY
Defines the Capabilities measurement.

See Also:
GET_EXTERNAL_KEY, READ_EXTERNAL_KEY, Constant Field Values

CAPABILITIES_WRITE_EXTERNAL_KEY

static final java.lang.String CAPABILITIES_WRITE_EXTERNAL_KEY
Defines the Capabilities measurement.

See Also:
GET_EXTERNAL_KEY, READ_EXTERNAL_KEY, WRITE_EXTERNAL_KEY, Constant Field Values

Configuration

static final java.lang.String Configuration
Defines the Configuration measurement.

See Also:
Constant Field Values

CONFIGURATION_EXTERNAL_KEY

static final java.lang.String CONFIGURATION_EXTERNAL_KEY
Defines the Configuration measurement.

See Also:
Constant Field Values

CONFIGURATION_GET_EXTERNAL_KEY

static final java.lang.String CONFIGURATION_GET_EXTERNAL_KEY
Defines the Configuration measurement.

See Also:
GET_EXTERNAL_KEY, Constant Field Values

CONFIGURATION_READ_EXTERNAL_KEY

static final java.lang.String CONFIGURATION_READ_EXTERNAL_KEY
Defines the Configuration measurement.

See Also:
GET_EXTERNAL_KEY, READ_EXTERNAL_KEY, Constant Field Values

CONFIGURATION_WRITE_EXTERNAL_KEY

static final java.lang.String CONFIGURATION_WRITE_EXTERNAL_KEY
Defines the Configuration measurement.

See Also:
GET_EXTERNAL_KEY, READ_EXTERNAL_KEY, WRITE_EXTERNAL_KEY, Constant Field Values

Status

static final java.lang.String Status
Defines the Status measurement.

See Also:
Constant Field Values

STATUS_EXTERNAL_KEY

static final java.lang.String STATUS_EXTERNAL_KEY
Defines the Status measurement.

See Also:
Constant Field Values

STATUS_GET_EXTERNAL_KEY

static final java.lang.String STATUS_GET_EXTERNAL_KEY
Defines the Status measurement.

See Also:
GET_EXTERNAL_KEY, Constant Field Values

STATUS_READ_EXTERNAL_KEY

static final java.lang.String STATUS_READ_EXTERNAL_KEY
Defines the Status measurement.

See Also:
GET_EXTERNAL_KEY, READ_EXTERNAL_KEY, Constant Field Values

STATUS_WRITE_EXTERNAL_KEY

static final java.lang.String STATUS_WRITE_EXTERNAL_KEY
Defines the Status measurement.

See Also:
GET_EXTERNAL_KEY, READ_EXTERNAL_KEY, WRITE_EXTERNAL_KEY, Constant Field Values

ACTIVE

static final int ACTIVE
Define the ACTIVE state value. In the ACTIVE state, the device object is connected and is processing input.

See Also:
Constant Field Values

ALIVE

static final int ALIVE
Define the ALIVE state value. In the ALIVE state, the device object was been created and is running.

See Also:
Constant Field Values

CONNECTED

static final int CONNECTED
Define the CONNECTED state value. In the CONNECTED state, the device object is connected to the transport.

See Also:
Constant Field Values

CREATED

static final int CREATED
Define the CREATED state value. In the CREATED state, the device object has been created.

See Also:
Constant Field Values

DEAD

static final int DEAD
Define the DEAD state value.

See Also:
Constant Field Values

STARTED

static final int STARTED
Define the STARTED state value. In the STARTED state, the device object is started.

See Also:
Constant Field Values
Method Detail

addDeviceListener

void addDeviceListener(DeviceListener deviceListener)
Adds the specified listener to receive device listener notification. This method adds a DeviceListener to the list of current listeners on this Device. Each time this device is modified, all the Listeners of this device will be notified using the DeviceListener interface.

Parameters:
deviceListener - The org.eclipse.soda.dk.device.service.DeviceListener listener to be added.
See Also:
removeDeviceListener(DeviceListener)

elements

java.util.Enumeration elements()
Perform the elements method and return the Enumeration result. This method returns an enumeration of the Controls contained within the DeviceService.

Returns:
Results of the elements (Enumeration) value.

exit

void exit()
Request the device to exit. The device service will be stopped. It will no longer process any controls or messages. All resources will be released. After an exit, the device service can not be restarted.

NOTE: When running under OSGi bundles, only Device Bundle Activator should be calling this method.


get

ControlService get(java.lang.String key)
Perform the get method and return the ControlService result. This method returns the ControlService contained within the DeviceService, whose key matches the key argument.

Parameters:
key - java.lang.String
Returns:
ControlService or NULL

getCommand

CommandService getCommand(java.lang.String key)
Perform the getCommand method and return the CommandService result. This method returns the CommandService contained within the DeviceService, whose key matches the key argument. Some implementations of this method will throw a ClassCastException if the ControlService found is not a CommandService.

Parameters:
key - String
Returns:
Results of the get command (CommandService) value.

getConfigurationInformation

java.util.Dictionary getConfigurationInformation()
Gets the configuration information.

Returns:
Configuration Information.
See Also:
setConfigurationInformation(Dictionary)

getMeasurement

MeasurementService getMeasurement(java.lang.String key)
Perform the getMeasurement method and return the MeasurementService result. This method returns the MeasurementService contained within the DeviceService, whose key matches the key argument. Some implementations of this method will throw a ClassCastException if the ControlService found is not a MeasurementService.

Parameters:
key - String
Returns:
org.eclipse.soda.dk.measurement.service.MeasurementService or NULL

getNotificationService

NotificationService getNotificationService()
Gets the notification service value.

Returns:
The notification service (NotificationService) value.
See Also:
setNotificationService(NotificationService)

getSignal

SignalService getSignal(java.lang.String key)
Perform the getSignal method and return the SignalService result. This method returns the SignalService contained within the DeviceService, whose key matches the key argument. Some implementations of this method will throw a ClassCastException if the ControlService found is not a SignalService.

Parameters:
key - String
Returns:
org.eclipse.soda.dk.signal.service.SignalService or NULL

getState

int getState()
Gets the int state of the DeviceService.

Returns:
int The state of the DeviceService.

getTransport

TransportService getTransport()
Gets the Transport transport property value. This method returns a reference to the TransportService used by this DeviceService

Returns:
org.eclipse.soda.dk.device.service.Transport or NULL
See Also:
setTransport(TransportService)

isStarted

boolean isStarted()
Gets the started (boolean) value.

Returns:
The started (boolean) value.

put

void put(java.lang.String key,
         ControlService control)
Perform the put action method. This method places a new ControlService in the DeviceService's list of controls, with a key value equals to the key arguement.

NOTE: Normally, application code should not be using this method.

Parameters:
key - java.lang.String
control - org.eclipse.soda.dk.device.service.ControlService

remove

void remove(java.lang.String key)
Perform the remove action method. This method removes the ControlService from the DeviceService's list of ControlService whose key matches the key arguement.

NOTE: Normally, application code should not be using this method.

Parameters:
key - java.lang.String

removeDeviceListener

void removeDeviceListener(DeviceListener deviceListener)
Removes the specified listener from receiving device listener notification. This method removes a DeviceListener to the list of current listeners on this DeviceService. The DeviceListener will no longer be notified each time this device is modified.

Parameters:
deviceListener - The org.eclipse.soda.dk.device.service.DeviceListener listener to be removed.
See Also:
addDeviceListener(DeviceListener)

send

void send(MessageService message)
Perform the send action method. This method allows users of the DeviceService to send a MessageService.

NOTE: Normally, application code should not be using this method.

Parameters:
message - org.eclipse.soda.dk.message.service.MessageService

setConfigurationInformation

void setConfigurationInformation(java.util.Dictionary configurationInformation)
Set the configuration information.

Parameters:
configurationInformation - Set the configuration information,
See Also:
getConfigurationInformation()

setNotificationService

void setNotificationService(NotificationService notificationService)
Sets the notification service value. The notification service (NotificationService) parameter.

Parameters:
notificationService - The notification service (NotificationService).
See Also:
getNotificationService()

setTransport

void setTransport(TransportService transport)
Sets the Transport transport property value. This method sets the TransportService which will be used by this DeviceService

NOTE: When running under OSGi bundles, only Device Bundle Activator should be calling this method.

Parameters:
transport - The transport (TransportService) parameter.
See Also:
getTransport()

start

void start()
Request the device to start. If the device service is not already started, then the device will be started.

NOTE: When running under OSGi bundles, only Device Bundle Activator should be calling this method.


stop

void stop()
Request the device to stop. If no remaining device service users exist, then the device will be stopped and it will no longer any process any controls or messages.

NOTE: When running under OSGi bundles, only Device Bundle Activator should be calling this method.


1.0.0

Copyright (c) 1999, 2007 IBM