Environment | Line # 39 | 4 | 1 | 58.3% |
0.5833333
|
No Tests | |||
1 | /* | |
2 | * Copyright (c) 2000-2005, University of Salford | |
3 | * All rights reserved. | |
4 | * | |
5 | * Redistribution and use in source and binary forms, with or without | |
6 | * modification, are permitted provided that the following conditions are met: | |
7 | * | |
8 | * Redistributions of source code must retain the above copyright notice, this | |
9 | * list of conditions and the following disclaimer. | |
10 | * | |
11 | * Redistributions in binary form must reproduce the above copyright notice, | |
12 | * this list of conditions and the following disclaimer in the documentation | |
13 | * and/or other materials provided with the distribution. | |
14 | * | |
15 | * Neither the name of the University of Salford nor the names of its | |
16 | * contributors may be used to endorse or promote products derived from this | |
17 | * software without specific prior written permission. | |
18 | * | |
19 | * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" | |
20 | * AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE | |
21 | * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE | |
22 | * ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE | |
23 | * LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR | |
24 | * CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF | |
25 | * SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS | |
26 | * INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN | |
27 | * CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) | |
28 | * ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE | |
29 | * POSSIBILITY OF SUCH DAMAGE. | |
30 | */ | |
31 | ||
32 | package issrg.pba.rbac.xmlpolicy.ifstatement; | |
33 | ||
34 | /** | |
35 | * This class holds the execution environment parameters. They are the | |
36 | * arguments to | |
37 | * the action and other environmental variables, as defined by the AEF. | |
38 | */ | |
39 | public class Environment { | |
40 | protected java.util.Map args; | |
41 | protected java.util.Map env; | |
42 | ||
43 | 0 | protected Environment() { |
44 | } | |
45 | ||
46 | /** | |
47 | * This constructor builds an Environment from the given map of arguments | |
48 | * and a map of environmental variables. Both maps have the variable names | |
49 | * as keys and their string values as values. The values are then decoded | |
50 | * using Types.construct() method. | |
51 | * | |
52 | * @param arguments - the arguments of the action; if null, no arguments of | |
53 | * the action are present | |
54 | * @param environment - the environment; if null, the environment is assumed | |
55 | * to be empty | |
56 | * | |
57 | * @see Types#construct | |
58 | */ | |
59 | 72 | public Environment(java.util.Map arguments, java.util.Map environment){ |
60 | 72 | args=arguments==null?new java.util.Hashtable():arguments; |
61 | 72 | env=environment==null?new java.util.Hashtable():environment; |
62 | } | |
63 | ||
64 | /** | |
65 | * This method returns a map of action arguments, indexed by their name, as | |
66 | * defined by the ActionPolicy. | |
67 | * | |
68 | * @return java.util.Map of the action arguments; never null, but may contain | |
69 | * no entries | |
70 | */ | |
71 | 0 | public java.util.Map getArgs(){ |
72 | 0 | return args; |
73 | } | |
74 | ||
75 | /** | |
76 | * This method returns a map of environmental parameters, indexed by their | |
77 | * name, as defined by the AEF. | |
78 | * | |
79 | * @return java.util.Map of the environmental parameters; never null, but | |
80 | * may contain no entries | |
81 | */ | |
82 | 122 | public java.util.Map getEnv(){ |
83 | 122 | return env; |
84 | } | |
85 | } | |
86 |
|