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 Summary
Fields Modifier and Type Field Description static int
NO_PRIORITY
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected void
afterSpanSet(io.opentracing.Span span)
Use this method to add custom span values on insert.boolean
isJsonFormat()
static GenericAnalyticsRequest
jsonQuery(String jsonQuery, String bucket, String username, String password)
Create aGenericAnalyticsRequest
and mark it as containing a full Analytics query in Json form (including additional query parameters).static GenericAnalyticsRequest
jsonQuery(String jsonQuery, String bucket, String username, String password, int priority)
Create aGenericAnalyticsRequest
and mark it as containing a full Analytics query in Json form (including additional query parameters).static GenericAnalyticsRequest
jsonQuery(String jsonQuery, String bucket, String username, String password, String targetNode)
Create aGenericAnalyticsRequest
and mark it as containing a full Analytics query in Json form (including additional query parameters).String
path()
Get path to construct the uriint
priority()
String
query()
String
sendTo()
The hostname to send this request to, or null to use defaultnode location process
.static GenericAnalyticsRequest
simpleStatement(String statement, String bucket, String password)
Creates aGenericAnalyticsRequest
and mark it as containing a single simple statement (e.g.static GenericAnalyticsRequest
simpleStatement(String statement, String bucket, String username, String password)
Creates aGenericAnalyticsRequest
and mark it as containing a single simple statement (e.g.-
Methods inherited from class com.couchbase.client.core.message.AbstractCouchbaseRequest
bucket, complete, creationTime, dispatchHostname, dispatchHostname, emit, fail, incrementRetryCount, isActive, lastLocalId, lastLocalId, lastLocalSocket, lastLocalSocket, lastRemoteSocket, lastRemoteSocket, maxRetryDuration, maxRetryDuration, observable, operationId, password, retryAfter, retryAfter, retryCount, retryDelay, retryDelay, span, span, subscriber, succeed, toString, username
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
-
Methods inherited from interface com.couchbase.client.core.message.CouchbaseMessage
creationTime
-
Methods inherited from interface com.couchbase.client.core.message.CouchbaseRequest
bucket, complete, dispatchHostname, dispatchHostname, emit, fail, incrementRetryCount, isActive, lastLocalId, lastLocalId, lastLocalSocket, lastLocalSocket, lastRemoteSocket, lastRemoteSocket, maxRetryDuration, maxRetryDuration, observable, operationId, password, retryAfter, retryAfter, retryCount, retryDelay, retryDelay, span, span, subscriber, succeed, username
-
-
-
-
Field Detail
-
NO_PRIORITY
public static final int NO_PRIORITY
- See Also:
- Constant Field Values
-
-
Method Detail
-
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 classAbstractCouchbaseRequest
-
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 defaultnode location process
.- Specified by:
sendTo
in interfacePrelocatedRequest
- 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 aGenericAnalyticsRequest
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 aGenericAnalyticsRequest
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 aGenericAnalyticsRequest
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 aGenericAnalyticsRequest
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 aGenericAnalyticsRequest
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 interfaceAnalyticsRequest
-
-