Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
Action |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright (c) 2009, Swiss Federal Department of Defence Civil Protection and Sport | |
3 | * (http://www.vbs.admin.ch) | |
4 | * Copyright (c) 2009, Ergon Informatik AG (http://www.ergon.ch) | |
5 | * All rights reserved. | |
6 | * | |
7 | * Licensed under the Open Permis License which accompanies this distribution, | |
8 | * and is available at http://www.openpermis.org/BSDlicenceKent.txt | |
9 | */ | |
10 | package org.openpermis.policy; | |
11 | ||
12 | import java.util.List; | |
13 | import java.util.Map; | |
14 | ||
15 | ||
16 | /** | |
17 | * An action is what a subject wants to execute on a resource. | |
18 | * <p>The action features a unique name and a list of parameter types.</p> | |
19 | * @since 0.1.0 | |
20 | */ | |
21 | public interface Action | |
22 | extends Part, Nameable | |
23 | { | |
24 | ||
25 | //---- Methods | |
26 | ||
27 | /** | |
28 | * Returns whether this action matches an action name and a list of arguments. | |
29 | * <p>This action will match if its name matches the specified action name and | |
30 | * if all arguments are assignable to the action's argument types. | |
31 | * @param actionName the name to match. | |
32 | * @param arguments an optional list of arguments to match. | |
33 | * @return {@code true} if this action matches the specified name and arguments. | |
34 | * @since 0.1.0 | |
35 | */ | |
36 | boolean matches (String actionName, List<?> arguments); | |
37 | ||
38 | /** | |
39 | * Returns a mapping of argument name to argument. | |
40 | * @param arguments a list of arguments. | |
41 | * @return a mapping of argument name to argument. | |
42 | * @since 0.1.0 | |
43 | */ | |
44 | Map<String, ?> mapArguments (List<?> arguments); | |
45 | ||
46 | } |