2009-01-09 1.2.0

org.eclipse.soda.dk.device
Class NotificationController

java.lang.Object
  extended by org.eclipse.soda.dk.core.EscObject
      extended by org.eclipse.soda.dk.device.NotificationController
All Implemented Interfaces:
java.lang.Runnable, CommandListener, MultiplexCommandListener, MeasurementListener, MultiplexMeasurementListener, org.eclipse.soda.dk.notification.service.NotificationListener, org.eclipse.soda.dk.notification.service.NotificationService, MultiplexSignalListener, SignalListener, ErrorListener

public class NotificationController
extends EscObject
implements org.eclipse.soda.dk.notification.service.NotificationService, org.eclipse.soda.dk.notification.service.NotificationListener, MultiplexSignalListener, MultiplexMeasurementListener, MultiplexCommandListener, java.lang.Runnable

Version:
1.2.0

Field Summary
protected  char idSeparator
          Define the id separator (char) field.
 
Fields inherited from class org.eclipse.soda.dk.core.EscObject
CLONE_EXCEPTION_RESOURCE, EMPTY_BYTES, EMPTY_STRING, ERROR_OCCURRED_EXCEPTION_RESOURCE, ID_FILTER_KEY, ID_KEY, ID_KEY_ANY, ID_NAME_KEY, INTEGER_TABLE, INTEGER_TABLE_SIZE, KEY_KEY, LOG_DEBUG, LOG_DEFAULT, LOG_ERROR, LOG_INFO, LOG_LEVEL_KEY, LOG_TRACE, LOG_WARNING, LONG_TABLE, LONG_TABLE_SIZE, PREFIX_KEY, READONLY_EMPTY_COLLECTION, READONLY_EMPTY_LIST, READONLY_EMPTY_MAP, RESOURCE_BUNDLE, SLEEP_EXCEPTION_RESOURCE, SYSTEM_INFO_RESOURCE, TO_STRING_CONFIGURATION_KEYS, TRACE_LEVEL_HIGH, TRACE_LEVEL_LOW, TRACE_LEVEL_MAX, TRACE_LEVEL_MIN, TRACE_LEVEL_NONE, TRACE_LEVEL_NORMAL, TRACELEVEL_KEY, UNKNOWN_ERROR_RESOURCE, Unmodifiable
 
Fields inherited from interface org.eclipse.soda.dk.notification.service.NotificationService
BROADCAST_THRESHOLD_KEY, BUNDLE_DATA_KEY, Capabilities, CAPABILITIES_EXTERNAL_KEY, CAPABILITIES_GET_EXTERNAL_KEY, CAPABILITIES_READ_EXTERNAL_KEY, Configuration, CONFIGURATION_DATA_KEY, CONFIGURATION_EXTERNAL_KEY, CONFIGURATION_GET_EXTERNAL_KEY, CONFIGURATION_READ_EXTERNAL_KEY, ERROR_EXTERNAL_KEY, EVENT_DATA_KEY, EXCEPTION_DATA_KEY, EXECUTE_EXTERNAL_KEY, FACTORY_SERVICE_NAME, GET_EXTERNAL_KEY, ID_DATA_KEY, LEVEL_DATA_KEY, LEVEL_DEFAULT, LEVEL_EXTENSION, LEVEL_KEY, LEVEL_MAXIMUM, LEVEL_MAXIMUM_KEY, LEVEL_MINIMUM, LEVEL_MINIMUM_KEY, LEVEL_MONITOR, MESSAGE_DATA_KEY, Metrics, METRICS_EXTERNAL_KEY, METRICS_GET_EXTERNAL_KEY, NOTIFICATION_HOST_DATA_KEY, NOTIFICATION_ID_DATA_KEY, NOTIFICATION_TIMESTAMP_DATA_KEY, NOTIFY_THRESHOLD_KEY, READ_EXTERNAL_KEY, RECEIVED_EVENT_DATA_KEY, RECEIVED_ID_DATA_KEY, SERVICE_NAME, SET_EXTERNAL_KEY, Status, STATUS_EXTERNAL_KEY, STATUS_GET_EXTERNAL_KEY, STATUS_READ_EXTERNAL_KEY, TIMESTAMP_DATA_KEY, TOPIC_DELIMITER, TOPIC_DELIMITER_STRING, TOPIC_WILDCARD, TOPIC_WILDCARD_STRING, TRIGGER_EXTERNAL_KEY, VALUE_DATA_KEY, VALUE_OLD_DATA_KEY, WRITE_EXTERNAL_KEY
 
Constructor Summary
NotificationController()
          Constructs an instance of this class.
NotificationController(org.eclipse.soda.dk.notification.service.NotificationService notificationService, Container container)
          Constructs an instance of this class from the specified notification service parameter.
NotificationController(org.eclipse.soda.dk.notification.service.NotificationService notificationService, Container container, java.lang.String id)
          Constructs an instance of this class from the specified notification service, container and ID parameters.
NotificationController(org.eclipse.soda.dk.notification.service.NotificationService notificationService, Container container, java.lang.String id, int notificationPriority)
          Constructs an instance of this class from the specified notification service, container, ID and notification priority parameters.
 
Method Summary
 void addData(java.lang.String externalKey, java.util.Dictionary data)
          Add receivedData with the specified receivedData parameter.
 void addQualifiedKeys(java.lang.String id)
          Add qualified keys with the specified id and controls parameters.
 void addReceivedData(java.lang.String externalKey, java.util.Dictionary notifyData)
          Add received data with the specified external key and notify data parameters.
 void broadcast(java.lang.String externalKey, java.util.Dictionary data)
          Broadcast with the specified external key and data parameters.
 void commandExecuted(CommandService source, java.lang.Object timestamp, ChannelService channel, java.lang.Object data)
          Command executed with the specified source, timestamp, channel and data parameters.
 void commandExecuted(CommandService source, java.lang.Object timestamp, java.lang.Object data)
          Command executed with the specified source, timestamp and data parameters.
 void errorOccurred(java.lang.Object source, java.lang.Object timestamp, java.lang.Object data)
          Error occurred with the specified source, timestamp and data parameters.
 void exit()
          Exit.
 org.osgi.framework.BundleContext getBundleContext()
          Gets the bundle context value.
 Container getContainer()
          Gets the container value.
 java.lang.String getId()
          Gets the ID (String) value.
 org.eclipse.soda.dk.notification.service.NotificationService getNotificationService()
          Gets the notification service value.
 NotificationQueue getQueue()
          Gets the queue (NotificationQueue) value.
 java.util.Dictionary getReceivedData()
          Gets the received data (Dictionary) value.
 java.lang.String getReceivedExternalKey()
          Gets the received external key (String) value.
 java.lang.String getSymbolicName()
          Gets the symbolic name (String) value.
 java.lang.Thread getThread()
          Gets the thread value.
 boolean isRunning()
          Gets the running (boolean) value.
 void measurementChanged(MeasurementService source, java.lang.Object timestamp, ChannelService channel, java.lang.Object newValue, java.lang.Object oldValue)
          Measurement changed with the specified source, timestamp, channel, new value and old value parameters.
 void measurementChanged(MeasurementService source, java.lang.Object timestamp, java.lang.Object newValue, java.lang.Object oldValue)
          Measurement changed with the specified source, timestamp, new value and old value parameters.
 void notificationReceived(java.lang.String externalKey, java.util.Dictionary data)
          Notification received with the specified external key and data parameters.
 void process(java.lang.String externalKey, java.util.Dictionary data)
          Process with the specified external key and receivedData parameters.
 java.lang.Object publishValue(java.lang.Object value)
          Publish value with the specified value parameter and return the Object result.
 void register(java.lang.String externalKey)
          Register with the specified external key parameter.
 void register(java.lang.String[] externalKeys)
          Register with the specified external keys parameter.
 void register(java.lang.String[] externalKeys, org.eclipse.soda.dk.notification.service.NotificationListener listener)
          Register with the specified external keys and listener parameters.
 void register(java.lang.String externalKey, org.eclipse.soda.dk.notification.service.NotificationListener listener)
          Register with the specified external key and listener parameters.
 void removeQualifiedKeys()
          Remove qualified keys.
 void run()
          Run.
 void setBundleContext(org.osgi.framework.BundleContext bundleContext)
          Sets the bundle context value.
 void setContainer(Container container)
          Sets the container value.
 void setId(java.lang.String id)
          Sets the ID value.
 void setNotificationService(org.eclipse.soda.dk.notification.service.NotificationService notificationService)
          Sets the notification service value.
 void setQueue(NotificationQueue queue)
          Sets the queue value.
 void setReceivedData(java.util.Dictionary data)
          Sets the received data value.
 void setReceivedExternalKey(java.lang.String receivedExternalKey)
          Sets the received external key value.
 void setRunning(boolean running)
          Sets the running value.
 void setSymbolicName(java.lang.String symbolicName)
          Sets the symbolic name value.
 void setThread(java.lang.Thread thread)
          Sets the thread value.
 void signalOccurred(SignalService source, java.lang.Object timestamp, ChannelService channel, java.lang.Object data)
          Signal occurred with the specified source, timestamp, channel and data parameters.
 void signalOccurred(SignalService source, java.lang.Object timestamp, java.lang.Object data)
          Signal occurred with the specified source, timestamp and receivedData parameters.
 java.lang.String toString()
          Returns the string value.
 void unregister()
          Unregister.
 void unregister(org.eclipse.soda.dk.notification.service.NotificationListener listener)
          Unregister with the specified listener parameter.
 
Methods inherited from class org.eclipse.soda.dk.core.EscObject
attemptRecoveryFromError, createBoolean, createDefaultLogService, createException, createException, createInteger, createIntegerTable, createLong, createLongTable, createNumber, format, getBoolean, getByte, getChar, getConfigurationService, getCurrentTimestamp, getDefaultLogService, getDefaultResource, getDouble, getErrorSeverity, getFloat, getIdName, getInt, getLoadLibraryName, getLogDetails, getLogDetails, getLogDetails0, getLogDetails1, getLogDetails2, getLogDetails3, getLogDetails4, getLogDetails5, getLogDetails6, getLogDetails7, getLogLevel, getLogService, getLong, getObject, getOutputName, getReadOnlyEmptyCollection, getReadOnlyEmptyList, getReadOnlyEmptyMap, getResource, getShort, getSimpleClassName, getStaticBoolean, getStaticByte, getStaticChar, getStaticDouble, getStaticFloat, getStaticInt, getStaticLong, getStaticObject, getStaticShort, getStaticString, getString, getTraceLevel, getVmLibraryVersion, handleError, handleError, handleError, handleError, handleErrorInternal, handleStaticError, handleStaticException, isBackward, isDebug, isLogging, isTrace, isUnmodifiable, loadService, log, log, log, report, report, report, report, report, report, report, reportError, reportSystemInfo, setBackward, setDebug, setDefaultLogService, setLogService, setTraceLevel, setUnmodifiable, shouldLog, sleep, startupEscStatic, toStringConfigurationKeys, toStringInfo
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

idSeparator

protected char idSeparator
Define the id separator (char) field.

Constructor Detail

NotificationController

public NotificationController()
Constructs an instance of this class.

See Also:
NotificationController(NotificationService,Container), NotificationController(NotificationService,Container,String), NotificationController(NotificationService,Container,String,int)

NotificationController

public NotificationController(org.eclipse.soda.dk.notification.service.NotificationService notificationService,
                              Container container)
Constructs an instance of this class from the specified notification service parameter. The notification service (NotificationService) parameter. The container (Container) parameter. The The container ( Container) parameter. The notification

Parameters:
notificationService - The notification service (NotificationService) parameter.
container - The container (Container) parameter.
See Also:
NotificationController(), NotificationController(NotificationService,Container,String), NotificationController(NotificationService,Container,String,int)

NotificationController

public NotificationController(org.eclipse.soda.dk.notification.service.NotificationService notificationService,
                              Container container,
                              java.lang.String id)
Constructs an instance of this class from the specified notification service, container and ID parameters.

Parameters:
notificationService - The notification service (NotificationService) parameter.
container - The container (Container) parameter.
id - The ID (String) parameter.
See Also:
NotificationController(), NotificationController(NotificationService,Container), NotificationController(NotificationService,Container,String,int)

NotificationController

public NotificationController(org.eclipse.soda.dk.notification.service.NotificationService notificationService,
                              Container container,
                              java.lang.String id,
                              int notificationPriority)
Constructs an instance of this class from the specified notification service, container, ID and notification priority parameters.

Parameters:
notificationService - The notification service (NotificationService) parameter.
container - The container (Container) parameter.
id - The ID (String) parameter.
notificationPriority - The notification priority (int) parameter.
Since:
1.2
See Also:
NotificationController(), NotificationController(NotificationService,Container), NotificationController(NotificationService,Container,String)
Method Detail

addData

public void addData(java.lang.String externalKey,
                    java.util.Dictionary data)
Add receivedData with the specified receivedData parameter. The receivedData (Dictionary)

Parameters:
externalKey - The external key (String) parameter.
data - The data (Dictionary) parameter.
See Also:
addReceivedData(String,Dictionary), getReceivedData(), setReceivedData(Dictionary)

addQualifiedKeys

public void addQualifiedKeys(java.lang.String id)
Add qualified keys with the specified id and controls parameters. The id (String) parameter. The controls (Map) parameter. The id (String)

Parameters:
id - The ID (String) parameter.
See Also:
removeQualifiedKeys()

addReceivedData

public void addReceivedData(java.lang.String externalKey,
                            java.util.Dictionary notifyData)
Add received data with the specified external key and notify data parameters.

Parameters:
externalKey - The external key (String) parameter.
notifyData - The notify data (Dictionary) parameter.
See Also:
getReceivedData(), setReceivedData(Dictionary)

broadcast

public void broadcast(java.lang.String externalKey,
                      java.util.Dictionary data)
Broadcast with the specified external key and data parameters.

Specified by:
broadcast in interface org.eclipse.soda.dk.notification.service.NotificationService
Parameters:
externalKey - The external key (String) parameter.
data - The data (Dictionary) parameter.

commandExecuted

public void commandExecuted(CommandService source,
                            java.lang.Object timestamp,
                            ChannelService channel,
                            java.lang.Object data)
Command executed with the specified source, timestamp, channel and data parameters.

Specified by:
commandExecuted in interface MultiplexCommandListener
Parameters:
source - The source (CommandService) parameter.
timestamp - The time stamp (Object) parameter.
channel - The channel (ChannelService) parameter.
data - The data (Object) parameter.
Since:
1.2
See Also:
commandExecuted(CommandService,Object,Object)

commandExecuted

public void commandExecuted(CommandService source,
                            java.lang.Object timestamp,
                            java.lang.Object data)
Command executed with the specified source, timestamp and data parameters.

Specified by:
commandExecuted in interface CommandListener
Parameters:
source - The source (CommandService) parameter.
timestamp - The time stamp (Object) parameter.
data - The data (Object) parameter.
See Also:
commandExecuted(CommandService,Object,ChannelService,Object)

errorOccurred

public void errorOccurred(java.lang.Object source,
                          java.lang.Object timestamp,
                          java.lang.Object data)
Error occurred with the specified source, timestamp and data parameters.

Specified by:
errorOccurred in interface ErrorListener
Parameters:
source - The source (Object) parameter.
timestamp - The time stamp (Object) parameter.
data - The data (Object) parameter.
See Also:
signalOccurred(SignalService,Object,ChannelService,Object), signalOccurred(SignalService,Object,Object)

exit

public void exit()
Exit.


getBundleContext

public org.osgi.framework.BundleContext getBundleContext()
Gets the bundle context value.

Returns:
The bundle context (BundleContext) value.
See Also:
setBundleContext(BundleContext)

getContainer

public Container getContainer()
Gets the container value.

Returns:
The container (Container) value.
See Also:
setContainer(Container)

getId

public java.lang.String getId()
Gets the ID (String) value.

Overrides:
getId in class EscObject
Returns:
The id (String) value.
See Also:
setId(String)

getNotificationService

public org.eclipse.soda.dk.notification.service.NotificationService getNotificationService()
Gets the notification service value.

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

getQueue

public NotificationQueue getQueue()
Gets the queue (NotificationQueue) value.

Returns:
The queue (Queue) value.
See Also:
setQueue(NotificationQueue)

getReceivedData

public java.util.Dictionary getReceivedData()
Gets the received data (Dictionary) value.

Returns:
The received data (Dictionary) value.
See Also:
addReceivedData(String,Dictionary), setReceivedData(Dictionary)

getReceivedExternalKey

public java.lang.String getReceivedExternalKey()
Gets the received external key (String) value.

Returns:
The received external key (String) value.
See Also:
setReceivedExternalKey(String)

getSymbolicName

public java.lang.String getSymbolicName()
Gets the symbolic name (String) value.

Returns:
The symbolic name (String) value.
See Also:
setSymbolicName(String)

getThread

public java.lang.Thread getThread()
Gets the thread value.

Returns:
The thread (Thread) value.
See Also:
setThread(Thread)

isRunning

public boolean isRunning()
Gets the running (boolean) value.

Returns:
The running (boolean) value.
See Also:
setRunning(boolean)

measurementChanged

public void measurementChanged(MeasurementService source,
                               java.lang.Object timestamp,
                               ChannelService channel,
                               java.lang.Object newValue,
                               java.lang.Object oldValue)
Measurement changed with the specified source, timestamp, channel, new value and old value parameters.

Specified by:
measurementChanged in interface MultiplexMeasurementListener
Parameters:
source - The source (MeasurementService) parameter.
timestamp - The time stamp (Object) parameter.
channel - The channel (ChannelService) parameter.
newValue - The new value (Object) parameter.
oldValue - The old value (Object) parameter.
Since:
1.2
See Also:
measurementChanged(MeasurementService,Object,Object,Object)

measurementChanged

public void measurementChanged(MeasurementService source,
                               java.lang.Object timestamp,
                               java.lang.Object newValue,
                               java.lang.Object oldValue)
Measurement changed with the specified source, timestamp, new value and old value parameters.

Specified by:
measurementChanged in interface MeasurementListener
Parameters:
source - The source (MeasurementService) parameter.
timestamp - The time stamp (Object) parameter.
newValue - The new value (Object) parameter.
oldValue - The old value (Object) parameter.
See Also:
measurementChanged(MeasurementService,Object,ChannelService,Object,Object)

notificationReceived

public void notificationReceived(java.lang.String externalKey,
                                 java.util.Dictionary data)
Notification received with the specified external key and data parameters.

Specified by:
notificationReceived in interface org.eclipse.soda.dk.notification.service.NotificationListener
Parameters:
externalKey - The external key (String) parameter.
data - The data (Dictionary) parameter.

process

public void process(java.lang.String externalKey,
                    java.util.Dictionary data)
Process with the specified external key and receivedData parameters.

Parameters:
externalKey - The external key (String) parameter.
data - The data (Dictionary) parameter.

publishValue

public java.lang.Object publishValue(java.lang.Object value)
Publish value with the specified value parameter and return the Object result.

Parameters:
value - The value (Object) parameter.
Returns:
Results of the publish value (Object) value.

register

public void register(java.lang.String externalKey)
Register with the specified external key parameter. The external key (String)

Parameters:
externalKey - The external key (String) parameter.
See Also:
register(String,NotificationListener), register(String[]), register(String[],NotificationListener)

register

public void register(java.lang.String externalKey,
                     org.eclipse.soda.dk.notification.service.NotificationListener listener)
Register with the specified external key and listener parameters.

Specified by:
register in interface org.eclipse.soda.dk.notification.service.NotificationService
Parameters:
externalKey - The external key (String) parameter.
listener - The listener (NotificationListener) parameter.
See Also:
register(String), register(String[]), register(String[],NotificationListener)

register

public void register(java.lang.String[] externalKeys)
Register with the specified external keys parameter. The external keys (String[])

Parameters:
externalKeys - The external keys (String[]) parameter.
See Also:
register(String), register(String,NotificationListener), register(String[],NotificationListener)

register

public void register(java.lang.String[] externalKeys,
                     org.eclipse.soda.dk.notification.service.NotificationListener listener)
Register with the specified external keys and listener parameters.

Specified by:
register in interface org.eclipse.soda.dk.notification.service.NotificationService
Parameters:
externalKeys - The external keys (String[]) parameter.
listener - The listener (NotificationListener) parameter.
See Also:
register(String), register(String,NotificationListener), register(String[])

removeQualifiedKeys

public void removeQualifiedKeys()
Remove qualified keys.

See Also:
addQualifiedKeys(String)

run

public void run()
Run.

Specified by:
run in interface java.lang.Runnable

setBundleContext

public void setBundleContext(org.osgi.framework.BundleContext bundleContext)
Sets the bundle context value.

Parameters:
bundleContext - The bundle context (BundleContext) parameter.
See Also:
getBundleContext()

setContainer

public void setContainer(Container container)
Sets the container value.

Parameters:
container - The container (Container) parameter.
See Also:
getContainer()

setId

public void setId(java.lang.String id)
Sets the ID value.

Parameters:
id - The ID (String) parameter.
See Also:
getId()

setNotificationService

public void setNotificationService(org.eclipse.soda.dk.notification.service.NotificationService notificationService)
Sets the notification service value.

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

setQueue

public void setQueue(NotificationQueue queue)
Sets the queue value.

Parameters:
queue - The queue (NotificationQueue) parameter.
See Also:
getQueue()

setReceivedData

public void setReceivedData(java.util.Dictionary data)
Sets the received data value.

Parameters:
data - The data (Dictionary) parameter.
See Also:
addReceivedData(String,Dictionary), getReceivedData()

setReceivedExternalKey

public void setReceivedExternalKey(java.lang.String receivedExternalKey)
Sets the received external key value.

Parameters:
receivedExternalKey - The received external key (String) parameter.
See Also:
getReceivedExternalKey()

setRunning

public void setRunning(boolean running)
Sets the running value.

Parameters:
running - The running (boolean) parameter.
See Also:
isRunning()

setSymbolicName

public void setSymbolicName(java.lang.String symbolicName)
Sets the symbolic name value.

Parameters:
symbolicName - The symbolic name (String) parameter.
See Also:
getSymbolicName()

setThread

public void setThread(java.lang.Thread thread)
Sets the thread value.

Parameters:
thread - The thread (Thread) parameter.
See Also:
getThread()

signalOccurred

public void signalOccurred(SignalService source,
                           java.lang.Object timestamp,
                           ChannelService channel,
                           java.lang.Object data)
Signal occurred with the specified source, timestamp, channel and data parameters.

Specified by:
signalOccurred in interface MultiplexSignalListener
Parameters:
source - The source (SignalService) parameter.
timestamp - The time stamp (Object) parameter.
channel - The channel (ChannelService) parameter.
data - The data (Object) parameter.
Since:
1.2
See Also:
errorOccurred(Object,Object,Object), signalOccurred(SignalService,Object,Object)

signalOccurred

public void signalOccurred(SignalService source,
                           java.lang.Object timestamp,
                           java.lang.Object data)
Signal occurred with the specified source, timestamp and receivedData parameters.

Specified by:
signalOccurred in interface SignalListener
Parameters:
source - The source (SignalService) parameter.
timestamp - The time stamp (Object) parameter.
data - The data (Object) parameter.
See Also:
errorOccurred(Object,Object,Object), signalOccurred(SignalService,Object,ChannelService,Object)

toString

public java.lang.String toString()
Returns the string value.

Overrides:
toString in class EscObject
Returns:
The string (String) value.
See Also:
EscObject.getStaticString(String,String), EscObject.getString(String,String)

unregister

public void unregister()
Unregister.

See Also:
unregister(NotificationListener)

unregister

public void unregister(org.eclipse.soda.dk.notification.service.NotificationListener listener)
Unregister with the specified listener parameter.

Specified by:
unregister in interface org.eclipse.soda.dk.notification.service.NotificationService
Parameters:
listener - The listener (NotificationListener) parameter.
See Also:
unregister()

2009-01-09 1.2.0

Copyright (c) 2009 IBM. See license in Legal section.