1 karl 1.12 //%2006////////////////////////////////////////////////////////////////////////
|
2 mike 1.2 //
|
3 karl 1.7 // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
4 // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
5 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L.P.;
|
6 karl 1.5 // IBM Corp.; EMC Corporation, The Open Group.
|
7 karl 1.7 // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
8 // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
|
9 karl 1.8 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
10 // EMC Corporation; VERITAS Software Corporation; The Open Group.
|
11 karl 1.12 // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
12 // EMC Corporation; Symantec Corporation; The Open Group.
|
13 mike 1.2 //
14 // Permission is hereby granted, free of charge, to any person obtaining a copy
15 // of this software and associated documentation files (the "Software"), to
16 // deal in the Software without restriction, including without limitation the
17 // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
18 // sell copies of the Software, and to permit persons to whom the Software is
19 // furnished to do so, subject to the following conditions:
|
20 karl 1.12 //
|
21 mike 1.2 // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
22 // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
23 // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
24 // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
25 // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
26 // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
27 // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
28 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
29 //
30 //==============================================================================
31 //
32 // Author: Nag Boranna (nagaraja_boranna@hp.com)
33 //
|
34 a.arora 1.6 // Modified By: Amit K Arora, IBM (amita@in.ibm.com) for PEP101
|
35 aruran.ms 1.9 // Aruran, IBM (ashanmug@in.ibm.com) for Bug# 3614
|
36 david.dillard 1.10 // David Dillard, VERITAS Software Corp.
37 // (david.dillard@veritas.com)
|
38 vijay.eli 1.11 // Vijay Eli, IBM, (vijayeli@in.ibm.com) for Bug# 3613
|
39 mike 1.2 //
40 //%/////////////////////////////////////////////////////////////////////////////
41
42
43 #ifndef Pegasus_GeneralPropertyOwner_h
44 #define Pegasus_GeneralPropertyOwner_h
45
46 #include <Pegasus/Common/String.h>
|
47 kumpf 1.4 #include <Pegasus/Common/Constants.h>
|
48 a.arora 1.6 #include <Pegasus/Common/AutoPtr.h>
|
49 mike 1.2 #include <Pegasus/Config/ConfigPropertyOwner.h>
50
51
52 PEGASUS_NAMESPACE_BEGIN
53
54
55 ///////////////////////////////////////////////////////////////////////////////
56 // DefaultPropertyOwner Class
57 ///////////////////////////////////////////////////////////////////////////////
58
59
60 ///////////////////////////////////////////////////////////////////////////////
61 /**
62
63 When a new property is added that does not belong to any existing property
|
64 david.dillard 1.10 owners, then typically a new property owner is required to be created.
65 If there are no specific validations required for the new property, then
66 there is no need to create a new owner, instead that property can be added
|
67 mike 1.2 to the default property owner.
68
69 The default property owner will maintain the attributes for all the default
|
70 david.dillard 1.10 properties that are added and it provides standard acces methods.
71 By default it does not do any validations on any of the properties, but
|
72 mike 1.2 validations can be added on per property basis.
73 */
74 ///////////////////////////////////////////////////////////////////////////////
75
|
76 david.dillard 1.10 /**
|
77 mike 1.2 This is default property owner class that extends ConfigPropertyOwner
78 class and provide implementation.
79 */
80 class PEGASUS_CONFIG_LINKAGE DefaultPropertyOwner : public ConfigPropertyOwner
81 {
82 public:
83
84 /** Constructors */
85 DefaultPropertyOwner();
86
87 /**
88 Initialize the config properties.
89
90 This method is expected to be called only once at the start of the
91 CIMOM. It initializes the properties with the default values.
92 */
93 void initialize();
94
95
|
96 david.dillard 1.10 /**
|
97 mike 1.2 Get information about the specified property.
98
99 @param propertyName The name of the property.
100 @param propertyInfo List to store the property info.
101 @exception UnrecognizedConfigProperty if the property is not defined.
102 */
|
103 vijay.eli 1.11 void getPropertyInfo(const String& name, Array<String>& propertyInfo)
104 const;
|
105 mike 1.2
106
|
107 david.dillard 1.10 /**
|
108 mike 1.2 Get default value of the specified property.
109
110 @param name The name of the property.
111 @return string containing the default value of the property specified.
112 @exception UnrecognizedConfigProperty if the property is not defined.
113 */
|
114 vijay.eli 1.11 String getDefaultValue(const String& name) const;
|
115 mike 1.2
116
|
117 david.dillard 1.10 /**
|
118 mike 1.2 Get current value of the specified property.
119
120 @param name The name of the property.
121 @return string containing the currnet value of the property specified.
122 @exception UnrecognizedConfigProperty if the property is not defined.
123 */
|
124 vijay.eli 1.11 String getCurrentValue(const String& name) const;
|
125 mike 1.2
126
|
127 david.dillard 1.10 /**
|
128 mike 1.2 Get planned value of the specified property.
129
130 @param name The name of the property.
131 @return string containing the planned value of the property specified.
132 @exception UnrecognizedConfigProperty if the property is not defined.
133 */
|
134 vijay.eli 1.11 String getPlannedValue(const String& name) const;
|
135 mike 1.2
136
|
137 david.dillard 1.10 /**
|
138 mike 1.2 Init current value of the specified property to the specified value.
139 This method is expected to be called only once at the start of the
140 CIMOM. The property value will be initialized irrespective of whether
141 the property is dynamic or not.
142
143 @param name The name of the property.
|
144 david.dillard 1.10 @param value The current value of the property.
|
145 mike 1.2 @exception UnrecognizedConfigProperty if the property is not defined.
146 @exception InvalidPropertyValue if the property value is not valid.
147 */
148 void initCurrentValue(const String& name, const String& value);
149
150
|
151 david.dillard 1.10 /**
|
152 mike 1.2 Init planned value of the specified property to the specified value.
153 This method is expected to be called only once at the start of the
154 CIMOM. The property value will be initialized irrespective of whether
155 the property is dynamic or not.
156
157 @param name The name of the property.
|
158 david.dillard 1.10 @param value The planned value of the property.
|
159 mike 1.2 @exception UnrecognizedConfigProperty if the property is not defined.
160 @exception InvalidPropertyValue if the property value is not valid.
161 */
|
162 david.dillard 1.10 void initPlannedValue(const String& name, const String& value);
|
163 mike 1.2
164
|
165 david.dillard 1.10 /**
|
166 mike 1.2 Update current value of the specified property to the specified value.
167 The property value will be updated only if the property is dynamically
168 updatable.
169
170 @param name The name of the property.
|
171 david.dillard 1.10 @param value The current value of the property.
|
172 mike 1.2 @exception NonDynamicConfigProperty if the property is not dynamic.
173 @exception InvalidPropertyValue if the property value is not valid.
174 @exception UnrecognizedConfigProperty if the property is not defined.
175 */
176 void updateCurrentValue(const String& name, const String& value);
177 //throw (NonDynamicConfigProperty, InvalidPropertyValue,
178 // UnrecognizedConfigProperty);
179
180
|
181 david.dillard 1.10 /**
|
182 mike 1.2 Update planned value of the specified property to the specified value.
183
184 @param name The name of the property.
|
185 david.dillard 1.10 @param value The planned value of the property.
|
186 mike 1.2 @exception InvalidPropertyValue if the property value is not valid.
187 @exception UnrecognizedConfigProperty if the property is not defined.
188 */
189 void updatePlannedValue(const String& name, const String& value);
190
191
|
192 david.dillard 1.10 /**
|
193 mike 1.2 Checks to see if the given value is valid or not.
194
195 @param name The name of the property.
|
196 david.dillard 1.10 @param value The value of the property to be validated.
|
197 mike 1.2 @return Boolean True if the specified value for the property is valid.
198 @exception UnrecognizedConfigProperty if the property is not defined.
199 */
|
200 vijay.eli 1.11 Boolean isValid(const String& name, const String& value) const;
|
201 mike 1.2
202
|
203 david.dillard 1.10 /**
|
204 mike 1.2 Checks to see if the specified property is dynamic or not.
205
206 @param name The name of the property.
207 @return Boolean True if the specified property is dynamic.
208 @exception UnrecognizedConfigProperty if the property is not defined.
209 */
|
210 vijay.eli 1.11 Boolean isDynamic(const String& name) const;
|
211 mike 1.2
212
213 private:
214
215 /**
216 The table to hold the properties owned by this class
217 */
|
218 a.arora 1.6 AutoArrayPtr<struct ConfigProperty> _configProperties;
|
219 mike 1.2 };
220
221
222 PEGASUS_NAMESPACE_END
223
224 #endif /* Pegasus_GeneralPropertyOwner_h */
|