Class AnalyticsParams
java.lang.Object
com.couchbase.client.java.analytics.AnalyticsParams
- All Implemented Interfaces:
Serializable
@Committed @Public public class AnalyticsParams extends Object implements Serializable
Parameters for Analytics Queries.
- Since:
- 2.4.3
- Author:
- Michael Nitschinger
- See Also:
- Serialized Form
-
Method Summary
Modifier and Type Method Description static AnalyticsParamsbuild()Start building aAnalyticsParams, allowing to customize an Analytics requests.StringclientContextId()Helper method to check if a client context ID is set.booleandeferred()AnalyticsParamsdeferred(boolean deferred)Set to true for deferred query execution (Translates to mode async for the server request)booleanequals(Object o)inthashCode()booleanhasServerSideTimeout()Helper method to check if a custom server side timeout has been applied on the params.voidinjectParams(JsonObject queryJson)Modifies the given Analytics query (as aJsonObject) to reflect theseN1qlParams.AnalyticsParamspretty(boolean pretty)If set to false, the server will be instructed to remove extra whitespace from the JSON response in order to save bytes.intpriority()Returns the set priority as an integer.AnalyticsParamspriority(boolean priority)If this request should receive priority in server side scheduling.AnalyticsParamsrawParam(String name, Object value)Allows to specify an arbitrary, raw Analytics param.AnalyticsParamsserverSideTimeout(long timeout, TimeUnit unit)Sets a maximum timeout for processing on the server side.StringtoString()AnalyticsParamswithContextId(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.
-
Method Details
-
injectParams
Modifies the given Analytics query (as aJsonObject) to reflect theseN1qlParams.- Parameters:
queryJson- the Analytics query
-
withContextId
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.- Parameters:
clientContextId- the client context ID (null to send none)- Returns:
- this
AnalyticsParamsfor chaining.
-
serverSideTimeout
Sets a maximum timeout for processing on the server side.- Parameters:
timeout- the duration of the timeout.unit- the unit of the timeout, from nanoseconds to hours.- Returns:
- this
AnalyticsParamsfor chaining.
-
rawParam
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 theAnalyticsParamsclass.- Parameters:
name- the name of the property.value- the value of the property, only JSON value types are supported.- Returns:
- this
AnalyticsParamsfor chaining.
-
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.- Parameters:
pretty- if set to false, pretty responses are disabled.- Returns:
- this
AnalyticsParamsfor chaining.
-
priority
If this request should receive priority in server side scheduling. Default is false.- Parameters:
priority- true if it should, false otherwise.- Returns:
- this
AnalyticsParamsfor chaining.
-
deferred
-
deferred
Set to true for deferred query execution (Translates to mode async for the server request)- Parameters:
deferred- true for deferred execution, false otherwise.- Returns:
- this
AnalyticsParamsfor chaining.
-
priority
Returns the set priority as an integer. This method is considered private API.- Returns:
- the priority if set, 0 if not set.
-
hasServerSideTimeout
public boolean hasServerSideTimeout()Helper method to check if a custom server side timeout has been applied on the params.- Returns:
- true if it has, false otherwise.
-
clientContextId
Helper method to check if a client context ID is set. -
build
Start building aAnalyticsParams, allowing to customize an Analytics requests.- Returns:
- a new
AnalyticsParams
-
equals
-
hashCode
public int hashCode() -
toString
-