Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
ResourceReferenceHandler | 36 | 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.resource; | |
21 | ||
22 | import java.util.List; | |
23 | ||
24 | import org.xwiki.component.annotation.Role; | |
25 | ||
26 | /** | |
27 | * Handles a given {@link ResourceReference}. | |
28 | * | |
29 | * @param <T> the qualifying element to specify what Resource Reference are handled by thus Handler | |
30 | * (e.g. Resource Type, Entity Resource Action) | |
31 | * @param <T> the type of supported items | |
32 | * @version $Id: da69e37d99fafbd5736c7fa52629209c50556a71 $ | |
33 | * @since 6.1M2 | |
34 | */ | |
35 | @Role | |
36 | public interface ResourceReferenceHandler<T> extends Comparable<ResourceReferenceHandler> | |
37 | { | |
38 | /** | |
39 | * The priority of execution relative to the other Handlers. The lowest values have the highest priorities and | |
40 | * execute first. For example a Handler with a priority of 100 will execute before one with a priority of 500. | |
41 | * | |
42 | * @return the execution priority | |
43 | */ | |
44 | int getPriority(); | |
45 | ||
46 | /** | |
47 | * @return the list of qualifying Resource References elements supported by this Handler (e.g Resource Type, | |
48 | * Entity Resource Action) | |
49 | */ | |
50 | List<T> getSupportedResourceReferences(); | |
51 | ||
52 | /** | |
53 | * Executes the Handler on the passed Resource Reference. | |
54 | * | |
55 | * @param reference the Resource Reference to handle | |
56 | * @param chain the Handler execution chain, needed to tell the next Handler in the chain to execute (similar to the | |
57 | * Filter Chain in the Servlet API) | |
58 | * @throws ResourceReferenceHandlerException if an error happens during the Handler execution | |
59 | */ | |
60 | void handle(ResourceReference reference, ResourceReferenceHandlerChain chain) | |
61 | throws ResourceReferenceHandlerException; | |
62 | } |