01: /*
02: * $Id: DynamicPolicyContext.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 java.util.HashMap;
30: import java.util.Iterator;
31:
32: /**
33: * Represents a SecurityPolicy identifier context resolved at runtime
34: */
35: public abstract class DynamicPolicyContext {
36:
37: /* Represents extraneous properties */
38: protected HashMap properties = new HashMap();
39:
40: /**
41: * get the named property
42: * @param name property name
43: * @return Object property value
44: */
45: protected Object getProperty(String name) {
46: return properties.get(name);
47: }
48:
49: /**
50: * set the named property to value <code>value</code>.
51: * @param name property name
52: * @param value property value
53: */
54: protected void setProperty(String name, Object value) {
55: properties.put(name, value);
56: }
57:
58: /**
59: * remove the named property
60: * @param name property to be removed
61: */
62: protected void removeProperty(String name) {
63: properties.remove(name);
64: }
65:
66: /**
67: * @param name property to be checked for presence
68: * @return true if the property <code>name</code> is present.
69: */
70: protected boolean containsProperty(String name) {
71: return properties.containsKey(name);
72: }
73:
74: /**
75: * @return Iterator over the property names
76: */
77: protected Iterator getPropertyNames() {
78: return properties.keySet().iterator();
79: }
80:
81: /**
82: * @return Any <code>StaticPolicyContext</code> associated with this context.
83: */
84: public abstract StaticPolicyContext getStaticPolicyContext();
85: }
|