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 Selector expressing the selection.
Throws:
Returns:

a collection of path/value.

put

public void put(Path path, Value value)

Put a path/value into Zenoh.

Parameters:
  • path – the Path. Can be absolute or relative to the workspace.
  • value – the Value.
Throws:

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:

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:

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:

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:

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 Path where the function can be triggered using get(Selector)
  • eval – the evaluation function
Throws:

remove

public void remove(Path path)

Remove a path/value from Zenoh.

Parameters:
  • path – the Path to be removed. Can be absolute or relative to the workspace.
Throws:

subscribe

public SubscriptionId subscribe(Selector selector, Listener listener)

Subscribe to a selection of path/value from Zenoh.

Parameters:
  • selector – the Selector expressing the selection.
  • listener – the Listener that will be called for each change of a path/value matching the selection.
Throws:
Returns:

a SubscriptionId.

unregisterEval

public void unregisterEval(Path path)

Unregister a previously registered evaluation function.

Parameters:
  • path – the Path where the function has been registered
Throws:

unsubscribe

public void unsubscribe(SubscriptionId subid)

Unregisters a previous subscription.

Parameters:
Throws:

update

public void update(Path path, Value value)

Update a path/value into Zenoh.

Parameters:
  • path – the Path. Can be absolute or relative to the workspace.
  • value – a delta to be applied on the existing value.
Throws: