version 1.69, 2004/06/28 09:39:29
|
version 1.71, 2004/07/27 16:17:56
|
|
|
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; |
|
|
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; |
|
|
// | // |
// 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); |
} | } |
|
|
// | // |
// 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); |
} | } |
|
|
termination_req->operationContext.set(AcceptLanguageListContainer(al)); | termination_req->operationContext.set(AcceptLanguageListContainer(al)); |
| |
// create request envelope | // create request envelope |
AsyncLegacyOperationStart * asyncRequest = |
AsyncLegacyOperationStart asyncRequest |
new AsyncLegacyOperationStart ( |
(_service->get_next_xid(), |
_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 (* _client_handle, _queueId, |
_queueId, |
&asyncRequest)); |
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); |
} | } |
} | } |
} | } |
|
|
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); |
|
|
else | else |
{ | { |
instance = _providerRegistrationManager->getInstance(objectReference); | instance = _providerRegistrationManager->getInstance(objectReference); |
if (_isIndicationProvider(moduleName, instance, objectReference)) |
if (_isIndicationProvider(moduleName, instance)) |
{ | { |
indProvider = true; | indProvider = true; |
indicationProviders.append(true); | indicationProviders.append(true); |
|
|
| |
CIMNotifyProviderEnableResponseMessage * response = | CIMNotifyProviderEnableResponseMessage * response = |
reinterpret_cast<CIMNotifyProviderEnableResponseMessage *>( | reinterpret_cast<CIMNotifyProviderEnableResponseMessage *>( |
(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) |
{ | { |
|
|
} | } |
} | } |
| |
// 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); |
|
} | } |
| |
// | // |