@InterfaceStability.Uncommitted @InterfaceAudience.Public public class AsyncRawQueryExecutor extends Object
N1QL
and FTS
queries
asynchronously and receive a raw version of the service's JSON response.
The responses can directly be exposed as JsonObject
or String
, but custom methods allow
to work from a byte array (for N1QL) or String (for FTS) and perform a custom deserialization.
Note that this class is outside of the Bucket API as it is uncommitted,
and is not common to all Couchbase SDKs.Constructor and Description |
---|
AsyncRawQueryExecutor(String bucket,
String password,
ClusterFacade core) |
AsyncRawQueryExecutor(String bucket,
String username,
String password,
ClusterFacade core) |
Modifier and Type | Method and Description |
---|---|
rx.Observable<JsonObject> |
ftsToJsonObject(SearchQuery query)
Asynchronously perform a
SearchQuery and return the raw N1QL response as a JsonObject . |
<T> rx.Observable<T> |
ftsToRawCustom(SearchQuery query,
rx.functions.Func1<String,T> deserializer)
Asynchronously perform a
SearchQuery and apply a user function to deserialize the raw JSON
FTS response, which is represented as a String . |
rx.Observable<String> |
ftsToRawJson(SearchQuery query)
Asynchronously perform a
SearchQuery and return the raw N1QL response as a String. |
rx.Observable<JsonObject> |
n1qlToJsonObject(N1qlQuery query)
Asynchronously perform a
N1qlQuery and return the raw N1QL response as a JsonObject . |
<T> rx.Observable<T> |
n1qlToRawCustom(N1qlQuery query,
rx.functions.Func1<TranscoderUtils.ByteBufToArray,T> deserializer)
Asynchronously perform a
N1qlQuery and apply a user function to deserialize the raw N1QL
response, which is represented as a "TranscoderUtils.ByteBufToArray". |
rx.Observable<String> |
n1qlToRawJson(N1qlQuery query)
Asynchronously perform a
N1qlQuery and return the raw N1QL response as a String. |
public AsyncRawQueryExecutor(String bucket, String password, ClusterFacade core)
public AsyncRawQueryExecutor(String bucket, String username, String password, ClusterFacade core)
public rx.Observable<JsonObject> n1qlToJsonObject(N1qlQuery query)
N1qlQuery
and return the raw N1QL response as a JsonObject
.
Note that the query is executed "as is", without any processing comparable to what is done in
AsyncBucket.query(N1qlQuery)
(like enforcing a server side timeout or managing prepared
statements).query
- the query to execute.Observable
of the N1QL response as a JsonObject
.public rx.Observable<String> n1qlToRawJson(N1qlQuery query)
N1qlQuery
and return the raw N1QL response as a String.
Note that the query is executed "as is", without any processing comparable to what is done in
AsyncBucket.query(N1qlQuery)
(like enforcing a server side timeout or managing prepared
statements).query
- the query to execute.Observable
of the N1QL response as a String.public <T> rx.Observable<T> n1qlToRawCustom(N1qlQuery query, rx.functions.Func1<TranscoderUtils.ByteBufToArray,T> deserializer)
N1qlQuery
and apply a user function to deserialize the raw N1QL
response, which is represented as a "TranscoderUtils.ByteBufToArray".
The array is derived from a ByteBuf
that will be released, so it shouldn't be used
to back the returned instance. Its scope should be considered the scope of the call method.
Note that the query is executed "as is", without any processing comparable to what is done in
AsyncBucket.query(N1qlQuery)
(like enforcing a server side timeout or managing prepared
statements).T
- the type of the response, once deserialized by the user-provided function.query
- the query to execute.deserializer
- a deserializer function that transforms the byte representation of the response into a custom type T.Observable
of the N1QL response as a T.public rx.Observable<JsonObject> ftsToJsonObject(SearchQuery query)
SearchQuery
and return the raw N1QL response as a JsonObject
.
Note that the query is executed "as is", without any processing comparable to what is done in
AsyncBucket.query(SearchQuery)
(like enforcing a server side timeout).query
- the query to execute.Observable
of the FTS response as a JsonObject
.public rx.Observable<String> ftsToRawJson(SearchQuery query)
SearchQuery
and return the raw N1QL response as a String.
Note that the query is executed "as is", without any processing comparable to what is done in
AsyncBucket.query(SearchQuery)
(like enforcing a server side timeout).query
- the query to execute.Observable
of the FTS response as a String.public <T> rx.Observable<T> ftsToRawCustom(SearchQuery query, rx.functions.Func1<String,T> deserializer)
SearchQuery
and apply a user function to deserialize the raw JSON
FTS response, which is represented as a String
.
Note that the query is executed "as is", without any processing comparable to what is done in
AsyncBucket.query(SearchQuery)
(like enforcing a server side timeout).T
- the type of the response, once deserialized by the user-provided function.query
- the query to execute.deserializer
- a deserializer function that transforms the String representation of the response into a custom type T.Observable
of the FTS response as a T.Copyright © 2015 Couchbase, Inc.