|
AeroGear Android Libary 1.0.0.M1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.jboss.aerogear.android.impl.pipeline.RestAdapter<T>
public final class RestAdapter<T>
Rest implementation of Pipe.
| Constructor Summary | |
|---|---|
RestAdapter(Class<T> klass,
URL baseURL)
|
|
RestAdapter(Class<T> klass,
URL baseURL,
com.google.gson.GsonBuilder gsonBuilder)
|
|
| Method Summary | |
|---|---|
PipeType |
getType()
Returns the connection type of this Pipe object (e.g. |
URL |
getUrl()
Returns the URL to which this Pipe object points. |
void |
read(Callback<List<T>> callback)
Reads all the data from the underlying server connection. |
void |
readWithFilter(ReadFilter filter,
Callback<List<T>> callback)
Reads all the data from the underlying server connection. |
void |
remove(String id,
Callback<Void> callback)
Removes an object from the underlying server connection. |
void |
save(T data,
Callback<T> callback)
Saves or updates a given object on the server. |
void |
setAuthenticationModule(AuthenticationModule module)
Sets the authentication module for the Pipe. |
void |
setEncoding(Charset encoding)
Sets the encoding of the Pipe. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public RestAdapter(Class<T> klass,
URL baseURL)
public RestAdapter(Class<T> klass,
URL baseURL,
com.google.gson.GsonBuilder gsonBuilder)
| Method Detail |
|---|
public PipeType getType()
Pipe object (e.g. REST).
getType in interface Pipe<T>public URL getUrl()
URL to which this Pipe object points.
getUrl in interface Pipe<T>
public void readWithFilter(ReadFilter filter,
Callback<List<T>> callback)
Pipe
readWithFilter in interface Pipe<T>filter - a ReadFilter for performing pagination and querying.callback - The callback for consuming the result from the Pipe invocation.public void read(Callback<List<T>> callback)
read in interface Pipe<T>callback - The callback for consuming the result from the Pipe invocation.
public void save(T data,
Callback<T> callback)
Pipe
save in interface Pipe<T>data - the item to save or updatecallback - The callback for consuming the result from the Pipe invocation.
public void remove(String id,
Callback<Void> callback)
remove in interface Pipe<T>id - representing the ‘id’ of the object to be removedcallback - The callback for consuming the result from the Pipe invocation.public void setAuthenticationModule(AuthenticationModule module)
Pipe
setAuthenticationModule in interface Pipe<T>public void setEncoding(Charset encoding)
encoding -
IllegalArgumentException - if encoding is null
|
AeroGear Android Libary 1.0.0.M1 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||