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

  1 martin 1.20 //%LICENSE////////////////////////////////////////////////////////////////
  2 martin 1.21 //
  3 martin 1.20 // Licensed to The Open Group (TOG) under one or more contributor license
  4             // agreements.  Refer to the OpenPegasusNOTICE.txt file distributed with
  5             // this work for additional information regarding copyright ownership.
  6             // Each contributor licenses this file to you under the OpenPegasus Open
  7             // Source License; you may not use this file except in compliance with the
  8             // License.
  9 martin 1.21 //
 10 martin 1.20 // Permission is hereby granted, free of charge, to any person obtaining a
 11             // copy of this software and associated documentation files (the "Software"),
 12             // to deal in the Software without restriction, including without limitation
 13             // the rights to use, copy, modify, merge, publish, distribute, sublicense,
 14             // and/or sell copies of the Software, and to permit persons to whom the
 15             // Software is furnished to do so, subject to the following conditions:
 16 martin 1.21 //
 17 martin 1.20 // The above copyright notice and this permission notice shall be included
 18             // in all copies or substantial portions of the Software.
 19 martin 1.21 //
 20 martin 1.20 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 21 martin 1.21 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 22 martin 1.20 // MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT.
 23             // IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY
 24             // CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT,
 25             // TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE
 26             // SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 27 martin 1.21 //
 28 martin 1.20 //////////////////////////////////////////////////////////////////////////
 29 mike   1.2  //
 30             //%/////////////////////////////////////////////////////////////////////////////
 31             
 32             
 33             //////////////////////////////////////////////////////////////////////////////
 34 david.dillard 1.10 //
 35 mike          1.2  // This file defines the trace property owner class.
 36                    //
 37                    //////////////////////////////////////////////////////////////////////////////
 38                    
 39                    #ifndef Pegasus_TracePropertyOwner_h
 40                    #define Pegasus_TracePropertyOwner_h
 41                    
 42                    #include <Pegasus/Config/ConfigPropertyOwner.h>
 43 a.arora       1.6  #include <Pegasus/Common/AutoPtr.h>
 44 mike          1.2  
 45                    
 46                    PEGASUS_NAMESPACE_BEGIN
 47                    
 48                    ///////////////////////////////////////////////////////////////////
 49                    //  TracePropertyOwner Class
 50                    ///////////////////////////////////////////////////////////////////
 51                    
 52 david.dillard 1.10 /**
 53 mike          1.2      This is Trace property owner class that extends ConfigPropertyOwner
 54                        class and provide implementation.
 55                    */
 56                    class PEGASUS_CONFIG_LINKAGE TracePropertyOwner : public ConfigPropertyOwner
 57                    {
 58                    public:
 59                    
 60                        /** Constructors  */
 61                        TracePropertyOwner();
 62                    
 63                        /**
 64                        Initialize the config properties.
 65                    
 66                        This method is expected to be called only once at the start of the
 67                        CIMOM. It initializes the properties with the default values.
 68                        */
 69                        void initialize();
 70                    
 71                    
 72 david.dillard 1.10     /**
 73 mike          1.2      Get information about the specified property.
 74                    
 75 kumpf         1.15     @param name   The name of the property.
 76 mike          1.2      @param propertyInfo   List to store the property info.
 77                        @exception UnrecognizedConfigProperty  if the property is not defined.
 78                        */
 79 vijay.eli     1.11     void getPropertyInfo(const String& name, Array<String>& propertyInfo)const;
 80 mike          1.2  
 81 david.dillard 1.10     /**
 82 mike          1.2      Get default value of the specified property.
 83                    
 84                        @param  name         The name of the property.
 85                        @return string containing the default value of the property specified.
 86                        @exception UnrecognizedConfigProperty  if the property is not defined.
 87                        */
 88 vijay.eli     1.11     String getDefaultValue(const String& name)const;
 89 mike          1.2  
 90 david.dillard 1.10     /**
 91 mike          1.2      Get current value of the specified property.
 92                    
 93                        @param  name         The name of the property.
 94                        @return string containing the currnet value of the property specified.
 95                        @exception UnrecognizedConfigProperty  if the property is not defined.
 96                        */
 97 vijay.eli     1.11     String getCurrentValue(const String& name)const;
 98 mike          1.2  
 99 david.dillard 1.10     /**
100 mike          1.2      Get planned value of the specified property.
101                    
102                        @param  name         The name of the property.
103                        @return string containing the planned value of the property specified.
104                        @exception UnrecognizedConfigProperty  if the property is not defined.
105                        */
106 vijay.eli     1.11     String getPlannedValue(const String& name)const;
107 mike          1.2  
108 david.dillard 1.10     /**
109 mike          1.2      Init current value of the specified property to the specified value.
110                        This method is expected to be called only once at the start of the
111                        CIMOM. The property value will be initialized irrespective of whether
112                        the property is dynamic or not.
113                    
114                        @param  name         The name of the property.
115 david.dillard 1.10     @param  value        The current value of the property.
116 mike          1.2      @exception     UnrecognizedConfigProperty  if the property is not defined.
117                        @exception     InvalidPropertyValue  if the property value is not valid.
118                        */
119                        void initCurrentValue(const String& name, const String& value);
120                    
121 david.dillard 1.10     /**
122 mike          1.2      Init planned value of the specified property to the specified value.
123                        This method is expected to be called only once at the start of the
124                        CIMOM. The property value will be initialized irrespective of whether
125                        the property is dynamic or not.
126                    
127                        @param  name         The name of the property.
128 david.dillard 1.10     @param  value        The planned value of the property.
129 mike          1.2      @exception     UnrecognizedConfigProperty  if the property is not defined.
130                        @exception     InvalidPropertyValue  if the property value is not valid.
131                        */
132 david.dillard 1.10     void initPlannedValue(const String& name, const String& value);
133 mike          1.2  
134 david.dillard 1.10     /**
135 mike          1.2      Update current value of the specified property to the specified value.
136                        The property value will be updated only if the property is dynamically
137                        updatable.
138                    
139                        @param  name         The name of the property.
140 david.dillard 1.10     @param  value        The current value of the property.
141 venkat.puvvada 1.23     @param  userName     User requesting the update.
142 venkat.puvvada 1.24     @param timeoutSeconds Timeout in seconds to complete the update.
143 mike           1.2      @exception     NonDynamicConfigProperty  if the property is not dynamic.
144                         @exception     InvalidPropertyValue  if the property value is not valid.
145                         @exception     UnrecognizedConfigProperty  if the property is not defined.
146                         */
147 venkat.puvvada 1.23     void updateCurrentValue(
148                             const String& name,
149                             const String& value,
150 venkat.puvvada 1.24         const String& userName,
151                             Uint32 timeoutSeconds);
152 mike           1.2          //throw (NonDynamicConfigProperty, InvalidPropertyValue,
153                             //    UnrecognizedConfigProperty);
154                     
155 david.dillard  1.10     /**
156 mike           1.2      Update planned value of the specified property to the specified value.
157                     
158                         @param  name         The name of the property.
159 david.dillard  1.10     @param  value        The planned value of the property.
160                         @exception     UnrecognizedConfigProperty  if the property is not defined.
161 mike           1.2      @exception     InvalidPropertyValue  if the property value is not valid.
162                         */
163                         void updatePlannedValue(const String& name, const String& value);
164                     
165 david.dillard  1.10     /**
166 mike           1.2      Checks to see if the given value is valid or not.
167                     
168                         @param  name         The name of the property.
169 david.dillard  1.10     @param  value        The value of the property to be validated.
170 mike           1.2      @return Boolean      True if the specified value for the property is valid.
171                         @exception UnrecognizedConfigProperty  if the property is not defined.
172                         */
173 vijay.eli      1.11     Boolean isValid(const String& name, const String& value)const;
174 mike           1.2  
175 david.dillard  1.10     /**
176 mike           1.2      Checks to see if the specified property is dynamic or not.
177                     
178                         @param  name         The name of the property.
179                         @return Boolean      True if the specified property is dynamic.
180                         @exception UnrecognizedConfigProperty  if the property is not defined.
181                         */
182 vijay.eli      1.11     Boolean isDynamic(const String& name)const;
183 mike           1.2  
184                     private:
185 aruran.ms      1.12     struct ConfigProperty* _lookupConfigProperty(const String& name) const;
186 kumpf          1.3  
187 marek          1.16 
188                         /**
189                         Converts the string representation of a trace level into a tracer
190                         constant.
191                     
192                         @param  traceLevel   The trace level as string
193                         @return Uint32       The matching trace level constant value.
194                         */
195                         Uint32 getTraceLevel(const String& traceLevel);
196                     
197                         /**
198                         Checks if a given string representation of a trace level matches a
199                         valid value.
200                     
201                         @param  traceLevel   The trace level as string
202                         @return Boolean      True if specified level is valid.
203                         */
204                         Boolean isLevelValid(const String& traceLevel) const;
205 kumpf          1.22 
206 r.kieninger    1.17     /**
207 thilo.boehm    1.18     Converts a given string representation of a trace buffer size into Uint32.
208                         If the string reperesantation is not valid, the returnd bufferSize is 0.
209 kumpf          1.22 
210 thilo.boehm    1.18     @param  traceBufferSize   The trace buffer size as string
211 kumpf          1.22     @param  bufferSize        Returns the buffer size as Uint32.
212                         @return Boolean           True if specified size is a
213 thilo.boehm    1.18                               valid string representaion of a Uint32.
214                         */
215 kumpf          1.22     Boolean toUint32TraceMemoryBufferSize( const String& traceBufferSize,
216 thilo.boehm    1.18                   Uint32& bufferSize ) const;
217 kumpf          1.22 
218 thilo.boehm    1.18     /**
219 r.kieninger    1.17     Makes sure the tracer has the trace file set with the current
220                         value from the config manager and issue a warning, if the
221                         traceFile cannot be used for tracing.
222                     
223                         @return Boolean      True if tracefile is valid
224                         */
225                         Boolean applyTraceFileConfigSetting(void) const;
226                     
227 marek          1.16 
228 mike           1.2      /**
229                         The trace properties owned by this class
230                         */
231 a.arora        1.6      AutoPtr<struct ConfigProperty>      _traceLevel; //PEP101
232 mike           1.2  
233 a.arora        1.6      AutoPtr<struct ConfigProperty>      _traceComponents; //PEP101
234 mike           1.2  
235 a.arora        1.6      AutoPtr<struct ConfigProperty>      _traceFilePath; //PEP101
236 mike           1.2  
237 r.kieninger    1.17     AutoPtr<struct ConfigProperty>      _traceFacility; //PEP315
238                     
239 thilo.boehm    1.18     AutoPtr<struct ConfigProperty>      _traceMemoryBufferKbytes; //PEP316
240                     
241 thilo.boehm    1.19     /**
242                         Remember if configproperties are already initialized.
243                         */
244                         Boolean _initialized;
245                     
246 mike           1.2  };
247                     
248                     PEGASUS_NAMESPACE_END
249                     
250                     #endif /* Pegasus_TracePropertyOwner_h */

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2