|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||
java.lang.Objectcom.pervasa.atlas.dev.service.AtlasServiceClass
Class providing basic Atlas Service functions Developers who write their own Atlas Service bundles need to make their implementation extend the AtlasServiceClass
| Field Summary | |
protected NodeServiceHandler |
handler
|
protected static boolean |
isSubscribe
|
protected java.util.Properties |
serviceProperties
|
| Constructor Summary | |
AtlasServiceClass()
|
|
| Method Summary | |
protected void |
addProperty(java.lang.String key,
java.lang.String value)
Method provided for adding any additional properties for this service Can be used by authors of service bundles for putting in properties in addition to the default ones already provided by the middleware. |
void |
DataHandler(java.lang.String data,
java.lang.String channel)
Event Handler Method called by the node service handler when data arrives from the node. |
protected void |
getData(AtlasService serv)
Pull Data from node. |
protected java.util.Properties |
getProperties()
Get the properties associated with this service |
boolean |
isSubscriber()
Checks if this service is a subscriber (i.e. |
protected void |
removeProperty(java.lang.String key,
java.lang.String value)
Method provided for removing any properties associated with this service Use carefully since removing properties might make some applications behave abnormally |
protected void |
sendCommand(AtlasService serv,
java.lang.String command)
Send a Low-level command to the Node. |
void |
setNodeServiceHandler(NodeServiceHandler handler)
Called by the node service handler to bind itself to this Service. |
void |
setProperties(java.util.Properties props)
Method called by NodeServiceHandler to set properties associated with the device being represented by this service. |
protected void |
subscribe(AtlasService serv)
Become a subscriber to the sensor data. |
protected void |
unsubscribe(AtlasService serv)
Unsubscribe from the sensor data. |
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
protected NodeServiceHandler handler
protected static boolean isSubscribe
protected java.util.Properties serviceProperties
| Constructor Detail |
public AtlasServiceClass()
| Method Detail |
public final void setNodeServiceHandler(NodeServiceHandler handler)
setNodeServiceHandler in interface AtlasServicehandler - - NodeServiceHandler bound to this servicepublic final void setProperties(java.util.Properties props)
setProperties in interface AtlasServiceprops - - The properties associated with this serviceProperties object will contain the following standard property keys
(* = optional):
node-id (specified by middleware) - NodeId of node to which device is
connected ;
channel (specified by middleware) - Channel of node to which device is
connected ;
bundle-id (specified by middleware) - BundleId of service bundle which is
bound to this device ;
bundle-location (specified by middleware) - Physical location on disk of
bundle ;
location* (specified by user who configured the node) - Location of device
eg. door, bedroom etc. ;
label* (specified by user who configured the node)- Label attached to device
eg. doorsensor-1,ps5 etc. ;
measure-type* (can be specified by service bundle using addProperty())
- Type of measurement; eg. temperature, pressure etc. ;
measure-unit* (specified by service bundle using addProperty())
- Unit of measurement; eg. celcius, psi etc. ;
data-type* (specified by the service bundle using addProperty())
- Type of reading data; int, float, double, long or string
device-type* (specified by service bundle using addProperty())
- Type of device; eg. Sensor, Actuator or Hybrid(ie both)protected final java.util.Properties getProperties()
protected final void addProperty(java.lang.String key,
java.lang.String value)
key - value -
protected final void removeProperty(java.lang.String key,
java.lang.String value)
key -
public void DataHandler(java.lang.String data,
java.lang.String channel)
DataHandler in interface AtlasServicedata - The data arriving from the devicechannel - The channel to which device is connectedpublic final boolean isSubscriber()
isSubscriber in interface AtlasServiceprotected final void getData(AtlasService serv)
serv - The AtlasService object which is calling this methodprotected final void subscribe(AtlasService serv)
serv - The AtlasService object which is calling this methodprotected final void unsubscribe(AtlasService serv)
serv - The AtlasService object which is calling this method
protected final void sendCommand(AtlasService serv,
java.lang.String command)
serv - The AtlasService object which is calling this methodcommand - The low-level Command String to be executed by the Node
|
|||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||||