org.universAAL.support.utils.service.top
Class UtilSensorCallee
java.lang.Object
org.universAAL.middleware.bus.member.BusMember
org.universAAL.middleware.bus.member.Callee
org.universAAL.middleware.service.ServiceCallee
org.universAAL.support.utils.service.top.UtilSensorCallee
public abstract class UtilSensorCallee
- extends ServiceCallee
This is an abstract class for those who want to use the typical services of
an sensor (get status) over an ontological service. Classes extending this
abstract class will be ServiceCallees which handle by default these 1
services. Those considering using UtilSensor could take advantage of this
class if they want only to handle those 1 typical services profiles and no
more.
- Author:
- alfiva
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
UtilSensorCallee
public UtilSensorCallee(ModuleContext context,
String namespace,
Sensor sensor)
throws InvalidOntologyUtilException
- Default constructor of the class. Takes the same parameters needed by a
UtilSensor profile method, in addition to the ModuleContext.
BE CAREFUL: This will only work with sensors that have StatusValue as
HAS_VALUE property. Others, like DimmerSensor, will throw an exception.
- Parameters:
context
- The Module Context of uAALnamespace
- The namespace of your server, ending with the character #sensor
- The ontology instance of the sensor you are controlling. The
more properties it has set, the better.
- Throws:
InvalidOntologyUtilException
- when an sensor is passed that is does not have StatusValue as
type restriction of its HAS_VALUE property.
handleCall
public ServiceResponse handleCall(ServiceCall call)
- Description copied from class:
ServiceCallee
- The actual service method of the
ServiceCallee
. It is called
by the bus whenever there is a call that need to be serviced by this
ServiceCallee
.
- Specified by:
handleCall
in class ServiceCallee
- Parameters:
call
- the call that needs to be serviced.
- Returns:
- the result of the call execution.
executeGet
public abstract boolean executeGet()
- When a GET STATUS service request is received, this method is called
automatically.
- Returns:
- The Boolean value representing the measured value property of the
sensor.
Copyright © 2014 universAAL Consortium. All Rights Reserved.