de.mklinger.qetcher.client.QetcherClient Maven / Gradle / Ivy
package de.mklinger.qetcher.client;
import java.io.File;
import java.nio.file.OpenOption;
import java.nio.file.Path;
import java.security.KeyStore;
import java.util.List;
import java.util.concurrent.CompletableFuture;
import de.mklinger.qetcher.client.model.v1.AvailableConversion;
import de.mklinger.qetcher.client.model.v1.AvailableNode;
import de.mklinger.qetcher.client.model.v1.ConversionFile;
import de.mklinger.qetcher.client.model.v1.FileExtensionInfos;
import de.mklinger.qetcher.client.model.v1.Job;
import de.mklinger.qetcher.client.model.v1.MediaTypeInfo;
/**
* The Qetcher client.
*
* @author Marc Klinger - mklinger[at]mklinger[dot]de
*/
public interface QetcherClient extends AutoCloseable {
CompletableFuture uploadFile(InputConversionFile inputFile);
CompletableFuture getFile(String fileId);
CompletableFuture> getFiles();
CompletableFuture deleteFile(String fileId);
CompletableFuture downloadAsFile(String fileId, Path file, OpenOption... openOptions);
CompletableFuture createJob(InputJob inputJob);
CompletableFuture getJob(String jobId);
CompletableFuture> getJobs();
CompletableFuture cancelJob(String jobId);
CompletableFuture deleteJob(String jobId);
CompletableFuture> getAvailableConversions();
CompletableFuture> getMediaTypes();
CompletableFuture getFileExtensions();
CompletableFuture getMediaTypeForFilename(String filename);
CompletableFuture> getAvailableNodes();
CompletableFuture getFile(final ConversionFile file);
CompletableFuture deleteFile(final ConversionFile file);
CompletableFuture downloadAsFile(final String fileId, final Path file);
CompletableFuture downloadAsFile(final String fileId, final File file);
CompletableFuture downloadAsTempFile(final String fileId);
CompletableFuture downloadAsTempFile(final String fileId, final Path dir);
CompletableFuture downloadAsByteArray(final String fileId);
CompletableFuture getJob(final Job job);
CompletableFuture deleteJob(final Job job);
CompletableFuture getJobDone(final Job job);
CompletableFuture getJobDone(final String jobId);
@Override
void close();
public interface Builder {
Builder serviceAddresses(String... serviceAddresses);
Builder withServiceAddress(String serviceAddress);
Builder withServiceAddress(String host, int port);
Builder disableServiceLookup();
Builder trustStore(KeyStore trustStore);
Builder keyStore(KeyStore keyStore, String keyPassword);
QetcherClient build();
}
}