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

de.mklinger.qetcher.client.impl.InstanceFactory Maven / Gradle / Ivy

There is a newer version: 2.0.42.rc
Show newest version
package de.mklinger.qetcher.client.impl;

import de.mklinger.qetcher.client.InputConversionFile;
import de.mklinger.qetcher.client.InputJob;
import de.mklinger.qetcher.client.QetcherClient;
import de.mklinger.qetcher.client.impl.lookup.NodeLookupQetcherClientImpl;
import de.mklinger.qetcher.client.impl.lookup.StaticServiceUriSupplier;
import de.mklinger.qetcher.client.impl.retry.RetryingQetcherClientImpl;

/**
 * @author Marc Klinger - mklinger[at]mklinger[dot]de
 */
public class InstanceFactory {
	/** No instantiation. */
	private InstanceFactory() {}

	public static QetcherClient newInstance(final QetcherClientBuilderImpl builder) {
		if (builder.isServiceLookupDisabled()) {
			return new RetryingQetcherClientImpl(builder, new StaticServiceUriSupplier(builder.getServiceUris()));
		} else {
			return new NodeLookupQetcherClientImpl(builder);
		}
	}

	public static InputConversionFile newInstance(final InputConversionFileBuilderImpl builder) {
		return new InputConversionFileImpl(builder);
	}

	public static InputJob newInstance(final InputJobBuilderImpl builder) {
		return new InputJobImpl(builder);
	}
}




© 2015 - 2024 Weber Informatics LLC | Privacy Policy