1/*2* Licensed to the Apache Software Foundation (ASF) under one or more3* contributor license agreements. See the NOTICE file distributed with4* this work for additional information regarding copyright ownership.5* The ASF licenses this file to You under the Apache License, Version 2.06* (the "License"); you may not use this file except in compliance with7* the License. You may obtain a copy of the License at8*9* http://www.apache.org/licenses/LICENSE-2.010*11* Unless required by applicable law or agreed to in writing, software12* distributed under the License is distributed on an "AS IS" BASIS,13* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.14* See the License for the specific language governing permissions and15* limitations under the License.16*/17packageorg.apache.jetspeed.security;
1819import java.io.Serializable;
20import java.security.Policy;
2122/***23 * <p>24 * Simple wrapper for security policy providing the ability to add attribute on Policy and how they25 * should be used by the application.26 * </p>27 * 28 * @author <a href="mailto:LeStrat_David@emc.com">David Le Strat</a>29 */30publicclassPolicyWrapper implements Serializable
31 {
32/*** The serial version uid. */33privatestaticfinallong serialVersionUID = 3386468724328997598L;
3435/*** The policy. */36privatetransient Policy policy;
3738/*** Whether to use as a policy. */39privateboolean useAsPolicy = false;
4041/*** Whether to use as a default policy. */42privateboolean defaultPolicy = false;
4344/***45 * @param policy46 * @param useAsPolicy47 * @param defaultPolicy48 */49publicPolicyWrapper(Policy policy, boolean useAsPolicy, boolean defaultPolicy)
50 {
51this.policy = policy;
52this.useAsPolicy = useAsPolicy;
53this.defaultPolicy = defaultPolicy;
54 }
5556/***57 * @return Returns the policy.58 */59public Policy getPolicy()
60 {
61returnthis.policy;
62 }
6364/***65 * @param policy The policy to set.66 */67publicvoid setPolicy(Policy policy)
68 {
69this.policy = policy;
70 }
7172/***73 * @return Returns the defaultPolicy.74 */75publicboolean isDefaultPolicy()
76 {
77return defaultPolicy;
78 }
7980/***81 * @param defaultPolicy The defaultPolicy to set.82 */83publicvoid setDefaultPolicy(boolean defaultPolicy)
84 {
85this.defaultPolicy = defaultPolicy;
86 }
8788/***89 * @return Returns the useAsPolicy.90 */91publicboolean isUseAsPolicy()
92 {
93return useAsPolicy;
94 }
9596/***97 * @param useAsPolicy The useAsPolicy to set.98 */99publicvoid setUseAsPolicy(boolean useAsPolicy)
100 {
101this.useAsPolicy = useAsPolicy;
102 }
103104 }