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

com.aliyuncs.http.IHttpClient Maven / Gradle / Ivy

Go to download

Aliyun Open API SDK for Java Copyright (C) Alibaba Cloud Computing All rights reserved. 版权所有 (C)阿里云计算有限公司 http://www.aliyun.com

The newest version!
package com.aliyuncs.http;

import com.aliyuncs.exceptions.ClientException;

import java.io.Closeable;
import java.io.IOException;
import java.util.concurrent.Future;

public abstract class IHttpClient implements Closeable {

    protected HttpClientConfig clientConfig;

    public IHttpClient(HttpClientConfig clientConfig) throws ClientException {
        if (clientConfig == null) {
            clientConfig = HttpClientConfig.getDefault();
        }
        this.clientConfig = clientConfig;
        init(clientConfig);
    }

    public IHttpClient() {
        // do nothing
    }

    protected abstract void init(HttpClientConfig clientConfig) throws ClientException;

    public abstract HttpResponse syncInvoke(HttpRequest apiRequest) throws IOException, ClientException;

    public abstract Future asyncInvoke(final HttpRequest apiRequest, final CallBack callback)
            throws IOException;

    @Deprecated
    public abstract void ignoreSSLCertificate();

    @Deprecated
    public abstract void restoreSSLCertificate();

    public abstract boolean isSingleton();
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy