public interface RestService extends Serializable
Modifier and Type | Method and Description |
---|---|
void |
delete(String uri)
Perform a REST delete command with given uri
|
<T> T |
get(String uri,
Class<T> clazz)
Perform a REST Get command and return an object of the provided class
|
<T> T |
get(String uri,
Class<T> clazz,
Object... urlParams)
Perform a REST get command with given parameters to put in the given URI and return an object of the provided class
|
String |
getSocialMediaName()
Returns the name/type of the Social Network we're connected to
|
boolean |
isConnected()
Returns the status of this Service
|
<T> T |
post(String uri,
Map<String,?> params,
Class<T> clazz)
Perform a REST post command with given parameters to put in Body and return an object of the provided class
|
String |
post(String uri,
Object toPost,
Object... urlParams)
Perform a REST post command with given object and given URI params.
|
void |
put(String uri,
Object toPut,
Object... urlParams)
Perform a REST put command with given object and given URI params
|
boolean isConnected()
String getSocialMediaName()
<T> T get(String uri, Class<T> clazz)
uri
- the uri to perform the rest get callclazz
- class of the returned object<T> T get(String uri, Class<T> clazz, Object... urlParams)
T
- generic type for returned objecturi
- a string with MessageFormat
placeholders (i.e. {0},
{1}) style for params. It's the uri to perform the REST get callclazz
- class of the returned objecturlParams
- list of params to feed the uri with<T> T post(String uri, Map<String,?> params, Class<T> clazz)
T
- generic type for returned objecturi
- the URI to post toparams
- parameters to put in bodyclazz
- class of the returned objectString post(String uri, Object toPost, Object... urlParams)
uri
- a string with MessageFormat
placeholders (i.e. {0},
{1}) style for params. It's the uri to perform the REST post calltoPost
- the object to posturlParams
- list of params to feed the uri withvoid put(String uri, Object toPut, Object... urlParams)
uri
- a string with MessageFormat
placeholders (i.e. {0},
{1}) style for params. It's the uri to perform the REST put calltoPut
- the object to puturlParams
- list of params to feed the uri withvoid delete(String uri)
uri
- to perform te REST delete callCopyright © 2012-2013. All Rights Reserved.