Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
EventStream | 35 | 0 | - | 0 | 0 |
1 | /* | |
2 | * See the NOTICE file distributed with this work for additional | |
3 | * information regarding copyright ownership. | |
4 | * | |
5 | * This is free software; you can redistribute it and/or modify it | |
6 | * under the terms of the GNU Lesser General Public License as | |
7 | * published by the Free Software Foundation; either version 2.1 of | |
8 | * the License, or (at your option) any later version. | |
9 | * | |
10 | * This software is distributed in the hope that it will be useful, | |
11 | * but WITHOUT ANY WARRANTY; without even the implied warranty of | |
12 | * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU | |
13 | * Lesser General Public License for more details. | |
14 | * | |
15 | * You should have received a copy of the GNU Lesser General Public | |
16 | * License along with this software; if not, write to the Free | |
17 | * Software Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA | |
18 | * 02110-1301 USA, or see the FSF site: http://www.fsf.org. | |
19 | */ | |
20 | package org.xwiki.eventstream; | |
21 | ||
22 | import java.util.List; | |
23 | ||
24 | import org.xwiki.component.annotation.Role; | |
25 | import org.xwiki.query.Query; | |
26 | import org.xwiki.query.QueryException; | |
27 | ||
28 | /** | |
29 | * The stream of events, allowing to store and retrieve events. | |
30 | * | |
31 | * @version $Id: f643258028180a2ee69d188fe1692c3f6ce17494 $ | |
32 | * @since 3.0M2 | |
33 | */ | |
34 | @Role | |
35 | public interface EventStream | |
36 | { | |
37 | /** | |
38 | * Add a new event to the storage. | |
39 | * | |
40 | * @param e the event to store | |
41 | */ | |
42 | void addEvent(Event e); | |
43 | ||
44 | /** | |
45 | * Search stored events. The query will be prefixed with a hardcoded {@code select event from Event as event} or | |
46 | * equivalent stub which selects actual events from the storage, so it must start with further {@code from} or | |
47 | * {@code where} statements. | |
48 | * | |
49 | * @param query a query stub | |
50 | * @return the list of events matched by the query | |
51 | * @throws QueryException if the query is malformed or cannot be executed | |
52 | */ | |
53 | List<Event> searchEvents(Query query) throws QueryException; | |
54 | ||
55 | /** | |
56 | * Retrieve the group that a given event is part of. | |
57 | * | |
58 | * @param e the event to search for | |
59 | * @return the event's group of related events | |
60 | */ | |
61 | EventGroup getRelatedEvents(Event e); | |
62 | ||
63 | /** | |
64 | * Delete an event from the storage. This method does not perform any rights check, it should be done before calling | |
65 | * this method. | |
66 | * | |
67 | * @param e the event to delete | |
68 | */ | |
69 | void deleteEvent(Event e); | |
70 | } |