Zenoh¶
-
public class
Zenoh
¶ The Zenoh client API.
Methods¶
admin¶
login¶
-
public static Zenoh
login
()¶ Establish a zenoh session through dynamic discovered peers/routers/brokers.
Throws: - ZException – if login fails.
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 notnull
, the locator must have the format:tcp/<ip>:<port>
(for instancetcp/127.0.0.1:7447
).Parameters: - locator – the locator or
null
.
Throws: - ZException – if login fails.
Returns: a
Zenoh
object.- locator – the locator or
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: - ZException – if login fails.
Returns: a
Zenoh
object.- properties – the Properties to be used for this session (e.g. “user”, “password”…). Can be
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 notnull
, the locator must have the format:tcp/<ip>:<port>
(for instancetcp/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: - ZException – if login fails.
Returns: a
Zenoh
object.- locator – the locator or
workspace¶
-
public Workspace
workspace
()¶ Creates a Workspace on the root path. All relative
Selector
orPath
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
orPath
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
orPath
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
orPath
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
.