public class IndyClientHttp extends Object implements Closeable
| Modifier and Type | Field and Description |
|---|---|
static int |
GLOBAL_MAX_CONNECTIONS |
| Constructor and Description |
|---|
IndyClientHttp(IndyClientAuthenticator authenticator,
org.commonjava.indy.model.core.io.IndyObjectMapper mapper,
org.commonjava.util.jhttpc.model.SiteConfig location) |
IndyClientHttp(org.commonjava.util.jhttpc.auth.PasswordManager passwordManager,
org.commonjava.indy.model.core.io.IndyObjectMapper mapper,
org.commonjava.util.jhttpc.model.SiteConfig location) |
| 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()
Deprecated.
|
void |
connect(org.apache.http.conn.HttpClientConnectionManager connectionManager)
Deprecated.
|
static org.commonjava.util.jhttpc.model.SiteConfig |
defaultSiteConfig(String baseUrl) |
void |
delete(String path) |
void |
delete(String path,
int... responseCodes) |
void |
deleteWithChangelog(String path,
String changelog) |
void |
deleteWithChangelog(String path,
String changelog,
int... responseCodes) |
HttpResources |
execute(org.apache.http.client.methods.HttpRequestBase request) |
boolean |
exists(String path) |
boolean |
exists(String path,
int... responseCodes) |
boolean |
exists(String path,
java.util.function.Supplier<Map<String,String>> querySupplier) |
boolean |
exists(String path,
java.util.function.Supplier<Map<String,String>> querySupplier,
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.indy.model.core.io.IndyObjectMapper |
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.HttpPost |
newRawPost(String url) |
org.apache.http.client.methods.HttpPut |
newRawPut(String url) |
HttpResources |
postRaw(String path,
Object value) |
HttpResources |
postRaw(String path,
Object value,
Map<String,String> headers) |
<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 |
toIndyUrl(String... path) |
boolean |
validResponseCode(int statusCode,
int[] responseCodes) |
public static final int GLOBAL_MAX_CONNECTIONS
public IndyClientHttp(IndyClientAuthenticator authenticator, org.commonjava.indy.model.core.io.IndyObjectMapper mapper, org.commonjava.util.jhttpc.model.SiteConfig location) throws IndyClientException
IndyClientExceptionpublic IndyClientHttp(org.commonjava.util.jhttpc.auth.PasswordManager passwordManager,
org.commonjava.indy.model.core.io.IndyObjectMapper mapper,
org.commonjava.util.jhttpc.model.SiteConfig location)
throws IndyClientException
IndyClientException@Deprecated public void connect(org.apache.http.conn.HttpClientConnectionManager connectionManager) throws IndyClientException
IndyClientException@Deprecated public void connect()
public Map<String,String> head(String path) throws IndyClientException
IndyClientExceptionpublic Map<String,String> head(String path, int... responseCodes) throws IndyClientException
IndyClientExceptionpublic <T> T get(String path, Class<T> type) throws IndyClientException
IndyClientExceptionpublic <T> T get(String path, com.fasterxml.jackson.core.type.TypeReference<T> typeRef) throws IndyClientException
IndyClientExceptionpublic HttpResources getRaw(org.apache.http.client.methods.HttpGet req) throws IndyClientException
IndyClientExceptionpublic HttpResources getRaw(String path) throws IndyClientException
IndyClientExceptionpublic HttpResources getRaw(String path, Map<String,String> headers) throws IndyClientException
IndyClientExceptionpublic void putWithStream(String path, InputStream stream) throws IndyClientException
IndyClientExceptionpublic void putWithStream(String path, InputStream stream, int... responseCodes) throws IndyClientException
IndyClientExceptionpublic boolean put(String path, Object value) throws IndyClientException
IndyClientExceptionpublic boolean put(String path, Object value, int... responseCodes) throws IndyClientException
IndyClientExceptionpublic HttpResources execute(org.apache.http.client.methods.HttpRequestBase request) throws IndyClientException
IndyClientExceptionpublic HttpResources postRaw(String path, Object value) throws IndyClientException
IndyClientExceptionpublic HttpResources postRaw(String path, Object value, Map<String,String> headers) throws IndyClientException
IndyClientExceptionpublic <T> T postWithResponse(String path, Object value, Class<T> type) throws IndyClientException
IndyClientExceptionpublic <T> T postWithResponse(String path, Object value, Class<T> type, int... responseCodes) throws IndyClientException
IndyClientExceptionpublic boolean validResponseCode(int statusCode,
int[] responseCodes)
public <T> T postWithResponse(String path, Object value, com.fasterxml.jackson.core.type.TypeReference<T> typeRef) throws IndyClientException
IndyClientExceptionpublic <T> T postWithResponse(String path, Object value, com.fasterxml.jackson.core.type.TypeReference<T> typeRef, int... responseCodes) throws IndyClientException
IndyClientExceptionpublic void close()
close in interface Closeableclose in interface AutoCloseablepublic void delete(String path) throws IndyClientException
IndyClientExceptionpublic void delete(String path, int... responseCodes) throws IndyClientException
IndyClientExceptionpublic void deleteWithChangelog(String path, String changelog) throws IndyClientException
IndyClientExceptionpublic void deleteWithChangelog(String path, String changelog, int... responseCodes) throws IndyClientException
IndyClientExceptionpublic boolean exists(String path) throws IndyClientException
IndyClientExceptionpublic boolean exists(String path, java.util.function.Supplier<Map<String,String>> querySupplier) throws IndyClientException
IndyClientExceptionpublic boolean exists(String path, int... responseCodes) throws IndyClientException
IndyClientExceptionpublic boolean exists(String path, java.util.function.Supplier<Map<String,String>> querySupplier, int... responseCodes) throws IndyClientException
IndyClientExceptionpublic 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 IndyClientException
IndyClientExceptionpublic org.apache.http.client.protocol.HttpClientContext newContext()
throws IndyClientException
IndyClientExceptionpublic 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.apache.http.client.methods.HttpPost newRawPost(String url)
public org.commonjava.indy.model.core.io.IndyObjectMapper getObjectMapper()
public static org.commonjava.util.jhttpc.model.SiteConfig defaultSiteConfig(String baseUrl)
Copyright © 2011-2017-2018. All Rights Reserved.