Class InfluxDBClientFactory
- Author:
- Jakub Bednar (bednar@github) (05/09/2018 10:04)
-
Method Summary
Modifier and TypeMethodDescriptionstatic InfluxDBClient
create()
Create an instance of the InfluxDB 2.x client that is configured viainflux2.properties
.static InfluxDBClient
create
(InfluxDBClientOptions options) Create an instance of the InfluxDB 2.x client.static InfluxDBClient
Create an instance of the InfluxDB 2.x client.static InfluxDBClient
Create an instance of the InfluxDB 2.x client.static InfluxDBClient
Create an instance of the InfluxDB 2.x client.static InfluxDBClient
Create an instance of the InfluxDB 2.x client.static InfluxDBClient
Create an instance of the InfluxDB 2.x client.static InfluxDBClient
Create an instance of the InfluxDB 2.x client to connect into InfluxDB 1.8.static InfluxDBClient
createV1
(String url, String username, char[] password, String database, String retentionPolicy, WriteConsistency consistency) Create an instance of the InfluxDB 2.x client to connect into InfluxDB 1.8.static OnboardingResponse
onBoarding
(String url, OnboardingRequest onboarding) Post onboarding request, to setup initial user, org and bucket.static OnboardingResponse
Post onboarding request, to setup initial user, org and bucket.
-
Method Details
-
create
Create an instance of the InfluxDB 2.x client that is configured viainflux2.properties
. Theinflux2.properties
has to be located on classpath.- Returns:
- client
-
create
Create an instance of the InfluxDB 2.x client. The url could be a connection string with various configurations.e.g.: "http://localhost:8086?readTimeout=5000&connectTimeout=5000&logLevel=BASIC
- Parameters:
connectionString
- connection string with various configurations.- Returns:
- client
-
create
@Nonnull public static InfluxDBClient create(@Nonnull String url, @Nonnull String username, @Nonnull char[] password) Create an instance of the InfluxDB 2.x client.The username/password auth is based on HTTP "Basic" authentication. The authorization expires when the time-to-live (TTL) (default 60 minutes) is reached and client produces
UnauthorizedException
.The url could be a connection string with various configurations. For more info see:
InfluxDBClientOptions.Builder.connectionString(String)
.- Parameters:
url
- url the url to connect to InfluxDB (required). Example: http://localhost:8086?readTimeout=5000username
- the username to use in the basic authpassword
- the password to use in the basic auth- Returns:
- client
- See Also:
-
create
Create an instance of the InfluxDB 2.x client.The url could be a connection string with various configurations. For more info see:
InfluxDBClientOptions.Builder.connectionString(String)
.- Parameters:
url
- url the url to connect to InfluxDB (required). Example: http://localhost:8086?readTimeout=5000token
- the token to use for the authorization- Returns:
- client
- See Also:
-
create
@Nonnull public static InfluxDBClient create(@Nonnull String url, @Nonnull char[] token, @Nullable String org) Create an instance of the InfluxDB 2.x client.The url could be a connection string with various configurations. For more info see:
InfluxDBClientOptions.Builder.connectionString(String)
.- Parameters:
url
- url the url to connect to InfluxDB (required). Example: http://localhost:8086?readTimeout=5000token
- the token to use for the authorizationorg
- the name of an organization- Returns:
- client
- See Also:
-
create
@Nonnull public static InfluxDBClient create(@Nonnull String url, @Nonnull char[] token, @Nullable String org, @Nullable String bucket) Create an instance of the InfluxDB 2.x client.The url could be a connection string with various configurations. For more info see:
InfluxDBClientOptions.Builder.connectionString(String)
.- Parameters:
url
- url the url to connect to InfluxDB (required). Example: http://localhost:8086?readTimeout=5000token
- the token to use for the authorizationorg
- the name of an organizationbucket
- the name of a bucket- Returns:
- client
- See Also:
-
createV1
@Nonnull public static InfluxDBClient createV1(@Nonnull String url, @Nullable String username, char[] password, @Nonnull String database, @Nullable String retentionPolicy) Create an instance of the InfluxDB 2.x client to connect into InfluxDB 1.8.The url could be a connection string with various configurations. For more info see:
InfluxDBClientOptions.Builder.connectionString(String)
.- Parameters:
url
- the url to connect to InfluxDB 1.8 (required). http://localhost:8086?readTimeout=5000username
- authorization usernamepassword
- authorization passworddatabase
- database nameretentionPolicy
- retention policy- Returns:
- client
-
createV1
@Nonnull public static InfluxDBClient createV1(@Nonnull String url, @Nullable String username, char[] password, @Nonnull String database, @Nullable String retentionPolicy, @Nullable WriteConsistency consistency) Create an instance of the InfluxDB 2.x client to connect into InfluxDB 1.8.The url could be a connection string with various configurations. For more info see:
InfluxDBClientOptions.Builder.connectionString(String)
.- Parameters:
url
- the url to connect to InfluxDB 1.8 (required). http://localhost:8086?readTimeout=5000username
- authorization usernamepassword
- authorization passworddatabase
- database nameretentionPolicy
- retention policyconsistency
- Specify the write consistency for the point. InfluxDB assumes that the write consistency isWriteConsistency.ONE
if you do not specify consistency. See the InfluxDB Enterprise documentation for detailed descriptions of each consistency option. Available with InfluxDB Enterprise clusters only!- Returns:
- client
-
create
Create an instance of the InfluxDB 2.x client.- Parameters:
options
- the connection configuration- Returns:
- client
-
onBoarding
@Nonnull public static OnboardingResponse onBoarding(@Nonnull String url, @Nonnull String username, @Nonnull String password, @Nonnull String org, @Nonnull String bucket) Post onboarding request, to setup initial user, org and bucket.- Parameters:
url
- the url to connect to the InfluxDBusername
- the name of an userpassword
- the password to connect as an userorg
- the name of an organizationbucket
- the name of a bucket- Returns:
- Created default user, bucket, org.
-
onBoarding
@Nonnull public static OnboardingResponse onBoarding(@Nonnull String url, @Nonnull OnboardingRequest onboarding) Post onboarding request, to setup initial user, org and bucket.- Parameters:
url
- the url to connect to the InfluxDBonboarding
- the defaults- Returns:
- Created default user, bucket, org.
-