1 package com.atlassian.streams.refapp.api;
2
3 import com.atlassian.streams.api.ActivityRequest;
4 import com.atlassian.streams.api.StreamsEntry;
5
6 import java.net.URI;
7
8 /**
9 * Provide backdoor to test create/delete streams activity entries.
10 */
11 public interface StreamsActivityManager {
12 /**
13 * Get the activities, with filter applied.
14 *
15 * @param activityRequest the activities request.
16 * @return a non-null collection of entries.
17 */
18 public Iterable<StreamsEntry> getEntries(final ActivityRequest activityRequest);
19
20 /**
21 * Add an activities entry to the in-memory buffer. If the maximum size of the buffer reach, the oldest entry is
22 * removed.
23 *
24 * @param entryRequest the entry information to add.
25 */
26 public void addEntry(StreamsEntryRequest entryRequest);
27
28 /**
29 * Remove an activity entry.
30 *
31 * @param id the entry to remove.
32 * @return true if the id is found and removed, otherwise false.
33 */
34 public boolean removeEntry(final int id);
35
36 /**
37 * Get entry by id.
38 *
39 * @param id id of the entry.
40 * @return entry, null if not found.
41 */
42 public StreamsEntry getEntry(final int id);
43
44 /**
45 * Build the URI to access entry detail from integer id.
46 *
47 * @param id id.
48 * @return URI.
49 */
50 public URI buildUriId(final int id);
51 }