Workspace¶
-
public class
Workspace¶ A Workspace to operate on Zenoh.
Constructors¶
Workspace¶
-
protected
Workspace(Path path, Session session, ExecutorService threadPool)¶
Methods¶
get¶
-
public Collection<Data>
get(Selector selector)¶ Get a selection of path/value from Zenoh.
Parameters: - selector – the
Selectorexpressing the selection.
Throws: - ZException – if get failed.
Returns: a collection of path/value.
- selector – the
put¶
put¶
-
public void
put(Path path, String value)¶ Put a path/String into Zenoh.
Parameters: - path – the
Path. Can be absolute or relative to the workspace. - value – the value
java.lang.String.
Throws: - ZException – if put failed.
- path – the
put¶
-
public void
put(Path path, long value)¶ Put a path/integer into Zenoh.
Parameters: - path – the
Path. Can be absolute or relative to the workspace. - value – the integer value as a long
Throws: - ZException – if put failed.
- path – the
put¶
-
public void
put(Path path, double value)¶ Put a path/float into Zenoh.
Parameters: - path – the
Path. Can be absolute or relative to the workspace. - value – the float value as a double.
Throws: - ZException – if put failed.
- path – the
put¶
-
public void
put(Path path, ByteBuffer value)¶ Put a path/ByteBuffer into Zenoh using the RAW encoding.
Parameters: - path – the
Path. Can be absolute or relative to the workspace. - value – the ByteBuffer.
Throws: - ZException – if put failed.
- path – the
registerEval¶
-
public void
registerEval(Path path, Eval eval)¶ Registers an evaluation function under the provided
Path. The function will be evaluated in a dedicated thread, and thus may call any other Workspace operation.Parameters: - path – the
Pathwhere the function can be triggered usingget(Selector) - eval – the evaluation function
Throws: - ZException – if registration failed.
- path – the
remove¶
-
public void
remove(Path path)¶ Remove a path/value from Zenoh.
Parameters: - path – the
Pathto be removed. Can be absolute or relative to the workspace.
Throws: - ZException – if remove failed.
- path – the
subscribe¶
-
public SubscriptionId
subscribe(Selector selector, Listener listener)¶ Subscribe to a selection of path/value from Zenoh.
Parameters: Throws: - ZException – if subscribe failed.
Returns:
unregisterEval¶
-
public void
unregisterEval(Path path)¶ Unregister a previously registered evaluation function.
Parameters: - path – the
Pathwhere the function has been registered
Throws: - ZException – if unregistration failed.
- path – the
unsubscribe¶
-
public void
unsubscribe(SubscriptionId subid)¶ Unregisters a previous subscription.
Parameters: - subid – the
SubscriptionIdto unregister
Throws: - ZException – if unsusbscribe failed.
- subid – the