public class BaseHttpApi extends Object implements AutoCloseable
Modifier and Type | Field and Description |
---|---|
protected char[] |
apiKey |
protected String |
host |
protected HttpFactory |
httpFactory |
protected TaskListener |
taskListener |
Constructor and Description |
---|
BaseHttpApi(TaskListener taskListener,
HttpFactory httpFactory,
String host,
char[] apiKey) |
Modifier and Type | Method and Description |
---|---|
void |
close() |
<T> T |
convertJsonToObject(org.apache.hc.core5.http.HttpResponse response,
Type type) |
protected <T> T |
doHttpGet(String address,
Type type) |
protected final TaskListener taskListener
protected final HttpFactory httpFactory
protected final String host
protected final char[] apiKey
public BaseHttpApi(TaskListener taskListener, HttpFactory httpFactory, String host, char[] apiKey)
public void close()
close
in interface AutoCloseable
protected <T> T doHttpGet(String address, Type type) throws HttpException
HttpException
public <T> T convertJsonToObject(org.apache.hc.core5.http.HttpResponse response, Type type) throws IOException
IOException
Copyright © 2016–2022 Uleska. All rights reserved.