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

com.tinypass.client.common.ApiInvoker Maven / Gradle / Ivy

There is a newer version: 16.366.0
Show newest version
package com.tinypass.client.common;

import java.io.IOException;
import java.util.List;
import java.util.Map;

/**
 * Created  by alexander vorozhtsov on 17.09.14.
 */
public abstract class ApiInvoker {

	private static ApacheApiInvoker instance;

	/**
	 * Returns default api invoker with default settings
	 *
	 * @return  Default Implementation ApiInvoiker
	 */
	public static ApiInvoker getInstance() {
		if (instance == null || instance.isClosed()) {
			synchronized (ApiInvoker.class) {
				if (instance == null || instance.isClosed()) {
					instance = new ApacheApiInvoker(JsonParser.getInstance(), 50, 60000);
				}
			}
		}
		return instance;
	}

	public abstract  T invokeAPI(String host, String path, String method, String token,
			Map> queryParams, Object body, Map headerParams,
			Map> formParams, String resultContainerType, Class resultClass)
			throws ApiException;

	public void close() throws IOException {
        instance.close();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy