01: /*
02: * $Id: DynamicSecurityPolicy.java,v 1.3 2006/09/29 12:04:58 kumarjayanti Exp $
03: */
04:
05: /*
06: * The contents of this file are subject to the terms
07: * of the Common Development and Distribution License
08: * (the License). You may not use this file except in
09: * compliance with the License.
10: *
11: * You can obtain a copy of the license at
12: * https://glassfish.dev.java.net/public/CDDLv1.0.html.
13: * See the License for the specific language governing
14: * permissions and limitations under the License.
15: *
16: * When distributing Covered Code, include this CDDL
17: * Header Notice in each file and include the License file
18: * at https://glassfish.dev.java.net/public/CDDLv1.0.html.
19: * If applicable, add the following below the CDDL Header,
20: * with the fields enclosed by brackets [] replaced by
21: * you own identifying information:
22: * "Portions Copyrighted [year] [name of copyright owner]"
23: *
24: * Copyright 2006 Sun Microsystems Inc. All Rights Reserved
25: */
26:
27: package com.sun.xml.wss.impl.policy;
28:
29: import com.sun.xml.wss.impl.PolicyTypeUtil;
30:
31: /**
32: * Represents a dynamically generable SecurityPolicy
33: */
34: public abstract class DynamicSecurityPolicy implements SecurityPolicy {
35:
36: /*
37: * Associate static application context
38: */
39: StaticPolicyContext ctx;
40:
41: /**
42: * Default constructor
43: */
44: public DynamicSecurityPolicy() {
45: }
46:
47: /**
48: * Instantiate and associate DynamicSecurityPolicy with StaticPolicyContext
49: *
50: * @param ctx static security context used for implying dynamic policy generation
51: */
52: public DynamicSecurityPolicy(StaticPolicyContext ctx) {
53: this .ctx = ctx;
54: }
55:
56: /**
57: * @return the StaticPolicyContext associated with this DynamicSecurityPolicy, null otherwise
58: */
59: public StaticPolicyContext getStaticPolicyContext() {
60: return ctx;
61: }
62:
63: /**
64: * set the StaticPolicyContext for this DynamicSecurityPolicy
65: * @param ctx the StaticPolicyContext for this DynamicSecurityPolicy.
66: */
67: public void setStaticPolicyContext(StaticPolicyContext ctx) {
68: this .ctx = ctx;
69: }
70:
71: /**
72: * Associate a SecurityPolicy generator
73: * @return SecurityPolicyGenerator that can be used to generate concrete SecurityPolicies
74: * @see com.sun.xml.wss.impl.callback.DynamicPolicyCallback
75: */
76: public abstract SecurityPolicyGenerator policyGenerator();
77:
78: /**
79: * @return the type of the policy
80: */
81: public String getType() {
82: return PolicyTypeUtil.DYN_SEC_POLICY_TYPE;
83: }
84:
85: }
|