1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17 package org.apache.jetspeed.security;
18
19 import java.io.Serializable;
20 import java.security.Policy;
21
22 /***
23 * <p>
24 * Simple wrapper for security policy providing the ability to add attribute on Policy and how they
25 * should be used by the application.
26 * </p>
27 *
28 * @author <a href="mailto:LeStrat_David@emc.com">David Le Strat</a>
29 */
30 public class PolicyWrapper implements Serializable
31 {
32 /*** The serial version uid. */
33 private static final long serialVersionUID = 3386468724328997598L;
34
35 /*** The policy. */
36 private transient Policy policy;
37
38 /*** Whether to use as a policy. */
39 private boolean useAsPolicy = false;
40
41 /*** Whether to use as a default policy. */
42 private boolean defaultPolicy = false;
43
44 /***
45 * @param policy
46 * @param useAsPolicy
47 * @param defaultPolicy
48 */
49 public PolicyWrapper(Policy policy, boolean useAsPolicy, boolean defaultPolicy)
50 {
51 this.policy = policy;
52 this.useAsPolicy = useAsPolicy;
53 this.defaultPolicy = defaultPolicy;
54 }
55
56 /***
57 * @return Returns the policy.
58 */
59 public Policy getPolicy()
60 {
61 return this.policy;
62 }
63
64 /***
65 * @param policy The policy to set.
66 */
67 public void setPolicy(Policy policy)
68 {
69 this.policy = policy;
70 }
71
72 /***
73 * @return Returns the defaultPolicy.
74 */
75 public boolean isDefaultPolicy()
76 {
77 return defaultPolicy;
78 }
79
80 /***
81 * @param defaultPolicy The defaultPolicy to set.
82 */
83 public void setDefaultPolicy(boolean defaultPolicy)
84 {
85 this.defaultPolicy = defaultPolicy;
86 }
87
88 /***
89 * @return Returns the useAsPolicy.
90 */
91 public boolean isUseAsPolicy()
92 {
93 return useAsPolicy;
94 }
95
96 /***
97 * @param useAsPolicy The useAsPolicy to set.
98 */
99 public void setUseAsPolicy(boolean useAsPolicy)
100 {
101 this.useAsPolicy = useAsPolicy;
102 }
103
104 }