(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.71 and 1.80

version 1.71, 2004/07/27 16:17:56 version 1.80, 2005/05/23 19:16:41
Line 1 
Line 1 
 //%2003////////////////////////////////////////////////////////////////////////  //%2005////////////////////////////////////////////////////////////////////////
 // //
 // 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.
 // //
 // 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 75 
Line 79 
  
 ProviderRegistrationProvider::~ProviderRegistrationProvider(void) ProviderRegistrationProvider::~ProviderRegistrationProvider(void)
 { {
     if (_providerRegistrationManager)  
     {  
         delete _providerRegistrationManager;  
     }  
   
     if (_client_handle)     if (_client_handle)
     {     {
         delete _client_handle;         delete _client_handle;
Line 95 
Line 94 
  
 void ProviderRegistrationProvider::terminate(void) void ProviderRegistrationProvider::terminate(void)
 { {
     // delete self. this is necessary because the entry point for this object allocated it, and
     // the module is responsible for its memory management.
     delete this;
 } }
  
 // get registered provider // get registered provider
Line 137 
Line 139 
                                                              includeClassOrigin,                                                              includeClassOrigin,
                                                              propertyList);                                                              propertyList);
     }     }
     catch(CIMException& e)      catch(const CIMException&)
     {     {
         throw (e);          throw;
     }     }
  
     handler.deliver(instance);     handler.deliver(instance);
Line 188 
Line 190 
                                                              includeClassOrigin,                                                              includeClassOrigin,
                                                              propertyList);                                                              propertyList);
     }     }
     catch(CIMException& e)      catch(const CIMException&)
     {     {
         throw (e);          throw;
     }     }
  
     handler.deliver(enumInstances);     handler.deliver(enumInstances);
Line 234 
Line 236 
         enumInstanceNames =         enumInstanceNames =
             _providerRegistrationManager->enumerateInstanceNames(classReference);             _providerRegistrationManager->enumerateInstanceNames(classReference);
     }     }
     catch(CIMException& e)      catch(const CIMException&)
     {     {
         throw (e);          throw;
     }     }
  
     handler.deliver(enumInstanceNames);     handler.deliver(enumInstanceNames);
Line 330 
Line 332 
                                                      includeQualifiers,                                                      includeQualifiers,
                                                      propertyArray);                                                      propertyArray);
     }     }
     catch(CIMException& e)      catch(const CIMException& e)
     {     {
         throw (e);          throw;
     }     }
  
     // complete processing the request     // complete processing the request
Line 448 
Line 450 
             get(ifcTypeString);             get(ifcTypeString);
  
         if (ifcTypeString != "C++Default"         if (ifcTypeString != "C++Default"
 #ifdef ENABLE_CMPI_PROVIDER_MANAGER  #ifdef PEGASUS_ENABLE_CMPI_PROVIDER_MANAGER
             && ifcTypeString != "CMPI"             && ifcTypeString != "CMPI"
 #endif #endif
                 )                 )
Line 476 
Line 478 
         instanceObject.getProperty(ifcVersionIndex).getValue().         instanceObject.getProperty(ifcVersionIndex).getValue().
             get(ifcVersionString);             get(ifcVersionString);
         if (         if (
 #ifdef ENABLE_CMPI_PROVIDER_MANAGER  #ifdef PEGASUS_ENABLE_CMPI_PROVIDER_MANAGER
            (ifcTypeString == "CMPI" &&            (ifcTypeString == "CMPI" &&
             ifcVersionString != "2.0.0") ||             ifcVersionString != "2.0.0") ||
 #endif #endif
            (ifcTypeString == "C++Default" &&            (ifcTypeString == "C++Default" &&
             ifcVersionString != "2.1.0" &&             ifcVersionString != "2.1.0" &&
             ifcVersionString != "2.2.0" &&             ifcVersionString != "2.2.0" &&
             ifcVersionString != "2.3.0"))              ifcVersionString != "2.3.0" &&
               ifcVersionString != "2.5.0"))
         {         {
                 //l10n 485                 //l10n 485
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED,             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED,
Line 513 
Line 516 
             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 (!(
   # ifndef PEGASUS_DISABLE_PROV_USERCTXT_REQUESTOR
                     (userContext == PG_PROVMODULE_USERCTXT_REQUESTOR) ||
   # endif
   # ifndef PEGASUS_DISABLE_PROV_USERCTXT_DESIGNATED
                     (userContext == PG_PROVMODULE_USERCTXT_DESIGNATED) ||
   # endif
   # ifndef PEGASUS_DISABLE_PROV_USERCTXT_PRIVILEGED
                     (userContext == PG_PROVMODULE_USERCTXT_PRIVILEGED) ||
   # endif
   # ifndef PEGASUS_DISABLE_PROV_USERCTXT_CIMSERVER
                     (userContext == PG_PROVMODULE_USERCTXT_CIMSERVER) ||
   # endif
                     0))
               {
                   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 565 
Line 645 
                 "Missing ClassName which is required property in PG_ProviderCapabilities class."));                 "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 695 
Line 827 
         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 904 
Line 1036 
                         "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 914 
Line 1046 
     {     {
         _providerRegistrationManager->deleteInstance(instanceReference);         _providerRegistrationManager->deleteInstance(instanceReference);
     }     }
     catch(CIMException& e)      catch(const CIMException&)
     {     {
         throw (e);          throw;
     }     }
  
     // complete processing the request     // complete processing the request
Line 1019 
Line 1151 
             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
Line 1078 
Line 1209 
         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 1231 
Line 1362 
         if (response->cimException.getCode () != CIM_ERR_SUCCESS)         if (response->cimException.getCode () != CIM_ERR_SUCCESS)
         {         {
             CIMException e = response->cimException;             CIMException e = response->cimException;
             throw (e);              throw e;
         }         }
     }     }
 } }
Line 1634 
Line 1765 
             delete asyncRequest;             delete asyncRequest;
             delete asyncReply;             delete asyncReply;
             delete response;             delete response;
             throw (e);              throw e;
         }         }
  
         delete asyncRequest;         delete asyncRequest;


Legend:
Removed from v.1.71  
changed lines
  Added in v.1.80

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2