public final class AnalyticsClient extends Object implements Closeable
HttpTransport
which wraps the HTTP Client This client allows to build typed requests and read typed responses.
Requests are made under the Algolia's retry-strategy. This client is intended to be reused and
it's thread-safe.| Constructor and Description |
|---|
AnalyticsClient(AnalyticsConfig config,
HttpRequester httpRequester)
|
| Modifier and Type | Method and Description |
|---|---|
AddABTestResponse |
addABTest(ABTest abTest)
Creates a new AB Test with provided configuration
|
AddABTestResponse |
addABTest(ABTest abTest,
RequestOptions requestOptions)
Creates a new AB Test with provided configuration
|
CompletableFuture<AddABTestResponse> |
addABTestAsync(ABTest abTest)
Creates a new AB Test with provided configuration
|
CompletableFuture<AddABTestResponse> |
addABTestAsync(ABTest abTest,
RequestOptions requestOptions)
Creates a new AB Test with provided configuration
|
void |
close()
Close the underlying Http Client
|
DeleteAbTestResponse |
deleteABTest(long id)
Deletes the A/B Test and removes all associated metadata and metrics.
|
DeleteAbTestResponse |
deleteABTest(long id,
RequestOptions requestOptions)
Deletes the A/B Test and removes all associated metadata and metrics.
|
CompletableFuture<DeleteAbTestResponse> |
deleteABTestAsync(long id)
Deletes the A/B Test and removes all associated metadata and metrics.
|
CompletableFuture<DeleteAbTestResponse> |
deleteABTestAsync(long id,
RequestOptions requestOptions)
Deletes the A/B Test and removes all associated metadata and metrics.
|
ABTestResponse |
getABTest(long id)
Get an A/B test information and results.
|
ABTestResponse |
getABTest(long id,
RequestOptions requestOptions)
Get an A/B test information and results.
|
CompletableFuture<ABTestResponse> |
getABTestAsync(long id)
Get an A/B test information and results.
|
CompletableFuture<ABTestResponse> |
getABTestAsync(long id,
RequestOptions requestOptions)
Get an A/B test information and results.
|
ABTests |
getABTests()
Get an A/B test information and results.
|
ABTests |
getABTests(int offset,
int limit)
Get an A/B test information and results.
|
ABTests |
getABTests(int offset,
int limit,
RequestOptions requestOptions)
Get an A/B test information and results.
|
ABTests |
getABTests(RequestOptions requestOptions)
Get an A/B test information and results.
|
CompletableFuture<ABTests> |
getABTestsAsync()
Get an A/B test information and results.
|
CompletableFuture<ABTests> |
getABTestsAsync(int offset,
int limit)
Get an A/B test information and results.
|
CompletableFuture<ABTests> |
getABTestsAsync(int offset,
int limit,
RequestOptions requestOptions)
Get an A/B test information and results.
|
CompletableFuture<ABTests> |
getABTestsAsync(RequestOptions requestOptions)
Get an A/B test information and results.
|
ConfigBase |
getConfig()
Get Client's configuration
|
StopAbTestResponse |
stopABTest(long id)
Marks the A/B Test as stopped.
|
StopAbTestResponse |
stopABTest(long id,
RequestOptions requestOptions)
Marks the A/B Test as stopped.
|
CompletableFuture<StopAbTestResponse> |
stopABTestAsync(long id)
Marks the A/B Test as stopped.
|
CompletableFuture<StopAbTestResponse> |
stopABTestAsync(long id,
RequestOptions requestOptions)
Marks the A/B Test as stopped.
|
public AnalyticsClient(@Nonnull AnalyticsConfig config, @Nonnull HttpRequester httpRequester)
config - The configuration allows you to advanced configuration of the clients such as
batch size or custom hosts and timeout.httpRequester - Another HTTP Client than the default one. Must be an implementation of
HttpRequester.NullPointerException - If one of the following
ApplicationID/ApiKey/Configuration/Requester is nullIllegalArgumentException - If the ApplicationID or the APIKey are emptypublic void close()
throws IOException
close in interface Closeableclose in interface AutoCloseableIOException - if an I/O error occurspublic ConfigBase getConfig()
public ABTests getABTests()
public ABTests getABTests(RequestOptions requestOptions)
requestOptions - Options to pass to this requestAlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic ABTests getABTests(int offset, int limit)
offset - Position of the starting record. Used for paging. 0 is the first record.limit - Number of records to return. +used for paging. Limit is the size of the page.AlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic ABTests getABTests(int offset, int limit, RequestOptions requestOptions)
offset - Position of the starting record. Used for paging. 0 is the first record.limit - Number of records to return. +used for paging. Limit is the size of the page.requestOptions - Options to pass to this requestAlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic CompletableFuture<ABTests> getABTestsAsync()
AlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic CompletableFuture<ABTests> getABTestsAsync(RequestOptions requestOptions)
requestOptions - Options to pass to this requestAlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic CompletableFuture<ABTests> getABTestsAsync(int offset, int limit)
offset - Position of the starting record. Used for paging. 0 is the first record.limit - Number of records to return. +used for paging. Limit is the size of the page.AlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic CompletableFuture<ABTests> getABTestsAsync(int offset, int limit, RequestOptions requestOptions)
offset - Position of the starting record. Used for paging. 0 is the first record.limit - Number of records to return. +used for paging. Limit is the size of the page.requestOptions - Options to pass to this requestAlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic ABTestResponse getABTest(long id)
id - The ABTest IDAlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic ABTestResponse getABTest(long id, RequestOptions requestOptions)
id - The ABTest IDrequestOptions - Options to pass to this requestAlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic CompletableFuture<ABTestResponse> getABTestAsync(long id)
id - The ABTest IDAlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic CompletableFuture<ABTestResponse> getABTestAsync(long id, RequestOptions requestOptions)
id - The ABTest IDrequestOptions - Options to pass to this requestAlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic StopAbTestResponse stopABTest(long id)
id - The ABTest IDAlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic StopAbTestResponse stopABTest(long id, RequestOptions requestOptions)
id - The ABTest IDrequestOptions - Options to pass to this requestAlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic CompletableFuture<StopAbTestResponse> stopABTestAsync(long id)
id - The ABTest IDAlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic CompletableFuture<StopAbTestResponse> stopABTestAsync(long id, RequestOptions requestOptions)
id - The ABTest IDrequestOptions - Options to pass to this requestAlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic DeleteAbTestResponse deleteABTest(long id)
id - The ABTest IDAlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic DeleteAbTestResponse deleteABTest(long id, RequestOptions requestOptions)
id - The ABTest IDrequestOptions - Options to pass to this requestAlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic CompletableFuture<DeleteAbTestResponse> deleteABTestAsync(long id)
id - The ABTest IDAlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic CompletableFuture<DeleteAbTestResponse> deleteABTestAsync(long id, RequestOptions requestOptions)
id - The ABTest IDrequestOptions - Options to pass to this requestAlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic AddABTestResponse addABTest(@Nonnull ABTest abTest)
abTest - The definition of the A/B testAlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic AddABTestResponse addABTest(@Nonnull ABTest abTest, RequestOptions requestOptions)
abTest - The definition of the A/B testrequestOptions - Options to pass to this requestAlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic CompletableFuture<AddABTestResponse> addABTestAsync(@Nonnull ABTest abTest)
abTest - The definition of the A/B testAlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationpublic CompletableFuture<AddABTestResponse> addABTestAsync(@Nonnull ABTest abTest, RequestOptions requestOptions)
abTest - The definition of the A/B testrequestOptions - Options to pass to this requestAlgoliaRetryException - When the retry has failed on all hostsAlgoliaApiException - When the API sends an http error codeAlgoliaRuntimeException - When an error occurred during the serializationCopyright © 2019. All rights reserved.