java.lang.Object
io.evitadb.driver.EvitaClientManagement
- All Implemented Interfaces:
EvitaManagementContract,Closeable,AutoCloseable
Client implementation of
EvitaManagementContract.- Author:
- Jan Novotný (novotny@fg.cz), FG Forrest a.s. (c) 2024
-
Constructor Summary
ConstructorsConstructorDescriptionEvitaClientManagement(EvitaClient evitaClient, com.linecorp.armeria.client.grpc.GrpcClientBuilder grpcClientBuilder) -
Method Summary
Modifier and TypeMethodDescriptionbackupCatalog(String catalogName, OffsetDateTime pastMoment, boolean includingWAL) booleancancelTask(UUID jobId) voidclose()<S,T> ClientTask<S, T> createTask(TaskStatus<S, T> taskStatus) Creates a new client task.voiddeleteFile(UUID fileId) getFileToFetch(UUID fileId) Optional<TaskStatus<?,?>> getTaskStatus(UUID jobId) Collection<TaskStatus<?,?>> getTaskStatuses(UUID... jobId) io.evitadb.dataType.PaginatedList<FileForFetch>listFilesToFetch(int page, int pageSize, String origin) io.evitadb.dataType.PaginatedList<TaskStatus<?,?>> listTaskStatuses(int page, int pageSize, String[] taskType, TaskStatus.TaskSimplifiedState... states) restoreCatalog(String catalogName, long totalBytesExpected, InputStream inputStream) restoreCatalog(String catalogName, UUID fileId)
-
Constructor Details
-
EvitaClientManagement
public EvitaClientManagement(@Nonnull EvitaClient evitaClient, @Nonnull com.linecorp.armeria.client.grpc.GrpcClientBuilder grpcClientBuilder)
-
-
Method Details
-
getCatalogStatistics
- Specified by:
getCatalogStatisticsin interfaceEvitaManagementContract
-
backupCatalog
@Nonnull public CompletableFuture<FileForFetch> backupCatalog(@Nonnull String catalogName, @Nullable OffsetDateTime pastMoment, boolean includingWAL) throws TemporalDataNotAvailableException - Specified by:
backupCatalogin interfaceEvitaManagementContract- Throws:
TemporalDataNotAvailableException
-
restoreCatalog
@Nonnull public Task<?,Void> restoreCatalog(@Nonnull String catalogName, long totalBytesExpected, @Nonnull InputStream inputStream) throws io.evitadb.exception.UnexpectedIOException - Specified by:
restoreCatalogin interfaceEvitaManagementContract- Throws:
io.evitadb.exception.UnexpectedIOException
-
restoreCatalog
@Nonnull public Task<?,Void> restoreCatalog(@Nonnull String catalogName, @Nonnull UUID fileId) throws FileForFetchNotFoundException - Specified by:
restoreCatalogin interfaceEvitaManagementContract- Throws:
FileForFetchNotFoundException
-
listTaskStatuses
@Nonnull public io.evitadb.dataType.PaginatedList<TaskStatus<?,?>> listTaskStatuses(int page, int pageSize, @Nullable String[] taskType, @Nonnull TaskStatus.TaskSimplifiedState... states) - Specified by:
listTaskStatusesin interfaceEvitaManagementContract
-
getTaskStatus
- Specified by:
getTaskStatusin interfaceEvitaManagementContract
-
getTaskStatuses
- Specified by:
getTaskStatusesin interfaceEvitaManagementContract
-
cancelTask
- Specified by:
cancelTaskin interfaceEvitaManagementContract
-
listFilesToFetch
@Nonnull public io.evitadb.dataType.PaginatedList<FileForFetch> listFilesToFetch(int page, int pageSize, @Nullable String origin) - Specified by:
listFilesToFetchin interfaceEvitaManagementContract
-
getFileToFetch
- Specified by:
getFileToFetchin interfaceEvitaManagementContract
-
fetchFile
@Nonnull public InputStream fetchFile(@Nonnull UUID fileId) throws FileForFetchNotFoundException, io.evitadb.exception.UnexpectedIOException - Specified by:
fetchFilein interfaceEvitaManagementContract- Throws:
FileForFetchNotFoundExceptionio.evitadb.exception.UnexpectedIOException
-
deleteFile
- Specified by:
deleteFilein interfaceEvitaManagementContract- Throws:
FileForFetchNotFoundException
-
getSystemStatus
- Specified by:
getSystemStatusin interfaceEvitaManagementContract
-
getConfiguration
- Specified by:
getConfigurationin interfaceEvitaManagementContract
-
close
public void close()- Specified by:
closein interfaceAutoCloseable- Specified by:
closein interfaceCloseable
-
createTask
Creates a new client task. If the task is not yet completed (finished or failed), it is added to the queue of tracked tasks and its status is updated in the background, so that theTask.getFutureResult()is completed when the task is finished.- Type Parameters:
S- the type of the settings of the taskT- the type of the result of the task- Parameters:
taskStatus- the status of the task to be tracked- Returns:
- the client task that is tracking the status of the task
-