Back to project page cube-sdk.
The source code is released under:
Apache License
If you think the Android project cube-sdk listed in this page is inappropriate, such as containing malicious code/tools or violating the copyright, please email info at java2s dot com, thanks.
package in.srain.cube.cache; // w w w. ja v a 2s . c o m import in.srain.cube.request.JsonData; public interface QueryHandler<T> { public static abstract class DefaultHandler implements QueryHandler<JsonData> { @Override public JsonData processRawDataFromCache(JsonData rawData) { return rawData; } @Override public boolean useCacheAnyway() { return false; } } public long getCacheTime(); public String getCacheKey(); public String getAssertInitDataPath(); /** * We need to process the data from data source, do some filter of convert the structure. * <p/> * As the "Assert Data" is a special data source, we also need to do the same work. */ public T processRawDataFromCache(JsonData rawData); /** * when query finish * * @param cacheData * @param outOfDate */ public void onQueryFinish(Query.RequestType requestType, T cacheData, boolean outOfDate); /** * just using cache data if existent, no matter it is expired or not * * @return */ public boolean useCacheAnyway(); /** * create data when cache data is no existent */ public String createDataForCache(Query<T> query); public boolean disableCache(); }