public final class RestClient extends Object
| Modifier and Type | Class and Description |
|---|---|
static class |
RestClient.RestClientBuilder
The Class Builder.
|
| Modifier and Type | Method and Description |
|---|---|
<T> T |
call(String methodName,
String restPath,
Class<T> expectedResponse,
Object payload,
Map<String,String> queryParams)
Gets the.
|
static javax.ws.rs.ext.ContextResolver<org.glassfish.jersey.moxy.json.MoxyJsonConfig> |
createMoxyJsonResolver() |
javax.ws.rs.core.Response |
delete(String restPath,
Map<String,String> queryParams)
Delete.
|
<T> T |
get(String restPath,
Class<T> expectedResponse,
Map<String,String> queryParams)
Gets the.
|
int |
getConnectionTimeout()
Gets the connection timeout.
|
javax.ws.rs.core.MultivaluedMap<String,Object> |
getHeaders()
Gets the headers.
|
SupportedMediaType |
getMediaType()
Gets the mediaType.
|
String |
getPassword()
Gets the password.
|
AuthenticationToken |
getToken()
Gets the token.
|
String |
getUri()
Gets the uri.
|
javax.ws.rs.core.Response |
post(String restPath,
Object payload,
Map<String,String> queryParams)
Post.
|
javax.ws.rs.core.Response |
put(String restPath,
Object payload,
Map<String,String> queryParams)
Put.
|
void |
setConnectionTimeout(int connectionTimeout)
Sets the connection timeout.
|
void |
setHeaders(javax.ws.rs.core.MultivaluedMap<String,Object> headers)
Sets the headers.
|
void |
setMediaType(SupportedMediaType mediaType)
Sets the mediaType.
|
void |
setPassword(String password)
Sets the password.
|
void |
setToken(AuthenticationToken token)
Sets the token.
|
void |
setUri(String uri)
Sets the uri.
|
public <T> T get(String restPath, Class<T> expectedResponse, Map<String,String> queryParams)
T - the generic typerestPath - the rest pathexpectedResponse - the expected responsequeryParams - the query paramspublic javax.ws.rs.core.Response post(String restPath, Object payload, Map<String,String> queryParams)
restPath - the rest pathpayload - the payloadqueryParams - the query paramspublic javax.ws.rs.core.Response put(String restPath, Object payload, Map<String,String> queryParams)
restPath - the rest pathpayload - the payloadqueryParams - the query paramspublic javax.ws.rs.core.Response delete(String restPath, Map<String,String> queryParams)
restPath - the rest pathqueryParams - the query paramspublic <T> T call(String methodName, String restPath, Class<T> expectedResponse, Object payload, Map<String,String> queryParams)
T - the generic typemethodName - the method namerestPath - the rest pathexpectedResponse - the clazzpayload - the payloadqueryParams - the query paramspublic static javax.ws.rs.ext.ContextResolver<org.glassfish.jersey.moxy.json.MoxyJsonConfig> createMoxyJsonResolver()
public String getUri()
public void setUri(String uri)
uri - the new uripublic String getPassword()
public void setPassword(String password)
password - the new passwordpublic int getConnectionTimeout()
public void setConnectionTimeout(int connectionTimeout)
connectionTimeout - the new connection timeoutpublic AuthenticationToken getToken()
public void setToken(AuthenticationToken token)
token - the tokenpublic javax.ws.rs.core.MultivaluedMap<String,Object> getHeaders()
public void setHeaders(javax.ws.rs.core.MultivaluedMap<String,Object> headers)
headers - the headerspublic SupportedMediaType getMediaType()
public void setMediaType(SupportedMediaType mediaType)
mediaType - the mediaTypeCopyright © 2019. All rights reserved.