Storage handles all read and write persistence for a trsst server. Implementors will only need to implement this class in order to support different types of persistence (flat file, relational db, object db, etc.) This interface is intended to require no additional dependencies on the trsst or abder
| 30 | * @author mpowers |
| 31 | */ |
| 32 | public interface Storage { |
| 33 | |
| 34 | /** |
| 35 | * Returns feed ids with content hosted on this server. Feeds must be |
| 36 | * ordered by most recent update. |
| 37 | * |
| 38 | * @param start |
| 39 | * the start index from which to return results; if exceeds |
| 40 | * bounds of available results, zero results are returned. |
| 41 | * @param length |
| 42 | * the maximum number of results to return; servers may return |
| 43 | * fewer results. |
| 44 | * @return the specified feed ids hosted on this server; may be empty but |
| 45 | * not null. |
| 46 | */ |
| 47 | String[] getFeedIds(int start, int length); |
| 48 | |
| 49 | /** |
| 50 | * Returns categories mentioned in content hosted on this server. Categories |
| 51 | * should be ordered by most popular or recently used, or a combination of |
| 52 | * both ("trending"). |
| 53 | * |
| 54 | * @param start |
| 55 | * the start index from which to return results; if exceeds |
| 56 | * bounds of available results, zero results are returned. |
| 57 | * @param length |
| 58 | * the maximum number of results to return; servers may return |
| 59 | * fewer results. |
| 60 | * @return the specified trending categories; may be empty but not null. |
| 61 | */ |
| 62 | String[] getCategories(int start, int length); |
| 63 | |
| 64 | /** |
| 65 | * Returns the total number of entries for the specified optional filters, |
| 66 | * or -1 if count is unavailable or unsupported. |
| 67 | * |
| 68 | * @param after |
| 69 | * (optional) restricts results to those entries posted after the |
| 70 | * specified date, or null if no restriction. |
| 71 | * @param before |
| 72 | * (optional) restricts results to those entries posted before |
| 73 | * the specified date, or null if no restriction. |
| 74 | * @param query |
| 75 | * (optional) a space-delimited string of query terms, or null if |
| 76 | * for no query; query language is implementation-dependent, but |
| 77 | * at minimum a single-term search returns only results that |
| 78 | * contain the specified term. |
| 79 | * @param mentions |
| 80 | * (optional) restricts results to those entries that contain all |
| 81 | * of the specified mentions |
| 82 | * @param tags |
| 83 | * (optional) restricts results to those entries that contain all |
| 84 | * of the specified tags |
| 85 | * @param verb |
| 86 | * (optional) restricts results to those entries that contain the |
| 87 | * specified verb |
| 88 | * @return the total number of entries for the specified feed, or -1 if not |
| 89 | * supported or unavailable. |
no outgoing calls
no test coverage detected