Class | Line # | Actions | |||||
---|---|---|---|---|---|---|---|
ResourceReferenceHandlerManager | 33 | 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 org.xwiki.component.annotation.Role; | |
23 | ||
24 | /** | |
25 | * The Resource Handler Manager's goal is to locate the right {@link ResourceReferenceHandler} | |
26 | * implementations to call in the right order. | |
27 | * | |
28 | * @param <T> the qualifying element to distinguish a Resource Reference (e.g. Resource Type, Entity Resource Action) | |
29 | * @version $Id: aa32ee84fc619ec396b68aea02ed90e5400269e4 $ | |
30 | * @since 6.1M2 | |
31 | */ | |
32 | @Role | |
33 | public interface ResourceReferenceHandlerManager<T> | |
34 | { | |
35 | /** | |
36 | * Handles a passed {@link org.xwiki.resource.ResourceReference}. | |
37 | * | |
38 | * @param reference the Resource Reference to handle | |
39 | * @throws ResourceReferenceHandlerException if an error happens during the Handler execution, for example if no | |
40 | * Handler was found to handle the passed Resource Reference | |
41 | */ | |
42 | void handle(ResourceReference reference) throws ResourceReferenceHandlerException; | |
43 | ||
44 | /** | |
45 | * Check if there's a Handler for the passed Resource Reference or not. | |
46 | * | |
47 | * @param resourceReferenceQualifier the qualifying element to distinguish a Resource Reference for which we wish | |
48 | * to check if we can handle it or not (ie we have a Handler available for it). This can be for example the | |
49 | * Resource Type or for an Entity Resource it can be an Entity Resource Action | |
50 | * @return true if we have a Handler for the passed Resource Reference qualifier or false otherwise | |
51 | * @since 7.1M1 | |
52 | */ | |
53 | boolean canHandle(T resourceReferenceQualifier); | |
54 | } |