@InterfaceStability.Committed @InterfaceAudience.Public public class AnalyticsParams extends Object implements Serializable
Modifier and Type | Method and Description |
---|---|
static AnalyticsParams |
build()
Start building a
AnalyticsParams , allowing to customize an Analytics requests. |
String |
clientContextId()
Helper method to check if a client context ID is set.
|
boolean |
deferred() |
AnalyticsParams |
deferred(boolean deferred)
Set to true for deferred query execution
(Translates to mode async for the server request)
|
boolean |
equals(Object o) |
int |
hashCode() |
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 |
pretty(boolean pretty)
If set to false, the server will be instructed to remove extra whitespace from the JSON response
in order to save bytes.
|
int |
priority()
Returns the set priority as an integer.
|
AnalyticsParams |
priority(boolean priority)
If this request should receive priority in server side scheduling.
|
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.
|
String |
toString() |
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)
JsonObject
) to reflect these N1qlParams
.queryJson
- the Analytics querypublic AnalyticsParams withContextId(String clientContextId)
clientContextId
- the client context ID (null to send none)AnalyticsParams
for chaining.public AnalyticsParams serverSideTimeout(long timeout, TimeUnit unit)
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)
AnalyticsParams
class.name
- the name of the property.value
- the value of the property, only JSON value types are supported.AnalyticsParams
for chaining.public AnalyticsParams pretty(boolean pretty)
pretty
- if set to false, pretty responses are disabled.AnalyticsParams
for chaining.public AnalyticsParams priority(boolean priority)
priority
- true if it should, false otherwise.AnalyticsParams
for chaining.@InterfaceAudience.Private public boolean deferred()
public AnalyticsParams deferred(boolean deferred)
deferred
- true for deferred execution, false otherwise.AnalyticsParams
for chaining.@InterfaceAudience.Private public int priority()
public boolean hasServerSideTimeout()
public String clientContextId()
public static AnalyticsParams build()
AnalyticsParams
, allowing to customize an Analytics requests.AnalyticsParams
Copyright © 2015 Couchbase, Inc.