public class LoaderAdapter<T> extends Object implements LoaderPipe<T>, android.app.LoaderManager.LoaderCallbacks<HeaderAndBody>
| Modifier and Type | Class and Description |
|---|---|
static class |
LoaderAdapter.CallbackHandler<T> |
| Constructor and Description |
|---|
LoaderAdapter(android.app.Activity activity,
Pipe<T> pipe,
String name) |
LoaderAdapter(android.app.Fragment fragment,
android.content.Context applicationContext,
Pipe<T> pipe,
String name) |
| 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()
|
android.content.Loader<HeaderAndBody> |
onCreateLoader(int id,
android.os.Bundle bundle) |
void |
onLoaderReset(android.content.Loader<HeaderAndBody> loader) |
void |
onLoadFinished(android.content.Loader<HeaderAndBody> loader,
HeaderAndBody data) |
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 idx,
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 toRemoveId,
org.jboss.aerogear.android.core.Callback<Void> callback)
Removes an object from the underlying server connection.
|
void |
reset()
Calls reset on all loaders associated with this pipe.
|
void |
save(T item,
org.jboss.aerogear.android.core.Callback<T> callback)
Saves or updates a given object on the server.
|
void |
setLoaderIds(Map<String,List<Integer>> idsForNamedPipes)
Passes in a multimap of ids for the named pipe.
|
public void read(String idx, org.jboss.aerogear.android.core.Callback<T> callback)
Pipepublic void read(org.jboss.aerogear.android.core.Callback<List<T>> callback)
Pipepublic void read(org.jboss.aerogear.android.core.ReadFilter filter,
org.jboss.aerogear.android.core.Callback<List<T>> callback)
Pipepublic void save(T item, org.jboss.aerogear.android.core.Callback<T> callback)
Pipepublic void remove(String toRemoveId, org.jboss.aerogear.android.core.Callback<Void> callback)
Pipepublic 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>public android.content.Loader<HeaderAndBody> onCreateLoader(int id, android.os.Bundle bundle)
onCreateLoader in interface android.app.LoaderManager.LoaderCallbacks<HeaderAndBody>public void onLoadFinished(android.content.Loader<HeaderAndBody> loader, HeaderAndBody data)
onLoadFinished in interface android.app.LoaderManager.LoaderCallbacks<HeaderAndBody>public void onLoaderReset(android.content.Loader<HeaderAndBody> loader)
onLoaderReset in interface android.app.LoaderManager.LoaderCallbacks<HeaderAndBody>public void reset()
LoaderPipereset in interface LoaderPipe<T>public void setLoaderIds(Map<String,List<Integer>> idsForNamedPipes)
LoaderPipesetLoaderIds in interface LoaderPipe<T>idsForNamedPipes - A map of all LoaderIds for pipes hased by their nameCopyright © 2015 JBoss by Red Hat. All rights reserved.