version 1.157, 2005/02/14 21:15:37
|
version 1.158, 2005/02/25 21:44:17
|
|
|
| |
Array <CIMInstance> activeSubscriptions; | Array <CIMInstance> activeSubscriptions; |
Array <CIMInstance> noProviderSubscriptions; | Array <CIMInstance> noProviderSubscriptions; |
Array <ProviderClassList> enableProviders; |
|
Boolean invalidInstance = false; | Boolean invalidInstance = false; |
| |
// | // |
|
|
String queryLanguage; | String queryLanguage; |
CIMPropertyList propertyList; | CIMPropertyList propertyList; |
Array <ProviderClassList> indicationProviders; | Array <ProviderClassList> indicationProviders; |
|
Boolean createRequestsSent = false; |
| |
for (Uint32 i = 0; i < activeSubscriptions.size (); i++) | for (Uint32 i = 0; i < activeSubscriptions.size (); i++) |
{ | { |
|
|
indicationSubclasses, | indicationSubclasses, |
creator); | creator); |
| |
|
createRequestsSent = true; |
|
|
} // for each active subscription | } // for each active subscription |
| |
// | // |
|
|
} | } |
} | } |
| |
|
if (!createRequestsSent) |
|
{ |
|
// |
|
// Send message to tell Provider Manager that subscription |
|
// initialization is complete |
|
// |
|
_sendSubscriptionInitComplete (); |
|
} |
|
|
#ifdef PEGASUS_INDICATION_PERFINST | #ifdef PEGASUS_INDICATION_PERFINST |
double elapsed = stopWatch.getElapsed (); | double elapsed = stopWatch.getElapsed (); |
| |
|
|
| |
// | // |
// Response is sent from _handleCreateResponseAggregation | // Response is sent from _handleCreateResponseAggregation |
// or _handleEnableResponseAggregation |
|
// | // |
responseSent = true; | responseSent = true; |
} | } |
|
|
| |
// | // |
// Response is sent from _handleCreateResponseAggregation | // Response is sent from _handleCreateResponseAggregation |
// or _handleEnableResponseAggregation |
|
// | // |
responseSent = true; | responseSent = true; |
} | } |
|
|
| |
// | // |
// Response is sent from | // Response is sent from |
// _handleDeleteResponseAggregation or |
// _handleDeleteResponseAggregation |
// _handleDisableResponseAggregation |
|
// | // |
responseSent = true; | responseSent = true; |
} | } |
|
|
| |
// | // |
// Response is sent from | // Response is sent from |
// _handleDeleteResponseAggregation or |
// _handleDeleteResponseAggregation |
// _handleDisableResponseAggregation |
|
// | // |
responseSent = true; | responseSent = true; |
} | } |
|
|
| |
// | // |
// Response is sent from _handleCreateResponseAggregation | // Response is sent from _handleCreateResponseAggregation |
// or _handleEnableResponseAggregation |
|
// | // |
responseSent = true; | responseSent = true; |
} | } |
|
|
| |
// | // |
// Response is sent from | // Response is sent from |
// _handleDeleteResponseAggregation or |
// _handleDeleteResponseAggregation |
// _handleDisableResponseAggregation |
|
// | // |
responseSent = true; | responseSent = true; |
} | } |
|
|
| |
// | // |
// Response is sent from _handleCreateResponseAggregation | // Response is sent from _handleCreateResponseAggregation |
// or _handleEnableResponseAggregation |
|
// | // |
responseSent = true; | responseSent = true; |
| |
|
|
break; | break; |
} | } |
| |
case CIM_ENABLE_INDICATIONS_REQUEST_MESSAGE: |
|
{ |
|
_handleEnableResponseAggregation (operationAggregate); |
|
break; |
|
} |
|
|
|
case CIM_MODIFY_SUBSCRIPTION_REQUEST_MESSAGE: | case CIM_MODIFY_SUBSCRIPTION_REQUEST_MESSAGE: |
{ | { |
_handleModifyResponseAggregation (operationAggregate); | _handleModifyResponseAggregation (operationAggregate); |
|
|
break; | break; |
} | } |
| |
case CIM_DISABLE_INDICATIONS_REQUEST_MESSAGE: |
|
{ |
|
_handleDisableResponseAggregation (operationAggregate); |
|
break; |
|
} |
|
|
|
default: | default: |
{ | { |
PEG_TRACE_STRING (TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL2, | PEG_TRACE_STRING (TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL2, |
|
|
Array <ProviderClassList> acceptedProviders; | Array <ProviderClassList> acceptedProviders; |
CIMObjectPath instanceRef; | CIMObjectPath instanceRef; |
CIMException cimException; | CIMException cimException; |
Boolean responseSent = false; |
|
| |
// | // |
// Examine provider responses | // Examine provider responses |
|
|
// | // |
// At least one provider accepted the subscription | // At least one provider accepted the subscription |
// | // |
|
|
Array <ProviderClassList> enableProviders; |
|
|
|
if (operationAggregate->getOrigType () == | if (operationAggregate->getOrigType () == |
CIM_NOTIFY_PROVIDER_REGISTRATION_REQUEST_MESSAGE) | CIM_NOTIFY_PROVIDER_REGISTRATION_REQUEST_MESSAGE) |
{ | { |
|
|
// | // |
// Update the entry in the active subscriptions hash table | // Update the entry in the active subscriptions hash table |
// | // |
enableProviders = _subscriptionTable->updateProviders |
_subscriptionTable->updateProviders |
(request->subscriptionInstance.getPath (), provider, true); | (request->subscriptionInstance.getPath (), provider, true); |
|
|
// |
|
// Send Enable message to each provider that accepted |
|
// subscription |
|
// |
|
if (enableProviders.size () > 0) |
|
{ |
|
_sendEnable (enableProviders, |
|
operationAggregate->getOrigRequest ()); |
|
|
|
// |
|
// Response is sent from _handleEnableResponseAggregation |
|
// |
|
responseSent = true; |
|
} |
|
} | } |
else if (operationAggregate->getOrigType () == | else if (operationAggregate->getOrigType () == |
CIM_NOTIFY_PROVIDER_ENABLE_REQUEST_MESSAGE) | CIM_NOTIFY_PROVIDER_ENABLE_REQUEST_MESSAGE) |
|
|
// | // |
// Update the entry in the active subscriptions hash table | // Update the entry in the active subscriptions hash table |
// | // |
enableProviders = _subscriptionTable->updateProviders |
_subscriptionTable->updateProviders |
(request->subscriptionInstance.getPath (), provider, true); | (request->subscriptionInstance.getPath (), provider, true); |
|
|
// |
|
// Send Enable message to each provider that accepted |
|
// subscription |
|
// |
|
if (enableProviders.size () > 0) |
|
{ |
|
_sendEnable (enableProviders, |
|
operationAggregate->getOrigRequest ()); |
|
|
|
// |
|
// Response is sent from _handleEnableResponseAggregation |
|
// |
|
responseSent = true; |
|
} |
|
} | } |
else if (operationAggregate->getOrigType () == | else if (operationAggregate->getOrigType () == |
CIM_CREATE_INSTANCE_REQUEST_MESSAGE) | CIM_CREATE_INSTANCE_REQUEST_MESSAGE) |
|
|
// | // |
// Insert entries into the subscription hash tables | // Insert entries into the subscription hash tables |
// | // |
enableProviders = _subscriptionTable->insertSubscription |
_subscriptionTable->insertSubscription |
(instance, | (instance, |
acceptedProviders, | acceptedProviders, |
operationAggregate->getIndicationSubclasses (), | operationAggregate->getIndicationSubclasses (), |
request->nameSpace); | request->nameSpace); |
| |
if (enableProviders.size () > 0) |
|
{ |
|
// |
|
// Send Enable message to each provider that accepted |
|
// subscription |
|
// |
|
_sendEnable (enableProviders, |
|
operationAggregate->getOrigRequest (), instanceRef); |
|
|
|
// |
|
// Response is sent from _handleEnableResponseAggregation |
|
// |
|
responseSent = true; |
|
} | } |
} | } |
} |
else if (operationAggregate->getOrigType () == |
else // Initialize or Modify Instance |
CIM_MODIFY_INSTANCE_REQUEST_MESSAGE) |
{ | { |
PEGASUS_ASSERT ((operationAggregate->getOrigType () == 0) || |
|
(operationAggregate->getOrigType () == |
|
CIM_MODIFY_INSTANCE_REQUEST_MESSAGE)); |
|
|
|
// | // |
// Insert entries into the subscription hash tables | // Insert entries into the subscription hash tables |
// | // |
enableProviders = _subscriptionTable->insertSubscription |
_subscriptionTable->insertSubscription |
(request->subscriptionInstance, | (request->subscriptionInstance, |
acceptedProviders, | acceptedProviders, |
operationAggregate->getIndicationSubclasses (), | operationAggregate->getIndicationSubclasses (), |
request->nameSpace); | request->nameSpace); |
|
} |
if (enableProviders.size () > 0) |
else // Initialize |
{ | { |
|
PEGASUS_ASSERT (operationAggregate->getOrigType () == 0); |
|
|
// | // |
// Send Enable message to each provider that accepted |
// Insert entries into the subscription hash tables |
// subscription |
|
// | // |
_sendEnable (enableProviders, |
_subscriptionTable->insertSubscription |
operationAggregate->getOrigRequest ()); |
(request->subscriptionInstance, |
|
acceptedProviders, |
|
operationAggregate->getIndicationSubclasses (), |
|
request->nameSpace); |
| |
// | // |
// Response is sent from _handleEnableResponseAggregation |
// Send message to tell Provider Manager that subscription |
|
// initialization is complete |
|
// Provider Manager calls providers' enableIndications method |
// | // |
responseSent = true; |
_sendSubscriptionInitComplete (); |
} |
|
} | } |
} | } |
| |
// | // |
// For Create Instance, Modify Instance, Notify Provider Enable or | // For Create Instance, Modify Instance, Notify Provider Enable or |
// Notify Provider Registration request, |
// Notify Provider Registration request, send response |
// send response, if not sent from callback |
|
// When an enable indications request was required, the response (if |
|
// required) is sent from _handleEnableResponseAggregation, and must not |
|
// be sent from here |
|
// | // |
if ((!responseSent) && (operationAggregate->requiresResponse ())) |
if (operationAggregate->requiresResponse ()) |
{ | { |
if (operationAggregate->getOrigType () == | if (operationAggregate->getOrigType () == |
CIM_CREATE_INSTANCE_REQUEST_MESSAGE) | CIM_CREATE_INSTANCE_REQUEST_MESSAGE) |
|
|
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
} | } |
| |
void IndicationService::_handleEnableResponseAggregation ( |
|
IndicationOperationAggregate * operationAggregate) |
|
{ |
|
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, |
|
"IndicationService::_handleEnableResponseAggregation"); |
|
|
|
CIMException cimException; |
|
|
|
// |
|
// Examine provider responses |
|
// |
|
for (Uint32 i = 0; i < operationAggregate->getNumberResponses (); i++) |
|
{ |
|
// |
|
// If response is not SUCCESS, provider rejected the enable |
|
// |
|
CIMResponseMessage * response = operationAggregate->getResponse (i); |
|
if (response->cimException.getCode () != CIM_ERR_SUCCESS) |
|
{ |
|
// |
|
// Find provider from which response was sent |
|
// Log a trace message |
|
// |
|
ProviderClassList provider = operationAggregate->findProvider |
|
(response->messageId); |
|
PEG_TRACE_STRING (TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL3, |
|
"Provider (" + provider.provider.getPath ().toString() + |
|
") rejected enable indications: " + |
|
response->cimException.getMessage ()); |
|
|
|
// |
|
// NOTE: if there are multiple non-success responses, the last will |
|
// be returned in the response |
|
// |
|
cimException = response->cimException; |
|
} |
|
} |
|
|
|
// |
|
// For Create Instance, Modify Instance, Notify Provider Enable or |
|
// Notify Provider Registration request, send response |
|
// |
|
if (operationAggregate->requiresResponse ()) |
|
{ |
|
if (operationAggregate->getOrigType () == |
|
CIM_CREATE_INSTANCE_REQUEST_MESSAGE) |
|
{ |
|
// |
|
// Get the object path of the created instance from the operation |
|
// aggregate object |
|
// |
|
CIMObjectPath instanceRef = operationAggregate->getPath (); |
|
|
|
CIMCreateInstanceResponseMessage * response = dynamic_cast |
|
<CIMCreateInstanceResponseMessage *> |
|
(operationAggregate->getOrigRequest ()->buildResponse ()); |
|
response->cimException = cimException; |
|
response->instanceName = instanceRef; |
|
_enqueueResponse (operationAggregate->getOrigRequest (), response); |
|
} |
|
|
|
else if (operationAggregate->getOrigType () == |
|
CIM_MODIFY_INSTANCE_REQUEST_MESSAGE) |
|
{ |
|
CIMResponseMessage * response = |
|
operationAggregate->getOrigRequest ()->buildResponse (); |
|
response->cimException = cimException; |
|
_enqueueResponse (operationAggregate->getOrigRequest (), response); |
|
} |
|
|
|
else if (operationAggregate->getOrigType () == |
|
CIM_NOTIFY_PROVIDER_ENABLE_REQUEST_MESSAGE) |
|
{ |
|
CIMResponseMessage * response = |
|
operationAggregate->getOrigRequest ()->buildResponse (); |
|
response->cimException = cimException; |
|
_enqueueResponse (operationAggregate->getOrigRequest (), response); |
|
} |
|
|
|
else // CIM_NOTIFY_PROVIDER_REGISTRATION_REQUEST_MESSAGE |
|
{ |
|
PEGASUS_ASSERT (operationAggregate->getOrigType () == |
|
CIM_NOTIFY_PROVIDER_REGISTRATION_REQUEST_MESSAGE); |
|
|
|
CIMResponseMessage * response = |
|
operationAggregate->getOrigRequest ()->buildResponse (); |
|
response->cimException = cimException; |
|
_enqueueResponse (operationAggregate->getOrigRequest (), response); |
|
} |
|
} |
|
|
|
PEG_METHOD_EXIT (); |
|
} |
|
|
|
void IndicationService::_handleModifyResponseAggregation ( | void IndicationService::_handleModifyResponseAggregation ( |
IndicationOperationAggregate * operationAggregate) | IndicationOperationAggregate * operationAggregate) |
{ | { |
|
|
"IndicationService::_handleDeleteResponseAggregation"); | "IndicationService::_handleDeleteResponseAggregation"); |
| |
CIMException cimException; | CIMException cimException; |
Boolean responseSent = false; |
|
Array <ProviderClassList> checkProviders; | Array <ProviderClassList> checkProviders; |
| |
// | // |
|
|
{ | { |
// | // |
// Find provider from which response was sent and add to list | // Find provider from which response was sent and add to list |
// List will be checked later to determine if Disable Indications |
|
// request must be sent |
|
// | // |
CIMResponseMessage * response = operationAggregate->getResponse (i); | CIMResponseMessage * response = operationAggregate->getResponse (i); |
ProviderClassList provider = operationAggregate->findProvider | ProviderClassList provider = operationAggregate->findProvider |
|
|
(CIMDeleteSubscriptionRequestMessage *) | (CIMDeleteSubscriptionRequestMessage *) |
operationAggregate->getRequest (0); | operationAggregate->getRequest (0); |
| |
Array <ProviderClassList> disableProviders; |
|
|
|
if (operationAggregate->getOrigType () == | if (operationAggregate->getOrigType () == |
CIM_NOTIFY_PROVIDER_REGISTRATION_REQUEST_MESSAGE) | CIM_NOTIFY_PROVIDER_REGISTRATION_REQUEST_MESSAGE) |
{ | { |
|
|
(ProviderIdContainer::NAME); | (ProviderIdContainer::NAME); |
provider.provider = pidc.getProvider(); | provider.provider = pidc.getProvider(); |
provider.providerModule = pidc.getModule(); | provider.providerModule = pidc.getModule(); |
disableProviders = _subscriptionTable->updateProviders |
_subscriptionTable->updateProviders |
(request->subscriptionInstance.getPath (), provider, false); | (request->subscriptionInstance.getPath (), provider, false); |
} | } |
| |
|
|
// | // |
// Remove entries from the subscription hash tables | // Remove entries from the subscription hash tables |
// | // |
disableProviders = _subscriptionTable->removeSubscription |
_subscriptionTable->removeSubscription |
(request->subscriptionInstance, | (request->subscriptionInstance, |
operationAggregate->getIndicationSubclasses (), | operationAggregate->getIndicationSubclasses (), |
request->nameSpace, | request->nameSpace, |
|
|
} | } |
| |
// | // |
// Send Disable Indications requests to any provider no longer in |
|
// use |
|
// |
|
if (disableProviders.size () > 0) |
|
{ |
|
_sendDisable (disableProviders, operationAggregate->getOrigRequest ()); |
|
|
|
// |
|
// Response is sent from _handleDisableResponseAggregation |
|
// |
|
responseSent = true; |
|
} |
|
|
|
// |
|
// For Delete Instance, Modify Instance, or Notify Provider Registration | // For Delete Instance, Modify Instance, or Notify Provider Registration |
// request, send response if not sent from callback |
// request, send response |
// When a disable indicatiosn request was required, the response (if |
|
// required) is sent from _handleDisableResponseAggregation, and must not |
|
// be sent from here |
|
// | // |
if ((!responseSent) && (operationAggregate->requiresResponse ())) |
if (operationAggregate->requiresResponse ()) |
{ | { |
CIMResponseMessage * response; | CIMResponseMessage * response; |
if (operationAggregate->getOrigType () == | if (operationAggregate->getOrigType () == |
|
|
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
} | } |
| |
void IndicationService::_handleDisableResponseAggregation ( |
|
IndicationOperationAggregate * operationAggregate) |
|
{ |
|
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, |
|
"IndicationService::_handleDisableResponseAggregation"); |
|
|
|
CIMException cimException; |
|
|
|
// |
|
// Examine provider responses |
|
// |
|
for (Uint32 i = 0; i < operationAggregate->getNumberResponses (); i++) |
|
{ |
|
// |
|
// If response is not SUCCESS, provider rejected the disable |
|
// |
|
CIMResponseMessage * response = operationAggregate->getResponse (i); |
|
if (response->cimException.getCode () != CIM_ERR_SUCCESS) |
|
{ |
|
// |
|
// Find provider from which response was sent |
|
// Log a trace message |
|
// |
|
ProviderClassList provider = operationAggregate->findProvider |
|
(response->messageId); |
|
PEG_TRACE_STRING (TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL3, |
|
"Provider (" + provider.provider.getPath ().toString() + |
|
") rejected disable indications: " + |
|
response->cimException.getMessage ()); |
|
|
|
// |
|
// NOTE: if there are multiple non-success responses, the last will |
|
// be returned in the response |
|
// |
|
cimException = response->cimException; |
|
} |
|
} |
|
|
|
// |
|
// For Delete Instance, Modify Instance or Notify Provider Registration |
|
// request, send response |
|
// |
|
if (operationAggregate->requiresResponse ()) |
|
{ |
|
CIMResponseMessage * response; |
|
if (operationAggregate->getOrigType () == |
|
CIM_DELETE_INSTANCE_REQUEST_MESSAGE) |
|
{ |
|
response = operationAggregate->getOrigRequest ()->buildResponse (); |
|
response->cimException = cimException; |
|
} |
|
|
|
else if (operationAggregate->getOrigType () == |
|
CIM_MODIFY_INSTANCE_REQUEST_MESSAGE) |
|
{ |
|
response = operationAggregate->getOrigRequest ()->buildResponse (); |
|
response->cimException = cimException; |
|
} |
|
|
|
else // CIM_NOTIFY_PROVIDER_REGISTRATION_REQUEST_MESSAGE |
|
{ |
|
PEGASUS_ASSERT (operationAggregate->getOrigType () == |
|
CIM_NOTIFY_PROVIDER_REGISTRATION_REQUEST_MESSAGE); |
|
|
|
response = operationAggregate->getOrigRequest ()->buildResponse (); |
|
response->cimException = cimException; |
|
} |
|
|
|
_enqueueResponse (operationAggregate->getOrigRequest (), response); |
|
} |
|
|
|
PEG_METHOD_EXIT (); |
|
} |
|
|
|
CIMInstance IndicationService::_createAlertInstance ( | CIMInstance IndicationService::_createAlertInstance ( |
const CIMName & alertClassName, | const CIMName & alertClassName, |
const Array <CIMInstance> & subscriptions) | const Array <CIMInstance> & subscriptions) |
|
|
} | } |
#endif | #endif |
| |
void IndicationService::_sendEnable ( |
void IndicationService::_sendSubscriptionInitComplete () |
const Array <ProviderClassList> & enableProviders, |
|
const CIMRequestMessage * origRequest, |
|
const CIMObjectPath & path) |
|
{ |
|
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, "IndicationService::_sendEnable"); |
|
|
|
// If there are no providers to enable, just return |
|
if (enableProviders.size() == 0) |
|
{ |
|
return; |
|
} |
|
|
|
CIMRequestMessage * aggRequest = 0; |
|
|
|
if (origRequest == 0) |
|
{ |
|
// |
|
// Initialize -- no request associated with this enable |
|
// |
|
aggRequest = 0; |
|
} |
|
else |
|
{ |
|
// |
|
// Create Instance, Modify Instance, Provider Registration Change, |
|
// or Provider Enable |
|
// |
|
switch (origRequest->getType ()) |
|
{ |
|
case CIM_CREATE_INSTANCE_REQUEST_MESSAGE: |
|
{ |
|
CIMCreateInstanceRequestMessage * request = |
|
(CIMCreateInstanceRequestMessage *) origRequest; |
|
CIMCreateInstanceRequestMessage * requestCopy = |
|
new CIMCreateInstanceRequestMessage (* request); |
|
aggRequest = requestCopy; |
|
break; |
|
} |
|
|
|
case CIM_MODIFY_INSTANCE_REQUEST_MESSAGE: |
|
{ |
|
CIMModifyInstanceRequestMessage * request = |
|
(CIMModifyInstanceRequestMessage *) origRequest; |
|
CIMModifyInstanceRequestMessage * requestCopy = |
|
new CIMModifyInstanceRequestMessage (* request); |
|
aggRequest = requestCopy; |
|
break; |
|
} |
|
|
|
case CIM_NOTIFY_PROVIDER_REGISTRATION_REQUEST_MESSAGE: |
|
{ |
|
CIMNotifyProviderRegistrationRequestMessage * request = |
|
(CIMNotifyProviderRegistrationRequestMessage *) origRequest; |
|
CIMNotifyProviderRegistrationRequestMessage * requestCopy = |
|
new CIMNotifyProviderRegistrationRequestMessage (* request); |
|
aggRequest = requestCopy; |
|
break; |
|
} |
|
|
|
case CIM_NOTIFY_PROVIDER_ENABLE_REQUEST_MESSAGE: |
|
{ |
|
CIMNotifyProviderEnableRequestMessage * request = |
|
(CIMNotifyProviderEnableRequestMessage *) origRequest; |
|
CIMNotifyProviderEnableRequestMessage * requestCopy = |
|
new CIMNotifyProviderEnableRequestMessage (* request); |
|
aggRequest = requestCopy; |
|
break; |
|
} |
|
|
|
default: |
|
{ | { |
PEG_TRACE_STRING (TRC_INDICATION_SERVICE_INTERNAL, |
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, |
Tracer::LEVEL2, "Unexpected origRequest type " + |
"IndicationService::_sendSubscriptionInitComplete"); |
String (MessageTypeToString (origRequest->getType ())) + |
|
" in _sendEnable"); |
|
break; |
|
} |
|
} |
|
} |
|
|
|
// |
|
// Create an aggregate object for the enable indications requests |
|
// |
|
Array <CIMName> indicationSubclasses; // empty array -- not needed |
|
IndicationOperationAggregate * operationAggregate = |
|
new IndicationOperationAggregate (aggRequest, indicationSubclasses); |
|
operationAggregate->setNumberIssued (enableProviders.size ()); |
|
|
|
// |
|
// If original request was to create subscription instance, store the |
|
// object path of the created instance in the operation aggregate object |
|
// (because it will be needed for the response) |
|
// |
|
if (origRequest != 0) |
|
{ |
|
if (origRequest->getType () == CIM_CREATE_INSTANCE_REQUEST_MESSAGE) |
|
{ |
|
operationAggregate->setPath (path); |
|
} |
|
} |
|
| |
// | // |
// Send Enable request to each provider |
// Create the Subscription Init Complete request |
// |
|
for (Uint32 i = 0; i < enableProviders.size (); i++) |
|
{ |
|
// |
|
// Create the enable indications request |
|
// | // |
CIMEnableIndicationsRequestMessage * request = |
CIMSubscriptionInitCompleteRequestMessage * request = |
new CIMEnableIndicationsRequestMessage |
new CIMSubscriptionInitCompleteRequestMessage |
(XmlWriter::getNextMessageId (), | (XmlWriter::getNextMessageId (), |
QueueIdStack (_providerManager, getQueueId ())); | QueueIdStack (_providerManager, getQueueId ())); |
| |
// | // |
// Store a copy of the request in the operation aggregate instance |
// Send Subscription Initialization Complete request to provider manager |
// | // |
CIMEnableIndicationsRequestMessage * requestCopy = |
|
new CIMEnableIndicationsRequestMessage (* request); |
|
requestCopy->operationContext.insert(ProviderIdContainer |
|
(enableProviders [i].providerModule, |
|
enableProviders [i].provider)); |
|
operationAggregate->appendRequest (requestCopy); |
|
|
|
request->operationContext.insert(ProviderIdContainer |
|
(enableProviders [i].providerModule, |
|
enableProviders [i].provider)); |
|
|
|
AsyncOpNode* op = this->get_op (); | AsyncOpNode* op = this->get_op (); |
| |
AsyncLegacyOperationStart * async_req = |
AsyncLegacyOperationStart * asyncRequest = |
new AsyncLegacyOperationStart | new AsyncLegacyOperationStart |
(get_next_xid (), | (get_next_xid (), |
op, | op, |
|
|
request, | request, |
_queueId); | _queueId); |
| |
SendAsync |
AsyncReply * asyncReply = SendWait (asyncRequest); |
(op, |
|
_providerManager, |
|
IndicationService::_aggregationCallBack, |
|
this, |
|
operationAggregate); |
|
} |
|
|
|
PEG_METHOD_EXIT (); |
|
} |
|
|
|
void IndicationService::_sendDisable ( |
|
const Array <ProviderClassList> & disableProviders, |
|
const CIMRequestMessage * origRequest) |
|
{ |
|
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, |
|
"IndicationService::_sendDisable"); |
|
|
|
// If there are no providers to disable, just return |
|
if (disableProviders.size() == 0) |
|
{ |
|
return; |
|
} |
|
|
|
CIMRequestMessage * aggRequest = 0; |
|
|
|
if (origRequest == 0) |
|
{ |
|
// |
|
// Delete a referencing or expired subscription -- no request |
|
// associated with this delete |
|
// |
|
aggRequest = 0; |
|
} |
|
else |
|
{ |
|
// |
|
// Delete Instance, Modify Instance, or Provider Registration Change |
|
// |
|
switch (origRequest->getType ()) |
|
{ |
|
case CIM_DELETE_INSTANCE_REQUEST_MESSAGE: |
|
{ |
|
CIMDeleteInstanceRequestMessage * request = |
|
(CIMDeleteInstanceRequestMessage *) origRequest; |
|
CIMDeleteInstanceRequestMessage * requestCopy = |
|
new CIMDeleteInstanceRequestMessage (* request); |
|
aggRequest = requestCopy; |
|
break; |
|
} |
|
|
|
case CIM_MODIFY_INSTANCE_REQUEST_MESSAGE: |
|
{ |
|
CIMModifyInstanceRequestMessage * request = |
|
(CIMModifyInstanceRequestMessage *) origRequest; |
|
CIMModifyInstanceRequestMessage * requestCopy = |
|
new CIMModifyInstanceRequestMessage (* request); |
|
aggRequest = requestCopy; |
|
break; |
|
} |
|
|
|
case CIM_NOTIFY_PROVIDER_REGISTRATION_REQUEST_MESSAGE: |
|
{ |
|
CIMNotifyProviderRegistrationRequestMessage * request = |
|
(CIMNotifyProviderRegistrationRequestMessage *) origRequest; |
|
CIMNotifyProviderRegistrationRequestMessage * requestCopy = |
|
new CIMNotifyProviderRegistrationRequestMessage (* request); |
|
aggRequest = requestCopy; |
|
break; |
|
} |
|
|
|
default: |
|
{ |
|
PEG_TRACE_STRING (TRC_INDICATION_SERVICE_INTERNAL, |
|
Tracer::LEVEL2, "Unexpected origRequest type " + |
|
String (MessageTypeToString (origRequest->getType ())) + |
|
" in _sendDisable"); |
|
break; |
|
} |
|
} |
|
} |
|
|
|
// |
|
// Create an aggregate object for the disable indications requests |
|
// |
|
Array <CIMName> indicationSubclasses; // empty array -- not needed |
|
IndicationOperationAggregate * operationAggregate = |
|
new IndicationOperationAggregate (aggRequest, indicationSubclasses); |
|
operationAggregate->setNumberIssued (disableProviders.size ()); |
|
| |
// |
CIMSubscriptionInitCompleteResponseMessage * response = |
// Send Disable Indications request to each provider |
reinterpret_cast |
// |
<CIMSubscriptionInitCompleteResponseMessage *> |
for (Uint32 i = 0; i < disableProviders.size (); i++) |
((static_cast <AsyncLegacyOperationResult *> |
{ |
(asyncReply))->get_result ()); |
// |
|
// Create the disable indications request |
|
// |
|
CIMDisableIndicationsRequestMessage * request = |
|
new CIMDisableIndicationsRequestMessage |
|
(XmlWriter::getNextMessageId (), |
|
QueueIdStack (_providerManager, getQueueId ())); |
|
| |
// | // |
// Store a copy of the request in the operation aggregate instance |
// Note: the response does not contain interesting data |
// | // |
CIMDisableIndicationsRequestMessage * requestCopy = |
|
new CIMDisableIndicationsRequestMessage (* request); |
|
requestCopy->operationContext.insert(ProviderIdContainer |
|
(disableProviders [i].providerModule, |
|
disableProviders [i].provider)); |
|
operationAggregate->appendRequest (requestCopy); |
|
|
|
request->operationContext.insert(ProviderIdContainer |
|
(disableProviders [i].providerModule, |
|
disableProviders [i].provider)); |
|
|
|
AsyncOpNode* op = this->get_op (); |
|
|
|
AsyncLegacyOperationStart * async_req = |
|
new AsyncLegacyOperationStart |
|
(get_next_xid (), |
|
op, |
|
_providerManager, |
|
request, |
|
_queueId); |
|
|
|
SendAsync |
|
(op, |
|
_providerManager, |
|
IndicationService::_aggregationCallBack, |
|
this, |
|
operationAggregate); |
|
} |
|
| |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
} | } |