public interface FluxClient
| Modifier and Type | Method and Description |
|---|---|
void |
close()
Shutdown and close the client.
|
LogLevel |
getLogLevel()
Gets the
LogLevel that is used for logging requests and responses. |
Boolean |
ping()
Check the status of InfluxDB Server.
|
List<FluxTable> |
query(String query)
Executes the Flux query against the InfluxDB and synchronously map whole response to
List<FluxTable>. |
void |
query(String query,
BiConsumer<Cancellable,FluxRecord> onNext)
Executes the Flux query against the InfluxDB and asynchronously stream
FluxRecords
to onNext consumer. |
void |
query(String query,
BiConsumer<Cancellable,FluxRecord> onNext,
Consumer<? super Throwable> onError)
Executes the Flux query against the InfluxDB and asynchronously stream
FluxRecords
to onNext consumer. |
void |
query(String query,
BiConsumer<Cancellable,FluxRecord> onNext,
Consumer<? super Throwable> onError,
Runnable onComplete)
Executes the Flux query against the InfluxDB and asynchronously stream
FluxRecords
to onNext consumer. |
<M> List<M> |
query(String query,
Class<M> measurementType)
Executes the Flux query against the InfluxDB and synchronously map whole response to list of object with
given type.
|
<M> void |
query(String query,
Class<M> measurementType,
BiConsumer<Cancellable,M> onNext)
Executes the Flux query against the InfluxDB and asynchronously stream POJO classes
to
onNext consumer. |
<M> void |
query(String query,
Class<M> measurementType,
BiConsumer<Cancellable,M> onNext,
Consumer<? super Throwable> onError)
Executes the Flux query against the InfluxDB and asynchronously stream POJO classes
to
onNext consumer. |
<M> void |
query(String query,
Class<M> measurementType,
BiConsumer<Cancellable,M> onNext,
Consumer<? super Throwable> onError,
Runnable onComplete)
Executes the Flux query and asynchronously stream result as POJO.
|
String |
queryRaw(String query)
Executes the Flux query against the InfluxDB and synchronously map whole response to
String result. |
void |
queryRaw(String query,
BiConsumer<Cancellable,String> onResponse)
Executes the Flux query against the InfluxDB and asynchronously stream response
(line by line) to
onResponse. |
void |
queryRaw(String query,
BiConsumer<Cancellable,String> onResponse,
Consumer<? super Throwable> onError)
Executes the Flux query against the InfluxDB and asynchronously stream response
(line by line) to
onResponse. |
void |
queryRaw(String query,
BiConsumer<Cancellable,String> onResponse,
Consumer<? super Throwable> onError,
Runnable onComplete)
Executes the Flux query against the InfluxDB and asynchronously stream response
(line by line) to
onResponse. |
String |
queryRaw(String query,
String dialect)
Executes the Flux query against the InfluxDB and synchronously map whole response to
String result. |
void |
queryRaw(String query,
String dialect,
BiConsumer<Cancellable,String> onResponse)
Executes the Flux query against the InfluxDB and asynchronously stream response
(line by line) to
onResponse. |
void |
queryRaw(String query,
String dialect,
BiConsumer<Cancellable,String> onResponse,
Consumer<? super Throwable> onError)
Executes the Flux query against the InfluxDB and asynchronously stream response
(line by line) to
onResponse. |
void |
queryRaw(String query,
String dialect,
BiConsumer<Cancellable,String> onResponse,
Consumer<? super Throwable> onError,
Runnable onComplete)
Executes the Flux query against the InfluxDB and asynchronously stream response
(line by line) to
onResponse. |
FluxClient |
setLogLevel(LogLevel logLevel)
Sets the log level for the request and response information.
|
String |
version()
Returns the version of the connected InfluxDB Server.
|
@Nonnull List<FluxTable> query(@Nonnull String query)
List<FluxTable>.
NOTE: This method is not intended for large query results.
Use query(String, BiConsumer, Consumer, Runnable) for large data streaming.
query - the flux query to executeList<FluxTable> which are matched the query@Nonnull <M> List<M> query(@Nonnull String query, @Nonnull Class<M> measurementType)
NOTE: This method is not intended for large query results.
Use query(String, Class, BiConsumer, Consumer, Runnable) for large data streaming.
query - the flux query to executemeasurementType - the type of measurementList<FluxTable> which are matched the queryvoid query(@Nonnull String query, @Nonnull BiConsumer<Cancellable,FluxRecord> onNext)
FluxRecords
to onNext consumer.query - the flux query to executeonNext - the callback to consume the FluxRecord result with capability to discontinue a streaming query<M> void query(@Nonnull String query, @Nonnull Class<M> measurementType, @Nonnull BiConsumer<Cancellable,M> onNext)
onNext consumer.M - the type of the measurement (POJO)query - the flux query to executemeasurementType - the measurement type (POJO)onNext - the callback to consume the FluxRecord result with capability to discontinue a streaming queryvoid query(@Nonnull String query, @Nonnull BiConsumer<Cancellable,FluxRecord> onNext, @Nonnull Consumer<? super Throwable> onError)
FluxRecords
to onNext consumer.query - the flux query to executeonNext - the callback to consume FluxRecord result with capability to discontinue a streaming queryonError - the callback to consume any error notification<M> void query(@Nonnull String query, @Nonnull Class<M> measurementType, @Nonnull BiConsumer<Cancellable,M> onNext, @Nonnull Consumer<? super Throwable> onError)
onNext consumer.M - the type of the measurement (POJO)query - the flux query to executemeasurementType - the measurement type (POJO)onNext - the callback to consume POJO record with capability to discontinue a streaming queryonError - the callback to consume any error notificationvoid query(@Nonnull String query, @Nonnull BiConsumer<Cancellable,FluxRecord> onNext, @Nonnull Consumer<? super Throwable> onError, @Nonnull Runnable onComplete)
FluxRecords
to onNext consumer.query - the flux query to executeonNext - the callback to consume FluxRecord result with capability to discontinue a streaming queryonError - the callback to consume any error notificationonComplete - the callback to consume a notification about successfully end of stream<M> void query(@Nonnull String query, @Nonnull Class<M> measurementType, @Nonnull BiConsumer<Cancellable,M> onNext, @Nonnull Consumer<? super Throwable> onError, @Nonnull Runnable onComplete)
M - the type of the measurement (POJO)query - the flux query to executemeasurementType - the measurement type (POJO)onNext - the callback to consume POJO record with capability to discontinue a streaming queryonError - the callback to consume any error notificationonComplete - the callback to consume a notification about successfully end of stream@Nonnull String queryRaw(@Nonnull String query)
String result.
NOTE: This method is not intended for large responses, that do not fit into memory.
Use queryRaw(String, BiConsumer, Consumer, Runnable) for large data streaming.
query - the flux query to execute@Nonnull String queryRaw(@Nonnull String query, @Nullable String dialect)
String result.
NOTE: This method is not intended for large responses, that do not fit into memory.
Use queryRaw(String, String, BiConsumer, Consumer, Runnable) for large data streaming.
query - the flux query to executedialect - Dialect is an object defining the options to use when encoding the response.
See dialect SPEC..void queryRaw(@Nonnull String query, @Nonnull BiConsumer<Cancellable,String> onResponse)
onResponse.query - the flux query to executeonResponse - callback to consume the response line by line with capability to discontinue a streaming queryvoid queryRaw(@Nonnull String query, @Nullable String dialect, @Nonnull BiConsumer<Cancellable,String> onResponse)
onResponse.query - the flux query to executedialect - Dialect is an object defining the options to use when encoding the response.
See dialect SPEC..onResponse - the callback to consume the response line by line
with capability to discontinue a streaming queryvoid queryRaw(@Nonnull String query, @Nonnull BiConsumer<Cancellable,String> onResponse, @Nonnull Consumer<? super Throwable> onError)
onResponse.query - the flux query to executeonResponse - the callback to consume the response line by line
with capability to discontinue a streaming queryonError - callback to consume any error notificationvoid queryRaw(@Nonnull String query, @Nullable String dialect, @Nonnull BiConsumer<Cancellable,String> onResponse, @Nonnull Consumer<? super Throwable> onError)
onResponse.query - the flux query to executedialect - Dialect is an object defining the options to use when encoding the response.
See dialect SPEC..onResponse - the callback to consume the response line by line
with capability to discontinue a streaming queryonError - callback to consume any error notificationvoid queryRaw(@Nonnull String query, @Nonnull BiConsumer<Cancellable,String> onResponse, @Nonnull Consumer<? super Throwable> onError, @Nonnull Runnable onComplete)
onResponse.query - the flux query to executeonResponse - the callback to consume the response line by line
with capability to discontinue a streaming queryonError - callback to consume any error notificationonComplete - callback to consume a notification about successfully end of streamvoid queryRaw(@Nonnull String query, @Nullable String dialect, @Nonnull BiConsumer<Cancellable,String> onResponse, @Nonnull Consumer<? super Throwable> onError, @Nonnull Runnable onComplete)
onResponse.query - the flux query to executedialect - Dialect is an object defining the options to use when encoding the response.
See dialect SPEC..onResponse - the callback to consume the response line by line
with capability to discontinue a streaming query
The callback call contains the one line of the response.onError - callback to consume any error notificationonComplete - callback to consume a notification about successfully end of stream@Nonnull Boolean ping()
Boolean.TRUE if server is healthy otherwise return Boolean.FALSE@Nonnull String version()
@Nonnull LogLevel getLogLevel()
LogLevel that is used for logging requests and responses.LogLevel that is used for logging requests and responses@Nonnull FluxClient setLogLevel(@Nonnull LogLevel logLevel)
logLevel - the log level to set.void close()
Copyright © 2018–2020 InfluxData, Inc.. All rights reserved.