Zenoh

public class Zenoh

The Zenoh client API.

Methods

admin

public Admin admin()

Returns the Admin object that provides helper operations to administer Zenoh.

login

public static Zenoh login()

Establish a zenoh session through dynamic discovered peers/routers/brokers.

Throws:
Returns:

a Zenoh object.

login

public static Zenoh login(String locator)

Establish a zenoh session via a provided locator. Locator is a string representing the network endpoint to which establish the session. If the provided locator is null, login will perform some dynamic discovery and try to establish the session automatically. When not null, the locator must have the format: tcp/<ip>:<port> (for instance tcp/127.0.0.1:7447).

Parameters:
  • locator – the locator or null.
Throws:
Returns:

a Zenoh object.

login

public static Zenoh login(Properties properties)

Establish a zenoh session through dynamic discovered peers/routers/brokers.

Parameters:
  • properties – the Properties to be used for this session (e.g. “user”, “password”…). Can be null.
Throws:
Returns:

a Zenoh object.

login

public static Zenoh login(String locator, Properties properties)

Establish a zenoh session via a provided locator. Locator is a string representing the network endpoint to which establish the session. If the provided locator is null, login will perform some dynamic discovery and try to establish the session automatically. When not null, the locator must have the format: tcp/<ip>:<port> (for instance tcp/127.0.0.1:7447).

Parameters:
  • locator – the locator or null.
  • properties – the Properties to be used for this session (e.g. “user”, “password”…). Can be null.
Throws:
Returns:

a Zenoh object.

logout

public void logout()

Terminates the Zenoh session.

workspace

public Workspace workspace()

Creates a Workspace on the root path. All relative Selector or Path used with this Workspace will be relative to this path.

Notice that all subscription listeners and eval callbacks declared in this workspace will be executed by the I/O thread. This implies that no long operations or other call to Zenoh shall be performed in those callbacks.

Returns:a Workspace.

workspace

public Workspace workspace(Path path)

Creates a Workspace using the provided path. All relative Selector or Path used with this Workspace will be relative to this path.

Notice that all subscription listeners and eval callbacks declared in this workspace will be executed by the I/O thread. This implies that no long operations or other call to Zenoh shall be performed in those callbacks.

Parameters:
  • path – the Workspace’s path.
Returns:

a Workspace.

workspaceWithExecutor

public Workspace workspaceWithExecutor(Path path)

Creates a Workspace using the provided path. All relative Selector or Path used with this Workspace will be relative to this path.

Notice that all subscription listeners and eval callbacks declared in this workspace will be executed by a CachedThreadPool. This is useful when listeners and/or callbacks need to perform long operations or need to call other Zenoh operations.

Parameters:
  • path – the Workspace’s path.
Returns:

a Workspace.

workspaceWithExecutor

public Workspace workspaceWithExecutor()

Creates a Workspace using the provided path. All relative Selector or Path used with this Workspace will be relative to this path.

Notice that all subscription listeners and eval callbacks declared in this workspace will be executed by a CachedThreadPool. This is useful when listeners and/or callbacks need to perform long operations or need to call other Zenoh operations.

Returns:a Workspace.