abstact class AbstractPageRequestHandler() {
public List<Pair<String, String>> getPagingHeaders(ReadFilter filter){
List<Pair<String, String>> toReturn = new ArrayList<>();
return toReturn;
}
public byte[] appendToBody(ReadFilter filter, byte[] body){
return body;
public class MyApplication extends Application { | |
public Registrar registrar; | |
protected void onCreate(Bundle savedInstanceState) { | |
super.onCreate(savedInstanceState); | |
Registrar r = new Registrar(PUSH_REGISTRATION_URL); | |
PushConfig config = new PushConfig(GCM_APP_ID); | |
config.setMobileVariantId(AG_PUSH_VARIANT_ID); | |
r.register(getApplicationContext(), config, new Callback<Void>() { |
#!/bin/bash | |
# | |
# Derived from - | |
# Joshua Davis | |
# http://shrubbery.mynetgear.net/c/display/W/Java+Daemon+Startup+Script | |
# | |
# This is a modification of the original script (which lets you run a java program as a deamon. | |
# look bellow for more information) that lets you run a groovy script as a deamon. | |
# | |
# ============== OLD SCRIPT TEXT ============== |
This document describes the client side interfaces which a developer can use to Query and Page through data obtained from remote rest services. This document describes both how to interact with the Aerogear-Controller based paging as well how to extend the libraries and APIs to support most other restful services. It is currently Java centric, but this should be fixed up in the future.
At a high level, Paging and Querying is supported though the Pipe.readWithFilter(ReadFilter, Callback) method. A ReadFilter object will set the current page, number of results perPage, and a where property. The Pipe implementation will be responsible for processing a request along with any paging data and sending the appropriate headers, data, and query parameters to the server. Once the response has been received, the Pipe implementation will provide a List of objects to the supplied callback. If this call used paging, the List will be an instance of PagedList.
PagedList will be a List of results f
public interface Pipe<T> { | |
//snip | |
/** | |
* These methods MUST add a result to a Map so that a paging context can be looked up | |
*/ | |
public List<T> read(); | |
public List<T> readWithFilter(ReadFilter filter); | |
package net.saga.android.orienttests; | |
import net.saga.android.orienttests.vo.Person; | |
import com.orientechnologies.orient.core.sql.query.OSQLSynchQuery; | |
import com.orientechnologies.orient.object.db.OObjectDatabaseTx; | |
import java.util.List; | |
import java.util.logging.Logger; | |
import org.junit.After; | |
import org.junit.AfterClass; | |
import org.junit.Assert; |
In Main.java
Pipeline pipeline = new Pipeline(baseEarl);
PipeConfig<Data> config = new PipeConfig<>(Data.class); //config.baseUrl is null
Pipe<Data> pipe = pipeline(config);
In Pipeline.java
Currently, when creating a new PipeConfig we use a constructor and specify a rootUrl:
URL rootUrl = new URL("http://todo-aerogear.rhcloud.com/todo-server");
Pipeline pipeline = new Pipeline(rootUrl);
PipeConfig config = new PipeConfig(rootUrl, Project.class);
Pipe<Project> projects = pipeline.pipe(Project.class, config);