@InterfaceStability.Committed @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. |
String |
clientContextId()
Helper method to check if a client context ID is set.
|
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)
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 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. In performance-critical environments as well as large responses this is recommended in order to cut down on network traffic.
Note that false is the default, since usually that’s what is recommended.
pretty
- if set to false, pretty responses are disabled.AnalyticsParams
for chaining.public AnalyticsParams priority(boolean priority)
If this request should receive priority in server side scheduling.
Default is false.
priority
- true if it should, false otherwise.AnalyticsParams
for chaining.@InterfaceAudience.Private public int priority()
Returns the set priority as an integer.
This method is considered private API.
public boolean hasServerSideTimeout()
Helper method to check if a custom server side timeout has been applied on the params.
public String clientContextId()
Helper method to check if a client context ID is set.
public static AnalyticsParams build()
Start building a AnalyticsParams
, allowing to customize an Analytics requests.
AnalyticsParams
Copyright © 2015 Couchbase, Inc.