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

Diff for /pegasus/src/Pegasus/ControlProviders/ProviderRegistrationProvider/ProviderRegistrationProvider.cpp between version 1.58 and 1.94

version 1.58, 2003/11/04 19:00:59 version 1.94, 2007/03/21 20:35:54
Line 1 
Line 1 
 //%2003////////////////////////////////////////////////////////////////////////  //%2006////////////////////////////////////////////////////////////////////////
 // //
 // Copyright (c) 2000, 2001, 2002  BMC Software, Hewlett-Packard Development  // Copyright (c) 2000, 2001, 2002 BMC Software; Hewlett-Packard Development
 // Company, L. P., IBM Corp., The Open Group, Tivoli Systems.  // Company, L.P.; IBM Corp.; The Open Group; Tivoli Systems.
 // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.; // Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.;
 // IBM Corp.; EMC Corporation, The Open Group. // IBM Corp.; EMC Corporation, The Open Group.
   // Copyright (c) 2004 BMC Software; Hewlett-Packard Development Company, L.P.;
   // IBM Corp.; EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2005 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; VERITAS Software Corporation; The Open Group.
   // Copyright (c) 2006 Hewlett-Packard Development Company, L.P.; IBM Corp.;
   // EMC Corporation; Symantec Corporation; The Open Group.
 // //
 // Permission is hereby granted, free of charge, to any person obtaining a copy // Permission is hereby granted, free of charge, to any person obtaining a copy
 // of this software and associated documentation files (the "Software"), to // of this software and associated documentation files (the "Software"), to
Line 22 
Line 28 
 // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. // WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 // //
 //============================================================================== //==============================================================================
 //  
 // Author: Yi Zhou (yi_zhou@hp.com)  
 //  
 // Modified By: Chip Vincent (cvincent@us.ibm.com)  
 //              Nitin Upasani, Hewlett-Packard Company (Nitin_Upasani@hp.com)  
 //              Roger Kumpf, Hewlett-Packard Company (roger_kumpf@hp.com)  
 //              Carol Ann Krug Graves, Hewlett-Packard Company  
 //                  (carolann_graves@hp.com)  
 //  
 //%///////////////////////////////////////////////////////////////////////////// //%/////////////////////////////////////////////////////////////////////////////
  
 #include "ProviderRegistrationProvider.h" #include "ProviderRegistrationProvider.h"
Line 39 
Line 36 
 #include <Pegasus/Common/XmlWriter.h> #include <Pegasus/Common/XmlWriter.h>
 #include <Pegasus/Common/Constants.h> #include <Pegasus/Common/Constants.h>
 #include <Pegasus/Common/CIMMessage.h> #include <Pegasus/Common/CIMMessage.h>
 #include <Pegasus/Common/OperationContext.h>  #include <Pegasus/Common/OperationContextInternal.h>
 #include <Pegasus/Common/System.h> #include <Pegasus/Common/System.h>
 #include <Pegasus/Common/MessageLoader.h> //l10n #include <Pegasus/Common/MessageLoader.h> //l10n
   #include <Pegasus/Common/Constants.h>
  
 PEGASUS_NAMESPACE_BEGIN PEGASUS_NAMESPACE_BEGIN
  
Line 51 
Line 49 
 static const CIMName _PROPERTY_CAPABILITYID  = CIMName ("CapabilityID"); static const CIMName _PROPERTY_CAPABILITYID  = CIMName ("CapabilityID");
  
 /** /**
    Module status  
 */  
 static const Uint16 _MODULE_OK        = 2;  
   
 /**  
    stopping provider method    stopping provider method
 */ */
 static const CIMName _STOP_PROVIDER     = CIMName ("Stop"); static const CIMName _STOP_PROVIDER     = CIMName ("Stop");
Line 65 
Line 58 
 */ */
 static const CIMName _START_PROVIDER   = CIMName ("Start"); static const CIMName _START_PROVIDER   = CIMName ("Start");
  
 /**  
    Provider status  
 */  
 static const Uint16 _MODULE_STOPPING   = 9;  
   
 static const Uint16 _MODULE_STOPPED   = 10;  
   
 ProviderRegistrationProvider::ProviderRegistrationProvider( ProviderRegistrationProvider::ProviderRegistrationProvider(
     ProviderRegistrationManager * providerRegistrationManager)     ProviderRegistrationManager * providerRegistrationManager)
     :_id(peg_credential_types::PROVIDER)  
 { {
     _providerRegistrationManager = providerRegistrationManager;     _providerRegistrationManager = providerRegistrationManager;
  
     _controller = &(ModuleController::get_client_handle(_id, &_client_handle));      _controller = ModuleController::getModuleController();
     if(_client_handle == NULL)  
         throw UninitializedObjectException();  
 } }
  
 ProviderRegistrationProvider::~ProviderRegistrationProvider(void) ProviderRegistrationProvider::~ProviderRegistrationProvider(void)
 { {
     if (_providerRegistrationManager)  
     {  
         delete _providerRegistrationManager;  
     }  
   
     if (_client_handle)  
     {  
         delete _client_handle;  
     }  
   
 }  
   
 void ProviderRegistrationProvider::initialize(CIMOMHandle & cimom)  
 {  
     // This method should not be called because this is a control provider  
     // and is not dynamically loaded through the provider manager  
 }  
   
 void ProviderRegistrationProvider::terminate(void)  
 {  
 } }
  
 // get registered provider // get registered provider
Line 142 
Line 105 
  
     try     try
     {     {
         instance = _providerRegistrationManager->getInstance(instanceReference);          instance = _providerRegistrationManager->getInstance(instanceReference,
                                                                includeQualifiers,
                                                                includeClassOrigin,
                                                                propertyList);
     }     }
     catch(CIMException& e)      catch(const CIMException&)
     {     {
         throw (e);          throw;
     }     }
  
     handler.deliver(instance);     handler.deliver(instance);
Line 189 
Line 155 
  
     try     try
     {     {
         enumInstances = _providerRegistrationManager->enumerateInstances(classReference);          enumInstances =
               _providerRegistrationManager->enumerateInstancesForClass(
                   classReference,
                   includeQualifiers,
                   includeClassOrigin,
                   propertyList);
     }     }
     catch(CIMException& e)      catch(const CIMException&)
     {     {
         throw (e);          throw;
     }     }
  
     handler.deliver(enumInstances);     handler.deliver(enumInstances);
Line 235 
Line 206 
     try     try
     {     {
         enumInstanceNames =         enumInstanceNames =
             _providerRegistrationManager->enumerateInstanceNames(classReference);              _providerRegistrationManager->enumerateInstanceNamesForClass(
                   classReference);
     }     }
     catch(CIMException& e)      catch(const CIMException&)
     {     {
         throw (e);          throw;
     }     }
  
     handler.deliver(enumInstanceNames);     handler.deliver(enumInstanceNames);
Line 273 
Line 245 
  
     if ((userName != String::EMPTY) && !System::isPrivilegedUser(userName))     if ((userName != String::EMPTY) && !System::isPrivilegedUser(userName))
     {     {
         //l10n  
         //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_ACCESS_DENIED,  
             //"You must have superuser privilege to modify the registration.");  
             throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_ACCESS_DENIED,MessageLoaderParms(             throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_ACCESS_DENIED,MessageLoaderParms(
                         "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.SUPERUSER_PRIVILEGE_REQUIRED_MODIFY_REGISTRATION",              "ControlProviders.ProviderRegistrationProvider."
                         "You must have superuser privilege to modify the registration."));                  "ProviderRegistrationProvider."
                   "SUPERUSER_PRIVILEGE_REQUIRED_MODIFY_REGISTRATION",
               "You must have superuser privilege to modify the"
                   " registration."));
     }     }
  
     if(!instanceReference.getNameSpace().equal (PEGASUS_NAMESPACENAME_INTEROP))     if(!instanceReference.getNameSpace().equal (PEGASUS_NAMESPACENAME_INTEROP))
Line 303 
Line 275 
     //     //
     if (propertyList.isNull())     if (propertyList.isNull())
     {     {
         //l10n  
         //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED,  
             //"Only can modify Namespaces, SupportedProperties, and SupportedMethods.");  
             throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED, MessageLoaderParms(             throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED, MessageLoaderParms(
                         "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.CAN_ONLY_MODIFY_ERR",              "ControlProviders.ProviderRegistrationProvider."
                         "Only can modify Namespaces, SupportedProperties, and SupportedMethods."));                  "ProviderRegistrationProvider."
               "CAN_ONLY_MODIFY_ERR",
               "Only can modify Namespaces, SupportedProperties,"
                   "and SupportedMethods."));
     }     }
  
     Array<CIMName> propertyArray = propertyList.getPropertyNameArray();     Array<CIMName> propertyArray = propertyList.getPropertyNameArray();
Line 329 
Line 301 
     try     try
     {     {
         _providerRegistrationManager->modifyInstance(instanceReference,         _providerRegistrationManager->modifyInstance(instanceReference,
             instanceObject, includeQualifiers, propertyArray);                                                       instanceObject,
                                                        includeQualifiers,
                                                        propertyArray);
     }     }
     catch(CIMException& e)      catch(const CIMException&)
     {     {
         throw (e);          throw;
     }     }
  
     // complete processing the request     // complete processing the request
Line 361 
Line 335 
  
     if ((userName != String::EMPTY) && !System::isPrivilegedUser(userName))     if ((userName != String::EMPTY) && !System::isPrivilegedUser(userName))
     {     {
         //l10n  
         //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_ACCESS_DENIED,  
             //"You must have superuser privilege to register providers.");  
             throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_ACCESS_DENIED, MessageLoaderParms(             throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_ACCESS_DENIED, MessageLoaderParms(
                                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.SUPERUSER_PRIVILEGE_REQUIRED_REGISTER_PROVIDERS",              "ControlProviders.ProviderRegistrationProvider."
                   "ProviderRegistrationProvider."
                   "SUPERUSER_PRIVILEGE_REQUIRED_REGISTER_PROVIDERS",
                                 "You must have superuser privilege to register providers."));                                 "You must have superuser privilege to register providers."));
     }     }
  
Line 405 
Line 378 
         if (instanceObject.findProperty(_PROPERTY_PROVIDERMODULE_NAME) ==         if (instanceObject.findProperty(_PROPERTY_PROVIDERMODULE_NAME) ==
             PEG_NOT_FOUND)             PEG_NOT_FOUND)
         {         {
                 //l10n 485  
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,  
                 //"Missing Name which is required property in PG_ProviderModule class.");  
                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.MISSING_NAME_IN_PG_PROVIDERMODULE",                  "ControlProviders.ProviderRegistrationProvider."
                 "Missing Name which is required property in PG_ProviderModule class."));                      "ProviderRegistrationProvider."
                       "MISSING_NAME_IN_PG_PROVIDERMODULE",
                   "Missing Name which is required property in PG_ProviderModule"
                       " class."));
         }         }
  
         if (instanceObject.findProperty(_PROPERTY_VENDOR) == PEG_NOT_FOUND)         if (instanceObject.findProperty(_PROPERTY_VENDOR) == PEG_NOT_FOUND)
         {         {
                 //l10n 485  
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,  
                 //"Missing Vendor which is required property in PG_ProviderModule class.");  
                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.MISSING_VENDOR_IN_PG_PROVIDERMODULE",                  "ControlProviders.ProviderRegistrationProvider."
                 "Missing Vendor which is required property in PG_ProviderModule class."));                      "ProviderRegistrationProvider."
                       "MISSING_VENDOR_IN_PG_PROVIDERMODULE",
                   "Missing Vendor which is required property in"
                       " PG_ProviderModule class."));
         }         }
  
         if (instanceObject.findProperty(_PROPERTY_VERSION) == PEG_NOT_FOUND)         if (instanceObject.findProperty(_PROPERTY_VERSION) == PEG_NOT_FOUND)
         {         {
                 //l10n 485  
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,  
                 //"Missing Version which is required property in PG_ProviderModule class.");  
                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.MISSING_VERSION_IN_PG_PROVIDERMODULE",                  "ControlProviders.ProviderRegistrationProvider."
                 "Missing Version which is required property in PG_ProviderModule class."));                      "ProviderRegistrationProvider."
                       "MISSING_VERSION_IN_PG_PROVIDERMODULE",
                   "Missing Version which is required property in"
                       " PG_ProviderModule class."));
         }         }
  
         Uint32 ifcTypeIndex =         Uint32 ifcTypeIndex =
             instanceObject.findProperty(_PROPERTY_INTERFACETYPE);             instanceObject.findProperty(_PROPERTY_INTERFACETYPE);
         if (ifcTypeIndex == PEG_NOT_FOUND)         if (ifcTypeIndex == PEG_NOT_FOUND)
         {         {
                 //l10n 485  
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,  
                 //"Missing InterfaceType which is required property in PG_ProviderModule class.");  
                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.MISSING_INTERFACETYPE_IN_PG_PROVIDERMODULE",                  "ControlProviders.ProviderRegistrationProvider."
                 "Missing InterfaceType which is required property in PG_ProviderModule class."));                      "ProviderRegistrationProvider."
                       "MISSING_INTERFACETYPE_IN_PG_PROVIDERMODULE",
                   "Missing InterfaceType which is required property in"
                       " PG_ProviderModule class."));
         }         }
         String ifcTypeString;         String ifcTypeString;
         instanceObject.getProperty(ifcTypeIndex).getValue().         instanceObject.getProperty(ifcTypeIndex).getValue().
             get(ifcTypeString);             get(ifcTypeString);
  
         if(ifcTypeString != "C++Default" && ifcTypeString != "CMPI" )          if (ifcTypeString != "C++Default"
         {  #ifdef PEGASUS_ENABLE_CMPI_PROVIDER_MANAGER
                 //l10n 485              && ifcTypeString != "CMPI"
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED,  #endif
                 //"Unsupported InterfaceType value: \"" + ifcTypeString + "\"");  #ifdef PEGASUS_ENABLE_JMPI_PROVIDER_MANAGER
                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED,MessageLoaderParms(              && (ifcTypeString != "JMPI")
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.UNSUPPORTED_INTERFACETYPE_VALUE",              && (ifcTypeString != "JMPIExperimental")
   #endif
                   )
           {
               throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED,
                   MessageLoaderParms(
                   "ControlProviders.ProviderRegistrationProvider."
                       "ProviderRegistrationProvider."
                       "UNSUPPORTED_INTERFACETYPE_VALUE",
                 "Unsupported InterfaceType value: \"$0\"",ifcTypeString));                 "Unsupported InterfaceType value: \"$0\"",ifcTypeString));
         }         }
  
Line 462 
Line 443 
             instanceObject.findProperty(_PROPERTY_INTERFACEVERSION);             instanceObject.findProperty(_PROPERTY_INTERFACEVERSION);
         if (ifcVersionIndex == PEG_NOT_FOUND)         if (ifcVersionIndex == PEG_NOT_FOUND)
         {         {
                 //l10n 485  
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,  
                 //"Missing InterfaceVersion which is required property in PG_ProviderModule class.");  
                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.MISSING_INTERFACEVERSION_IN_PG_PROVIDERMODULE",                  "ControlProviders.ProviderRegistrationProvider."
                 "Missing InterfaceVersion which is required property in PG_ProviderModule class."));                      "ProviderRegistrationProvider."
                       "MISSING_INTERFACEVERSION_IN_PG_PROVIDERMODULE",
                   "Missing InterfaceVersion which is required property "
                       "in PG_ProviderModule class."));
         }         }
         String ifcVersionString;         String ifcVersionString;
         instanceObject.getProperty(ifcVersionIndex).getValue().         instanceObject.getProperty(ifcVersionIndex).getValue().
             get(ifcVersionString);             get(ifcVersionString);
         if ((ifcVersionString != "2.1.0") &&          if (
             (ifcVersionString != "2.2.0") &&  #ifdef PEGASUS_ENABLE_CMPI_PROVIDER_MANAGER
             (ifcVersionString != "2.3.0"))             (ifcTypeString == "CMPI" &&
         {              ifcVersionString != "2.0.0") ||
                 //l10n 485  #endif
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED,  #ifdef PEGASUS_ENABLE_JMPI_PROVIDER_MANAGER
                 //"Unsupported InterfaceVersion value: \"" + ifcVersionString +             (ifcTypeString == "JMPI" &&
                    // "\"");              ifcVersionString != "1.0.0" &&
               ifcVersionString != "2.0.0" &&
               ifcVersionString != "2.2.0") ||
              (ifcTypeString == "JMPIExperimental" &&
               ifcVersionString != "0.0.1") ||
   #endif
              (ifcTypeString == "C++Default" &&
               ifcVersionString != "2.1.0" &&
               ifcVersionString != "2.2.0" &&
               ifcVersionString != "2.3.0" &&
               ifcVersionString != "2.5.0" &&
               ifcVersionString != "2.6.0"))
           {
         String unsupported = "InterfaceVersion";         String unsupported = "InterfaceVersion";
         throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED,MessageLoaderParms(         throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED,MessageLoaderParms(
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.UNSUPPORTED_INTERFACEVERSION_VALUE",                  "ControlProviders.ProviderRegistrationProvider."
                       "ProviderRegistrationProvider."
                       "UNSUPPORTED_INTERFACEVERSION_VALUE",
                 "Unsupported InterfaceVersion value: \"$0\"",ifcVersionString));                 "Unsupported InterfaceVersion value: \"$0\"",ifcVersionString));
         }         }
  
         if (instanceObject.findProperty(_PROPERTY_LOCATION) == PEG_NOT_FOUND)         if (instanceObject.findProperty(_PROPERTY_LOCATION) == PEG_NOT_FOUND)
         {         {
                 //l10n 485  
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,  
                 //"Missing Location which is required property in PG_ProviderModule class.");  
                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.MISSING_LOCATION_IN_PG_PROVIDERMODULE",                  "ControlProviders.ProviderRegistrationProvider."
                 "Missing Location which is required property in PG_ProviderModule class."));                      "ProviderRegistrationProvider."
                       "MISSING_LOCATION_IN_PG_PROVIDERMODULE",
                   "Missing Location which is required property in"
                       " PG_ProviderModule class."));
         }         }
  
         if (instanceObject.findProperty(_PROPERTY_OPERATIONALSTATUS) ==         if (instanceObject.findProperty(_PROPERTY_OPERATIONALSTATUS) ==
             PEG_NOT_FOUND)             PEG_NOT_FOUND)
         {         {
             Array<Uint16> _operationalStatus;             Array<Uint16> _operationalStatus;
             _operationalStatus.append(_MODULE_OK);              _operationalStatus.append(CIM_MSE_OPSTATUS_VALUE_OK);
             instance.addProperty (CIMProperty             instance.addProperty (CIMProperty
                 (_PROPERTY_OPERATIONALSTATUS, _operationalStatus));                 (_PROPERTY_OPERATIONALSTATUS, _operationalStatus));
         }         }
   
           //
           // Validate the UserContext property
           //
           CIMValue userContextValue;
           Uint32 userContextIndex = instanceObject.findProperty(
               PEGASUS_PROPERTYNAME_MODULE_USERCONTEXT);
   
           if (userContextIndex != PEG_NOT_FOUND)
           {
               userContextValue =
                   instanceObject.getProperty(userContextIndex).getValue();
           }
   
           if (!userContextValue.isNull())
           {
   #ifdef PEGASUS_DISABLE_PROV_USERCTXT
               throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms(
                   "ControlProviders.ProviderRegistrationProvider."
                       "ProviderRegistrationProvider.USERCONTEXT_UNSUPPORTED",
                   "The UserContext property in the PG_ProviderModule class is "
                       "not supported."));
   #else
               Uint16 userContext;
               userContextValue.get(userContext);
   
               if (!((userContext == PG_PROVMODULE_USERCTXT_REQUESTOR) ||
                     (userContext == PG_PROVMODULE_USERCTXT_DESIGNATED) ||
                     (userContext == PG_PROVMODULE_USERCTXT_PRIVILEGED) ||
                     (userContext == PG_PROVMODULE_USERCTXT_CIMSERVER)))
               {
                   throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED,
                       MessageLoaderParms(
                           "ControlProviders.ProviderRegistrationProvider."
                               "ProviderRegistrationProvider."
                               "UNSUPPORTED_USERCONTEXT_VALUE",
                           "Unsupported UserContext value: \"$0\".",
                           userContext));
               }
   
               // DesignatedUserContext property is required when UserContext == 3
               if (userContext == PG_PROVMODULE_USERCTXT_DESIGNATED)
               {
                   Uint32 designatedUserIndex = instanceObject.findProperty(
                       PEGASUS_PROPERTYNAME_MODULE_DESIGNATEDUSER);
                   if ((designatedUserIndex == PEG_NOT_FOUND) ||
                       instanceObject.getProperty(designatedUserIndex).getValue()
                           .isNull())
                   {
                       throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,
                           MessageLoaderParms(
                               "ControlProviders.ProviderRegistrationProvider."
                                   "ProviderRegistrationProvider."
                                   "MISSING_DESIGNATEDUSER_IN_PG_PROVIDERMODULE",
                               "Missing DesignatedUserContext property in "
                                   "PG_ProviderModule instance."));
                   }
                   else
                   {
                       // Validate that DesignatedUserContext is of String type
                       String designatedUser;
                       instanceObject.getProperty(designatedUserIndex).getValue()
                           .get(designatedUser);
                   }
               }
   #endif
           }
     }     }
     else if (className.equal (PEGASUS_CLASSNAME_PROVIDERCAPABILITIES))     else if (className.equal (PEGASUS_CLASSNAME_PROVIDERCAPABILITIES))
     {     {
Line 515 
Line 577 
         if (instanceObject.findProperty(_PROPERTY_PROVIDERMODULENAME) ==         if (instanceObject.findProperty(_PROPERTY_PROVIDERMODULENAME) ==
             PEG_NOT_FOUND)             PEG_NOT_FOUND)
         {         {
                 //l10n 485  
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,  
                 //"Missing ProviderModuleName which is required property in PG_ProviderCapabilities class.");  
                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.MISSING_PROVIDERMODULENAME_IN_PG_PROVIDERCAPABILITIES",                  "ControlProviders.ProviderRegistrationProvider."
                 "Missing ProviderModuleName which is required property in PG_ProviderCapabilities class."));                      "ProviderRegistrationProvider."
                       "MISSING_PROVIDERMODULENAME_IN_PG_PROVIDERCAPABILITIES",
                   "Missing ProviderModuleName which is required property in"
                       " PG_ProviderCapabilities class."));
         }         }
  
         if (instanceObject.findProperty(_PROPERTY_PROVIDERNAME) ==         if (instanceObject.findProperty(_PROPERTY_PROVIDERNAME) ==
             PEG_NOT_FOUND)             PEG_NOT_FOUND)
         {         {
                 //l10n 485  
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,  
                 //"Missing ProviderName which is required property in PG_ProviderCapabilities class.");  
                 String missing = "ProviderName";                 String missing = "ProviderName";
                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.MISSING_REQUIRED_PROPERTY",                  "ControlProviders.ProviderRegistrationProvider."
                 "Missing ProviderName which is required property in PG_ProviderCapabilities class."));                      "ProviderRegistrationProvider.MISSING_REQUIRED_PROPERTY",
                   "Missing ProviderName which is required property in"
                       " PG_ProviderCapabilities class."));
         }         }
  
         if (instanceObject.findProperty(_PROPERTY_CAPABILITYID) ==         if (instanceObject.findProperty(_PROPERTY_CAPABILITYID) ==
             PEG_NOT_FOUND)             PEG_NOT_FOUND)
         {         {
                 //l10n 485  
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,  
                 //"Missing CapabilityID which is required property in PG_ProviderCapabilities class.");  
                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.MISSINGCAPABILITYID_IN_PG_PROVIDERCAPABILITIES",                  "ControlProviders.ProviderRegistrationProvider."
                 "Missing CapabilityID which is required property in PG_ProviderCapabilities class."));                      "ProviderRegistrationProvider."
                       "MISSINGCAPABILITYID_IN_PG_PROVIDERCAPABILITIES",
                   "Missing CapabilityID which is required property in"
                       " PG_ProviderCapabilities class."));
         }         }
  
         if (instanceObject.findProperty(_PROPERTY_CLASSNAME) == PEG_NOT_FOUND)         if (instanceObject.findProperty(_PROPERTY_CLASSNAME) == PEG_NOT_FOUND)
         {         {
                 //l10n 485  
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,  
                 //"Missing ClassName which is required property in PG_ProviderCapabilities class.");  
                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.MISSING_CLASSNAME_IN_PG_PROVIDERCAPABILITIES",                  "ControlProviders.ProviderRegistrationProvider."
                 "Missing ClassName which is required property in PG_ProviderCapabilities class."));                      "ProviderRegistrationProvider."
                       "MISSING_CLASSNAME_IN_PG_PROVIDERCAPABILITIES",
                   "Missing ClassName which is required property in"
                       " PG_ProviderCapabilities class."));
         }         }
  
         if (instanceObject.findProperty(_PROPERTY_NAMESPACES) == PEG_NOT_FOUND)          // Validate the Namespaces property
   
           Uint32 namespacesIndex =
               instanceObject.findProperty(_PROPERTY_NAMESPACES);
           Array<String> namespacesArray;
           if (namespacesIndex != PEG_NOT_FOUND)
         {         {
                 //l10n 485              CIMValue namespacesValue =
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,                  instanceObject.getProperty(namespacesIndex).getValue();
                 //"Missing Namespaces which is required property in PG_ProviderCapabilities class.");              if (!namespacesValue.isNull())
                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(              {
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.MISSING_NAMESPACES_IN_PG_PROVIDERCAPABILITIES",                  namespacesValue.get(namespacesArray);
                 "Missing Namespaces which is required property in PG_ProviderCapabilities class."));              }
         }         }
  
         if (instanceObject.findProperty(_PROPERTY_PROVIDERTYPE) == PEG_NOT_FOUND)          if (namespacesArray.size() == 0)
         {         {
                 //l10n 485  
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,  
                 //"Missing ProviderType which is required property in PG_ProviderCapabilities class.");  
                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.MISSING_PROVIDERTYPE_IN_PG_PROVIDERCAPABILITIES",                  "ControlProviders.ProviderRegistrationProvider."
                 "Missing ProviderType which is required property in PG_ProviderCapabilities class."));                      "ProviderRegistrationProvider."
                       "MISSING_NAMESPACES_IN_PG_PROVIDERCAPABILITIES",
                   "Missing Namespaces which is required property in "
                       "PG_ProviderCapabilities class."));
           }
   
           // Validate the ProviderType property
   
           Uint32 providerTypeIndex =
               instanceObject.findProperty(_PROPERTY_PROVIDERTYPE);
           Array<Uint16> providerTypeArray;
           if (providerTypeIndex != PEG_NOT_FOUND)
           {
               CIMValue providerTypeValue =
                   instanceObject.getProperty(providerTypeIndex).getValue();
               if (!providerTypeValue.isNull())
               {
                   providerTypeValue.get(providerTypeArray);
               }
           }
   
           if (providerTypeArray.size() == 0)
           {
               throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,
                   MessageLoaderParms(
                       "ControlProviders.ProviderRegistrationProvider."
                           "ProviderRegistrationProvider."
                           "MISSING_PROVIDERTYPE_IN_PG_PROVIDERCAPABILITIES",
                       "Missing ProviderType which is required property in "
                           "PG_ProviderCapabilities class."));
           }
   
           for (Uint32 i = 0; i < providerTypeArray.size(); i++)
           {
               if ((providerTypeArray[i] < 2) ||
   #ifdef PEGASUS_DISABLE_EXECQUERY
                   (providerTypeArray[i] > 6)
   #else
                   (providerTypeArray[i] > 7)
   #endif
                                             )
               {
                   throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,
                       MessageLoaderParms(
                           "ControlProviders.ProviderRegistrationProvider."
                               "ProviderRegistrationProvider.UNSUPPORTED_"
                               "PROVIDERTYPE_IN_PG_PROVIDERCAPABILITIES",
                           "Unsupported ProviderType value \"$0\" in "
                               "PG_ProviderCapabilities instance.",
                           providerTypeArray[i]));
               }
         }         }
     }     }
     else if (className.equal (PEGASUS_CLASSNAME_CONSUMERCAPABILITIES))     else if (className.equal (PEGASUS_CLASSNAME_CONSUMERCAPABILITIES))
Line 586 
Line 699 
         if (instanceObject.findProperty(_PROPERTY_PROVIDERMODULENAME) ==         if (instanceObject.findProperty(_PROPERTY_PROVIDERMODULENAME) ==
             PEG_NOT_FOUND)             PEG_NOT_FOUND)
         {         {
 //L10N_ TODO DONE  
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,  
                 //"Missing ProviderModuleName which is required property in PG_ConsumerCapabilities class.");  
             MessageLoaderParms parms(             MessageLoaderParms parms(
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.MISSING_PROVIDER_MODULE_NAME_WHICH_IS_REQUIRED",                  "ControlProviders.ProviderRegistrationProvider."
                 "Missing ProviderModuleName which is required property in PG_ConsumerCapabilities class.");                      "ProviderRegistrationProvider."
                       "MISSING_PROVIDER_MODULE_NAME_WHICH_IS_REQUIRED",
                   "Missing ProviderModuleName which is required property in"
                       " PG_ConsumerCapabilities class.");
  
             throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms);             throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms);
         }         }
Line 599 
Line 712 
         if (instanceObject.findProperty(_PROPERTY_PROVIDERNAME) ==         if (instanceObject.findProperty(_PROPERTY_PROVIDERNAME) ==
             PEG_NOT_FOUND)             PEG_NOT_FOUND)
         {         {
 //L10N_ TODO DONE  
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,  
                 //"Missing ProviderName which is required property in PG_ConsumerCapabilities class.");  
  
             MessageLoaderParms parms(             MessageLoaderParms parms(
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.MISSING_PROVIDER_NAME_WHICH_IS_REQUIRED",                  "ControlProviders.ProviderRegistrationProvider."
                 "Missing ProviderName which is required property in PG_ConsumerCapabilities class.");                      "ProviderRegistrationProvider."
                       "MISSING_PROVIDER_NAME_WHICH_IS_REQUIRED",
                   "Missing ProviderName which is required property in"
                       " PG_ConsumerCapabilities class.");
  
             throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms);             throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms);
         }         }
Line 613 
Line 726 
         if (instanceObject.findProperty(_PROPERTY_CAPABILITYID) ==         if (instanceObject.findProperty(_PROPERTY_CAPABILITYID) ==
             PEG_NOT_FOUND)             PEG_NOT_FOUND)
         {         {
 //L10N_ TODO DONE  
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,  
                 //"Missing CapabilityID which is required property in PG_ConsumerCapabilities class.");  
  
             MessageLoaderParms parms(             MessageLoaderParms parms(
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.MISSING_CAPABILITY_ID_WHICH_IS_REQUIRED",                  "ControlProviders.ProviderRegistrationProvider."
                 "Missing CapabilityID which is required property in PG_ConsumerCapabilities class.");                      "ProviderRegistrationProvider."
                       "MISSING_CAPABILITY_ID_WHICH_IS_REQUIRED",
                   "Missing CapabilityID which is required property in"
                       " PG_ConsumerCapabilities class.");
  
             throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms);             throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms);
         }         }
  
         if (instanceObject.findProperty(_PROPERTY_PROVIDERTYPE) == PEG_NOT_FOUND)          if (instanceObject.findProperty
               (_PROPERTY_PROVIDERTYPE) == PEG_NOT_FOUND)
         {         {
 //L10N_ TODO DONE  
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,  
                 //"Missing ProviderType which is required property in PG_ConsumerCapabilities class.");  
  
             MessageLoaderParms parms(             MessageLoaderParms parms(
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.MISSING_PROVIDER_TYPE_WHICH_IS_REQUIRED",                  "ControlProviders.ProviderRegistrationProvider."
                 "Missing ProviderType which is required property in PG_ConsumerCapabilities class.");                      "ProviderRegistrationProvider."
                       "MISSING_PROVIDER_TYPE_WHICH_IS_REQUIRED",
                   "Missing ProviderType which is required property in"
                       " PG_ConsumerCapabilities class.");
  
             throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms);             throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms);
         }         }
Line 640 
Line 754 
         if (instanceObject.findProperty(_PROPERTY_INDICATIONDESTINATIONS) ==         if (instanceObject.findProperty(_PROPERTY_INDICATIONDESTINATIONS) ==
             PEG_NOT_FOUND)             PEG_NOT_FOUND)
         {         {
 //L10N_ TODO DONE  
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,  
                 //"Missing Destinations which is required property in PG_ConsumerCapabilities class.");  
  
             MessageLoaderParms parms(             MessageLoaderParms parms(
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.MISSING_DESTINATIONS_TYPE_WHICH_IS_REQUIRED",                  "ControlProviders.ProviderRegistrationProvider."
                 "Missing Destinations which is required property in PG_ConsumerCapabilities class.");                      "ProviderRegistrationProvider."
                       "MISSING_DESTINATIONS_TYPE_WHICH_IS_REQUIRED",
                   "Missing Destinations which is required property in"
                       " PG_ConsumerCapabilities class.");
  
             throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms);             throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms);
         }         }
Line 656 
Line 770 
         //         //
         // Name and ProviderModuleName properties must be set         // Name and ProviderModuleName properties must be set
         //         //
         if (instanceObject.findProperty(_PROPERTY_PROVIDER_NAME) == PEG_NOT_FOUND)          if (instanceObject.findProperty
                   (_PROPERTY_PROVIDER_NAME) == PEG_NOT_FOUND)
         {         {
                 //l10n 485  
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,  
                 //"Missing Name which is required property in PG_Provider class.");  
                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.MISSING_REQUIRED_PROPERTY",                  "ControlProviders.ProviderRegistrationProvider."
                 "Missing Name which is required property in PG_Provider class."));                      "ProviderRegistrationProvider.MISSING_REQUIRED_PROPERTY",
                   "Missing Name which is required property in"
                       " PG_Provider class."));
         }         }
  
         if (instanceObject.findProperty(_PROPERTY_PROVIDERMODULENAME) ==         if (instanceObject.findProperty(_PROPERTY_PROVIDERMODULENAME) ==
             PEG_NOT_FOUND)             PEG_NOT_FOUND)
         {         {
                 //l10n 485  
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,  
                 //"Missing ProviderModuleName which is required property in PG_Provider class.");  
                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.MISSING_PROVIDERMODULENAME_IN_PG_PROVIDER",                  "ControlProviders.ProviderRegistrationProvider."
                 "Missing ProviderModuleName which is required property in PG_Provider class."));                      "ProviderRegistrationProvider."
                       "MISSING_PROVIDERMODULENAME_IN_PG_PROVIDER",
                   "Missing ProviderModuleName which is required property in"
                       " PG_Provider class."));
         }         }
     }     }
  
Line 684 
Line 798 
     try     try
     {     {
         returnReference =         returnReference =
             _providerRegistrationManager->createInstance(instanceReference, instance);              _providerRegistrationManager->createInstance(instanceReference,
                       instance);
     }     }
     catch(CIMException& e)      catch(const CIMException&)
     {     {
         throw (e);          throw;
     }     }
  
     handler.deliver(returnReference);     handler.deliver(returnReference);
Line 717 
Line 832 
  
     if ((userName != String::EMPTY) && !System::isPrivilegedUser(userName))     if ((userName != String::EMPTY) && !System::isPrivilegedUser(userName))
     {     {
         //l10n  
         //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_ACCESS_DENIED,  
             //"You must have superuser privilege to unregister providers.");  
             throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_ACCESS_DENIED,MessageLoaderParms(             throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_ACCESS_DENIED,MessageLoaderParms(
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.SUPERUSER_PRIVILEGE_REQUIRED_UNREGISTER_PROVIDERS",              "ControlProviders.ProviderRegistrationProvider."
                   "ProviderRegistrationProvider."
                   "SUPERUSER_PRIVILEGE_REQUIRED_UNREGISTER_PROVIDERS",
             "You must have superuser privilege to unregister providers."));             "You must have superuser privilege to unregister providers."));
     }     }
  
Line 732 
Line 846 
     }     }
  
  
 // l10n      AcceptLanguageList al;
     // Get the client's list of preferred languages for the response  
     AcceptLanguages al = AcceptLanguages::EMPTY;  
     try     try
     {     {
         AcceptLanguageListContainer al_container =         AcceptLanguageListContainer al_container =
                 (AcceptLanguageListContainer)context.get(AcceptLanguageListContainer::NAME);                  (AcceptLanguageListContainer)context.get
                   (AcceptLanguageListContainer::NAME);
         al = al_container.getLanguages();         al = al_container.getLanguages();
     }     }
     catch (...)     catch (...)
     {     {
         ;   // Leave AcceptLanguages empty          ;   // Leave AcceptLanguageList empty
     }     }
  
     CIMName className = instanceReference.getClassName();     CIMName className = instanceReference.getClassName();
Line 785 
Line 898 
         // if _PROPERTY_PROVIDERMODULENAME key not found         // if _PROPERTY_PROVIDERMODULENAME key not found
         if( !moduleFound)         if( !moduleFound)
         {         {
                 //l10n 485              throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED,
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED,                      MessageLoaderParms(
                 //"key ProviderModuleName was not found");                  "ControlProviders.ProviderRegistrationProvider."
                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED,MessageLoaderParms(                      "ProviderRegistrationProvider."
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.PROVIDERMODULENAME_KEY_NOT_FOUND",                      "PROVIDERMODULENAME_KEY_NOT_FOUND",
                 "key ProviderModuleName was not found"));                 "key ProviderModuleName was not found"));
         }         }
  
Line 798 
Line 911 
         //         //
         try         try
         {         {
              Sint16 ret_value = _disableModule(instanceReference, moduleName, true, al);               Sint16 ret_value = _disableModule(instanceReference,
                        moduleName, true, al);
  
              //              //
              // if the provider disable failed              // if the provider disable failed
Line 806 
Line 920 
 // l10n // l10n
              if (ret_value == -1)              if (ret_value == -1)
              {              {
                 //l10n                   throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,
                  //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,                           MessageLoaderParms(
                      //"disable the provider failed.");                       "ControlProviders.ProviderRegistrationProvider."
                  throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(                           "ProviderRegistrationProvider."
                                         "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.DISABLE_PROVIDER_FAILED",                           "DISABLE_PROVIDER_FAILED",
                     "disable the provider failed."));                     "disable the provider failed."));
              }              }
              //              //
Line 818 
Line 932 
              //              //
              if (ret_value == -2)              if (ret_value == -2)
              {              {
 //L10N TODO                   throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,
                 // throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,                      MessageLoaderParms(
                      //"disable the provider failed: Provider is busy.");                      "ControlProviders.ProviderRegistrationProvider."
                  throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(                          "ProviderRegistrationProvider."
                                         "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.DISABLE_PROVIDER_FAILED_PROVIDER_BUSY",                          "DISABLE_PROVIDER_FAILED_PROVIDER_BUSY",
                     "disable the provider failed: Provider is busy."));                     "disable the provider failed: Provider is busy."));
              }              }
         }         }
Line 853 
Line 967 
         // if _PROPERTY_PROVIDERMODULE_NAME key not found         // if _PROPERTY_PROVIDERMODULE_NAME key not found
         if( !moduleFound)         if( !moduleFound)
         {         {
                 //l10n 485              throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED,
         //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED,                  MessageLoaderParms(
                 //"key Name was not found");                  "ControlProviders.ProviderRegistrationProvider."
                 throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED,MessageLoaderParms(                  "ProviderRegistrationProvider.NAME_KEY_NOT_FOUND",
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.NAME_KEY_NOT_FOUND",  
                 "key Name was not found"));                 "key Name was not found"));
         }         }
  
Line 866 
Line 979 
         //         //
         try         try
         {         {
             Sint16 ret_value = _disableModule(instanceReference, moduleName, false, al);              Sint16 ret_value = _disableModule(instanceReference,
                       moduleName, false, al);
  
             //             //
             // if the provider module disable failed             // if the provider module disable failed
Line 874 
Line 988 
 // l10n // l10n
             if (ret_value == -1)             if (ret_value == -1)
             {             {
                 //l10n  
                  //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,  
                      //"disable the provider module failed.");  
                      throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(                      throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(
                                                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.DISABLE_PROVIDER_MODULE_FAILED",                      "ControlProviders.ProviderRegistrationProvider."
                           "ProviderRegistrationProvider."
                           "DISABLE_PROVIDER_MODULE_FAILED",
                         "disable the provider module failed."));                         "disable the provider module failed."));
             }             }
  
             //             //
             // The provider module disable failed since there are pending requests              // The provider module disable failed since there are
               // pending requests
             //             //
             if (ret_value == -2)             if (ret_value == -2)
             {             {
 //L10N TODO  
                  //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,  
                     // "disable the provider module failed: Provider is busy.");  
                  throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(                  throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED,MessageLoaderParms(
                                                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.DISABLE_PROVIDER_MODULE_FAILED_PROVIDER_BUSY",                      "ControlProviders.ProviderRegistrationProvider."
                           "ProviderRegistrationProvider."
                           "DISABLE_PROVIDER_MODULE_FAILED_PROVIDER_BUSY",
                         "disable the provider module failed: Provider is busy."));                         "disable the provider module failed: Provider is busy."));
             }             }
         }         }
         catch(CIMException& e)          catch(const CIMException&)
         {         {
             throw (e);              throw;
         }         }
     }     }
  
Line 905 
Line 1018 
     {     {
         _providerRegistrationManager->deleteInstance(instanceReference);         _providerRegistrationManager->deleteInstance(instanceReference);
     }     }
     catch(CIMException& e)      catch(const CIMException&)
     {     {
         throw (e);          throw;
     }     }
  
     // complete processing the request     // complete processing the request
Line 936 
Line 1049 
  
     if ((userName != String::EMPTY) && !System::isPrivilegedUser(userName))     if ((userName != String::EMPTY) && !System::isPrivilegedUser(userName))
     {     {
         //l10n          throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_ACCESS_DENIED,
         //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_ACCESS_DENIED,              MessageLoaderParms(
             //"You must have superuser privilege to disable or enable providers.");              "ControlProviders.ProviderRegistrationProvider."
             throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_ACCESS_DENIED,MessageLoaderParms(                  "ProviderRegistrationProvider."
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.SUPERUSER_PRIVILEGE_REQUIRED_DISABLE_ENABLE_PROVIDERS",                  "SUPERUSER_PRIVILEGE_REQUIRED_DISABLE_ENABLE_PROVIDERS",
             "You must have superuser privilege to disable or enable providers."));              "You must have superuser privilege to disable or enable"
                   " providers."));
     }     }
  
     if(!objectReference.getNameSpace().equal (PEGASUS_NAMESPACENAME_INTEROP))     if(!objectReference.getNameSpace().equal (PEGASUS_NAMESPACENAME_INTEROP))
Line 953 
Line 1067 
  
 // l10n // l10n
     // Get the client's list of preferred languages for the response     // Get the client's list of preferred languages for the response
     AcceptLanguages al = AcceptLanguages::EMPTY;      AcceptLanguageList al;
     try     try
     {     {
         AcceptLanguageListContainer al_container =         AcceptLanguageListContainer al_container =
                 (AcceptLanguageListContainer)context.get(AcceptLanguageListContainer::NAME);                  (AcceptLanguageListContainer)context.get
                   (AcceptLanguageListContainer::NAME);
         al = al_container.getLanguages();         al = al_container.getLanguages();
     }     }
     catch (...)     catch (...)
     {     {
         ;   // Leave AcceptLanguages empty          ;   // Leave AcceptLanguageList empty
     }     }
  
     String moduleName;     String moduleName;
Line 983 
Line 1098 
     // if _PROPERTY_PROVIDERMODULE_NAME key not found     // if _PROPERTY_PROVIDERMODULE_NAME key not found
     if( !moduleFound)     if( !moduleFound)
     {     {
         //l10n 485  
         throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED,MessageLoaderParms(         throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED,MessageLoaderParms(
                 "ControlProviders.ProviderRegistrationProvider.ProviderRegistrationProvider.NAME_KEY_NOT_FOUND",                  "ControlProviders.ProviderRegistrationProvider."
                       "ProviderRegistrationProvider.NAME_KEY_NOT_FOUND",
                 "key Name was not found"));                 "key Name was not found"));
     }     }
  
Line 998 
Line 1113 
         if(methodName.equal(_STOP_PROVIDER))         if(methodName.equal(_STOP_PROVIDER))
         {         {
             // disable module             // disable module
              ret_value =  _disableModule(objectReference, moduleName, false, al);               ret_value =  _disableModule(objectReference,
                                            moduleName, false, al);
         }         }
         else if(methodName.equal(_START_PROVIDER))         else if(methodName.equal(_START_PROVIDER))
         {         {
Line 1007 
Line 1123 
         }         }
         else         else
         {         {
             throw PEGASUS_CIM_EXCEPTION(CIM_ERR_METHOD_NOT_AVAILABLE, String::EMPTY);              throw PEGASUS_CIM_EXCEPTION(CIM_ERR_METHOD_NOT_AVAILABLE,
                       String::EMPTY);
         }         }
     }     }
     catch(CIMException& e)      catch(const CIMException&)
     {     {
         throw (e);          throw;
     }     }
  
     CIMValue retValue(ret_value);     CIMValue retValue(ret_value);
     handler.deliver(retValue);     handler.deliver(retValue);
     handler.complete();     handler.complete();
     return;  
 } }
  
 // get provider manager service // get provider manager service
 MessageQueueService * ProviderRegistrationProvider::_getProviderManagerService() MessageQueueService * ProviderRegistrationProvider::_getProviderManagerService()
 { {
     MessageQueue * queue = MessageQueue::lookup(PEGASUS_QUEUENAME_PROVIDERMANAGER_CPP);      MessageQueue * queue =
           MessageQueue::lookup(PEGASUS_QUEUENAME_PROVIDERMANAGER_CPP);
     MessageQueueService * _service = dynamic_cast<MessageQueueService *>(queue);     MessageQueueService * _service = dynamic_cast<MessageQueueService *>(queue);
  
     return(_service);     return(_service);
 } }
  
 ProviderRegistrationProvider & ProviderRegistrationProvider::operator=(const ProviderRegistrationProvider & handle)  ProviderRegistrationProvider & ProviderRegistrationProvider::operator=
       (const ProviderRegistrationProvider & handle)
 { {
     if(this == &handle)     if(this == &handle)
     {     {
Line 1040 
Line 1158 
     return(*this);     return(*this);
 } }
  
 Array<Uint16> ProviderRegistrationProvider::_sendDisableMessageToProviderManager(  Array<Uint16>
       ProviderRegistrationProvider::_sendDisableMessageToProviderManager(
         CIMDisableModuleRequestMessage * disable_req)         CIMDisableModuleRequestMessage * disable_req)
 { {
     MessageQueueService * _service = _getProviderManagerService();     MessageQueueService * _service = _getProviderManagerService();
     Uint32 _queueId = _service->getQueueId();     Uint32 _queueId = _service->getQueueId();
  
     callback_data *cb_data = new callback_data(this);  
   
     // create request envelope     // create request envelope
     AsyncLegacyOperationStart * asyncRequest =     AsyncLegacyOperationStart * asyncRequest =
         new AsyncLegacyOperationStart (         new AsyncLegacyOperationStart (
             _service->get_next_xid(),  
             NULL,             NULL,
             _queueId,             _queueId,
             disable_req,             disable_req,
             _queueId);             _queueId);
  
     AsyncReply * asyncReply = _controller->ClientSendWait(*_client_handle,      AsyncReply * asyncReply =
                                                           _queueId,          _controller->ClientSendWait(_queueId, asyncRequest);
                                                           asyncRequest);  
     CIMDisableModuleResponseMessage * response =     CIMDisableModuleResponseMessage * response =
         reinterpret_cast<CIMDisableModuleResponseMessage *>(         reinterpret_cast<CIMDisableModuleResponseMessage *>(
              (static_cast<AsyncLegacyOperationResult *>(asyncReply))->get_result());               (dynamic_cast<AsyncLegacyOperationResult
                     *>(asyncReply))->get_result());
     if (response->cimException.getCode() != CIM_ERR_SUCCESS)     if (response->cimException.getCode() != CIM_ERR_SUCCESS)
     {     {
         CIMException e = response->cimException;         CIMException e = response->cimException;
         delete asyncRequest;         delete asyncRequest;
         delete asyncReply;         delete asyncReply;
         delete response;         delete response;
         throw (e);          throw e;
     }     }
  
     Array<Uint16> operationalStatus = response->operationalStatus;     Array<Uint16> operationalStatus = response->operationalStatus;
Line 1087 
Line 1203 
     MessageQueueService * _service = _getProviderManagerService();     MessageQueueService * _service = _getProviderManagerService();
     Uint32 _queueId = _service->getQueueId();     Uint32 _queueId = _service->getQueueId();
  
     callback_data *cb_data = new callback_data(this);  
   
     // create request envelope     // create request envelope
     AsyncLegacyOperationStart * asyncRequest =     AsyncLegacyOperationStart * asyncRequest =
         new AsyncLegacyOperationStart (         new AsyncLegacyOperationStart (
             _service->get_next_xid(),  
             NULL,             NULL,
             _queueId,             _queueId,
             enable_req,             enable_req,
             _queueId);             _queueId);
  
     AsyncReply * asyncReply = _controller->ClientSendWait(*_client_handle,      AsyncReply * asyncReply =
                                                           _queueId,          _controller->ClientSendWait(_queueId, asyncRequest);
                                                           asyncRequest);  
     CIMEnableModuleResponseMessage * response =     CIMEnableModuleResponseMessage * response =
         reinterpret_cast<CIMEnableModuleResponseMessage *>(         reinterpret_cast<CIMEnableModuleResponseMessage *>(
              (static_cast<AsyncLegacyOperationResult *>(asyncReply))->get_result());               (dynamic_cast<AsyncLegacyOperationResult
                     *>(asyncReply))->get_result());
     if (response->cimException.getCode() != CIM_ERR_SUCCESS)     if (response->cimException.getCode() != CIM_ERR_SUCCESS)
     {     {
         CIMException e = response->cimException;         CIMException e = response->cimException;
Line 1126 
Line 1239 
 void ProviderRegistrationProvider::_sendTerminationMessageToSubscription( void ProviderRegistrationProvider::_sendTerminationMessageToSubscription(
     const CIMObjectPath & ref, const String & moduleName,     const CIMObjectPath & ref, const String & moduleName,
     const Boolean disableProviderOnly,     const Boolean disableProviderOnly,
     const AcceptLanguages & al)      const AcceptLanguageList & al)
 { {
     CIMInstance instance;     CIMInstance instance;
     String _moduleName;     String _moduleName;
Line 1138 
Line 1251 
             PEGASUS_CLASSNAME_PROVIDER, ref.getKeyBindings());             PEGASUS_CLASSNAME_PROVIDER, ref.getKeyBindings());
  
         Array<CIMObjectPath> instanceNames =         Array<CIMObjectPath> instanceNames =
             _providerRegistrationManager->enumerateInstanceNames(reference);              _providerRegistrationManager->enumerateInstanceNamesForClass(
                   reference);
  
         // find all the instances which have same module name as moduleName         // find all the instances which have same module name as moduleName
         for (Uint32 i = 0, n=instanceNames.size(); i < n; i++)         for (Uint32 i = 0, n=instanceNames.size(); i < n; i++)
Line 1164 
Line 1278 
                 //                 //
                 // if the provider is indication provider                 // if the provider is indication provider
                 //                 //
                 if (_isIndicationProvider(moduleName, instance, reference))                  if (_isIndicationProvider(moduleName, instance))
                 {                 {
                     instances.append(instance);                     instances.append(instance);
                 }                 }
Line 1178 
Line 1292 
         //         //
         // if the provider is indication provider         // if the provider is indication provider
         //         //
         if (_isIndicationProvider(moduleName, instance, ref))          if (_isIndicationProvider(moduleName, instance))
         {         {
             instances.append(instance);             instances.append(instance);
         }         }
Line 1200 
Line 1314 
                 QueueIdStack(_service->getQueueId()));                 QueueIdStack(_service->getQueueId()));
  
 // l10n // l10n
         termination_req->acceptLanguages = al;          termination_req->operationContext.set(AcceptLanguageListContainer(al));
  
         // create request envelope         // create request envelope
         AsyncLegacyOperationStart * asyncRequest =          AsyncLegacyOperationStart asyncRequest(
             new AsyncLegacyOperationStart (  
                 _service->get_next_xid(),  
                 NULL,                 NULL,
                 _queueId,                 _queueId,
                 termination_req,                 termination_req,
                 _queueId);                 _queueId);
  
         if( false  == _controller->ClientSendForget(          AutoPtr <AsyncReply> asyncReply(
                            *_client_handle,              _controller->ClientSendWait(_queueId, &asyncRequest));
                            _queueId,  
                            asyncRequest))          AutoPtr <CIMNotifyProviderTerminationResponseMessage> response
               (reinterpret_cast <CIMNotifyProviderTerminationResponseMessage *>
               ((dynamic_cast <AsyncLegacyOperationResult *>
               (asyncReply.get ()))->get_result ()));
   
           if (response->cimException.getCode () != CIM_ERR_SUCCESS)
         {         {
             delete asyncRequest;              CIMException e = response->cimException;
             throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_FOUND, String::EMPTY);              throw e;
         }         }
     }     }
 } }
Line 1240 
Line 1357 
     const CIMObjectPath & objectReference,     const CIMObjectPath & objectReference,
     const String & moduleName,     const String & moduleName,
     Boolean disableProviderOnly,     Boolean disableProviderOnly,
     const AcceptLanguages & al)         // l10n      const AcceptLanguageList & al)
 { {
         //         //
         // get module status         // get module status
Line 1251 
Line 1368 
         for (Uint32 i = 0; i<_OperationalStatus.size(); i++)         for (Uint32 i = 0; i<_OperationalStatus.size(); i++)
         {         {
             // retValue equals 1 if module is already disabled             // retValue equals 1 if module is already disabled
             if (_OperationalStatus[i] == _MODULE_STOPPED ||              if (_OperationalStatus[i] == CIM_MSE_OPSTATUS_VALUE_STOPPED ||
                 _OperationalStatus[i] == _MODULE_STOPPING)                  _OperationalStatus[i] == CIM_MSE_OPSTATUS_VALUE_STOPPING)
             {             {
                 return (1);                 return (1);
             }             }
Line 1262 
Line 1379 
         Array<CIMInstance> instances;         Array<CIMInstance> instances;
         CIMInstance mInstance;         CIMInstance mInstance;
         String _moduleName;         String _moduleName;
         Uint16 providers;  
         CIMObjectPath providerRef;         CIMObjectPath providerRef;
         Boolean indProvider = false;         Boolean indProvider = false;
         Array<Boolean> indicationProviders;         Array<Boolean> indicationProviders;
Line 1302 
Line 1418 
             // get all provider instances which have same module name as             // get all provider instances which have same module name as
             // moduleName             // moduleName
             Array<CIMObjectPath> instanceNames =             Array<CIMObjectPath> instanceNames =
                 _providerRegistrationManager->enumerateInstanceNames(providerRef);                  _providerRegistrationManager->enumerateInstanceNamesForClass(
                       providerRef);
  
             for(Uint32 i = 0, n=instanceNames.size(); i < n; i++)             for(Uint32 i = 0, n=instanceNames.size(); i < n; i++)
             {             {
Line 1325 
Line 1442 
                     providerRef.setKeyBindings(keys);                     providerRef.setKeyBindings(keys);
                     instance = _providerRegistrationManager->getInstance                     instance = _providerRegistrationManager->getInstance
                         (providerRef);                         (providerRef);
                     if (_isIndicationProvider(moduleName, instance, providerRef))                      if (_isIndicationProvider(moduleName, instance))
                     {                     {
                         indProvider = true;                         indProvider = true;
                         indicationProviders.append(true);                         indicationProviders.append(true);
Line 1341 
Line 1458 
         }         }
         else         else
         {         {
             instance = _providerRegistrationManager->getInstance(objectReference);              instance =
             if (_isIndicationProvider(moduleName, instance, objectReference))                  _providerRegistrationManager->getInstance(objectReference);
               if (_isIndicationProvider(moduleName, instance))
             {             {
                 indProvider = true;                 indProvider = true;
                 indicationProviders.append(true);                 indicationProviders.append(true);
Line 1372 
Line 1490 
                     indicationProviders,                     indicationProviders,
                     QueueIdStack(_service->getQueueId()));                     QueueIdStack(_service->getQueueId()));
 // l10n // l10n
             disable_req->acceptLanguages = al;                  disable_req->operationContext.set
                       (AcceptLanguageListContainer(al));;
  
             Array<Uint16> _opStatus =             Array<Uint16> _opStatus =
                 _sendDisableMessageToProviderManager(disable_req);                 _sendDisableMessageToProviderManager(disable_req);
Line 1382 
Line 1501 
                 for (Uint32 i = 0; i<_opStatus.size(); i++)                 for (Uint32 i = 0; i<_opStatus.size(); i++)
                 {                 {
                     // module was disabled successfully                     // module was disabled successfully
                     if (_opStatus[i] == _MODULE_STOPPED)                      if (_opStatus[i] == CIM_MSE_OPSTATUS_VALUE_STOPPED)
                     {                     {
                         if (indProvider)                         if (indProvider)
                         {                         {
                             // send termination message to subscription service                             // send termination message to subscription service
                             _sendTerminationMessageToSubscription(objectReference,                              _sendTerminationMessageToSubscription(
                                   moduleName, false, al);                                  objectReference, moduleName, false, al);
                         }                         }
                         return (0);                         return (0);
                     }                     }
  
                     // module is not disabled since there are pending                     // module is not disabled since there are pending
                     // requests for the providers in the module                     // requests for the providers in the module
                     if (_opStatus[i] == _MODULE_OK)                      if (_opStatus[i] == CIM_MSE_OPSTATUS_VALUE_OK)
                     {                     {
                         return (-2);                         return (-2);
                     }                     }
Line 1424 
Line 1543 
 Sint16 ProviderRegistrationProvider::_enableModule( Sint16 ProviderRegistrationProvider::_enableModule(
     const CIMObjectPath & moduleRef,     const CIMObjectPath & moduleRef,
     const String & moduleName,     const String & moduleName,
     const AcceptLanguages & al)      const AcceptLanguageList & al)
 { {
         //         //
         // get module status         // get module status
Line 1435 
Line 1554 
         for (Uint32 i = 0; i<_OperationalStatus.size(); i++)         for (Uint32 i = 0; i<_OperationalStatus.size(); i++)
         {         {
             // retValue equals 1 if module is already enabled             // retValue equals 1 if module is already enabled
             if (_OperationalStatus[i] == _MODULE_OK)              if (_OperationalStatus[i] == CIM_MSE_OPSTATUS_VALUE_OK)
             {             {
                 return (1);                 return (1);
             }             }
  
             // retValue equals 2 if module is stopping             // retValue equals 2 if module is stopping
             // at this stage, module can not be started             // at this stage, module can not be started
             if (_OperationalStatus[i] == _MODULE_STOPPING)              if (_OperationalStatus[i] == CIM_MSE_OPSTATUS_VALUE_STOPPING)
             {             {
                 return (2);                 return (2);
             }             }
Line 1466 
Line 1585 
                     XmlWriter::getNextMessageId (),                     XmlWriter::getNextMessageId (),
                     mInstance,                     mInstance,
                     QueueIdStack(_service->getQueueId()));                     QueueIdStack(_service->getQueueId()));
 // l10n  
             enable_req->acceptLanguages = al;              enable_req->operationContext.set(AcceptLanguageListContainer(al));;
  
             Array<Uint16> _opStatus;             Array<Uint16> _opStatus;
             _opStatus = _sendEnableMessageToProviderManager(enable_req);             _opStatus = _sendEnableMessageToProviderManager(enable_req);
Line 1475 
Line 1594 
             for (Uint32 i = 0; i<_opStatus.size(); i++)             for (Uint32 i = 0; i<_opStatus.size(); i++)
             {             {
                 // module is enabled successfully                 // module is enabled successfully
                 if (_opStatus[i] == _MODULE_OK)                  if (_opStatus[i] == CIM_MSE_OPSTATUS_VALUE_OK)
                 {                 {
                     enabled = true;                     enabled = true;
                 }                 }
Line 1485 
Line 1604 
         if (enabled)         if (enabled)
         {         {
             //             //
             // if the module is enabled, need to send enable message to              // Since module is enabled, need get updated module instance
               //
               CIMInstance updatedModuleInstance =
                   _providerRegistrationManager->getInstance(moduleRef);
   
               // module is enabled, initialize providers as necessary
               _providerRegistrationManager->initializeProviders(
                   updatedModuleInstance);
   
               //
               // The module is enabled, need to send enable message to
             // subscription service if the provider is an indication provider             // subscription service if the provider is an indication provider
             //             //
  
Line 1499 
Line 1628 
             // moduleName             // moduleName
             //             //
             Array<CIMObjectPath> instanceNames =             Array<CIMObjectPath> instanceNames =
                 _providerRegistrationManager->enumerateInstanceNames(providerRef);                  _providerRegistrationManager->enumerateInstanceNamesForClass(
                       providerRef);
             CIMInstance pInstance;             CIMInstance pInstance;
             String _moduleName;             String _moduleName;
             String _providerName;             String _providerName;
Line 1535 
Line 1665 
                     pInstance = _providerRegistrationManager->getInstance                     pInstance = _providerRegistrationManager->getInstance
                         (providerRef);                         (providerRef);
                     //                     //
                     // get all the indication capability instances which belongs                      // get all the indication capability instances which
                     // to this provider                      // belongs to this provider
                     //                     //
                     capInstances = _getIndicationCapInstances(                     capInstances = _getIndicationCapInstances(
                                    moduleName, pInstance, providerRef);                                    moduleName, pInstance, providerRef);
Line 1546 
Line 1676 
                     //                     //
                     if (capInstances.size() != 0)                     if (capInstances.size() != 0)
                     {                     {
                         _sendEnableMessageToSubscription(mInstance,                          _sendEnableMessageToSubscription(updatedModuleInstance,
                                                          pInstance,                                                          pInstance,
                                                          capInstances,                                                          capInstances,
                                                          al);                                                          al);
Line 1566 
Line 1696 
     const CIMInstance & mInstance,     const CIMInstance & mInstance,
     const CIMInstance & pInstance,     const CIMInstance & pInstance,
     const Array<CIMInstance> & capInstances,     const Array<CIMInstance> & capInstances,
     const AcceptLanguages & al)      const AcceptLanguageList & al)
 { {
     //     //
     // get indication server queueId     // get indication server queueId
Line 1580 
Line 1710 
         CIMNotifyProviderEnableRequestMessage * enable_req =         CIMNotifyProviderEnableRequestMessage * enable_req =
                 new CIMNotifyProviderEnableRequestMessage (                 new CIMNotifyProviderEnableRequestMessage (
                     XmlWriter::getNextMessageId (),                     XmlWriter::getNextMessageId (),
                     mInstance,  
                     pInstance,  
                     capInstances,                     capInstances,
                     QueueIdStack(_service->getQueueId()));                     QueueIdStack(_service->getQueueId()));
  
         enable_req->acceptLanguages = al;          enable_req->operationContext.set(AcceptLanguageListContainer(al));
       enable_req->operationContext.insert(ProviderIdContainer
                                           (mInstance,pInstance));
  
         // create request envelope         // create request envelope
         AsyncLegacyOperationStart * asyncRequest =         AsyncLegacyOperationStart * asyncRequest =
             new AsyncLegacyOperationStart (             new AsyncLegacyOperationStart (
                 _service->get_next_xid(),  
                 NULL,                 NULL,
                 _queueId,                 _queueId,
                 enable_req,                 enable_req,
                 _queueId);                 _queueId);
  
         if( false  == _controller->ClientSendForget(          AsyncReply * asyncReply =
                       *_client_handle,              _controller->ClientSendWait(_queueId, asyncRequest);
                       _queueId,  
                       asyncRequest))          CIMNotifyProviderEnableResponseMessage * response =
               reinterpret_cast<CIMNotifyProviderEnableResponseMessage *>(
                   (dynamic_cast<AsyncLegacyOperationResult *>
                       (asyncReply))->get_result());
   
           if (response->cimException.getCode() != CIM_ERR_SUCCESS)
         {         {
               CIMException e = response->cimException;
             delete asyncRequest;             delete asyncRequest;
             throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_FOUND, String::EMPTY);              delete asyncReply;
               delete response;
               throw e;
         }         }
  
           delete asyncRequest;
           delete asyncReply;
           delete response;
     }     }
 } }
  
 // If the provider is indication provider, return true,  // If provider is an indication provider, return true,
 // otherwise, return false // otherwise, return false
 Boolean ProviderRegistrationProvider::_isIndicationProvider( Boolean ProviderRegistrationProvider::_isIndicationProvider(
     const String & moduleName,     const String & moduleName,
     const CIMInstance & instance,      const CIMInstance & instance)
     const CIMObjectPath & providerRef)  
 { {
     // get provider name     // get provider name
     String providerName;     String providerName;
     Uint32 pos = instance.findProperty(CIMName (_PROPERTY_PROVIDER_NAME));      Uint32 pos = instance.findProperty(_PROPERTY_PROVIDER_NAME);
     if (pos != PEG_NOT_FOUND)     if (pos != PEG_NOT_FOUND)
     {     {
         instance.getProperty(pos).getValue().get(providerName);         instance.getProperty(pos).getValue().get(providerName);
     }     }
  
     CIMObjectPath capabilityRef;      return (_providerRegistrationManager->isIndicationProvider(
               moduleName, providerName));
     capabilityRef = CIMObjectPath(providerRef.getHost(),  
                                   providerRef.getNameSpace(),  
                                   PEGASUS_CLASSNAME_CAPABILITIESREGISTRATION,  
                                   providerRef.getKeyBindings());  
   
     // get all Capabilities instances  
     Array<CIMObjectPath> instanceNames =  
         _providerRegistrationManager->enumerateInstanceNames(capabilityRef);  
   
     //  
     // get provider module name and provider name from capability reference  
     //  
     String _moduleName, _providerName;  
     CIMInstance capInstance;  
     Array<Uint16> providerTypes;  
     for(Uint32 i = 0, n=instanceNames.size(); i < n; i++)  
     {  
         Array<CIMKeyBinding> keys = instanceNames[i].getKeyBindings();  
   
         for(Uint32 j=0; j < keys.size(); j++)  
         {  
              if(keys[j].getName().equal (_PROPERTY_PROVIDERMODULENAME))  
              {  
                   _moduleName = keys[j].getValue();  
              }  
   
              if(keys[j].getName().equal (_PROPERTY_PROVIDERNAME))  
              {  
                   _providerName = keys[j].getValue();  
              }  
   
              //  
              // if capability instance has same module name as moduleName  
              // and same provider name as providerName, get provider type  
              //  
              if(String::equal(_moduleName, moduleName) &&  
                 String::equal(_providerName, providerName))  
              {  
                   capInstance = _providerRegistrationManager->getInstance  
                                 (instanceNames[i]);  
   
                   Uint32 pos = capInstance.findProperty(CIMName (_PROPERTY_PROVIDERTYPE));  
                   if (pos != PEG_NOT_FOUND)  
                   {  
                        capInstance.getProperty(pos).getValue().get(providerTypes);  
   
                         for (Uint32 k=0; k < providerTypes.size(); k++)  
                         {  
                             if (providerTypes[k] == _INDICATION_PROVIDER)  
                             {  
                                 return (true);  
                             }  
                         }  
                   }  
              }  
         }  
     }  
   
     return (false);  
 } }
  
 // //
Line 1706 
Line 1786 
  
     capabilityRef = CIMObjectPath(providerRef.getHost(),     capabilityRef = CIMObjectPath(providerRef.getHost(),
                                   providerRef.getNameSpace(),                                   providerRef.getNameSpace(),
                                   PEGASUS_CLASSNAME_CAPABILITIESREGISTRATION,                                    PEGASUS_CLASSNAME_PROVIDERCAPABILITIES,
                                   providerRef.getKeyBindings());                                   providerRef.getKeyBindings());
  
     // get all Capabilities instances     // get all Capabilities instances
     Array<CIMObjectPath> instanceNames =     Array<CIMObjectPath> instanceNames =
         _providerRegistrationManager->enumerateInstanceNames(capabilityRef);          _providerRegistrationManager->enumerateInstanceNamesForClass(
               capabilityRef);
  
     String _moduleName, _providerName;     String _moduleName, _providerName;
     CIMInstance capInstance;     CIMInstance capInstance;
Line 1744 
Line 1825 
             capInstance = _providerRegistrationManager->getInstance             capInstance = _providerRegistrationManager->getInstance
                                 (instanceNames[i]);                                 (instanceNames[i]);
  
             Uint32 pos = capInstance.findProperty(CIMName (_PROPERTY_PROVIDERTYPE));              Uint32 pos = capInstance.findProperty(
                   CIMName (_PROPERTY_PROVIDERTYPE));
             if (pos != PEG_NOT_FOUND)             if (pos != PEG_NOT_FOUND)
             {             {
                 capInstance.getProperty(pos).getValue().get(providerTypes);                 capInstance.getProperty(pos).getValue().get(providerTypes);


Legend:
Removed from v.1.58  
changed lines
  Added in v.1.94

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2