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

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2