org.zodiac.core.resource.SpringHttp2ClientURLResource Maven / Gradle / Ivy
The newest version!
package org.zodiac.core.resource;
import java.net.MalformedURLException;
import java.net.URI;
import java.net.URL;
import java.util.Map;
import org.slf4j.Logger;
import org.zodiac.core.httpclient.http2client.HttpClientAccessor;
import org.zodiac.core.resource.support.SpringHttpURLResource;
import org.zodiac.sdk.toolkit.http.SimpleHttpMethod;
import org.zodiac.sdk.toolkit.util.AssertUtil;
public class SpringHttp2ClientURLResource extends SpringHttpURLResource implements Http2ClientResource {
private final HttpClientAccessor httpClientAccessor;
private final Http2ClientURLResponseHandler handler = new Http2ClientURLResponseHandler();
public SpringHttp2ClientURLResource(String path, Map headers, SimpleHttpMethod httpMethod,
HttpClientAccessor httpClientAccessor) throws MalformedURLException {
super(path, headers, httpMethod);
this.httpClientAccessor = AssertUtil.notNull(httpClientAccessor, "httpClientAccessor");
}
public SpringHttp2ClientURLResource(String path, Map headers, SimpleHttpMethod httpMethod) throws MalformedURLException {
this(path, headers, httpMethod, HttpClientAccessor.singleHttp());
}
public SpringHttp2ClientURLResource(String path, Map headers, HttpClientAccessor httpClientAccessor)
throws MalformedURLException {
super(path, headers);
this.httpClientAccessor = AssertUtil.notNull(httpClientAccessor, "httpClientAccessor");
}
public SpringHttp2ClientURLResource(String path, Map headers)
throws MalformedURLException {
this(path, headers, HttpClientAccessor.singleHttp());
}
public SpringHttp2ClientURLResource(String path, SimpleHttpMethod httpMethod, HttpClientAccessor httpClientAccessor)
throws MalformedURLException {
super(path, httpMethod);
this.httpClientAccessor = AssertUtil.notNull(httpClientAccessor, "httpClientAccessor");
}
public SpringHttp2ClientURLResource(String path, SimpleHttpMethod httpMethod)
throws MalformedURLException {
this(path, httpMethod, HttpClientAccessor.singleHttp());
}
public SpringHttp2ClientURLResource(String path, HttpClientAccessor httpClientAccessor)
throws MalformedURLException {
super(path);
this.httpClientAccessor = AssertUtil.notNull(httpClientAccessor, "httpClientAccessor");
}
public SpringHttp2ClientURLResource(String path)
throws MalformedURLException {
this(path, HttpClientAccessor.singleHttp());
}
public SpringHttp2ClientURLResource(URI uri, Map headers, SimpleHttpMethod httpMethod,
HttpClientAccessor httpClientAccessor) throws MalformedURLException {
super(uri, headers, httpMethod);
this.httpClientAccessor = AssertUtil.notNull(httpClientAccessor, "httpClientAccessor");
}
public SpringHttp2ClientURLResource(URI uri, Map headers, SimpleHttpMethod httpMethod) throws MalformedURLException {
this(uri, headers, httpMethod, HttpClientAccessor.singleHttp());
}
public SpringHttp2ClientURLResource(URI uri, Map headers, HttpClientAccessor httpClientAccessor)
throws MalformedURLException {
super(uri, headers);
this.httpClientAccessor = AssertUtil.notNull(httpClientAccessor, "httpClientAccessor");
}
public SpringHttp2ClientURLResource(URI uri, Map headers)
throws MalformedURLException {
this(uri, headers, HttpClientAccessor.singleHttp());
}
public SpringHttp2ClientURLResource(URI uri, SimpleHttpMethod httpMethod, HttpClientAccessor httpClientAccessor)
throws MalformedURLException {
super(uri, httpMethod);
this.httpClientAccessor = AssertUtil.notNull(httpClientAccessor, "httpClientAccessor");
}
public SpringHttp2ClientURLResource(URI uri, SimpleHttpMethod httpMethod)
throws MalformedURLException {
this(uri, httpMethod, HttpClientAccessor.singleHttp());
}
public SpringHttp2ClientURLResource(URI uri, HttpClientAccessor httpClientAccessor) throws MalformedURLException {
super(uri);
this.httpClientAccessor = AssertUtil.notNull(httpClientAccessor, "httpClientAccessor");
}
public SpringHttp2ClientURLResource(URI uri) throws MalformedURLException {
this(uri, HttpClientAccessor.singleHttp());
}
public SpringHttp2ClientURLResource(URL url, Map headers, SimpleHttpMethod httpMethod,
HttpClientAccessor httpClientAccessor) {
super(url, headers, httpMethod);
this.httpClientAccessor = AssertUtil.notNull(httpClientAccessor, "httpClientAccessor");
}
public SpringHttp2ClientURLResource(URL url, Map headers, SimpleHttpMethod httpMethod) {
this(url, headers, httpMethod, HttpClientAccessor.singleHttp());
}
public SpringHttp2ClientURLResource(URL url, Map headers, HttpClientAccessor httpClientAccessor) {
super(url, headers);
this.httpClientAccessor = AssertUtil.notNull(httpClientAccessor, "httpClientAccessor");
}
public SpringHttp2ClientURLResource(URL url, Map headers) {
this(url, headers, HttpClientAccessor.singleHttp());
}
public SpringHttp2ClientURLResource(URL url, SimpleHttpMethod httpMethod, HttpClientAccessor httpClientAccessor) {
super(url, httpMethod);
this.httpClientAccessor = AssertUtil.notNull(httpClientAccessor, "httpClientAccessor");
}
public SpringHttp2ClientURLResource(URL url, SimpleHttpMethod httpMethod) {
this(url, httpMethod, HttpClientAccessor.singleHttp());
}
public SpringHttp2ClientURLResource(URL url, HttpClientAccessor httpClientAccessor) {
super(url);
this.httpClientAccessor = AssertUtil.notNull(httpClientAccessor, "httpClientAccessor");
}
public SpringHttp2ClientURLResource(URL url) {
this(url, HttpClientAccessor.singleHttp());
}
@Override
public HttpClientAccessor getHttpClientAccessor() {
return this.httpClientAccessor;
}
@Override
public Http2ClientURLResponseHandler getHandler() {
return this.handler;
}
@Override
public Logger getLogger() {
return this.log;
}
}