@InterfaceStability.Uncommitted @InterfaceAudience.Public public class AnalyticsParams extends Object implements Serializable
Parameters for Analytics Queries.
Modifier and Type | Method and Description |
---|---|
static AnalyticsParams |
build()
Start building a
AnalyticsParams , allowing to customize an Analytics requests. |
boolean |
hasServerSideTimeout()
Helper method to check if a custom server side timeout has been applied on the params.
|
void |
injectParams(JsonObject queryJson)
Modifies the given Analytics query (as a
JsonObject ) to reflect these N1qlParams . |
AnalyticsParams |
rawParam(String name,
Object value)
Allows to specify an arbitrary, raw Analytics param.
|
AnalyticsParams |
serverSideTimeout(long timeout,
TimeUnit unit)
Sets a maximum timeout for processing on the server side.
|
AnalyticsParams |
withContextId(String clientContextId)
Adds a client context ID to the request, that will be sent back in the response, allowing clients to meaningfully trace requests/responses when many are exchanged.
|
public void injectParams(JsonObject queryJson)
Modifies the given Analytics query (as a JsonObject
) to reflect these N1qlParams
.
queryJson
- the Analytics querypublic AnalyticsParams withContextId(String clientContextId)
Adds a client context ID to the request, that will be sent back in the response, allowing clients to meaningfully trace requests/responses when many are exchanged.
clientContextId
- the client context ID (null to send none)AnalyticsParams
for chaining.public AnalyticsParams serverSideTimeout(long timeout, TimeUnit unit)
Sets a maximum timeout for processing on the server side.
timeout
- the duration of the timeout.unit
- the unit of the timeout, from nanoseconds to hours.AnalyticsParams
for chaining.@InterfaceStability.Uncommitted public AnalyticsParams rawParam(String name, Object value)
Allows to specify an arbitrary, raw Analytics param.
Use with care and only provide options that are supported by the server and are not exposed as part of the overall stable API in the AnalyticsParams
class.
name
- the name of the property.value
- the value of the property, only JSON value types are supported.AnalyticsParams
for chaining.public boolean hasServerSideTimeout()
Helper method to check if a custom server side timeout has been applied on the params.
public static AnalyticsParams build()
Start building a AnalyticsParams
, allowing to customize an Analytics requests.
AnalyticsParams
Copyright © 2015 Couchbase, Inc.