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

  1 martin 1.36 //%LICENSE////////////////////////////////////////////////////////////////
  2 martin 1.37 //
  3 martin 1.36 // 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.37 //
 10 martin 1.36 // 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.37 //
 17 martin 1.36 // The above copyright notice and this permission notice shall be included
 18             // in all copies or substantial portions of the Software.
 19 martin 1.37 //
 20 martin 1.36 // THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS
 21 martin 1.37 // OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF
 22 martin 1.36 // 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.37 //
 28 martin 1.36 //////////////////////////////////////////////////////////////////////////
 29 mike   1.2  //
 30             //%/////////////////////////////////////////////////////////////////////////////
 31             
 32             
 33             ///////////////////////////////////////////////////////////////////////////////
 34 chip   1.20 //
 35 mike   1.2  // This file has implementation for the default property owner class.
 36             //
 37             ///////////////////////////////////////////////////////////////////////////////
 38             
 39             #include "DefaultPropertyOwner.h"
 40 yi.zhou 1.26 #include "ConfigManager.h"
 41              #include <Pegasus/Common/AuditLogger.h>
 42 kavita.gupta 1.30 #include <Pegasus/Common/StringConversion.h>
 43 kavita.gupta 1.35 #include <Pegasus/Common/HTTPAcceptor.h>
 44                   #include <Pegasus/Common/HTTPConnection.h>
 45 venkat.puvvada 1.42 #include <Pegasus/Common/CIMMessage.h>
 46                     #include <Pegasus/Common/CIMNameCast.h>
 47 marek          1.47 #include <Pegasus/Common/HostAddress.h>
 48                     
 49 mike           1.2  
 50                     PEGASUS_USING_STD;
 51                     
 52                     PEGASUS_NAMESPACE_BEGIN
 53                     
 54                     
 55                     ///////////////////////////////////////////////////////////////////////////////
 56                     //  DefaultPropertyOwner
 57                     //
 58 chip           1.20 //  When a new property is added with the default owner, make sure to add
 59                     //  the property name and the default attributes of that property in
 60 mike           1.2  //  the table below.
 61                     ///////////////////////////////////////////////////////////////////////////////
 62                     
 63                     static struct ConfigPropertyRow properties[] =
 64                     {
 65 kumpf          1.14 #include "DefaultPropertyTable.h"
 66 mike           1.2  };
 67                     
 68                     const Uint32 NUM_PROPERTIES = sizeof(properties) / sizeof(properties[0]);
 69                     
 70                     
 71                     /** Constructors  */
 72                     DefaultPropertyOwner::DefaultPropertyOwner()
 73                     {
 74 a.arora        1.17     _configProperties.reset(new ConfigProperty[NUM_PROPERTIES]);
 75 mike           1.2  }
 76                     
 77                     
 78                     /**
 79 kumpf          1.27     Initialize the config properties.
 80 mike           1.2  */
 81                     void DefaultPropertyOwner::initialize()
 82                     {
 83                         for (Uint32 i = 0; i < NUM_PROPERTIES; i++)
 84                         {
 85 a.arora        1.17         (_configProperties.get())[i].propertyName = properties[i].propertyName;
 86                             (_configProperties.get())[i].defaultValue = properties[i].defaultValue;
 87                             (_configProperties.get())[i].currentValue = properties[i].defaultValue;
 88                             (_configProperties.get())[i].plannedValue = properties[i].defaultValue;
 89                             (_configProperties.get())[i].dynamic = properties[i].dynamic;
 90 kumpf          1.27         (_configProperties.get())[i].externallyVisible =
 91                                 properties[i].externallyVisible;
 92 mike           1.2      }
 93                     }
 94                     
 95                     
 96 chip           1.20 /**
 97 kumpf          1.27     Get information about the specified property.
 98 mike           1.2  */
 99                     void DefaultPropertyOwner::getPropertyInfo(
100 chip           1.20     const String& name,
101 vijay.eli      1.23     Array<String>& propertyInfo) const
102 mike           1.2  {
103                         propertyInfo.clear();
104                     
105                         for (Uint32 i = 0; i < NUM_PROPERTIES; i++)
106                         {
107 kavita.gupta   1.41         if (String::equal(_configProperties.get()[i].propertyName, name))
108 mike           1.2          {
109 kumpf          1.27             propertyInfo.append(_configProperties.get()[i].propertyName);
110                                 propertyInfo.append(_configProperties.get()[i].defaultValue);
111                                 propertyInfo.append(_configProperties.get()[i].currentValue);
112                                 propertyInfo.append(_configProperties.get()[i].plannedValue);
113 karl           1.48 
114 kumpf          1.27             if (_configProperties.get()[i].dynamic)
115 kumpf          1.15             {
116                                     propertyInfo.append(STRING_TRUE);
117                                 }
118                                 else
119                                 {
120                                     propertyInfo.append(STRING_FALSE);
121                                 }
122 karl           1.48 
123 kumpf          1.27             if (_configProperties.get()[i].externallyVisible)
124 mike           1.2              {
125                                     propertyInfo.append(STRING_TRUE);
126                                 }
127                                 else
128                                 {
129                                     propertyInfo.append(STRING_FALSE);
130                                 }
131 karl           1.48 
132                                 propertyInfo.append(getPropertyHelp(name));
133                     
134 mike           1.2              return;
135                             }
136                         }
137                     
138                         //
139                         // specified property name is not found
140                         //
141                         throw UnrecognizedConfigProperty(name);
142                     }
143                     
144 chip           1.20 /**
145 kumpf          1.27     Get default value of the specified property
146 mike           1.2  */
147 vijay.eli      1.23 String DefaultPropertyOwner::getDefaultValue(const String& name) const
148 mike           1.2  {
149                         for (Uint32 i = 0; i < NUM_PROPERTIES; i++)
150                         {
151 kavita.gupta   1.41         if (String::equal(_configProperties.get()[i].propertyName, name))
152 mike           1.2          {
153 kumpf          1.27             return _configProperties.get()[i].defaultValue;
154 mike           1.2          }
155                         }
156                     
157                         //
158                         // Specified property name could not be found
159                         //
160                         throw UnrecognizedConfigProperty(name);
161                     }
162                     
163 chip           1.20 /**
164 kumpf          1.27     Get current value of the specified property
165 mike           1.2  */
166 vijay.eli      1.23 String DefaultPropertyOwner::getCurrentValue(const String& name) const
167 mike           1.2  {
168                         for (Uint32 i = 0; i < NUM_PROPERTIES; i++)
169                         {
170 kavita.gupta   1.41         if (String::equal(_configProperties.get()[i].propertyName, name))
171 mike           1.2          {
172 marek          1.47             if (String::equalNoCase(name, "hostname"))
173                                 {
174                                     if (0 == _configProperties.get()[i].currentValue.size())
175                                     {
176                                         _configProperties.get()[i].currentValue=
177                                             System::getHostName();
178                                     }
179                                 }
180                                 if (String::equalNoCase(name, "fullyQualifiedHostName"))
181                                 {
182                                     if (0 == _configProperties.get()[i].currentValue.size())
183                                     {
184                                         _configProperties.get()[i].currentValue=
185                                             System::getFullyQualifiedHostName();
186                                     }
187                                 }
188 venkat.puvvada 1.44             if (String::equalNoCase(name, "maxProviderProcesses") ||
189                                     String::equalNoCase(name, "maxFailedProviderModuleRestarts"))
190 kavita.gupta   1.33             {
191 venkat.puvvada 1.44                 AutoMutex lock(_dynamicConfigPropertyMutex);
192 kavita.gupta   1.33                 return _configProperties.get()[i].currentValue;
193                                 }
194                                 else
195                                 {
196                                     return _configProperties.get()[i].currentValue;
197                                 }
198 mike           1.2          }
199                         }
200                     
201                         //
202                         // Specified property name could not be found
203                         //
204                         throw UnrecognizedConfigProperty(name);
205                     }
206                     
207 chip           1.20 /**
208 kumpf          1.27     Get planned value of the specified property
209 mike           1.2  */
210 vijay.eli      1.23 String DefaultPropertyOwner::getPlannedValue(const String& name) const
211 mike           1.2  {
212                         for (Uint32 i = 0; i < NUM_PROPERTIES; i++)
213                         {
214 kavita.gupta   1.41         if (String::equal(_configProperties.get()[i].propertyName, name))
215 mike           1.2          {
216 kumpf          1.27             return _configProperties.get()[i].plannedValue;
217 mike           1.2          }
218                         }
219                     
220                         //
221                         // Specified property name could not be found
222                         //
223                         throw UnrecognizedConfigProperty(name);
224                     }
225                     
226 chip           1.20 /**
227 kumpf          1.27     Init current value of the specified property to the specified value
228 mike           1.2  */
229                     void DefaultPropertyOwner::initCurrentValue(
230 chip           1.20     const String& name,
231 mike           1.2      const String& value)
232                     {
233 kavita.gupta   1.35     Uint32 index;
234                         for (index = 0; index < NUM_PROPERTIES; index++)
235 mike           1.2      {
236 kavita.gupta   1.41         if (String::equal(
237 kavita.gupta   1.35             _configProperties.get()[index].propertyName,
238                                 name))
239 mike           1.2          {
240 venkat.puvvada 1.44             if (String::equalNoCase(name, "maxProviderProcesses") ||
241                                     String::equalNoCase(name, "maxFailedProviderModuleRestarts"))
242 kavita.gupta   1.33             {
243 venkat.puvvada 1.44                 AutoMutex lock(_dynamicConfigPropertyMutex);
244 kavita.gupta   1.35                 _configProperties.get()[index].currentValue = value;
245 kavita.gupta   1.33             }
246 marek          1.47             else if (String::equalNoCase(name, "hostname"))
247                                 {
248                                     if (0 == value.size())
249                                     {
250                                         _configProperties.get()[index].currentValue=
251                                             System::getHostName();
252                                     }
253                                     else
254                                     {
255                                         System::setHostName(value);
256                                         _configProperties.get()[index].currentValue=value;
257                                     }
258                     
259                                 }
260                                 else if (String::equalNoCase(name, "fullyQualifiedHostName"))
261                                 {
262                                     if (0 == value.size())
263                                     {
264                                         _configProperties.get()[index].currentValue=
265                                             System::getFullyQualifiedHostName();
266                                     }
267 marek          1.47                 else
268                                     {
269                                         System::setFullyQualifiedHostName(value);
270                                         _configProperties.get()[index].currentValue=value;
271                                     }
272                                 }
273 kavita.gupta   1.33             else
274                                 {
275 kavita.gupta   1.35                _configProperties.get()[index].currentValue = value;
276 kavita.gupta   1.33             }
277 kavita.gupta   1.35             break;
278 mike           1.2          }
279                         }
280                     
281 kavita.gupta   1.35     if (index >= NUM_PROPERTIES)
282                         {
283                             //
284 kumpf          1.38         // Specified property name could not be found
285 kavita.gupta   1.35         //
286                             throw UnrecognizedConfigProperty(name);
287                         }
288                         else if (String::equal(name, "idleConnectionTimeout"))
289 kumpf          1.38     {
290 kavita.gupta   1.35         Uint64 v;
291                             StringConversion::decimalStringToUint64(value.getCString(), v);
292                             HTTPConnection::setIdleConnectionTimeout((Uint32)v);
293                         }
294                         else if (String::equal(name, "socketWriteTimeout"))
295                         {
296                             Uint64 v;
297                             StringConversion::decimalStringToUint64(value.getCString(), v);
298                             HTTPAcceptor::setSocketWriteTimeout((Uint32)v);
299                         }
300                         return;
301 mike           1.2  }
302                     
303 chip           1.20 /**
304 kumpf          1.27     Init planned value of the specified property to the specified value
305 mike           1.2  */
306                     void DefaultPropertyOwner::initPlannedValue(
307 chip           1.20     const String& name,
308 mike           1.2      const String& value)
309                     {
310                         for (Uint32 i = 0; i < NUM_PROPERTIES; i++)
311                         {
312 kavita.gupta   1.41         if (String::equal(_configProperties.get()[i].propertyName, name))
313 mike           1.2          {
314 kumpf          1.27             _configProperties.get()[i].plannedValue = value;
315 mike           1.2              return;
316                             }
317                         }
318                     
319                         //
320                         // Specified property name could not be found
321                         //
322                         throw UnrecognizedConfigProperty(name);
323                     }
324                     
325 chip           1.20 /**
326 kumpf          1.27     Update current value of the specified property to the specified value
327 mike           1.2  */
328                     void DefaultPropertyOwner::updateCurrentValue(
329 chip           1.20     const String& name,
330 venkat.puvvada 1.42     const String& value,
331 venkat.puvvada 1.43     const String& userName,
332                         Uint32 timeoutSeconds)
333 mike           1.2  {
334                         //
335                         // make sure the property is dynamic before updating the value.
336                         //
337                         if (!isDynamic(name))
338                         {
339 chip           1.20         throw NonDynamicConfigProperty(name);
340 mike           1.2      }
341                     
342 venkat.puvvada 1.42 #ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
343                         if (String::equal(name, "enableIndicationService"))
344                         {
345                             ConfigProperty *configProperty = 0;
346                             for (Uint32 i = 0; i < NUM_PROPERTIES; i++)
347                             {
348                                 if (String::equal(_configProperties.get()[i].propertyName, name))
349                                 {
350                                     configProperty = &_configProperties.get()[i];
351                                     break;
352                                 }
353                             }
354                             PEGASUS_ASSERT(configProperty);
355                             _requestIndicationServiceStateChange(
356                                 userName,
357 venkat.puvvada 1.43             ConfigManager::parseBooleanValue(value),
358                                 timeoutSeconds);
359 venkat.puvvada 1.42         configProperty->currentValue = value;
360                             return;
361                         }
362                     #endif
363                     
364 mike           1.2      //
365 chip           1.20     // Since the validations done in initCurrrentValue are sufficient and
366                         // no additional validations required for update, we shall call
367 mike           1.2      // initCurrrentValue.
368                         //
369                         initCurrentValue(name, value);
370 yi.zhou        1.26 
371 kumpf          1.28 #ifdef PEGASUS_ENABLE_AUDIT_LOGGER
372 yi.zhou        1.26 
373                         if (String::equal(name, "enableAuditLog") && isValid(name, value))
374                         {
375                             Boolean enableAuditLog = ConfigManager::parseBooleanValue(value);
376                             AuditLogger::setEnabled(enableAuditLog);
377                         }
378                     
379                     #endif
380                     
381 mike           1.2  }
382                     
383                     
384 chip           1.20 /**
385 kumpf          1.27     Update planned value of the specified property to the specified value
386 mike           1.2  */
387                     void DefaultPropertyOwner::updatePlannedValue(
388 chip           1.20     const String& name,
389 mike           1.2      const String& value)
390                     {
391                         //
392 chip           1.20     // Since the validations done in initPlannedValue are sufficient and
393                         // no additional validations required for update, we shall call
394 mike           1.2      // initPlannedValue.
395                         //
396                         initPlannedValue(name, value);
397                     }
398                     
399 dev.meetei     1.46 /**
400 karl           1.48  *Parse the list of comma seperated interface addresses
401 dev.meetei     1.46  * and return a list of string representation of interfaces
402                      * and works in following way
403                      *1)It checks for comma in a specified non empty listenAddress value
404                      *   a)if not found, it is assumed as single interface is specified
405                      *2) Otherwise, iterate to find comma and append
406                      */
407                     Array<String> DefaultPropertyOwner::parseAndGetListenAddress
408                         (const String &value_)
409                     {
410                         PEGASUS_ASSERT(value_.size() != 0 );
411                         String value = value_;
412                         Array<String> interfaces;
413                         try
414                         {
415                             Uint32 idx = value.find(",");
416                             interfaces.clear();
417                     
418                             //it has one ip address only
419                             if( idx == PEG_NOT_FOUND)
420                             {
421                                 interfaces.append(value);
422 dev.meetei     1.46         }
423                             else // has multiple address
424                             {
425                                 while(idx !=PEG_NOT_FOUND)
426                                 {
427                                     interfaces.append(value.subString(0,idx));
428 karl           1.48                 value.remove(0,idx+1);
429 dev.meetei     1.46                 idx = value.find(",");
430                                 }
431                                 //Last Remaining address
432                                 PEGASUS_ASSERT (idx == PEG_NOT_FOUND);
433                                 interfaces.append(value);
434                                 value.remove(0);
435                             }
436                         }
437                         catch( Exception &e)
438                         {
439                             PEG_TRACE((TRC_CONFIG,Tracer::LEVEL1,
440                                 "Exception caught while parsing listenAddresses %s",
441                             (const char*)e.getMessage().getCString()));
442                             throw;
443                         }
444                         return interfaces;
445                     }
446                     
447                     static Boolean isListenAddressValid(const String value_)
448                     {
449                         if(value_.size() == 0 )
450 dev.meetei     1.46     {
451                             return false;
452                         }
453                     
454                         Boolean isIpListTrue = true;
455                         Array<String> interfaces = DefaultPropertyOwner::parseAndGetListenAddress(
456                                                        value_);
457                     
458                         HostAddress theAddress;
459                         for(Uint32 i = 0, m = interfaces.size(); i < m; ++i)
460                         {
461                             if(!theAddress.setHostAddress(interfaces[i]))
462                             {
463                                 isIpListTrue = false;
464                                 throw InvalidListenAddressPropertyValue(
465                                     "listenAddress", interfaces[i]);
466                                 break;
467                             }
468                         }
469                     
470                         return isIpListTrue;
471 dev.meetei     1.46 }
472                     
473 mike           1.2  
474 chip           1.20 /**
475 mike           1.2  Checks to see if the given value is valid or not.
476                     */
477 kumpf          1.27 Boolean DefaultPropertyOwner::isValid(
478                         const String& name,
479                         const String& value) const
480 mike           1.2  {
481                         //
482                         // By default, no validation is done. It can optionally be added here
483                         // per property.
484                         //
485 kavita.gupta   1.41     if (String::equal(name, "socketWriteTimeout"))
486 marek          1.31     {
487                             Uint64 v;
488 kumpf          1.38         return
489 marek          1.31             StringConversion::decimalStringToUint64(value.getCString(), v) &&
490                                 StringConversion::checkUintBounds(v, CIMTYPE_UINT32) &&
491                                 (v != 0);
492                         }
493 kavita.gupta   1.41     if (String::equal(name, "maxProviderProcesses") ||
494 venkat.puvvada 1.44         String::equal(name, "idleConnectionTimeout") ||
495                             String::equal(name, "maxFailedProviderModuleRestarts"))
496 marek          1.25     {
497 kavita.gupta   1.30         Uint64 v;
498 kumpf          1.38         return
499 kavita.gupta   1.30             StringConversion::decimalStringToUint64(value.getCString(), v) &&
500                                 StringConversion::checkUintBounds(v, CIMTYPE_UINT32);
501 marek          1.25     }
502 venkat.puvvada 1.45     else if (String::equal(name, "httpsPort") ||
503                                 String::equal(name, "httpPort"))
504                         {
505                             Uint64 v;
506                             return StringConversion::decimalStringToUint64(value.getCString(), v) &&
507                                     StringConversion::checkUintBounds(v, CIMTYPE_UINT16) && (v!=0);
508                         }
509 dev.meetei     1.46     else if (String::equal(name, "listenAddress"))
510                         {
511 karl           1.48 
512 dev.meetei     1.46         return isListenAddressValid(value);
513                     
514                         }
515 kavita.gupta   1.41     else if (String::equal(name, "enableHttpConnection") ||
516                             String::equal(name, "enableHttpsConnection") ||
517                             String::equal(name, "daemon") ||
518                             String::equal(name, "enableAssociationTraversal") ||
519                             String::equal(name, "enableIndicationService") ||
520                             String::equal(name, "forceProviderProcesses")
521 kavita.gupta   1.40 #ifdef PEGASUS_ENABLE_SLP
522 kavita.gupta   1.41         || String::equal(name, "slp")
523 kavita.gupta   1.40 #endif
524 kumpf          1.28 #ifdef PEGASUS_ENABLE_AUDIT_LOGGER
525 kavita.gupta   1.40         || String::equal(name, "enableAuditLog")
526                     #endif
527                             )
528 yi.zhou        1.26     {
529 kavita.gupta   1.41         return ConfigManager::isValidBooleanValue(value);
530 yi.zhou        1.26     }
531 marek          1.47     else if (String::equal(name, "hostname") ||
532                             String::equal(name, "fullyQualifiedHostName"))
533                         {
534                             return HostAddress::isValidHostName(value);
535                         }
536 kumpf          1.27     return true;
537 mike           1.2  }
538                     
539 chip           1.20 /**
540 kumpf          1.27     Checks to see if the specified property is dynamic or not.
541 mike           1.2  */
542 vijay.eli      1.23 Boolean DefaultPropertyOwner::isDynamic(const String& name) const
543 mike           1.2  {
544                         for (Uint32 i = 0; i < NUM_PROPERTIES; i++)
545                         {
546 kavita.gupta   1.41         if (String::equal(_configProperties.get()[i].propertyName, name))
547 mike           1.2          {
548 kumpf          1.27             return (_configProperties.get()[i].dynamic == IS_DYNAMIC);
549 mike           1.2          }
550                         }
551                     
552                         //
553                         // Specified property name could not be found
554                         //
555                         throw UnrecognizedConfigProperty(name);
556                     }
557                     
558 venkat.puvvada 1.42 #ifdef PEGASUS_ENABLE_DMTF_INDICATION_PROFILE_SUPPORT
559                     void DefaultPropertyOwner::_requestIndicationServiceStateChange(
560                         const String& userName,
561 venkat.puvvada 1.43     Boolean enable,
562                         Uint32 timeoutSeconds)
563 venkat.puvvada 1.42 {
564                         MessageQueue *queue = MessageQueue::lookup(
565                             PEGASUS_QUEUENAME_INDICATIONSERVICE);
566                         // Return if indication service can not be found
567                         if (!queue)
568                         {
569                             return;
570                         }
571                     
572                         Uint32 queueId = queue->getQueueId();
573                     
574                         const String METHOD_NAME = "RequestStateChange";
575                         const String PARAMNAME_REQUESTEDSTATE = "RequestedState";
576                         const String PARAMNAME_TIMEOUTPERIOD = "TimeoutPeriod";
577                         const Uint16 STATE_ENABLED = 2;
578                         const Uint16 STATE_DISABLED = 3;
579                     
580                         String referenceStr("//", 2);
581                         referenceStr.append(System::getHostName());
582                         referenceStr.append("/");
583                         referenceStr.append(PEGASUS_NAMESPACENAME_INTEROP.getString());
584 venkat.puvvada 1.42     referenceStr.append(":");
585                         referenceStr.append(
586                             PEGASUS_CLASSNAME_CIM_INDICATIONSERVICE.getString());
587                         CIMObjectPath reference(referenceStr);
588                     
589                         Array<CIMParamValue> inParams;
590                         Array<CIMParamValue> outParams;
591                     
592                         inParams.append(CIMParamValue(PARAMNAME_REQUESTEDSTATE,
593                             CIMValue(enable ? STATE_ENABLED : STATE_DISABLED)));
594                     
595                         inParams.append(CIMParamValue(PARAMNAME_TIMEOUTPERIOD,
596 venkat.puvvada 1.43         CIMValue(CIMDateTime(timeoutSeconds * 1000000, true))));
597 venkat.puvvada 1.42 
598                         MessageQueueService *controller = ModuleController::getModuleController();
599                     
600                         try
601                         {
602                             CIMInvokeMethodRequestMessage* request =
603                                 new CIMInvokeMethodRequestMessage(
604                                     XmlWriter::getNextMessageId(),
605                                     PEGASUS_NAMESPACENAME_INTEROP,
606                                     referenceStr,
607                                     CIMNameCast(METHOD_NAME),
608                                     inParams,
609                                     QueueIdStack(queueId));
610                     
611                             request->operationContext.insert(
612                                 IdentityContainer(userName));
613                     
614                             AsyncLegacyOperationStart *asyncRequest =
615                                 new AsyncLegacyOperationStart(
616                                     0,
617                                     queueId,
618 venkat.puvvada 1.42                 request);
619                     
620                             AsyncReply * asyncReply = controller->SendWait(asyncRequest);
621                     
622                             CIMInvokeMethodResponseMessage * response =
623                                 reinterpret_cast<CIMInvokeMethodResponseMessage *>(
624                                     (static_cast<AsyncLegacyOperationResult *>(
625                                         asyncReply))->get_result());
626                     
627                             CIMException e = response->cimException;
628                     
629                             delete response;
630                             delete asyncRequest;
631                             delete asyncReply;
632                     
633                             if (e.getCode() != CIM_ERR_SUCCESS)
634                             {
635                                 throw e;
636                             }
637                         }
638                         catch(const Exception &e)
639 venkat.puvvada 1.42     {
640                             PEG_TRACE((TRC_CONFIG,Tracer::LEVEL1,
641                                 "Exception caught while invoking CIM_IndicationService."
642                                     "RequestStateChange()  method: %s",
643                             (const char*)e.getMessage().getCString()));
644                             throw;
645                         }
646                         catch(...)
647                         {
648                             PEG_TRACE_CSTRING(TRC_CONFIG,Tracer::LEVEL1,
649                                 "Unknown exception caught while invoking CIM_IndicationService."
650                                     "RequestStateChange()  method");
651                             throw;
652                         }
653                     }
654                     #endif
655                     
656 mike           1.2  PEGASUS_NAMESPACE_END

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2