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

  1 karl  1.16 //%2006////////////////////////////////////////////////////////////////////////
  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 karl  1.16 // 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.16 // 
 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 david.dillard 1.14 // Modified By: Sushma Fernandes, Hewlett-Packard Company, sushma_fernandes@hp.com
 35                    //              Chip Vincent (cvincent@us.ibm.com)
 36                    //              Aruran, IBM (ashanmug@in.ibm.com) for Bug# 3614
 37                    //              David Dillard, VERITAS Software Corp.
 38                    //                  (david.dillard@veritas.com)
 39 vijay.eli     1.15 //              Vijay Eli, IBM, (vijayeli@in.ibm.com) for Bug# 3613
 40 mike          1.2  //
 41                    //%/////////////////////////////////////////////////////////////////////////////
 42                    
 43                    
 44                    ///////////////////////////////////////////////////////////////////////////////
 45 chip          1.11 //
 46 mike          1.2  // This file defines the configuration property owner class.
 47                    //
 48                    ///////////////////////////////////////////////////////////////////////////////
 49                    
 50                    
 51                    #ifndef Pegasus_ConfigPropertyOwner_h
 52                    #define Pegasus_ConfigPropertyOwner_h
 53                    
 54 kumpf         1.6  #include <Pegasus/Common/ArrayInternal.h>
 55 mike          1.2  #include <Pegasus/Common/String.h>
 56                    #include <Pegasus/Common/Config.h>
 57                    #include <Pegasus/Config/ConfigExceptions.h>
 58                    #include <Pegasus/Config/Linkage.h>
 59                    
 60                    PEGASUS_NAMESPACE_BEGIN
 61                    
 62                    ///////////////////////////////////////////////////////////////////////////////
 63                    //  ConfigPropertyOwner Class
 64                    ///////////////////////////////////////////////////////////////////////////////
 65                    
 66 chip          1.11 /**
 67                        This is an abstract class that the individual config property
 68                        owners will extend and provide implementation.
 69 mike          1.2  */
 70                    class PEGASUS_CONFIG_LINKAGE ConfigPropertyOwner
 71                    {
 72                    public:
 73                    
 74                        /** Constructors  */
 75                        ConfigPropertyOwner() { }
 76                    
 77                    
 78                        /** Destructor  */
 79                        virtual ~ConfigPropertyOwner() { }
 80                    
 81                        /**
 82                        Initialize the config properties.
 83                    
 84                        This method is expected to be called only once at the start of the
 85                        CIMOM. It initializes the properties with the default values.
 86                        */
 87                        virtual void initialize() = 0;
 88                    
 89                    
 90 chip          1.11     /**
 91 mike          1.2      Get information about the specified property.
 92                    
 93                        @param name           The name of the property.
 94                        @param propertyInfo   List to store the property info.
 95                        @exception UnrecognizedConfigProperty  if the property is not defined.
 96                        */
 97 chip          1.11     virtual void getPropertyInfo(const String& name,
 98 vijay.eli     1.15                          Array<String>& propertyInfo) const = 0;
 99 mike          1.2  
100                    
101 chip          1.11     /**
102 mike          1.2      Get default value of the specified property.
103                    
104                        @param  name         The name of the property.
105                        @return string containing the default value of the property specified.
106                        @exception UnrecognizedConfigProperty  if the property is not defined.
107                        */
108 vijay.eli     1.15     virtual String getDefaultValue(const String& name) const = 0;
109 mike          1.2  
110                    
111 chip          1.11     /**
112 mike          1.2      Get current value of the specified property.
113                    
114                        @param  name         The name of the property.
115                        @return string containing the currnet value of the property specified.
116                        @exception UnrecognizedConfigProperty  if the property is not defined.
117                        */
118 vijay.eli     1.15     virtual String getCurrentValue(const String& name) const = 0;
119 mike          1.2  
120                    
121 chip          1.11     /**
122 mike          1.2      Get planned value of the specified property.
123                    
124                        @param  name         The name of the property.
125                        @return string containing the planned value of the property specified.
126                        @exception UnrecognizedConfigProperty  if the property is not defined.
127                        */
128 vijay.eli     1.15     virtual String getPlannedValue(const String& name) const = 0;
129 mike          1.2  
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                    
144                    
145 chip          1.11     /**
146 mike          1.2      Init planned value of the specified property to the specified value.
147                        This method is expected to be called only once at the start of the
148                        CIMOM. The property value will be initialized irrespective of whether
149                        the property is dynamic or not.
150                    
151                        @param  name   The name of the property.
152 chip          1.11     @param  value  The planned value of the property.
153 mike          1.2      @exception     UnrecognizedConfigProperty  if the property is not defined.
154                        @exception     InvalidPropertyValue  if the property value is not valid.
155                        */
156                        virtual void initPlannedValue(const String& name, const String& value) = 0;
157                    
158                    
159 chip          1.11     /**
160 mike          1.2      Update current value of the specified property to the specified value.
161                        The property value will be updated only if the property is dynamically
162                        updatable.
163                    
164                        @param  name   The name of the property.
165 chip          1.11     @param  value  The current value of the property.
166 mike          1.2      @exception     NonDynamicConfigProperty  if the property is not dynamic.
167                        @exception     InvalidPropertyValue  if the property value is not valid.
168                        @exception     UnrecognizedConfigProperty  if the property is not defined.
169                        */
170                        virtual void updateCurrentValue(
171 chip          1.11         const String& name,
172 mike          1.2          const String& value) = 0;
173                            //throw (NonDynamicConfigProperty, InvalidPropertyValue,
174                            //    UnrecognizedConfigProperty) = 0;
175                    
176                    
177 chip          1.11     /**
178 mike          1.2      Update planned value of the specified property to the specified value.
179                    
180                        @param  name   The name of the property.
181 chip          1.11     @param  value  The planned value of the property.
182 mike          1.2      @exception     InvalidPropertyValue  if the property value is not valid.
183                        @exception     UnrecognizedConfigProperty  if the property is not defined.
184                        */
185                        virtual void updatePlannedValue(
186 chip          1.11         const String& name,
187                            const String& value) = 0;
188 mike          1.2  
189                    
190 chip          1.11     /**
191 mike          1.2      Checks to see if the given value is valid or not.
192                    
193                        @param  name   The name of the property.
194 chip          1.11     @param  value  The value of the property to be validated.
195 mike          1.2      @return true if the specified value for the property is valid.
196                        @exception UnrecognizedConfigProperty  if the property is not defined.
197                        */
198 vijay.eli     1.15     virtual Boolean isValid(const String& name, const String& value)const = 0;
199 mike          1.2  
200                    
201 chip          1.11     /**
202 mike          1.2      Checks to see if the specified property is dynamic or not.
203                    
204                        @param  name   The name of the property.
205                        @return true if the specified property is dynamic.
206                        @exception UnrecognizedConfigProperty  if the property is not defined.
207                        */
208 vijay.eli     1.15     virtual Boolean isDynamic(const String& name) const = 0;
209 mike          1.2  };
210                    
211                    
212                    ///////////////////////////////////////////////////////////////////////////////
213                    //  ConfigProperty
214                    ///////////////////////////////////////////////////////////////////////////////
215 chip          1.11 /**
216 mike          1.2      The ConfigProperty struct used for defining the config properties.
217                    
218 chip          1.11     This structure is used by property owners that implement the
219                        ConfigPropertyOwner interface. Each config property they own will have
220                        their attributes defined in a structure of the type ConfigProperty.
221                        The structure members are initialized using the values defined in
222                        ConfigPropertyRow or by the set methods.
223 mike          1.2  */
224                    ///////////////////////////////////////////////////////////////////////////////
225                    
226 konrad.r      1.10 enum ConfigDynamic
227                    {
228                    		IS_DYNAMIC = 1,
229                    		IS_STATIC = 0
230                    };
231                    
232                    enum ConfigVisible
233                    {
234                    		IS_VISIBLE =1,
235                    		IS_HIDDEN = 0
236                    };
237                    
238 mike          1.2  struct ConfigProperty
239                    {
240                        String     propertyName;    // Name of a config property
241                        String     defaultValue;    // Default value of a config property
242                        String     currentValue;    // Current value of a config property
243                        String     plannedValue;    // Planned of a config property
244 konrad.r      1.10     ConfigDynamic    dynamic;            // Dynamic or non dynamic property
245 mike          1.2      char**     domain;            // List of valid values of a config property
246                        Uint32     domainSize;        // Size of the domain
247 konrad.r      1.10     ConfigVisible    externallyVisible; // Determines whether a property wants to be
248 chip          1.11                                   // externally visible or not.
249                                                      // If a property chooses not to be externally
250                                                      // visible, it is not listed as a configurable
251                                                      // property but is still configurable.
252 mike          1.2  };
253                    
254                    ///////////////////////////////////////////////////////////////////////////////
255 chip          1.11 /**
256                        The ConfigPropertyRow used for uniformly defining the values of
257 mike          1.2      the properties.
258                    
259 chip          1.11     This structure is intended to be used by property owners that implement
260                        the ConfigPropertyOwner interface. Using this structure they can define
261                        the in memory default values for each attributes of the properties
262 mike          1.2      that they own.
263                    */
264                    ///////////////////////////////////////////////////////////////////////////////
265                    
266                    struct ConfigPropertyRow
267                    {
268                        const char* propertyName;
269                        const char* defaultValue;
270 konrad.r      1.10     ConfigDynamic         dynamic;
271 mike          1.2      char**      domain;
272                        Uint32      domainSize;
273 konrad.r      1.10     ConfigVisible         externallyVisible;
274 mike          1.2  };
275                    
276                    ///////////////////////////////////////////////////////////////////////////////
277                    /**
278 chip          1.11     Definition of commonly used constant string literals
279 mike          1.2  */
280                    ///////////////////////////////////////////////////////////////////////////////
281                    
282                    PEGASUS_CONFIG_LINKAGE extern const char* STRING_TRUE;
283                    PEGASUS_CONFIG_LINKAGE extern const char* STRING_FALSE;
284                    
285                    PEGASUS_NAMESPACE_END
286                    
287                    #endif /* Pegasus_ConfigPropertyOwner_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2