DecisionWithObligationException | Line # 66 | 3 | 1 | 0% |
0.0
|
No Tests | |||
1 | ||
2 | /* | |
3 | * Copyright (c) 2006, University of Kent | |
4 | * All rights reserved. | |
5 | * | |
6 | * Redistribution and use in source and binary forms, with or without | |
7 | * modification, are permitted provided that the following conditions are met: | |
8 | * | |
9 | * Redistributions of source code must retain the above copyright notice, this | |
10 | * list of conditions and the following disclaimer. | |
11 | * | |
12 | * Redistributions in binary form must reproduce the above copyright notice, | |
13 | * this list of conditions and the following disclaimer in the documentation | |
14 | * and/or other materials provided with the distribution. | |
15 | * | |
16 | * 1. Neither the name of the University of Kent nor the names of its | |
17 | * contributors may be used to endorse or promote products derived from this | |
18 | * software without specific prior written permission. | |
19 | * | |
20 | * 2. THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS | |
21 | * IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, | |
22 | * THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR | |
23 | * PURPOSE ARE DISCLAIMED. | |
24 | * | |
25 | * 3. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | |
26 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
27 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
28 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
29 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
30 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
31 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
32 | * POSSIBILITY OF SUCH DAMAGE. | |
33 | * | |
34 | * 4. YOU AGREE THAT THE EXCLUSIONS IN PARAGRAPHS 2 AND 3 ABOVE ARE REASONABLE | |
35 | * IN THE CIRCUMSTANCES. IN PARTICULAR, YOU ACKNOWLEDGE (1) THAT THIS | |
36 | * SOFTWARE HAS BEEN MADE AVAILABLE TO YOU FREE OF CHARGE, (2) THAT THIS | |
37 | * SOFTWARE IS NOT "PRODUCT" QUALITY, BUT HAS BEEN PRODUCED BY A RESEARCH | |
38 | * GROUP WHO DESIRE TO MAKE THIS SOFTWARE FREELY AVAILABLE TO PEOPLE WHO WISH | |
39 | * TO USE IT, AND (3) THAT BECAUSE THIS SOFTWARE IS NOT OF "PRODUCT" QUALITY | |
40 | * IT IS INEVITABLE THAT THERE WILL BE BUGS AND ERRORS, AND POSSIBLY MORE | |
41 | * SERIOUS FAULTS, IN THIS SOFTWARE. | |
42 | * | |
43 | * 5. This license is governed, except to the extent that local laws | |
44 | * necessarily apply, by the laws of England and Wales. | |
45 | * | |
46 | * Author : Gansen Zhao | |
47 | * Email: gz7@kent.ac.uk | |
48 | */ | |
49 | ||
50 | package issrg.pba; | |
51 | ||
52 | /** | |
53 | * This class represents a special type of PbaException, DecisionWithObligationException, | |
54 | * which is thrown by the traditional decision method of PBAAPI, if the decision | |
55 | * cannot be enforced without enforcing the Obligations, i.e. this | |
56 | * Exception is thrown when enforcing a simple boolean decision is not | |
57 | * sufficient to meet the security requirements of the system. The AEF or PEP is | |
58 | * free to either log this exception as an error, or obtain the Response from | |
59 | * this object and enforce the decision in it as well as the Obligations. Note | |
60 | * that if you call | |
61 | * response method of the PBAAPI, you always get the Response, and never get | |
62 | * this exception. | |
63 | * | |
64 | * @author gansen, A.Otenko | |
65 | */ | |
66 | public class DecisionWithObligationException extends PbaException{ | |
67 | Response resp; | |
68 | ||
69 | /** | |
70 | * This method creates a DecisionWithObligationException with a message | |
71 | * and the Response that contains Obligations. | |
72 | * | |
73 | * @param msg - a human-readable diagnostic message, which makes sense only | |
74 | * if the code is not going to enforce the Obligations in the Response | |
75 | * @param r - the Response with Obligations that need to be enforced along | |
76 | * with the decision | |
77 | */ | |
78 | 0 | public DecisionWithObligationException(String msg, Response r) { |
79 | 0 | super(msg); |
80 | 0 | resp=r; |
81 | } | |
82 | ||
83 | /** | |
84 | * This method returns the Response that was computed at decision time, | |
85 | * but which cannot be enforced without enforcing the Obligations inside. | |
86 | */ | |
87 | 0 | public Response getResponse(){ |
88 | 0 | return resp; |
89 | } | |
90 | } |
|