public class ImClient extends Object
Constructor and Description |
---|
ImClient(String targetUrl,
Path authFilePath)
Creates a new client using the 'imServiceUrl' as endpoint.
Loads the authorization file from the parameter 'authFilePath'. |
ImClient(String targetUrl,
String authorizationHeader)
Creates a new client using the 'imServiceUrl' as endpoint.
Loads the authorization credentials from the 'authorizationHeader' parameter. |
Modifier and Type | Method and Description |
---|---|
javax.ws.rs.client.Invocation.Builder |
configureClient(String path,
RestParameter... parameters)
Returns a Rest client configured with the specified properties.
|
<T> T |
delete(String path,
Class<T> type,
RestParameter... parameters)
Generic DELETE call.
|
<T> T |
get(String path,
Class<T> type,
RestParameter... parameters)
Generic GET call
|
<T> T |
post(String path,
Class<T> type,
RestParameter... parameters)
Simplified POST call.
|
<T> T |
post(String path,
String bodyContent,
String contentType,
Class<T> type,
RestParameter... parameters)
Generic POST call.
|
<T> T |
put(String path,
Class<T> type,
RestParameter... parameters)
Simplified PUT call.
|
<T> T |
put(String path,
String bodyContent,
String contentType,
Class<T> type,
RestParameter... parameters)
Generic PUT call.
|
public ImClient(String targetUrl, Path authFilePath) throws ImClientException
targetUrl
- : url of the IM rest serviceauthFilePath
- : path to the authorization fileImClientException
public ImClient(String targetUrl, String authorizationHeader) throws ImClientException
targetUrl
- : url of the IM rest serviceauthorizationHeader
- : string with the authorization contentImClientException
public <T> T get(String path, Class<T> type, RestParameter... parameters) throws ImClientException
T
- : class returned by the callpath
- : specific path for the call (e.g. infrastructures/02154-659a)parameters
- : extra parameters for the call (if needed)ImClientException
public <T> T delete(String path, Class<T> type, RestParameter... parameters) throws ImClientException
ImClientException
public <T> T post(String path, Class<T> type, RestParameter... parameters) throws ImClientException
ImClientException
public <T> T post(String path, String bodyContent, String contentType, Class<T> type, RestParameter... parameters) throws ImClientException
ImClientException
public <T> T put(String path, Class<T> type, RestParameter... parameters) throws ImClientException
ImClientException
public <T> T put(String path, String bodyContent, String contentType, Class<T> type, RestParameter... parameters) throws ImClientException
ImClientException
public javax.ws.rs.client.Invocation.Builder configureClient(String path, RestParameter... parameters) throws ImClientException
path
- : path where the client is going to connect (e.g.
/infrastructures/asdalk-asd34/vms)parameters
- : extra parameters for the call (if needed)ImClientException
Copyright © 2016. All rights reserved.