Class ITER_MQTTSubscribe
java.lang.Object
fr.mines_stetienne.ci.sparql_generate.iterator.IteratorStreamFunctionBase
fr.mines_stetienne.ci.sparql_generate.mqtt.ITER_MQTTSubscribe
- All Implemented Interfaces:
IteratorFunction
Iterator function
iter:MQTTSubscribe
connects to a MQTT server, subscribes to some topics, and issues bindings for
the topic (first variable) and the message (second variable) when they are
received.
See Live example
- Param 1: (a String or URL) the MQTT server. Two types of connection are supported tcp:// for a TCP connection and ssl:// for a TCP connection secured by SSL/TLS;
- Param 2 .. n (optional, Strings): topics to subscribe to.
For SSL configuration (programmatic or using JVM arguments), see the constructor of MqttClient.
Additional connection OPTIONS configuration can be programmatically set using
the MqttConnectOptions returned by getOptions().
The MQTT message (byte[]) is assumed to be a UTF-8 string. This behaviour may
may changed using setParser(java.util.function.Function<byte[], org.apache.jena.sparql.expr.NodeValue>) static method.
- Since:
- 2018-10-02
- Author:
- Maxime Lefrançois invalid input: '<'maxime.lefrancois at emse.fr>
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final org.eclipse.paho.client.mqttv3.MqttConnectOptionsstatic Function<byte[], org.apache.jena.sparql.expr.NodeValue> static final StringFields inherited from class fr.mines_stetienne.ci.sparql_generate.iterator.IteratorStreamFunctionBase
arguments -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidcheckBuild(org.apache.jena.sparql.expr.ExprList args) Partially checks if the iterator function can be executed with the given arguments.voidexec(List<org.apache.jena.sparql.expr.NodeValue> args, Consumer<List<List<org.apache.jena.sparql.expr.NodeValue>>> listListNodeValue) IteratorFunction call to a list of evaluated argument values.static org.eclipse.paho.client.mqttv3.MqttConnectOptionsstatic voidMethods inherited from class fr.mines_stetienne.ci.sparql_generate.iterator.IteratorStreamFunctionBase
build, exec, getContext
-
Field Details
-
URI
- See Also:
-
OPTIONS
public static final org.eclipse.paho.client.mqttv3.MqttConnectOptions OPTIONS -
PARSER
-
-
Constructor Details
-
ITER_MQTTSubscribe
public ITER_MQTTSubscribe()
-
-
Method Details
-
setParser
-
getOptions
public static org.eclipse.paho.client.mqttv3.MqttConnectOptions getOptions() -
checkBuild
public void checkBuild(org.apache.jena.sparql.expr.ExprList args) Description copied from class:IteratorStreamFunctionBasePartially checks if the iterator function can be executed with the given arguments.- Specified by:
checkBuildin classIteratorStreamFunctionBase- Parameters:
args- -
-
exec
public void exec(List<org.apache.jena.sparql.expr.NodeValue> args, Consumer<List<List<org.apache.jena.sparql.expr.NodeValue>>> listListNodeValue) Description copied from class:IteratorStreamFunctionBaseIteratorFunction call to a list of evaluated argument values.- Specified by:
execin classIteratorStreamFunctionBase- Parameters:
args- -listListNodeValue- - where to emit collections of nodevalues
-