(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.88

version 1.71, 2004/07/27 16:17:56 version 1.88, 2006/07/23 18:02:38
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 75 
Line 81 
  
 ProviderRegistrationProvider::~ProviderRegistrationProvider(void) ProviderRegistrationProvider::~ProviderRegistrationProvider(void)
 { {
     if (_providerRegistrationManager)  
     {  
         delete _providerRegistrationManager;  
     }  
   
     if (_client_handle)  
     {  
         delete _client_handle;         delete _client_handle;
     }     }
  
 }  
   
 void ProviderRegistrationProvider::initialize(CIMOMHandle & cimom) void ProviderRegistrationProvider::initialize(CIMOMHandle & cimom)
 { {
     // This method should not be called because this is a control provider     // This method should not be called because this is a control provider
Line 95 
Line 92 
  
 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 137 
                                                              includeClassOrigin,                                                              includeClassOrigin,
                                                              propertyList);                                                              propertyList);
     }     }
     catch(CIMException& e)      catch(const CIMException&)
     {     {
         throw (e);          throw;
     }     }
  
     handler.deliver(instance);     handler.deliver(instance);
Line 188 
Line 188 
                                                              includeClassOrigin,                                                              includeClassOrigin,
                                                              propertyList);                                                              propertyList);
     }     }
     catch(CIMException& e)      catch(const CIMException&)
     {     {
         throw (e);          throw;
     }     }
  
     handler.deliver(enumInstances);     handler.deliver(enumInstances);
Line 234 
Line 234 
         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 330 
                                                      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 448 
             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
   #ifdef PEGASUS_ENABLE_JMPI_PROVIDER_MANAGER
               && (ifcTypeString != "JMPI")
               && (ifcTypeString != "JMPIExperimental")
   #endif
                 )                 )
         {         {
                 //l10n 485                 //l10n 485
Line 476 
Line 480 
         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
   #ifdef PEGASUS_ENABLE_JMPI_PROVIDER_MANAGER
              (ifcTypeString == "JMPI" &&
               ifcVersionString != "1.0.0" &&
               ifcVersionString != "2.0.0" &&
               ifcVersionString != "2.2.0") ||
              (ifcTypeString == "JMPIExperimental" &&
               ifcVersionString != "0.0.1") ||
   #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" &&
               ifcVersionString != "2.6.0"))
         {         {
                 //l10n 485                 //l10n 485
             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED,             //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED,
Line 513 
Line 527 
             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 656 
                 "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 838 
         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 743 
Line 886 
  
 // 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 =
Line 752 
Line 895 
     }     }
     catch (...)     catch (...)
     {     {
         ;   // Leave AcceptLanguages empty          ;   // Leave AcceptLanguageList empty
     }     }
  
     CIMName className = instanceReference.getClassName();     CIMName className = instanceReference.getClassName();
Line 904 
Line 1047 
                         "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 1057 
     {     {
         _providerRegistrationManager->deleteInstance(instanceReference);         _providerRegistrationManager->deleteInstance(instanceReference);
     }     }
     catch(CIMException& e)      catch(const CIMException&)
     {     {
         throw (e);          throw;
     }     }
  
     // complete processing the request     // complete processing the request
Line 962 
Line 1105 
  
 // 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 =
Line 971 
Line 1114 
     }     }
     catch (...)     catch (...)
     {     {
         ;   // Leave AcceptLanguages empty          ;   // Leave AcceptLanguageList empty
     }     }
  
     String moduleName;     String moduleName;
Line 1019 
Line 1162 
             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 1055 
Line 1197 
     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,
Line 1078 
Line 1217 
         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 1096 
Line 1235 
     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,
Line 1135 
Line 1271 
 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 1212 
Line 1348 
         termination_req->operationContext.set(AcceptLanguageListContainer(al));         termination_req->operationContext.set(AcceptLanguageListContainer(al));
  
         // create request envelope         // create request envelope
         AsyncLegacyOperationStart asyncRequest          AsyncLegacyOperationStart asyncRequest(
             (_service->get_next_xid(),  
             NULL,             NULL,
             _queueId,             _queueId,
             termination_req,             termination_req,
Line 1231 
Line 1366 
         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 1254 
Line 1389 
     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 1438 
Line 1573 
 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 1590 
Line 1725 
     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 1613 
Line 1748 
         // 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,
Line 1634 
Line 1768 
             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.88

No CVS admin address has been configured
Powered by
ViewCVS 0.9.2