1. Project Clover database Sat Feb 2 2019 06:45:20 CET
  2. Package org.xwiki.eventstream

File RecordableEventDescriptor.java

 

Coverage histogram

../../../img/srcFileCovDistChart3.png
82% of files have more coverage

Code metrics

0
4
4
2
106
29
4
1
1
2
1

Classes

Class Line # Actions
RecordableEventDescriptor 32 4 0% 4 6
0.2525%
RecordableEventDescriptor.EventFilter 38 0 - 0 0
-1.0 -
 

Contributing tests

No tests hitting this source file were found.

Source view

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 org.xwiki.component.annotation.Role;
23   
24    /**
25    * Provide a description for a specific implementation of RecordableEvent so that users can knows what the event is
26    * about.
27    *
28    * @version $Id: cdd6332af9b345d97718f3fdb01cf24ad96863f8 $
29    * @since 9.2RC1
30    */
31    @Role
 
32    public interface RecordableEventDescriptor
33    {
34    /**
35    * The different filters we support to retrieve event.
36    * @since 9.4RC1
37    */
 
38    enum EventFilter {
39    /** There is no filter (except the event type) on this kind of events. */
40    NO_FILTER,
41    /** There is a custom filter on this kind of events. */
42    CUSTOM_FILTER,
43    /** There is a filter to enable the event on some wikis. */
44    WIKI_FILTER,
45    /** There is a filter to enable the event on some wikis and some spaces. */
46    WIKI_AND_SPACE_FILTER,
47    /** There is a filter to enable the event on some wikis, some spaces and/or some pages. */
48    WIKI_SPACE_AND_DOCUMENT_FILTER
49    }
50   
51    /**
52    * @return the name of the event described by the descriptor, as it is stored in the event stream.
53    */
54    String getEventType();
55   
56    /**
57    * @return the id of the application that provide this event
58    * @since 9.6RC1
59    */
 
60  0 toggle default String getApplicationId() {
61    // Should be reimplemented
62  0 return getApplicationName();
63    }
64   
65    /**
66    * @return the name of the application that provide this event
67    */
68    String getApplicationName();
69   
70    /**
71    * @return the description of the event type
72    */
73    String getDescription();
74   
75    /**
76    * @return the icon corresponding to the application
77    */
78    String getApplicationIcon();
79   
80    /**
81    * @return the kind of filter to use for this event type
82    * @since 9.4RC1
83    */
 
84  0 toggle default EventFilter getFilter() {
85  0 return EventFilter.NO_FILTER;
86    }
87   
88    /**
89    * @return the id of the application that provide this event
90    * @since 9.10RC1
91    */
 
92  0 toggle default String getEventTypeIcon() {
93    // Should be reimplemented
94  0 return getApplicationIcon();
95    }
96   
97    /**
98    * @param wikiId id of the wiki
99    * @return either or not the descriptor is enabled in the given wiki
100    * @since 10.5RC1
101    * @since 9.11.6
102    */
 
103  57596 toggle default boolean isEnabled(String wikiId) {
104  57596 return true;
105    }
106    }