| Modifier and Type | Field and Description |
|---|---|
static Executor |
THREAD_POOL_EXECUTOR |
| Constructor and Description |
|---|
RestAdapter(Class<T> klass,
URL absoluteURL)
This will configure the Adapter as with sane RESTful defaults.
|
RestAdapter(Class<T> klass,
URL absoluteURL,
RestfulPipeConfiguration config)
This will build an adapter based on a configuration.
|
| Modifier and Type | Method and Description |
|---|---|
PipeHandler<T> |
getHandler()
Returns the instance which is responsible for handling read, save, and remove.
|
Class<T> |
getKlass() |
RequestBuilder<T> |
getRequestBuilder()
The
RequestBuilder is responsible for turning objects in bodies of requests. |
ResponseParser<T> |
getResponseParser()
The
ResponseParser is responsible for turning responses from a SAVE into an object |
URL |
getUrl()
|
void |
read(org.jboss.aerogear.android.core.Callback<List<T>> callback)
Sends a signal to the Pipe to read its data and return it via the callback.
|
void |
read(org.jboss.aerogear.android.core.ReadFilter filter,
org.jboss.aerogear.android.core.Callback<List<T>> callback)
Reads all the data from the underlying server connection.
|
void |
read(String id,
org.jboss.aerogear.android.core.Callback<T> callback)
Sends a signal to the Pipe to read data by id and return it via the callback.
|
void |
remove(String id,
org.jboss.aerogear.android.core.Callback<Void> callback)
Removes an object from the underlying server connection.
|
void |
save(T data,
org.jboss.aerogear.android.core.Callback<T> callback)
Saves or updates a given object on the server.
|
public static final Executor THREAD_POOL_EXECUTOR
public RestAdapter(Class<T> klass, URL absoluteURL)
klass - The type that this adapter will consume and produceabsoluteURL - the RESTful URL endpoint.public RestAdapter(Class<T> klass, URL absoluteURL, RestfulPipeConfiguration config)
klass - The type that this adapter will consume and produceabsoluteURL - the RESTful URL endpoint.config - A PipeConfig to use. NOTE: the URL's provided in the config
are ignored in deference to the absoluteURL parameter.public void read(String id, org.jboss.aerogear.android.core.Callback<T> callback)
Pipepublic void read(org.jboss.aerogear.android.core.ReadFilter filter,
org.jboss.aerogear.android.core.Callback<List<T>> callback)
Pipepublic void read(org.jboss.aerogear.android.core.Callback<List<T>> callback)
public void save(T data, org.jboss.aerogear.android.core.Callback<T> callback)
Pipepublic void remove(String id, org.jboss.aerogear.android.core.Callback<Void> callback)
public PipeHandler<T> getHandler()
PipegetHandler in interface Pipe<T>public RequestBuilder<T> getRequestBuilder()
PipeRequestBuilder is responsible for turning objects in bodies of requests.getRequestBuilder in interface Pipe<T>public ResponseParser<T> getResponseParser()
PipeResponseParser is responsible for turning responses from a SAVE into an objectgetResponseParser in interface Pipe<T>Copyright © 2016 JBoss by Red Hat. All rights reserved.