public class AsyncAPIClient extends Object
| Modifier and Type | Field and Description |
|---|---|
protected AsyncAPIClientConfiguration |
configuration |
protected Executor |
executor |
protected AsyncAlgoliaHttpClient |
httpClient
Constructor & protected stuff
|
| Modifier and Type | Method and Description |
|---|---|
CompletableFuture<CreateUpdateKey> |
addApiKey(ApiKey key)
Create a new key
|
CompletableFuture<CreateUpdateKey> |
addApiKey(ApiKey key,
RequestOptions requestOptions)
Create a new key
|
CompletableFuture<CreateUpdateKey> |
addKey(ApiKey key)
Deprecated.
|
CompletableFuture<AssignUserID> |
assignUserID(String userID,
String clusterName) |
CompletableFuture<AssignUserID> |
assignUserID(String userID,
String clusterName,
RequestOptions requestOptions) |
CompletableFuture<AsyncTasksMultipleIndex> |
batch(List<BatchOperation> operations)
Custom batch
|
CompletableFuture<AsyncTasksMultipleIndex> |
batch(List<BatchOperation> operations,
RequestOptions requestOptions)
Custom batch
|
void |
close()
Close the internal HTTP client
|
CompletableFuture<AsyncTask> |
copyIndex(String srcIndexName,
String dstIndexName)
Copy an existing index
|
CompletableFuture<AsyncTask> |
copyIndex(String srcIndexName,
String dstIndexName,
List<String> scope)
Copy an existing index
|
CompletableFuture<AsyncTask> |
copyIndex(String srcIndexName,
String dstIndexName,
List<String> scope,
RequestOptions requestOptions)
Copy an existing index
|
CompletableFuture<AsyncTask> |
copyIndex(String srcIndexName,
String dstIndexName,
RequestOptions requestOptions)
Copy an existing index
|
CompletableFuture<DeleteKey> |
deleteApiKey(String key)
Delete an existing key
|
CompletableFuture<DeleteKey> |
deleteApiKey(String key,
RequestOptions requestOptions)
Delete an existing key
|
CompletableFuture<AsyncTask> |
deleteIndex(String indexName)
Delete an existing index
|
CompletableFuture<AsyncTask> |
deleteIndex(String indexName,
RequestOptions requestOptions)
Delete an existing index
|
CompletableFuture<DeleteKey> |
deleteKey(String key)
Deprecated.
|
String |
generateSecuredApiKey(String privateApiKey,
Query query)
Generate a secured and public API Key from a query and an optional user token identifying the
current user
|
String |
generateSecuredApiKey(String privateApiKey,
Query query,
String userToken)
Generate a secured and public API Key from a query and an optional user token identifying the
current user
|
CompletableFuture<Optional<ApiKey>> |
getApiKey(String key)
Get an Key from it's name
|
CompletableFuture<Optional<ApiKey>> |
getApiKey(String key,
RequestOptions requestOptions)
Get an Key from it's name
|
CompletableFuture<Optional<ApiKey>> |
getKey(String key)
Deprecated.
|
CompletableFuture<List<Log>> |
getLogs()
Return 10 last log entries.
|
CompletableFuture<List<Log>> |
getLogs(Integer offset,
Integer length,
LogType logType)
Return last logs entries
|
CompletableFuture<List<Log>> |
getLogs(Integer offset,
Integer length,
LogType logType,
RequestOptions requestOptions)
Return last logs entries
|
CompletableFuture<List<Log>> |
getLogs(RequestOptions requestOptions)
Return 10 last log entries.
|
CompletableFuture<Map<String,List<UserID>>> |
getTopUserID() |
CompletableFuture<Map<String,List<UserID>>> |
getTopUserID(RequestOptions requestOptions) |
CompletableFuture<UserID> |
getUserID(String userID) |
CompletableFuture<UserID> |
getUserID(String userID,
RequestOptions requestOptions) |
AsyncAnalytics |
initAnalytics() |
AsyncIndex<?> |
initIndex(String name)
Get the index object initialized (no server call needed for initialization)
|
<T> AsyncIndex<T> |
initIndex(String name,
Class<T> klass)
Get the index object initialized (no server call needed for initialization)
|
CompletableFuture<List<ApiKey>> |
listApiKeys()
List all existing user keys with their associated ACLs
|
CompletableFuture<List<ApiKey>> |
listApiKeys(RequestOptions requestOptions)
List all existing user keys with their associated ACLs
|
CompletableFuture<List<Cluster>> |
listClusters() |
CompletableFuture<List<Cluster>> |
listClusters(RequestOptions requestOptions) |
CompletableFuture<List<Index.Attributes>> |
listIndices()
List all existing indexes
|
CompletableFuture<List<Index.Attributes>> |
listIndices(RequestOptions requestOptions)
List all existing indexes
|
CompletableFuture<List<ApiKey>> |
listKeys()
Deprecated.
|
CompletableFuture<UserIDs> |
listUserIDs() |
CompletableFuture<UserIDs> |
listUserIDs(Integer page,
Integer hitsPerPage) |
CompletableFuture<UserIDs> |
listUserIDs(Integer page,
Integer hitsPerPage,
RequestOptions requestOptions) |
CompletableFuture<AsyncTask> |
moveIndex(String srcIndexName,
String dstIndexName)
Moves an existing index
|
CompletableFuture<AsyncTask> |
moveIndex(String srcIndexName,
String dstIndexName,
RequestOptions requestOptions)
Moves an existing index
|
CompletableFuture<MultiQueriesResult> |
multipleQueries(List<IndexQuery> queries)
Performs multiple searches on multiple indices with the strategy
MultiQueriesStrategy.NONE |
CompletableFuture<MultiQueriesResult> |
multipleQueries(List<IndexQuery> queries,
MultiQueriesStrategy strategy)
Performs multiple searches on multiple indices
|
CompletableFuture<MultiQueriesResult> |
multipleQueries(List<IndexQuery> queries,
MultiQueriesStrategy strategy,
RequestOptions requestOptions)
Performs multiple searches on multiple indices
|
CompletableFuture<MultiQueriesResult> |
multipleQueries(List<IndexQuery> queries,
RequestOptions requestOptions)
Performs multiple searches on multiple indices with the strategy
MultiQueriesStrategy.NONE |
CompletableFuture<DeleteUserID> |
removeUserID(String userID) |
CompletableFuture<DeleteUserID> |
removeUserID(String userID,
RequestOptions requestOptions) |
CompletableFuture<SearchUserIDs> |
searchUserIDs(String query,
String clusterName) |
CompletableFuture<SearchUserIDs> |
searchUserIDs(String query,
String clusterName,
int page,
int hitsPerPage) |
CompletableFuture<SearchUserIDs> |
searchUserIDs(String query,
String clusterName,
int page,
int hitsPerPage,
RequestOptions requestOptions) |
CompletableFuture<SearchUserIDs> |
searchUserIDs(String query,
String clusterName,
RequestOptions requestOptions) |
CompletableFuture<CreateUpdateKey> |
updateApiKey(String keyName,
ApiKey key)
Update a key
|
CompletableFuture<CreateUpdateKey> |
updateApiKey(String keyName,
ApiKey key,
RequestOptions requestOptions)
Update a key
|
CompletableFuture<CreateUpdateKey> |
updateKey(String keyName,
ApiKey key)
Deprecated.
|
<T> void |
waitTask(AsyncGenericTask<T> task)
Wait for the completion of this task /!\ WARNING /!\ This method is blocking
|
<T> void |
waitTask(AsyncGenericTask<T> task,
long timeToWait)
Wait for the completion of this task /!\ WARNING /!\ This method is blocking
|
<T> void |
waitTask(AsyncGenericTask<T> task,
long timeToWait,
RequestOptions requestOptions)
Wait for the completion of this task /!\ WARNING /!\ This method is blocking
|
protected final AsyncAlgoliaHttpClient httpClient
protected final AsyncAPIClientConfiguration configuration
protected final Executor executor
public void close()
throws AlgoliaException
AlgoliaExceptionpublic CompletableFuture<List<Index.Attributes>> listIndices()
public CompletableFuture<List<Index.Attributes>> listIndices(@Nonnull RequestOptions requestOptions)
requestOptions - Options to pass to this requestpublic <T> AsyncIndex<T> initIndex(@Nonnull String name, @Nonnull Class<T> klass)
T - the type of the objects in this indexname - name of the indexklass - class of the object in this indexpublic AsyncAnalytics initAnalytics()
public AsyncIndex<?> initIndex(@Nonnull String name)
name - name of the indexpublic CompletableFuture<AsyncTask> moveIndex(@Nonnull String srcIndexName, @Nonnull String dstIndexName)
srcIndexName - the index name that will be the source of the copydstIndexName - the new index name that will contains a copy of srcIndexName (destination
will be overwritten if it already exist)public CompletableFuture<AsyncTask> moveIndex(@Nonnull String srcIndexName, @Nonnull String dstIndexName, @Nonnull RequestOptions requestOptions)
srcIndexName - the index name that will be the source of the copydstIndexName - the new index name that will contains a copy of srcIndexName (destination
will be overwritten if it already exist)requestOptions - Options to pass to this requestpublic CompletableFuture<AsyncTask> copyIndex(@Nonnull String srcIndexName, @Nonnull String dstIndexName)
srcIndexName - the index name that will be the source of the copydstIndexName - the new index name that will contains a copy of srcIndexName (destination
will be overwritten if it already exist)public CompletableFuture<AsyncTask> copyIndex(@Nonnull String srcIndexName, @Nonnull String dstIndexName, @Nonnull RequestOptions requestOptions)
srcIndexName - the index name that will be the source of the copydstIndexName - the new index name that will contains a copy of srcIndexName (destination
will be overwritten if it already exist)requestOptions - Options to pass to this requestpublic CompletableFuture<AsyncTask> copyIndex(@Nonnull String srcIndexName, @Nonnull String dstIndexName, List<String> scope, @Nonnull RequestOptions requestOptions)
srcIndexName - the index name that will be the source of the copydstIndexName - the new index name that will contains a copy of srcIndexName (destination
will be overwritten if it already exist)scope - the list of scope to copyrequestOptions - Options to pass to this requestpublic CompletableFuture<AsyncTask> copyIndex(@Nonnull String srcIndexName, @Nonnull String dstIndexName, @Nonnull List<String> scope)
srcIndexName - the index name that will be the source of the copydstIndexName - the new index name that will contains a copy of srcIndexName (destination
will be overwritten if it already exist)scope - the list of scope to copypublic CompletableFuture<List<Log>> getLogs()
public CompletableFuture<List<Log>> getLogs(@Nonnull RequestOptions requestOptions)
requestOptions - Options to pass to this requestpublic CompletableFuture<List<Log>> getLogs(@Nonnull Integer offset, @Nonnull Integer length, @Nonnull LogType logType)
offset - Specify the first entry to retrieve (0-based, 0 is the most recent log entry)length - Specify the maximum number of entries to retrieve starting at offset. Maximum
allowed value: 1000logType - Specify the type of log to retrievepublic CompletableFuture<List<Log>> getLogs(@Nonnull Integer offset, @Nonnull Integer length, @Nonnull LogType logType, @Nonnull RequestOptions requestOptions)
offset - Specify the first entry to retrieve (0-based, 0 is the most recent log entry)length - Specify the maximum number of entries to retrieve starting at offset. Maximum
allowed value: 1000logType - Specify the type of log to retrieverequestOptions - Options to pass to this request@Deprecated public CompletableFuture<List<ApiKey>> listKeys()
listApiKeys()public CompletableFuture<List<ApiKey>> listApiKeys()
public CompletableFuture<List<ApiKey>> listApiKeys(@Nonnull RequestOptions requestOptions)
requestOptions - Options to pass to this request@Deprecated public CompletableFuture<Optional<ApiKey>> getKey(@Nonnull String key)
getApiKey(String)public CompletableFuture<Optional<ApiKey>> getApiKey(@Nonnull String key)
key - name of the keypublic CompletableFuture<Optional<ApiKey>> getApiKey(@Nonnull String key, @Nonnull RequestOptions requestOptions)
key - name of the keyrequestOptions - Options to pass to this request@Deprecated public CompletableFuture<DeleteKey> deleteKey(@Nonnull String key)
deleteApiKey(String)public CompletableFuture<DeleteKey> deleteApiKey(@Nonnull String key)
key - name of the keypublic CompletableFuture<DeleteKey> deleteApiKey(@Nonnull String key, @Nonnull RequestOptions requestOptions)
key - name of the keyrequestOptions - Options to pass to this request@Deprecated public CompletableFuture<CreateUpdateKey> addKey(@Nonnull ApiKey key)
addApiKey(ApiKey)public CompletableFuture<CreateUpdateKey> addApiKey(@Nonnull ApiKey key)
key - the key with the ACLspublic CompletableFuture<CreateUpdateKey> addApiKey(@Nonnull ApiKey key, @Nonnull RequestOptions requestOptions)
key - the key with the ACLsrequestOptions - Options to pass to this request@Deprecated public CompletableFuture<CreateUpdateKey> updateKey(@Nonnull String keyName, @Nonnull ApiKey key)
updateApiKey(String, ApiKey)public CompletableFuture<CreateUpdateKey> updateApiKey(@Nonnull String keyName, @Nonnull ApiKey key)
keyName - name of the key to updatekey - the key with the ACLspublic CompletableFuture<CreateUpdateKey> updateApiKey(@Nonnull String keyName, @Nonnull ApiKey key, @Nonnull RequestOptions requestOptions)
keyName - name of the key to updatekey - the key with the ACLsrequestOptions - Options to pass to this requestpublic String generateSecuredApiKey(@Nonnull String privateApiKey, @Nonnull Query query) throws AlgoliaException
privateApiKey - your private API Keyquery - contains the parameter applied to the query (used as security)AlgoliaExceptionpublic String generateSecuredApiKey(@Nonnull String privateApiKey, @Nonnull Query query, String userToken) throws AlgoliaException
privateApiKey - your private API Keyquery - contains the parameter applied to the query (used as security)userToken - an optional token identifying the current userAlgoliaExceptionpublic <T> void waitTask(@Nonnull AsyncGenericTask<T> task)
task - the task to waitpublic <T> void waitTask(@Nonnull AsyncGenericTask<T> task, long timeToWait)
task - the task to waittimeToWait - the time to wait in millisecondspublic <T> void waitTask(@Nonnull AsyncGenericTask<T> task, long timeToWait, @Nonnull RequestOptions requestOptions)
task - the task to waittimeToWait - the time to wait in millisecondsrequestOptions - Options to pass to this requestpublic CompletableFuture<AsyncTasksMultipleIndex> batch(@Nonnull List<BatchOperation> operations)
All operations must have a valid index name (not null)
operations - the list of operations to performpublic CompletableFuture<AsyncTasksMultipleIndex> batch(@Nonnull List<BatchOperation> operations, @Nonnull RequestOptions requestOptions)
All operations must have a valid index name (not null)
operations - the list of operations to performrequestOptions - Options to pass to this requestpublic CompletableFuture<MultiQueriesResult> multipleQueries(@Nonnull List<IndexQuery> queries)
MultiQueriesStrategy.NONEqueries - the queriespublic CompletableFuture<MultiQueriesResult> multipleQueries(@Nonnull List<IndexQuery> queries, @Nonnull RequestOptions requestOptions)
MultiQueriesStrategy.NONEqueries - the queriesrequestOptions - Options to pass to this requestpublic CompletableFuture<MultiQueriesResult> multipleQueries(@Nonnull List<IndexQuery> queries, @Nonnull MultiQueriesStrategy strategy)
queries - the queriesstrategy - the strategy to apply to this multiple queriespublic CompletableFuture<MultiQueriesResult> multipleQueries(@Nonnull List<IndexQuery> queries, @Nonnull MultiQueriesStrategy strategy, @Nonnull RequestOptions requestOptions)
queries - the queriesstrategy - the strategy to apply to this multiple queriesrequestOptions - Options to pass to this requestpublic CompletableFuture<AsyncTask> deleteIndex(@Nonnull String indexName)
indexName - The index name that will be deletedpublic CompletableFuture<AsyncTask> deleteIndex(@Nonnull String indexName, @Nonnull RequestOptions requestOptions)
indexName - The index name that will be deletedrequestOptions - Options to pass to this requestpublic CompletableFuture<List<Cluster>> listClusters()
public CompletableFuture<List<Cluster>> listClusters(@Nonnull RequestOptions requestOptions)
public CompletableFuture<UserIDs> listUserIDs()
public CompletableFuture<UserIDs> listUserIDs(Integer page, Integer hitsPerPage)
public CompletableFuture<UserIDs> listUserIDs(@Nonnull Integer page, @Nonnull Integer hitsPerPage, @Nonnull RequestOptions requestOptions)
public CompletableFuture<Map<String,List<UserID>>> getTopUserID()
public CompletableFuture<Map<String,List<UserID>>> getTopUserID(RequestOptions requestOptions)
public CompletableFuture<AssignUserID> assignUserID(@Nonnull String userID, @Nonnull String clusterName)
public CompletableFuture<AssignUserID> assignUserID(@Nonnull String userID, @Nonnull String clusterName, RequestOptions requestOptions)
public CompletableFuture<UserID> getUserID(@Nonnull String userID)
public CompletableFuture<UserID> getUserID(@Nonnull String userID, RequestOptions requestOptions)
public CompletableFuture<DeleteUserID> removeUserID(@Nonnull String userID)
public CompletableFuture<DeleteUserID> removeUserID(@Nonnull String userID, RequestOptions requestOptions)
public CompletableFuture<SearchUserIDs> searchUserIDs(@Nonnull String query, @Nonnull String clusterName)
public CompletableFuture<SearchUserIDs> searchUserIDs(@Nonnull String query, @Nonnull String clusterName, RequestOptions requestOptions)
public CompletableFuture<SearchUserIDs> searchUserIDs(@Nonnull String query, @Nonnull String clusterName, int page, int hitsPerPage)
public CompletableFuture<SearchUserIDs> searchUserIDs(@Nonnull String query, @Nonnull String clusterName, int page, int hitsPerPage, RequestOptions requestOptions)
Copyright © 2018. All rights reserved.