Classes in this File | Line Coverage | Branch Coverage | Complexity | ||||
AccessDecisionVetoException |
|
| 1.0;1 |
1 | /* | |
2 | * Copyright (c) 2009, Ergon Informatik AG (http://www.ergon.ch) | |
3 | * All rights reserved. | |
4 | * | |
5 | * Licensed under the Open Permis License which accompanies this distribution, | |
6 | * and is available at http://www.openpermis.org/BSDlicenceKent.txt | |
7 | */ | |
8 | package org.openpermis.audit; | |
9 | ||
10 | import org.openpermis.policy.AccessDecision; | |
11 | ||
12 | ||
13 | /** | |
14 | * An exception thrown if an access decision is not acceptable. | |
15 | * <p>May be thrown by a {@link VetoableAccessDecisionListener} once an unacceptable access | |
16 | * decision has been reached to prevent its propagation to the caller of a | |
17 | * {@link org.openpermis.PolicyDecisionPoint}.</p> | |
18 | * @since 0.3.0 | |
19 | */ | |
20 | public class AccessDecisionVetoException | |
21 | extends Exception | |
22 | { | |
23 | ||
24 | //---- Static | |
25 | ||
26 | /** | |
27 | * @since 0.3.0 | |
28 | */ | |
29 | private static final long serialVersionUID = -5211670548178988048L; | |
30 | ||
31 | //---- State | |
32 | ||
33 | /** | |
34 | * @since 0.3.0 | |
35 | */ | |
36 | private final AccessDecisionRequest request; | |
37 | ||
38 | /** | |
39 | * @since 0.3.0 | |
40 | */ | |
41 | private final AccessDecision decision; | |
42 | ||
43 | //---- Constructors | |
44 | ||
45 | /** | |
46 | * Creates a new access decision veto exception. | |
47 | * @param reason the reason why the access decision has been vetoed. | |
48 | * @param request the access decision request that is vetoed. | |
49 | * @param decision the decision which is vetoed. | |
50 | * @since 0.3.0 | |
51 | */ | |
52 | public AccessDecisionVetoException ( | |
53 | String reason, AccessDecisionRequest request, AccessDecision decision | |
54 | ) { | |
55 | 0 | super(reason); |
56 | 0 | this.request = request; |
57 | 0 | this.decision = decision; |
58 | 0 | } |
59 | ||
60 | //---- Methods | |
61 | ||
62 | /** | |
63 | * The access decision request that was vetoed. | |
64 | * @return the request that was vetoed. | |
65 | * @since 0.3.0 | |
66 | */ | |
67 | public final AccessDecisionRequest getRequest () { | |
68 | 0 | return this.request; |
69 | } | |
70 | ||
71 | /** | |
72 | * The access decision that was vetoed. | |
73 | * @return the decision that was vetoed. | |
74 | * @since 0.3.0 | |
75 | */ | |
76 | public final AccessDecision getDecision () { | |
77 | 0 | return this.decision; |
78 | } | |
79 | ||
80 | } |