Package io.zenoh.query
Class Query
-
- All Implemented Interfaces:
-
io.zenoh.ZenohType,java.lang.AutoCloseable
public final class Query implements AutoCloseable, ZenohType
Represents a Zenoh Query in Kotlin.
A Query is generated within the context of a Queryable, when receiving a Query request.
-
-
Field Summary
Fields Modifier and Type Field Description private final Parametersparametersprivate final KeyExprkeyExprprivate final Selectorselectorprivate final ZBytespayloadprivate final Encodingencodingprivate final ZBytesattachment
-
Method Summary
Modifier and Type Method Description final ParametersgetParameters()Shortcut to the selector's parameters. final KeyExprgetKeyExpr()The key expression to which the query is associated. final SelectorgetSelector()The selector final ZBytesgetPayload()Optional payload in case the received query was declared using "with query". final EncodinggetEncoding()Encoding of the payload. final ZBytesgetAttachment()Optional attachment. final Unitreply(KeyExpr keyExpr, IntoZBytes payload, ReplyOptions options)Reply to the specified key expression. final Unitreply(KeyExpr keyExpr, String payload, ReplyOptions options)Reply to the specified key expression. final UnitreplyDel(KeyExpr keyExpr, ReplyDelOptions options)Reply "delete" to the specified key expression. final UnitreplyErr(IntoZBytes message, ReplyErrOptions options)Reply "error" to the specified key expression. final UnitreplyErr(String message, ReplyErrOptions options)Reply "error" to the specified key expression. Unitclose()-
-
Method Detail
-
getParameters
final Parameters getParameters()
Shortcut to the selector's parameters.
-
getKeyExpr
final KeyExpr getKeyExpr()
The key expression to which the query is associated.
-
getSelector
final Selector getSelector()
The selector
-
getPayload
final ZBytes getPayload()
Optional payload in case the received query was declared using "with query".
-
getEncoding
final Encoding getEncoding()
Encoding of the payload.
-
getAttachment
final ZBytes getAttachment()
Optional attachment.
-
reply
final Unit reply(KeyExpr keyExpr, IntoZBytes payload, ReplyOptions options)
Reply to the specified key expression.
- Parameters:
keyExpr- Key expression to reply to.payload- The reply payload.options- Optional options for configuring the reply.
-
reply
final Unit reply(KeyExpr keyExpr, String payload, ReplyOptions options)
Reply to the specified key expression.
- Parameters:
keyExpr- Key expression to reply to.payload- The reply payload as a string.options- Optional options for configuring the reply.
-
replyDel
final Unit replyDel(KeyExpr keyExpr, ReplyDelOptions options)
Reply "delete" to the specified key expression.
- Parameters:
keyExpr- Key expression to reply to.options- Optional options for configuring the reply.
-
replyErr
final Unit replyErr(IntoZBytes message, ReplyErrOptions options)
Reply "error" to the specified key expression.
- Parameters:
message- The error message.options- Optional options for configuring the reply.
-
replyErr
final Unit replyErr(String message, ReplyErrOptions options)
Reply "error" to the specified key expression.
- Parameters:
message- The error message as a String.options- Optional options for configuring the reply.
-
-
-
-