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 Parameters
parameters
private final KeyExpr
keyExpr
private final Selector
selector
private final ZBytes
payload
private final Encoding
encoding
private final ZBytes
attachment
-
Method Summary
Modifier and Type Method Description final Parameters
getParameters()
Shortcut to the selector's parameters. final KeyExpr
getKeyExpr()
The key expression to which the query is associated. final Selector
getSelector()
The selector final ZBytes
getPayload()
Optional payload in case the received query was declared using "with query". final Encoding
getEncoding()
Encoding of the payload. final ZBytes
getAttachment()
Optional attachment. final Unit
reply(KeyExpr keyExpr, IntoZBytes payload, ReplyOptions options)
Reply to the specified key expression. final Unit
reply(KeyExpr keyExpr, String payload, ReplyOptions options)
Reply to the specified key expression. final Unit
replyDel(KeyExpr keyExpr, ReplyDelOptions options)
Reply "delete" to the specified key expression. final Unit
replyErr(IntoZBytes message, ReplyErrOptions options)
Reply "error" to the specified key expression. final Unit
replyErr(String message, ReplyErrOptions options)
Reply "error" to the specified key expression. Unit
close()
-
-
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.
-
-
-
-