Class AnalyticsParams

    • Method Detail

      • injectParams

        public void injectParams​(JsonObject queryJson)
        Modifies the given Analytics query (as a JsonObject) to reflect these N1qlParams.
        Parameters:
        queryJson - the Analytics query
      • withContextId

        public 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.
        Parameters:
        clientContextId - the client context ID (null to send none)
        Returns:
        this AnalyticsParams for chaining.
      • serverSideTimeout

        public AnalyticsParams serverSideTimeout​(long timeout,
                                                 TimeUnit unit)
        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 AnalyticsParams for chaining.
      • rawParam

        @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.
        Parameters:
        name - the name of the property.
        value - the value of the property, only JSON value types are supported.
        Returns:
        this AnalyticsParams for chaining.
      • pretty

        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.
        Parameters:
        pretty - if set to false, pretty responses are disabled.
        Returns:
        this AnalyticsParams for chaining.
      • priority

        public AnalyticsParams priority​(boolean priority)
        If this request should receive priority in server side scheduling. Default is false.
        Parameters:
        priority - true if it should, false otherwise.
        Returns:
        this AnalyticsParams for chaining.
      • deferred

        @Private
        public boolean deferred()
      • deferred

        public AnalyticsParams deferred​(boolean 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 AnalyticsParams for chaining.
      • priority

        @Private
        public int 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

        public String clientContextId()
        Helper method to check if a client context ID is set.
      • hashCode

        public int hashCode()
        Overrides:
        hashCode in class Object