(file) Return to ConfigPropertyOwner.h CVS log (file) (dir) Up to [Pegasus] / pegasus / src / Pegasus / Config

  1 karl  1.12 //%2005////////////////////////////////////////////////////////////////////////
  2 mike  1.2  //
  3 karl  1.9  // 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.8  // IBM Corp.; EMC Corporation, The Open Group.
  7 karl  1.9  // 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.12 // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
 10            // EMC Corporation; VERITAS Software Corporation; The Open Group.
 11 mike  1.2  //
 12            // Permission is hereby granted, free of charge, to any person obtaining a copy
 13            // of this software and associated documentation files (the "Software"), to
 14            // deal in the Software without restriction, including without limitation the
 15            // rights to use, copy, modify, merge, publish, distribute, sublicense, and/or
 16            // sell copies of the Software, and to permit persons to whom the Software is
 17            // furnished to do so, subject to the following conditions:
 18 karl  1.12 // 
 19 mike  1.2  // THE ABOVE COPYRIGHT NOTICE AND THIS PERMISSION NOTICE SHALL BE INCLUDED IN
 20            // ALL COPIES OR SUBSTANTIAL PORTIONS OF THE SOFTWARE. THE SOFTWARE IS PROVIDED
 21            // "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT
 22            // LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR
 23            // PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT
 24            // HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN
 25            // ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION
 26            // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27            //
 28            //==============================================================================
 29            //
 30            // Author: Nag Boranna (nagaraja_boranna@hp.com)
 31            //
 32 chip  1.11 // Modified By:
 33            //      Sushma Fernandes, Hewlett-Packard Company, sushma_fernandes@hp.com
 34            //      Chip Vincent (cvincent@us.ibm.com)
 35 aruran.ms 1.13 //      Aruran, IBM (ashanmug@in.ibm.com) for Bug# 3614
 36 mike      1.2  //
 37                //%/////////////////////////////////////////////////////////////////////////////
 38                
 39                
 40                ///////////////////////////////////////////////////////////////////////////////
 41 chip      1.11 //
 42 mike      1.2  // This file defines the configuration property owner class.
 43                //
 44                ///////////////////////////////////////////////////////////////////////////////
 45                
 46                
 47                #ifndef Pegasus_ConfigPropertyOwner_h
 48                #define Pegasus_ConfigPropertyOwner_h
 49                
 50 kumpf     1.6  #include <Pegasus/Common/ArrayInternal.h>
 51 mike      1.2  #include <Pegasus/Common/String.h>
 52                #include <Pegasus/Common/Config.h>
 53                #include <Pegasus/Config/ConfigExceptions.h>
 54                #include <Pegasus/Config/Linkage.h>
 55                
 56                PEGASUS_NAMESPACE_BEGIN
 57                
 58                ///////////////////////////////////////////////////////////////////////////////
 59                //  ConfigPropertyOwner Class
 60                ///////////////////////////////////////////////////////////////////////////////
 61                
 62 chip      1.11 /**
 63                    This is an abstract class that the individual config property
 64                    owners will extend and provide implementation.
 65 mike      1.2  */
 66                class PEGASUS_CONFIG_LINKAGE ConfigPropertyOwner
 67                {
 68                public:
 69                
 70                    /** Constructors  */
 71                    ConfigPropertyOwner() { }
 72                
 73                
 74                    /** Destructor  */
 75                    virtual ~ConfigPropertyOwner() { }
 76                
 77                    /**
 78                    Initialize the config properties.
 79                
 80                    This method is expected to be called only once at the start of the
 81                    CIMOM. It initializes the properties with the default values.
 82                    */
 83                    virtual void initialize() = 0;
 84                
 85                
 86 chip      1.11     /**
 87 mike      1.2      Get information about the specified property.
 88                
 89                    @param name           The name of the property.
 90                    @param propertyInfo   List to store the property info.
 91                    @exception UnrecognizedConfigProperty  if the property is not defined.
 92                    */
 93 chip      1.11     virtual void getPropertyInfo(const String& name,
 94 mike      1.2          Array<String>& propertyInfo) = 0;
 95                        //throw (UnrecognizedConfigProperty) = 0;
 96                
 97                
 98 chip      1.11     /**
 99 mike      1.2      Get default value of the specified property.
100                
101                    @param  name         The name of the property.
102                    @return string containing the default value of the property specified.
103                    @exception UnrecognizedConfigProperty  if the property is not defined.
104                    */
105 aruran.ms 1.13     virtual String getDefaultValue(const String& name) = 0;
106 mike      1.2          //throw (UnrecognizedConfigProperty) = 0;
107                
108                
109 chip      1.11     /**
110 mike      1.2      Get current value of the specified property.
111                
112                    @param  name         The name of the property.
113                    @return string containing the currnet value of the property specified.
114                    @exception UnrecognizedConfigProperty  if the property is not defined.
115                    */
116 aruran.ms 1.13     virtual String getCurrentValue(const String& name) = 0;
117 mike      1.2          //throw (UnrecognizedConfigProperty) = 0;
118                
119                
120 chip      1.11     /**
121 mike      1.2      Get planned value of the specified property.
122                
123                    @param  name         The name of the property.
124                    @return string containing the planned value of the property specified.
125                    @exception UnrecognizedConfigProperty  if the property is not defined.
126                    */
127 aruran.ms 1.13     virtual String getPlannedValue(const String& name) = 0;
128 mike      1.2          //throw (UnrecognizedConfigProperty) = 0;
129                
130                
131 chip      1.11     /**
132 mike      1.2      Init current value of the specified property to the specified value.
133                    This method is expected to be called only once at the start of the
134                    CIMOM. The property value will be initialized irrespective of whether
135                    the property is dynamic or not.
136                
137                    @param  name   The name of the property.
138 chip      1.11     @param  value  The current value of the property.
139 mike      1.2      @exception     UnrecognizedConfigProperty  if the property is not defined.
140                    @exception     InvalidPropertyValue  if the property value is not valid.
141                    */
142                    virtual void initCurrentValue(const String& name, const String& value) = 0;
143                        //throw (UnrecognizedConfigProperty, InvalidPropertyValue) = 0;
144                
145                
146 chip      1.11     /**
147 mike      1.2      Init planned value of the specified property to the specified value.
148                    This method is expected to be called only once at the start of the
149                    CIMOM. The property value will be initialized irrespective of whether
150                    the property is dynamic or not.
151                
152                    @param  name   The name of the property.
153 chip      1.11     @param  value  The planned value of the property.
154 mike      1.2      @exception     UnrecognizedConfigProperty  if the property is not defined.
155                    @exception     InvalidPropertyValue  if the property value is not valid.
156                    */
157                    virtual void initPlannedValue(const String& name, const String& value) = 0;
158                        //throw (UnrecognizedConfigProperty, InvalidPropertyValue) = 0;
159                
160                
161 chip      1.11     /**
162 mike      1.2      Update current value of the specified property to the specified value.
163                    The property value will be updated only if the property is dynamically
164                    updatable.
165                
166                    @param  name   The name of the property.
167 chip      1.11     @param  value  The current value of the property.
168 mike      1.2      @exception     NonDynamicConfigProperty  if the property is not dynamic.
169                    @exception     InvalidPropertyValue  if the property value is not valid.
170                    @exception     UnrecognizedConfigProperty  if the property is not defined.
171                    */
172                    virtual void updateCurrentValue(
173 chip      1.11         const String& name,
174 mike      1.2          const String& value) = 0;
175                        //throw (NonDynamicConfigProperty, InvalidPropertyValue,
176                        //    UnrecognizedConfigProperty) = 0;
177                
178                
179 chip      1.11     /**
180 mike      1.2      Update planned value of the specified property to the specified value.
181                
182                    @param  name   The name of the property.
183 chip      1.11     @param  value  The planned value of the property.
184 mike      1.2      @exception     InvalidPropertyValue  if the property value is not valid.
185                    @exception     UnrecognizedConfigProperty  if the property is not defined.
186                    */
187                    virtual void updatePlannedValue(
188 chip      1.11         const String& name,
189                        const String& value) = 0;
190 mike      1.2          //throw (InvalidPropertyValue, UnrecognizedConfigProperty) = 0;
191                
192                
193 chip      1.11     /**
194 mike      1.2      Checks to see if the given value is valid or not.
195                
196                    @param  name   The name of the property.
197 chip      1.11     @param  value  The value of the property to be validated.
198 mike      1.2      @return true if the specified value for the property is valid.
199                    @exception UnrecognizedConfigProperty  if the property is not defined.
200                    */
201                    virtual Boolean isValid(const String& name, const String& value) = 0;
202                        //throw (UnrecognizedConfigProperty) = 0;
203                
204                
205 chip      1.11     /**
206 mike      1.2      Checks to see if the specified property is dynamic or not.
207                
208                    @param  name   The name of the property.
209                    @return true if the specified property is dynamic.
210                    @exception UnrecognizedConfigProperty  if the property is not defined.
211                    */
212                    virtual Boolean isDynamic(const String& name) = 0;
213                        //throw (UnrecognizedConfigProperty) = 0;
214                
215                };
216                
217                
218                ///////////////////////////////////////////////////////////////////////////////
219                //  ConfigProperty
220                ///////////////////////////////////////////////////////////////////////////////
221 chip      1.11 /**
222 mike      1.2      The ConfigProperty struct used for defining the config properties.
223                
224 chip      1.11     This structure is used by property owners that implement the
225                    ConfigPropertyOwner interface. Each config property they own will have
226                    their attributes defined in a structure of the type ConfigProperty.
227                    The structure members are initialized using the values defined in
228                    ConfigPropertyRow or by the set methods.
229 mike      1.2  */
230                ///////////////////////////////////////////////////////////////////////////////
231                
232 konrad.r  1.10 enum ConfigDynamic
233                {
234                		IS_DYNAMIC = 1,
235                		IS_STATIC = 0
236                };
237                
238                enum ConfigVisible
239                {
240                		IS_VISIBLE =1,
241                		IS_HIDDEN = 0
242                };
243                
244 mike      1.2  struct ConfigProperty
245                {
246                    String     propertyName;    // Name of a config property
247                    String     defaultValue;    // Default value of a config property
248                    String     currentValue;    // Current value of a config property
249                    String     plannedValue;    // Planned of a config property
250 konrad.r  1.10     ConfigDynamic    dynamic;            // Dynamic or non dynamic property
251 mike      1.2      char**     domain;            // List of valid values of a config property
252                    Uint32     domainSize;        // Size of the domain
253 konrad.r  1.10     ConfigVisible    externallyVisible; // Determines whether a property wants to be
254 chip      1.11                                   // externally visible or not.
255                                                  // If a property chooses not to be externally
256                                                  // visible, it is not listed as a configurable
257                                                  // property but is still configurable.
258 mike      1.2  };
259                
260                ///////////////////////////////////////////////////////////////////////////////
261 chip      1.11 /**
262                    The ConfigPropertyRow used for uniformly defining the values of
263 mike      1.2      the properties.
264                
265 chip      1.11     This structure is intended to be used by property owners that implement
266                    the ConfigPropertyOwner interface. Using this structure they can define
267                    the in memory default values for each attributes of the properties
268 mike      1.2      that they own.
269                */
270                ///////////////////////////////////////////////////////////////////////////////
271                
272                struct ConfigPropertyRow
273                {
274                    const char* propertyName;
275                    const char* defaultValue;
276 konrad.r  1.10     ConfigDynamic         dynamic;
277 mike      1.2      char**      domain;
278                    Uint32      domainSize;
279 konrad.r  1.10     ConfigVisible         externallyVisible;
280 mike      1.2  };
281                
282                ///////////////////////////////////////////////////////////////////////////////
283                /**
284 chip      1.11     Definition of commonly used constant string literals
285 mike      1.2  */
286                ///////////////////////////////////////////////////////////////////////////////
287                
288                PEGASUS_CONFIG_LINKAGE extern const char* STRING_TRUE;
289                PEGASUS_CONFIG_LINKAGE extern const char* STRING_FALSE;
290                
291                PEGASUS_NAMESPACE_END
292                
293                #endif /* Pegasus_ConfigPropertyOwner_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2