public class UtilActuator 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.
|
static String |
SERVICE_TURN_OFF
Service suffix.
|
static String |
SERVICE_TURN_ON
Service suffix.
|
Constructor and Description |
---|
UtilActuator() |
Modifier and Type | Method and Description |
---|---|
static ServiceProfile[] |
getServiceProfiles(String namespace,
Actuator actuator)
Gives you the 3 typical service profiles of an on/off actuator service:
Get status, Set On, and Set Off.
|
static ServiceProfile[] |
getServiceProfiles(String namespace,
String ontologyURI,
Actuator actuator)
Gives you the 3 typical service profiles of an on/off actuator service:
Get status, Set On, and Set Off.
|
static ServiceRequest |
requestGetOnOff(Actuator actuator,
String out)
Gives you the typical GET STATUS service request for actuator services.
|
static ServiceRequest |
requestGetOnOff(String ontologyURI,
Actuator actuator,
String out)
Gives you the typical GET STATUS service request for actuator services.
|
static ServiceRequest |
requestGetOnOff(String ontologyURI,
Variable argIn,
Output argOut)
Gives you the typical GET STATUS service request for actuator services.
|
static ServiceRequest |
requestSetOff(Actuator actuator)
Gives you the typical SET OFF service request for actuator services.
|
static ServiceRequest |
requestSetOff(String ontologyURI,
Actuator actuator)
Gives you the typical SET OFF service request for actuator services.
|
static ServiceRequest |
requestSetOff(String ontologyURI,
Variable argIn)
Gives you the typical SET OFF service request for actuator services.
|
static ServiceRequest |
requestSetOn(Actuator actuator)
Gives you the typical SET ON service request for actuator services.
|
static ServiceRequest |
requestSetOn(String ontologyURI,
Actuator actuator)
Gives you the typical SET ON service request for actuator services.
|
static ServiceRequest |
requestSetOn(String ontologyURI,
Variable argIn)
Gives you the typical SET ON service request for actuator services.
|
public static final String SERVICE_GET_ON_OFF
public static final String OUT_GET_ON_OFF
public static final String SERVICE_TURN_OFF
public static final String SERVICE_TURN_ON
public static final String IN_DEVICE
public static ServiceProfile[] getServiceProfiles(String namespace, String ontologyURI, Actuator actuator) throws InvalidOntologyUtilException
namespace
to UtilActuator constants.
BE CAREFUL: This will only work with actuators that have StatusValue as HAS_VALUE property. Others, like DimmerActuator, will throw an exception.
Example:
new SCallee(context, getServiceProfiles("http://ontology.universAAL.org/OvenServer.owl#", OvenService.MY_URI, myOvenDevice))
namespace
- The namespace of your server, ending with the character #. You
can optionally add some prefix after the # if you use
UtilActuator 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.actuator
- The ontology instance of the actuator you are controlling. The
more properties it has set, the better.InvalidOntologyUtilException
- when an actuator is passed that is does not have StatusValue
as type restriction of its HAS_VALUE property.public static ServiceProfile[] getServiceProfiles(String namespace, Actuator actuator) throws InvalidOntologyUtilException
namespace
to UtilActuator constants. The service is treated
as the default DeviceService, in case you don't have a specific service
ontology for the type of actuator you are handling.
BE CAREFUL: This will only work with actuators that have StatusValue as HAS_VALUE property. Others, like DimmerActuator, 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
UtilActuator more than once in the same Callee.actuator
- The ontology instance of the actuator you are controlling. The
more properties it has set, the better.InvalidOntologyUtilException
- when an actuator is passed that is does not have StatusValue
as type restriction of its HAS_VALUE propertypublic 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 actuator GET service will be called for this specific
actuator.argOut
- The returned value of the actuator 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, Actuator actuator, String out)
ontologyURI
- The MY_URI of the class of Service ontology you want to callactuator
- The ontology instance of the actuator you want to get the
status from.out
- The returned value of the actuator GET service will be placed
in the URI represented by this String. Look for it there in
the response.public static ServiceRequest requestGetOnOff(Actuator actuator, String out)
actuator
- The ontology instance of the actuator you want to get the
status from.out
- The returned value of the actuator GET service will be placed
in the URI represented by this String. Look for it there in
the response.public static ServiceRequest requestSetOn(String ontologyURI, Variable argIn)
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 actuator SET ON service will be called for this specific
actuator.public static ServiceRequest requestSetOn(String ontologyURI, Actuator actuator)
ontologyURI
- The MY_URI of the class of Service ontology you want to callactuator
- The ontology instance of the actuator you want to set on.public static ServiceRequest requestSetOn(Actuator actuator)
actuator
- The ontology instance of the actuator you want to set on.public static ServiceRequest requestSetOff(String ontologyURI, Variable argIn)
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 actuator SET OFF service will be called for this specific
actuator.public static ServiceRequest requestSetOff(String ontologyURI, Actuator actuator)
ontologyURI
- The MY_URI of the class of Service ontology you want to callactuator
- The ontology instance of the actuator you want to set off.public static ServiceRequest requestSetOff(Actuator actuator)
actuator
- The ontology instance of the actuator you want to set off.Copyright © 2018 universAAL Consortium. All rights reserved.