public class EntityHttpClientImpl extends java.lang.Object implements EntityHttpClient
EntityHttpClient.ResponseCodePredicates
Modifier and Type | Method and Description |
---|---|
HttpToolResponse |
delete(java.lang.String path,
java.util.Map<java.lang.String,java.lang.String> headers)
Makes an HTTP DELETE to a Brooklyn node entity.
|
HttpToolResponse |
get(java.lang.String path)
Makes an HTTP GET to a Brooklyn node entity.
|
HttpTool.HttpClientBuilder |
getHttpClientForBrooklynNode() |
HttpToolResponse |
post(java.lang.String path,
java.util.Map<java.lang.String,java.lang.String> headers,
byte[] body)
Makes an HTTP POST to a Brooklyn node entity.
|
HttpToolResponse |
post(java.lang.String path,
java.util.Map<java.lang.String,java.lang.String> headers,
java.util.Map<java.lang.String,java.lang.String> formParams)
Makes an HTTP POST to a Brooklyn node entity.
|
EntityHttpClient |
responseSuccess(com.google.common.base.Predicate<java.lang.Integer> responseSuccess)
Configure which response codes are treated as successful
|
public HttpTool.HttpClientBuilder getHttpClientForBrooklynNode()
getHttpClientForBrooklynNode
in interface EntityHttpClient
web console URI
at the
given entity, or null if the entity has no URI.public EntityHttpClient responseSuccess(com.google.common.base.Predicate<java.lang.Integer> responseSuccess)
EntityHttpClient
responseSuccess
in interface EntityHttpClient
public HttpToolResponse get(java.lang.String path)
EntityHttpClient
get
in interface EntityHttpClient
path
- Relative path to resource on server, e.g v1/catalogpublic HttpToolResponse post(java.lang.String path, java.util.Map<java.lang.String,java.lang.String> headers, byte[] body)
EntityHttpClient
post
in interface EntityHttpClient
path
- Relative path to resource on server, e.g v1/catalogbody
- byte array of serialized JSON to attach to the requestpublic HttpToolResponse post(java.lang.String path, java.util.Map<java.lang.String,java.lang.String> headers, java.util.Map<java.lang.String,java.lang.String> formParams)
EntityHttpClient
post
in interface EntityHttpClient
path
- Relative path to resource on server, e.g v1/catalogformParams
- The parameters to send in a x-www-form-urlencoded formatpublic HttpToolResponse delete(java.lang.String path, java.util.Map<java.lang.String,java.lang.String> headers)
EntityHttpClient
delete
in interface EntityHttpClient
path
- Relative path to resource on server, e.g v1/catalog