Class GenericAnalyticsRequest

java.lang.Object
com.couchbase.client.core.message.AbstractCouchbaseRequest
com.couchbase.client.core.message.analytics.GenericAnalyticsRequest
All Implemented Interfaces:
AnalyticsRequest, CouchbaseMessage, CouchbaseRequest, PrelocatedRequest
Direct Known Subclasses:
RawAnalyticsRequest

@Uncommitted
@Public
public class GenericAnalyticsRequest
extends AbstractCouchbaseRequest
implements AnalyticsRequest, PrelocatedRequest
For the lack of a better name, a analytics request against a analytics server.
Since:
1.4.3
Author:
Michael Nitschinger
  • Field Details

  • Constructor Details

    • GenericAnalyticsRequest

      protected GenericAnalyticsRequest​(String query, boolean jsonFormat, String bucket, String username, String password, String targetNode, int priority)
  • Method Details

    • afterSpanSet

      protected void afterSpanSet​(io.opentracing.Span span)
      Description copied from class: AbstractCouchbaseRequest
      Use this method to add custom span values on insert.
      Overrides:
      afterSpanSet in class AbstractCouchbaseRequest
    • query

      public String query()
    • priority

      public int priority()
    • isJsonFormat

      public boolean isJsonFormat()
    • sendTo

      public String sendTo()
      Description copied from interface: PrelocatedRequest
      The hostname to send this request to, or null to use default node location process.
      Specified by:
      sendTo in interface PrelocatedRequest
      Returns:
      the address of the target node or null to revert to default dispatching.
    • simpleStatement

      public static GenericAnalyticsRequest simpleStatement​(String statement, String bucket, String password)
      Creates a GenericAnalyticsRequest and mark it as containing a single simple statement (e.g. "SELECT * FROM default").
      Parameters:
      statement - the Analytics query statement to perform.
      bucket - the bucket on which to search.
      password - the password for the target bucket.
      Returns:
      a GenericAnalyticsRequest for this simple statement.
    • simpleStatement

      public static GenericAnalyticsRequest simpleStatement​(String statement, String bucket, String username, String password)
      Creates a GenericAnalyticsRequest and mark it as containing a single simple statement (e.g. "SELECT * FROM default").
      Parameters:
      statement - the Analytics query statement to perform.
      bucket - the bucket on which to search.
      username - the user authorized for bucket access.
      password - the password for the user.
      Returns:
      a GenericAnalyticsRequest for this simple statement.
    • jsonQuery

      public static GenericAnalyticsRequest jsonQuery​(String jsonQuery, String bucket, String username, String password, int priority)
      Create a GenericAnalyticsRequest and mark it as containing a full Analytics query in Json form (including additional query parameters). The simplest form of such a query is a single statement encapsulated in a json query object:
      {"statement":"SELECT * FROM default"}
      .
      Parameters:
      jsonQuery - the Analytics query in json form.
      bucket - the bucket on which to perform the query.
      password - the password for the target bucket.
      Returns:
      a GenericAnalyticsRequest for this full query.
    • jsonQuery

      public static GenericAnalyticsRequest jsonQuery​(String jsonQuery, String bucket, String username, String password)
      Create a GenericAnalyticsRequest and mark it as containing a full Analytics query in Json form (including additional query parameters). The simplest form of such a query is a single statement encapsulated in a json query object:
      {"statement":"SELECT * FROM default"}
      .
      Parameters:
      jsonQuery - the Analytics query in json form.
      bucket - the bucket on which to perform the query.
      password - the password for the target bucket.
      Returns:
      a GenericAnalyticsRequest for this full query.
    • jsonQuery

      public static GenericAnalyticsRequest jsonQuery​(String jsonQuery, String bucket, String username, String password, String targetNode)
      Create a GenericAnalyticsRequest and mark it as containing a full Analytics query in Json form (including additional query parameters). The simplest form of such a query is a single statement encapsulated in a json query object:
      {"statement":"SELECT * FROM default"}
      .
      Parameters:
      jsonQuery - the Analytics query in json form.
      bucket - the bucket on which to perform the query.
      username - the username authorized for bucket access.
      password - the password for the user.
      targetNode - the node on which to execute this request (or null to let the core locate and choose one).
      Returns:
      a GenericAnalyticsRequest for this full query.
    • path

      public String path()
      Description copied from interface: AnalyticsRequest
      Get path to construct the uri
      Specified by:
      path in interface AnalyticsRequest