version 1.11.4.5, 2004/03/24 00:50:34
|
version 1.22, 2004/03/04 10:11:14
|
|
|
#include <Pegasus/Common/Logger.h> | #include <Pegasus/Common/Logger.h> |
#include <Pegasus/Common/MessageLoader.h> //l10n | #include <Pegasus/Common/MessageLoader.h> //l10n |
| |
//#include <Pegasus/Common/QueryExpression.h> |
#include <Pegasus/Common/QueryExpression.h> |
//#include <Pegasus/ProviderManager2/QueryExpressionFactory.h> |
#include <Pegasus/ProviderManager2/QueryExpressionFactory.h> |
| |
#include <Pegasus/Config/ConfigManager.h> | #include <Pegasus/Config/ConfigManager.h> |
| |
|
|
response = handleDeleteInstanceRequest(request); | response = handleDeleteInstanceRequest(request); |
| |
break; | break; |
// case CIM_EXEC_QUERY_REQUEST_MESSAGE: |
case CIM_EXEC_QUERY_REQUEST_MESSAGE: |
// response = handleExecQueryRequest(request); |
response = handleExecQueryRequest(request); |
| |
// break; |
break; |
case CIM_ASSOCIATORS_REQUEST_MESSAGE: | case CIM_ASSOCIATORS_REQUEST_MESSAGE: |
response = handleAssociatorsRequest(request); | response = handleAssociatorsRequest(request); |
| |
|
|
| |
return(response); | return(response); |
} | } |
/* |
|
Message * DefaultProviderManager::handleExecQueryRequest(const Message * message) | Message * DefaultProviderManager::handleExecQueryRequest(const Message * message) |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleExecQueryRequest"); | PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleExecQueryRequest"); |
|
|
| |
return(response); | return(response); |
} | } |
*/ |
|
Message * DefaultProviderManager::handleAssociatorsRequest(const Message * message) | Message * DefaultProviderManager::handleAssociatorsRequest(const Message * message) |
{ | { |
PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleAssociatorsRequest"); | PEG_METHOD_ENTER(TRC_PROVIDERMANAGER, "DefaultProviderManager::handleAssociatorsRequest"); |
|
|
ph.GetProvider().getName()); | ph.GetProvider().getName()); |
| |
pm_service_op_lock op_lock(&ph.GetProvider()); | pm_service_op_lock op_lock(&ph.GetProvider()); |
ph.GetProvider().protect(); |
|
| |
ph.GetProvider().enableIndications(*handler); | ph.GetProvider().enableIndications(*handler); |
| |
|
|
| |
ProviderRegistrationManager * _providerRegistrationManager = GetProviderRegistrationManager(); | ProviderRegistrationManager * _providerRegistrationManager = GetProviderRegistrationManager(); |
| |
try { |
try |
|
{ |
// get provider module name | // get provider module name |
String moduleName; | String moduleName; |
CIMInstance mInstance = request->providerModule; | CIMInstance mInstance = request->providerModule; |
Uint32 pos = mInstance.findProperty(CIMName ("Name")); | Uint32 pos = mInstance.findProperty(CIMName ("Name")); |
| |
if(pos != PEG_NOT_FOUND) { |
if(pos != PEG_NOT_FOUND) |
|
{ |
mInstance.getProperty(pos).getValue().get(moduleName); | mInstance.getProperty(pos).getValue().get(moduleName); |
} | } |
| |
|
|
// | // |
// get operational status | // get operational status |
// | // |
if (!disableProviderOnly) { |
if (!disableProviderOnly) |
|
{ |
Uint32 pos2 = mInstance.findProperty(CIMName ("OperationalStatus")); | Uint32 pos2 = mInstance.findProperty(CIMName ("OperationalStatus")); |
if (pos2 != PEG_NOT_FOUND) { |
if (pos2 != PEG_NOT_FOUND) |
|
{ |
// | // |
// ATTN-CAKG-P2-20020821: Check for null status? | // ATTN-CAKG-P2-20020821: Check for null status? |
// | // |
|
|
// | // |
// update module status from OK to Stopping | // update module status from OK to Stopping |
// | // |
for (Uint32 i=0, n = operationalStatus.size(); i < n; i++) { |
for (Uint32 i=0, n = operationalStatus.size(); i < n; i++) |
if (operationalStatus[i] == _MODULE_OK) { |
{ |
|
if (operationalStatus[i] == _MODULE_OK) |
|
{ |
operationalStatus.remove(i); | operationalStatus.remove(i); |
} | } |
} | } |
|
|
operationalStatus.append(_MODULE_STOPPING); | operationalStatus.append(_MODULE_STOPPING); |
| |
if(_providerRegistrationManager->setProviderModuleStatus | if(_providerRegistrationManager->setProviderModuleStatus |
(moduleName, operationalStatus) == false) { |
(moduleName, operationalStatus) == false) |
|
{ |
//l10n | //l10n |
//throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "set module status failed."); | //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "set module status failed."); |
throw PEGASUS_CIM_EXCEPTION_L( | throw PEGASUS_CIM_EXCEPTION_L( |
CIM_ERR_FAILED, | CIM_ERR_FAILED, |
MessageLoaderParms("ProviderManager.ProviderManagerService." |
MessageLoaderParms( |
"SET_MODULE_STATUS_FAILED","set module status failed.")); |
"ProviderManager.ProviderManagerService." |
|
"SET_MODULE_STATUS_FAILED", |
|
"set module status failed.")); |
} | } |
} | } |
| |
|
|
mInstance.getProperty( | mInstance.getProperty( |
mInstance.findProperty("Location")).getValue().toString()); | mInstance.findProperty("Location")).getValue().toString()); |
| |
for (Uint32 i = 0, n = _pInstances.size(); i < n; i++) { |
for(Uint32 i = 0, n = _pInstances.size(); i < n; i++) |
|
{ |
String pName(_pInstances[i].getProperty( | String pName(_pInstances[i].getProperty( |
_pInstances[i].findProperty("Name")).getValue().toString()); | _pInstances[i].findProperty("Name")).getValue().toString()); |
| |
Sint16 ret_value = providerManager.disableProvider(physicalName,pName); | Sint16 ret_value = providerManager.disableProvider(physicalName,pName); |
| |
if (ret_value == 0) { |
if (ret_value == 0) |
|
{ |
// disable failed since there are pending requests, | // disable failed since there are pending requests, |
// update module status from Stopping to OK if | // update module status from Stopping to OK if |
// disableProviderOnly is not true | // disableProviderOnly is not true |
if (!disableProviderOnly) { |
if (!disableProviderOnly) |
for(Uint32 j=0, m = operationalStatus.size(); j < m; j++) { |
{ |
if (operationalStatus[j] == _MODULE_STOPPING) { |
for(Uint32 j=0, m = operationalStatus.size(); j < m; j++) |
|
{ |
|
if (operationalStatus[j] == _MODULE_STOPPING) |
|
{ |
operationalStatus.remove(j); | operationalStatus.remove(j); |
} | } |
} | } |
|
|
operationalStatus.append(_MODULE_OK); | operationalStatus.append(_MODULE_OK); |
| |
if (_providerRegistrationManager->setProviderModuleStatus | if (_providerRegistrationManager->setProviderModuleStatus |
(moduleName, operationalStatus) == false) { |
(moduleName, operationalStatus) == false) |
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, |
{ |
MessageLoaderParms("ProviderManager.ProviderManagerService." |
throw PEGASUS_CIM_EXCEPTION_L( |
"SET_MODULE_STATUS_FAILED","set module status failed.")); |
CIM_ERR_FAILED, |
|
MessageLoaderParms( |
|
"ProviderManager.ProviderManagerService." |
|
"SET_MODULE_STATUS_FAILED", |
|
"set module status failed.")); |
} | } |
} | } |
} | } |
|
else if (ret_value == 1) |
else if (ret_value == 1) { |
{ |
// if It is an indication provider | // if It is an indication provider |
// remove the entry from the table since the | // remove the entry from the table since the |
// provider has been disabled | // provider has been disabled |
if (_indicationProviders[i]) { |
if (_indicationProviders[i]) |
|
{ |
_removeEntry(_generateKey(pName,physicalName)); | _removeEntry(_generateKey(pName,physicalName)); |
} | } |
} | } |
else { |
else |
|
{ |
// disable failed for other reason, throw exception | // disable failed for other reason, throw exception |
// update module status from Stopping to OK if | // update module status from Stopping to OK if |
// disableProviderOnly is not true | // disableProviderOnly is not true |
if (!disableProviderOnly) { |
if (!disableProviderOnly) |
for (Uint32 j=0, m = operationalStatus.size(); j < m; j++) { |
{ |
if (operationalStatus[j] == _MODULE_STOPPING) { |
for(Uint32 j=0, m = operationalStatus.size(); j < m; j++) |
|
{ |
|
if (operationalStatus[j] == _MODULE_STOPPING) |
|
{ |
operationalStatus.remove(j); | operationalStatus.remove(j); |
} | } |
} | } |
|
|
operationalStatus.append(_MODULE_OK); | operationalStatus.append(_MODULE_OK); |
| |
if (_providerRegistrationManager->setProviderModuleStatus | if (_providerRegistrationManager->setProviderModuleStatus |
(moduleName, operationalStatus) == false) { |
(moduleName, operationalStatus) == false) |
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, |
{ |
MessageLoaderParms("ProviderManager.ProviderManagerService." |
throw PEGASUS_CIM_EXCEPTION_L( |
"SET_MODULE_STATUS_FAILED","set module status failed.")); |
CIM_ERR_FAILED, |
|
MessageLoaderParms( |
|
"ProviderManager.ProviderManagerService." |
|
"SET_MODULE_STATUS_FAILED", |
|
"set module status failed.")); |
} | } |
} | } |
| |
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms("ProviderManager.ProviderManagerService." |
CIM_ERR_FAILED, |
"DISABLE_PROVIDER_FAILED","Failed to disable the provider.")); |
MessageLoaderParms( |
|
"ProviderManager.ProviderManagerService." |
|
"DISABLE_PROVIDER_FAILED", |
|
"Failed to disable the provider.")); |
} | } |
} | } |
// disable succeed | // disable succeed |
// update module status from Stopping to Stopped if | // update module status from Stopping to Stopped if |
// disableProviderOnly is not true | // disableProviderOnly is not true |
if (!disableProviderOnly) { |
if (!disableProviderOnly) |
|
{ |
// update module status from Stopping to Stopped | // update module status from Stopping to Stopped |
for (Uint32 j=0, m = operationalStatus.size(); j < m; j++) { |
for(Uint32 j=0, m = operationalStatus.size(); j < m; j++) |
if (operationalStatus[j] == _MODULE_STOPPING) { |
{ |
|
if (operationalStatus[j] == _MODULE_STOPPING) |
|
{ |
operationalStatus.remove(j); | operationalStatus.remove(j); |
operationalStatus.append(_MODULE_STOPPED); | operationalStatus.append(_MODULE_STOPPED); |
} | } |
} | } |
| |
if (_providerRegistrationManager->setProviderModuleStatus | if (_providerRegistrationManager->setProviderModuleStatus |
(moduleName, operationalStatus) == false) { |
(moduleName, operationalStatus) == false) |
|
{ |
//l10n | //l10n |
//throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, | //throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
//"set module status failed."); | //"set module status failed."); |
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms("ProviderManager.ProviderManagerService." |
CIM_ERR_FAILED, |
"SET_MODULE_STATUS_FAILED","set module status failed.")); |
MessageLoaderParms( |
|
"ProviderManager.ProviderManagerService." |
|
"SET_MODULE_STATUS_FAILED", |
|
"set module status failed.")); |
} | } |
} | } |
} | } |
|
|
"Exception: " + e.getMessage()); | "Exception: " + e.getMessage()); |
cimException = CIMException(CIM_ERR_FAILED, e.getMessage()); | cimException = CIMException(CIM_ERR_FAILED, e.getMessage()); |
} | } |
catch(...) { |
catch(...) |
|
{ |
PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, | PEG_TRACE_STRING(TRC_PROVIDERMANAGER, Tracer::LEVEL4, |
"Exception: Unknown"); | "Exception: Unknown"); |
//l10n | //l10n |
|
|
return(temp); | return(temp); |
} | } |
| |
void DefaultProviderManager::unload_idle_providers() |
|
{ |
|
providerManager.unload_idle_providers(); |
|
} |
|
|
|
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |