org.universAAL.lddi.samples.activityhub.client
Class MyActivityHubServiceConsumer

Package class diagram package MyActivityHubServiceConsumer
java.lang.Object
  extended by org.universAAL.lddi.samples.activityhub.client.MyActivityHubServiceConsumer

public class MyActivityHubServiceConsumer
extends Object

This class provides ontological service requests and processes the service responses This class is stateless; no objects (sensors) are stored here LogUtil from uAAL-Middleware is used here

Author:
Thomas Fuxreiter (foex@gmx.at)

Constructor Summary
MyActivityHubServiceConsumer(ModuleContext mc, ActivityHubClient ahc)
          Contructor
 
Method Summary
 void deleteGui()
          close the GUI window, e.g. if the bundle is stopped; called by Activator
static List getActivityHubSensorInfo(ActivityHubSensor ahs)
          Get details for a specific ActivityHub sensor Get the ontological service request Send service request to service bus Process the response Log errors if the call was not successful
static ServiceRequest getAllActivityHubSensorsRequest()
          Create ontological service request no input output: resources that are controled by ActivityHub service
static ArrayList getControlledActivityHubSensors()
          Get a list of all available ActivityHub sensors in the system Get the ontological service request Send service request to service bus Process the response Log errors if the call was not successful
 void getDeviceInfo(String sensorURI, int deviceType)
          The parameters are just URI-Strings to keep this class stateless A new ActivityHubSensor is created from the Ontology according to the URIs from the client application (client doesn't store Ontology Resource objects) Pass this sensor object in service request Process result list from service response Send result text array to GUI
 void getSensors()
          Fetch sensors from service bus and send to gui Process result list of ActivityHubSensors from service response Send just URI-Strings to client application to decouple from Ontology-stuff Display sensor list in GUI
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MyActivityHubServiceConsumer

public MyActivityHubServiceConsumer(ModuleContext mc,
                                    ActivityHubClient ahc)
Contructor

Parameters:
mc - uAAL-Middleware ModuleContext
ahc - link to client application
Method Detail

getControlledActivityHubSensors

public static ArrayList getControlledActivityHubSensors()
Get a list of all available ActivityHub sensors in the system Get the ontological service request Send service request to service bus Process the response Log errors if the call was not successful

Returns:
ArrayList with ActivityHubSensors (Ontology Resource objects)

getActivityHubSensorInfo

public static List getActivityHubSensorInfo(ActivityHubSensor ahs)
Get details for a specific ActivityHub sensor Get the ontological service request Send service request to service bus Process the response Log errors if the call was not successful

Returns:
List with ? (Ontology Resource objects)

getSensors

public void getSensors()
Fetch sensors from service bus and send to gui Process result list of ActivityHubSensors from service response Send just URI-Strings to client application to decouple from Ontology-stuff Display sensor list in GUI


getDeviceInfo

public void getDeviceInfo(String sensorURI,
                          int deviceType)
The parameters are just URI-Strings to keep this class stateless A new ActivityHubSensor is created from the Ontology according to the URIs from the client application (client doesn't store Ontology Resource objects) Pass this sensor object in service request Process result list from service response Send result text array to GUI

Parameters:
sensorURI - is the resourceURI
deviceType - is the type-id for the ActivityHubSensor

getAllActivityHubSensorsRequest

public static ServiceRequest getAllActivityHubSensorsRequest()
Create ontological service request no input output: resources that are controled by ActivityHub service


deleteGui

public void deleteGui()
close the GUI window, e.g. if the bundle is stopped; called by Activator



Copyright © 2014 universAAL Consortium. All Rights Reserved.