AeroGear Android Library 1.1.0

org.jboss.aerogear.android.pipeline
Interface Pipe<T>

Type Parameters:
T - The data type of the Pipe operation
All Known Subinterfaces:
LoaderPipe<T>
All Known Implementing Classes:
LoaderAdapter, RestAdapter, SupportLoaderAdapter

public interface Pipe<T>

A Pipe represents a server connection. An object of this class is responsible to communicate with the server in order to perform read/write operations.


Method Summary
 com.google.gson.Gson getGson()
          Deprecated. 
 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
 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)
          Sends a signal to the Pipe to read its data and return it via the callback.
 void read(ReadFilter filter, Callback<List<T>> callback)
          Reads all the data from the underlying server connection.
 void readWithFilter(ReadFilter filter, Callback<List<T>> callback)
          Deprecated. in 1.1. Please use read(org.jboss.aerogear.android.ReadFilter, org.jboss.aerogear.android.Callback) instead
 void remove(String id, Callback<Void> callback)
          Removes an object from the underlying server connection.
 void save(T item, Callback<T> callback)
          Saves or updates a given object on the server.
 

Method Detail

getType

PipeType getType()
Returns the connection type of this Pipe object (e.g. REST).

Returns:
the connection type

getUrl

URL getUrl()
Returns the URL to which this Pipe object points.

Returns:
the endpoint URL

read

void read(Callback<List<T>> callback)
Sends a signal to the Pipe to read its data and return it via the callback.

Parameters:
callback - The callback for consuming the result from the Pipe invocation.

read

void read(ReadFilter filter,
          Callback<List<T>> callback)
Reads all the data from the underlying server connection.

Parameters:
callback - The callback for consuming the result from the Pipe invocation.
filter - a ReadFilter for performing pagination and querying.

readWithFilter

@Deprecated
void readWithFilter(ReadFilter filter,
                               Callback<List<T>> callback)
Deprecated. in 1.1. Please use read(org.jboss.aerogear.android.ReadFilter, org.jboss.aerogear.android.Callback) instead

Reads all the data from the underlying server connection.

Parameters:
callback - The callback for consuming the result from the Pipe invocation.
filter - a ReadFilter for performing pagination and querying.

save

void save(T item,
          Callback<T> callback)
Saves or updates a given object on the server.

Parameters:
item - the item to save or update
callback - The callback for consuming the result from the Pipe invocation.

remove

void remove(String id,
            Callback<Void> callback)
Removes an object from the underlying server connection. The given key argument is used as the objects ID.

Parameters:
id - representing the ‘id’ of the object to be removed
callback - The callback for consuming the result from the Pipe invocation.

getGson

@Deprecated
com.google.gson.Gson getGson()
Deprecated. 

Returns the GSON serializer used to serialized instances of objects.

Returns:
the gson instance servicing this pipe.

getKlass

Class<T> getKlass()
Returns:
the class which travels on this pipe

getHandler

PipeHandler<T> getHandler()
Returns the instance which is responsible for handling read, save, and remove.

Returns:
the handler performing operations for this Pipe. May be the Pipe itself.

getRequestBuilder

RequestBuilder<T> getRequestBuilder()
The RequestBuilder is responsible for turning objects in bodies of requests.

Returns:
the current RequestBuilder instance

getResponseParser

ResponseParser<T> getResponseParser()
The ResponseParser is responsible for turning responses from a SAVE into an object

Returns:
the current ResponseParser instance

AeroGear Android Library 1.1.0

Copyright © 2013 JBoss by Red Hat. All Rights Reserved.