|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.createsend.util.JerseyClientImpl
public class JerseyClientImpl
| Constructor Summary | |
|---|---|
JerseyClientImpl(AuthenticationDetails auth)
Constructs a JerseyClientImpl instance, including an OAuth access token and refresh token. |
|
| Method Summary | ||
|---|---|---|
protected void |
addPagingParams(javax.ws.rs.core.MultivaluedMap<String,String> queryString,
Integer page,
Integer pageSize,
String orderField,
String orderDirection)
|
|
void |
delete(javax.ws.rs.core.MultivaluedMap<String,String> queryString,
String... pathElements)
Makes a HTTP DELETE request to the specified path with the specified query string |
|
void |
delete(String... pathElements)
Makes a HTTP DELETE request to the specified path |
|
protected
|
fixStringResult(Class<T> klass,
T result)
Jersey is awesome in that even though we specify a JSON response and to use the JsonProvider it sees that we want a
String result and that the response is already a String so just use that. |
|
|
get(Class<T> klass,
ErrorDeserialiser<?> errorDeserialiser,
String... pathElements)
|
|
|
get(Class<T> klass,
javax.ws.rs.core.MultivaluedMap<String,String> queryString,
ResourceFactory resourceFactory,
ErrorDeserialiser<?> errorDeserialiser,
String... pathElements)
|
|
|
get(Class<T> klass,
javax.ws.rs.core.MultivaluedMap<String,String> queryString,
ResourceFactory resourceFactory,
String... pathElements)
|
|
|
get(Class<T> klass,
javax.ws.rs.core.MultivaluedMap<String,String> queryString,
String... pathElements)
Performs a HTTP GET on the route specified by the pathElements deserialising the result to an instance of klass. |
|
|
get(Class<T> klass,
String... pathElements)
Performs a HTTP GET on the route specified by the pathElements deserialising the result to an instance of klass. |
|
AuthenticationDetails |
getAuthenticationDetails()
|
|
static ParameterizedType |
getGenericReturnType(Class<?> klass,
int stackFrame)
|
|
|
getPagedResult(Integer page,
Integer pageSize,
String orderField,
String orderDirection,
javax.ws.rs.core.MultivaluedMap<String,String> queryString,
String... pathElements)
Performs a HTTP GET on the route specified attempting to deserialise the result to a paged result of the given type. |
|
|
post(Class<T> klass,
Object entity,
ErrorDeserialiser<?> errorDeserialiser,
String... pathElements)
|
|
|
post(Class<T> klass,
Object entity,
javax.ws.rs.core.MediaType mediaType,
String... pathElements)
|
|
|
post(Class<T> klass,
Object entity,
String... pathElements)
Posts the provided entity to the url specified by the provided path elements. |
|
|
post(String baseUri,
Class<T> klass,
Object entity,
ErrorDeserialiser<?> errorDeserialiser,
javax.ws.rs.core.MediaType mediaType,
String... pathElements)
|
|
|
post(String baseUri,
Class<T> klass,
Object entity,
ErrorDeserialiser<?> errorDeserialiser,
String... pathElements)
|
|
|
post(String baseUri,
Class<T> klass,
Object entity,
javax.ws.rs.core.MediaType mediaType,
String... pathElements)
|
|
|
post(String baseUri,
Class<T> klass,
Object entity,
String... pathElements)
|
|
|
put(Class<T> klass,
Object entity,
String... pathElements)
|
|
void |
put(Object entity,
ErrorDeserialiser<?> errorDeserialiser,
String... pathElements)
|
|
void |
put(Object entity,
javax.ws.rs.core.MultivaluedMap<String,String> queryString,
String... pathElements)
|
|
void |
put(Object entity,
String... pathElements)
Makes a HTTP PUT request to the path specified, using the provided entity as the request body. |
|
void |
setAuthenticationDetails(AuthenticationDetails authDetails)
|
|
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public JerseyClientImpl(AuthenticationDetails auth)
auth - | Method Detail |
|---|
public AuthenticationDetails getAuthenticationDetails()
getAuthenticationDetails in interface JerseyClientpublic void setAuthenticationDetails(AuthenticationDetails authDetails)
setAuthenticationDetails in interface JerseyClient
public <T> T get(Class<T> klass,
String... pathElements)
throws CreateSendException
get in interface JerseyClientT - The type of model expected from the API call.klass - The class of the model to deserialise.pathElements - The path of the API resource to access
CreateSendException - If the API call results in a HTTP status code >= 400
public <T> T get(Class<T> klass,
ErrorDeserialiser<?> errorDeserialiser,
String... pathElements)
throws CreateSendException
get in interface JerseyClientCreateSendException
public <T> T get(Class<T> klass,
javax.ws.rs.core.MultivaluedMap<String,String> queryString,
String... pathElements)
throws CreateSendException
get in interface JerseyClientT - The type of model expected from the API call.klass - The class of the model to deserialise.queryString - The query string params to use for the request.
Use null when no query string is required.pathElements - The path of the API resource to access
CreateSendException - If the API call results in a HTTP status code >= 400
public <T> T get(Class<T> klass,
javax.ws.rs.core.MultivaluedMap<String,String> queryString,
ResourceFactory resourceFactory,
String... pathElements)
throws CreateSendException
get in interface JerseyClientCreateSendException
public <T> T get(Class<T> klass,
javax.ws.rs.core.MultivaluedMap<String,String> queryString,
ResourceFactory resourceFactory,
ErrorDeserialiser<?> errorDeserialiser,
String... pathElements)
throws CreateSendException
CreateSendException
public <T> PagedResult<T> getPagedResult(Integer page,
Integer pageSize,
String orderField,
String orderDirection,
javax.ws.rs.core.MultivaluedMap<String,String> queryString,
String... pathElements)
throws CreateSendException
getPagedResult in interface JerseyClientT - The type of paged result data expected from the API call.queryString - The query string values to use for the request.pathElements - The path of the API resource to access
CreateSendException - If the API call results in a HTTP status code >= 400
public <T> T post(Class<T> klass,
Object entity,
String... pathElements)
throws CreateSendException
post in interface JerseyClientT - The class to use for model deserialisationklass - The class to use for model deserialisationentity - The entity to use as the body of the post requestpathElements - The path to send the post request to
CreateSendException - Thrown when the API responds with a HTTP Status >= 400
public <T> T post(Class<T> klass,
Object entity,
ErrorDeserialiser<?> errorDeserialiser,
String... pathElements)
throws CreateSendException
post in interface JerseyClientCreateSendException
public <T> T post(String baseUri,
Class<T> klass,
Object entity,
String... pathElements)
throws CreateSendException
post in interface JerseyClientCreateSendException
public <T> T post(String baseUri,
Class<T> klass,
Object entity,
ErrorDeserialiser<?> errorDeserialiser,
String... pathElements)
throws CreateSendException
post in interface JerseyClientCreateSendException
public <T> T post(Class<T> klass,
Object entity,
javax.ws.rs.core.MediaType mediaType,
String... pathElements)
throws CreateSendException
post in interface JerseyClientCreateSendException
public <T> T post(String baseUri,
Class<T> klass,
Object entity,
javax.ws.rs.core.MediaType mediaType,
String... pathElements)
throws CreateSendException
post in interface JerseyClientCreateSendException
public <T> T post(String baseUri,
Class<T> klass,
Object entity,
ErrorDeserialiser<?> errorDeserialiser,
javax.ws.rs.core.MediaType mediaType,
String... pathElements)
throws CreateSendException
post in interface JerseyClientCreateSendException
public void put(Object entity,
String... pathElements)
throws CreateSendException
put in interface JerseyCliententity - The entity to use as the request bodypathElements - The path to make the request to.
CreateSendException - Raised when the API responds with a HTTP Status >= 400
public <T> T put(Class<T> klass,
Object entity,
String... pathElements)
throws CreateSendException
put in interface JerseyClientCreateSendException
public void put(Object entity,
javax.ws.rs.core.MultivaluedMap<String,String> queryString,
String... pathElements)
throws CreateSendException
put in interface JerseyClientCreateSendException
public void put(Object entity,
ErrorDeserialiser<?> errorDeserialiser,
String... pathElements)
throws CreateSendException
put in interface JerseyClientCreateSendException
public void delete(String... pathElements)
throws CreateSendException
delete in interface JerseyClientpathElements - The path of the resource to delete
CreateSendException - Raised when the API responds with a HTTP Status >= 400
public void delete(javax.ws.rs.core.MultivaluedMap<String,String> queryString,
String... pathElements)
throws CreateSendException
delete in interface JerseyClientpathElements - The path of the resource to delete
CreateSendException - Raised when the API responds with a HTTP Status >= 400
protected void addPagingParams(javax.ws.rs.core.MultivaluedMap<String,String> queryString,
Integer page,
Integer pageSize,
String orderField,
String orderDirection)
protected <T> T fixStringResult(Class<T> klass,
T result)
JsonProvider it sees that we want a
String result and that the response is already a String so just use that.
This method strips any enclosing quotes required as per the JSON spec.
T - The type of result we are expectingklass - The class of the provided resultresult - The result as deserialised by Jersey
public static ParameterizedType getGenericReturnType(Class<?> klass,
int stackFrame)
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||