public class AproxClientHttp extends Object implements Closeable
| Constructor and Description |
|---|
AproxClientHttp(String baseUrl,
AproxClientAuthenticator authenticator,
org.commonjava.aprox.model.core.io.AproxObjectMapper mapper) |
| Modifier and Type | Method and Description |
|---|---|
void |
addJsonHeaders(org.apache.http.client.methods.HttpUriRequest req) |
void |
cleanup(org.apache.http.HttpRequest request,
org.apache.http.HttpResponse response,
org.apache.http.impl.client.CloseableHttpClient client) |
void |
close() |
void |
connect() |
void |
connect(org.apache.http.conn.HttpClientConnectionManager connectionManager) |
void |
delete(String path) |
void |
delete(String path,
int... responseCodes) |
void |
deleteWithChangelog(String path,
String changelog) |
void |
deleteWithChangelog(String path,
String changelog,
int... responseCodes) |
boolean |
exists(String path) |
boolean |
exists(String path,
int... responseCodes) |
<T> T |
get(String path,
Class<T> type) |
<T> T |
get(String path,
com.fasterxml.jackson.core.type.TypeReference<T> typeRef) |
String |
getBaseUrl() |
org.commonjava.aprox.model.core.io.AproxObjectMapper |
getObjectMapper() |
HttpResources |
getRaw(org.apache.http.client.methods.HttpGet req) |
HttpResources |
getRaw(String path) |
HttpResources |
getRaw(String path,
Map<String,String> headers) |
Map<String,String> |
head(String path) |
Map<String,String> |
head(String path,
int... responseCodes) |
org.apache.http.impl.client.CloseableHttpClient |
newClient() |
org.apache.http.client.protocol.HttpClientContext |
newContext() |
org.apache.http.client.methods.HttpDelete |
newDelete(String url) |
org.apache.http.client.methods.HttpGet |
newJsonGet(String url) |
org.apache.http.client.methods.HttpHead |
newJsonHead(String url) |
org.apache.http.client.methods.HttpPost |
newJsonPost(String url) |
org.apache.http.client.methods.HttpPut |
newJsonPut(String url) |
org.apache.http.client.methods.HttpGet |
newRawGet(String url) |
org.apache.http.client.methods.HttpPut |
newRawPut(String url) |
<T> T |
postWithResponse(String path,
Object value,
Class<T> type) |
<T> T |
postWithResponse(String path,
Object value,
Class<T> type,
int... responseCodes) |
<T> T |
postWithResponse(String path,
Object value,
com.fasterxml.jackson.core.type.TypeReference<T> typeRef) |
<T> T |
postWithResponse(String path,
Object value,
com.fasterxml.jackson.core.type.TypeReference<T> typeRef,
int... responseCodes) |
boolean |
put(String path,
Object value) |
boolean |
put(String path,
Object value,
int... responseCodes) |
void |
putWithStream(String path,
InputStream stream) |
void |
putWithStream(String path,
InputStream stream,
int... responseCodes) |
String |
toAproxUrl(String... path) |
boolean |
validResponseCode(int statusCode,
int[] responseCodes) |
public AproxClientHttp(String baseUrl, AproxClientAuthenticator authenticator, org.commonjava.aprox.model.core.io.AproxObjectMapper mapper) throws AproxClientException
AproxClientExceptionpublic void connect(org.apache.http.conn.HttpClientConnectionManager connectionManager)
throws AproxClientException
AproxClientExceptionpublic void connect()
public Map<String,String> head(String path) throws AproxClientException
AproxClientExceptionpublic Map<String,String> head(String path, int... responseCodes) throws AproxClientException
AproxClientExceptionpublic <T> T get(String path, Class<T> type) throws AproxClientException
AproxClientExceptionpublic <T> T get(String path, com.fasterxml.jackson.core.type.TypeReference<T> typeRef) throws AproxClientException
AproxClientExceptionpublic HttpResources getRaw(org.apache.http.client.methods.HttpGet req) throws AproxClientException
AproxClientExceptionpublic HttpResources getRaw(String path) throws AproxClientException
AproxClientExceptionpublic HttpResources getRaw(String path, Map<String,String> headers) throws AproxClientException
AproxClientExceptionpublic void putWithStream(String path, InputStream stream) throws AproxClientException
AproxClientExceptionpublic void putWithStream(String path, InputStream stream, int... responseCodes) throws AproxClientException
AproxClientExceptionpublic boolean put(String path, Object value) throws AproxClientException
AproxClientExceptionpublic boolean put(String path, Object value, int... responseCodes) throws AproxClientException
AproxClientExceptionpublic <T> T postWithResponse(String path, Object value, Class<T> type) throws AproxClientException
AproxClientExceptionpublic <T> T postWithResponse(String path, Object value, Class<T> type, int... responseCodes) throws AproxClientException
AproxClientExceptionpublic boolean validResponseCode(int statusCode,
int[] responseCodes)
public <T> T postWithResponse(String path, Object value, com.fasterxml.jackson.core.type.TypeReference<T> typeRef) throws AproxClientException
AproxClientExceptionpublic <T> T postWithResponse(String path, Object value, com.fasterxml.jackson.core.type.TypeReference<T> typeRef, int... responseCodes) throws AproxClientException
AproxClientExceptionpublic void close()
close in interface Closeableclose in interface AutoCloseablepublic void delete(String path) throws AproxClientException
AproxClientExceptionpublic void delete(String path, int... responseCodes) throws AproxClientException
AproxClientExceptionpublic void deleteWithChangelog(String path, String changelog) throws AproxClientException
AproxClientExceptionpublic void deleteWithChangelog(String path, String changelog, int... responseCodes) throws AproxClientException
AproxClientExceptionpublic boolean exists(String path) throws AproxClientException
AproxClientExceptionpublic boolean exists(String path, int... responseCodes) throws AproxClientException
AproxClientExceptionpublic void cleanup(org.apache.http.HttpRequest request,
org.apache.http.HttpResponse response,
org.apache.http.impl.client.CloseableHttpClient client)
public String getBaseUrl()
public org.apache.http.impl.client.CloseableHttpClient newClient()
throws AproxClientException
AproxClientExceptionpublic org.apache.http.client.protocol.HttpClientContext newContext()
public org.apache.http.client.methods.HttpGet newRawGet(String url)
public org.apache.http.client.methods.HttpGet newJsonGet(String url)
public org.apache.http.client.methods.HttpHead newJsonHead(String url)
public void addJsonHeaders(org.apache.http.client.methods.HttpUriRequest req)
public org.apache.http.client.methods.HttpDelete newDelete(String url)
public org.apache.http.client.methods.HttpPut newJsonPut(String url)
public org.apache.http.client.methods.HttpPut newRawPut(String url)
public org.apache.http.client.methods.HttpPost newJsonPost(String url)
public org.commonjava.aprox.model.core.io.AproxObjectMapper getObjectMapper()
Copyright © 2011-2015. All Rights Reserved.