All Downloads are FREE. Search and download functionalities are using the official Maven repository.

de.mklinger.qetcher.client.QetcherClient Maven / Gradle / Ivy

There is a newer version: 2.0.42.rc
Show newest version
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.Job;

/**
 * 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 deleteJob(String jobId);

	CompletableFuture> getAvailableConversions();

	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 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();
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy