public class UtilSensor extends Object
Modifier and Type | Field and Description |
---|---|
static String |
IN_DEVICE
Argument suffix.
|
static String |
OUT_GET_ON_OFF
Argument suffix.
|
static String |
SERVICE_GET_ON_OFF
Service suffix.
|
Constructor and Description |
---|
UtilSensor() |
Modifier and Type | Method and Description |
---|---|
static ServiceProfile[] |
getServiceProfiles(String namespace,
Sensor sensor)
Gives you the typical service profile of an on/off sensor service: Get
status.
|
static ServiceProfile[] |
getServiceProfiles(String namespace,
String ontologyURI,
Sensor sensor)
Gives you the typical service profile of an on/off sensor service: Get
status.
|
static ServiceRequest |
requestGetOnOff(Sensor sensor,
Output argOut)
Gives you the typical GET STATUS service request for sensor services.
|
static ServiceRequest |
requestGetOnOff(Sensor sensor,
String out)
Gives you the typical GET STATUS service request for sensor services.
|
static ServiceRequest |
requestGetOnOff(String ontologyURI,
Object in,
String out)
Gives you the typical GET STATUS service request for sensor services.
|
static ServiceRequest |
requestGetOnOff(String ontologyURI,
Sensor sensor,
Output argOut)
Gives you the typical GET STATUS service request for sensor services.
|
static ServiceRequest |
requestGetOnOff(String ontologyURI,
Sensor sensor,
String out)
Gives you the typical GET STATUS service request for sensor services.
|
static ServiceRequest |
requestGetOnOff(String ontologyURI,
Variable argIn,
Output argOut)
Gives you the typical GET STATUS service request for sensor services.
|
public static final String SERVICE_GET_ON_OFF
public static final String OUT_GET_ON_OFF
public static final String IN_DEVICE
public static ServiceProfile[] getServiceProfiles(String namespace, String ontologyURI, Sensor sensor) throws InvalidOntologyUtilException
namespace
to
UtilSensor constants.
BE CAREFUL: This will only work with sensors that have StatusValue as HAS_VALUE property. Others, like DimmerSensor, will throw an exception.
Example:
new SCallee(context, getServiceProfiles("http://ontology.universAAL.org/OvenServer.owl#", CarpetSensor.MY_URI, myCarpetSensor))
namespace
- The namespace of your server, ending with the character #. You
can optionally add some prefix after the # if you use
UtilSensor more than once in the same Callee.ontologyURI
- The MY_URI of the class of DeviceService ontology you are
going to implement. It MUST be a subclass of DeviceService.sensor
- The ontology instance of the sensor you are controlling. The
more properties it has set, the better.InvalidOntologyUtilException
- when an sensor is passed that is does not have StatusValue as
type restriction of its HAS_VALUE property.public static ServiceProfile[] getServiceProfiles(String namespace, Sensor sensor) throws InvalidOntologyUtilException
namespace
to
UtilSensor constants.
BE CAREFUL: This will only work with sensors that have StatusValue as HAS_VALUE property. Others, like DimmerSensor, will throw an exception.
namespace
- The namespace of your server, ending with the character #. You
can optionally add some prefix after the # if you use
UtilSensor more than once in the same Callee.sensor
- The ontology instance of the sensor you are controlling. The
more properties it has set, the better.InvalidOntologyUtilException
- when an sensor is passed that is does not have StatusValue as
type restriction of its HAS_VALUE property.public static ServiceRequest requestGetOnOff(String ontologyURI, Variable argIn, Output argOut)
ontologyURI
- The MY_URI of the class of Service ontology you want to callargIn
- Value representing the input you want to pass as parameter.
The sensor GET service will be called for this specific
actuator.argOut
- The returned value of the sensor GET service will be placed in
the URI represented by this Output. Look for it there in the
response.public static ServiceRequest requestGetOnOff(String ontologyURI, Object in, String out)
ontologyURI
- The MY_URI of the class of Service ontology you want to callin
- Object representing the input you want to pass as parameter.
The sensor GET service will be called for this specific
actuator.out
- The returned value of the sensor GET service will be placed in
this URI. Look for it there in the response.public static ServiceRequest requestGetOnOff(String ontologyURI, Sensor sensor, Output argOut)
ontologyURI
- The MY_URI of the class of Service ontology you want to callsensor
- The ontology instance of the sensor you want to get the status
from.argOut
- The returned value of the sensor GET service will be placed in
the URI represented by this Output. Look for it there in the
response.public static ServiceRequest requestGetOnOff(String ontologyURI, Sensor sensor, String out)
ontologyURI
- The MY_URI of the class of Service ontology you want to callsensor
- The ontology instance of the sensor you want to get the status
from.out
- The returned value of the sensor GET service will be placed in
the URI represented by this String. Look for it there in the
response.public static ServiceRequest requestGetOnOff(Sensor sensor, Output argOut)
sensor
- The ontology instance of the sensor you want to get the status
from.argOut
- The returned value of the sensor GET service will be placed in
the URI represented by this Output. Look for it there in the
response.public static ServiceRequest requestGetOnOff(Sensor sensor, String out)
sensor
- The ontology instance of the sensor you want to get the status
from.out
- The returned value of the sensor GET service will be placed in
the URI represented by this String. Look for it there in the
response.Copyright © 2018 universAAL Consortium. All rights reserved.