version 1.1.2.1, 2004/03/10 14:19:29
|
version 1.2, 2004/05/18 23:58:41
|
|
|
}; | }; |
| |
| |
|
typedef void (*PEGASUS_INDICATION_CALLBACK)( |
|
CIMProcessIndicationRequestMessage*); |
|
|
class EnableIndicationsResponseHandler : public OperationResponseHandler, public SimpleIndicationResponseHandler | class EnableIndicationsResponseHandler : public OperationResponseHandler, public SimpleIndicationResponseHandler |
{ | { |
public: | public: |
|
|
CIMEnableIndicationsRequestMessage * request, | CIMEnableIndicationsRequestMessage * request, |
CIMEnableIndicationsResponseMessage * response, | CIMEnableIndicationsResponseMessage * response, |
CIMInstance & provider, | CIMInstance & provider, |
MessageQueueService * source, |
PEGASUS_INDICATION_CALLBACK indicationCallback) |
MessageQueueService * target = 0) |
|
: OperationResponseHandler(request, response), | : OperationResponseHandler(request, response), |
_source(source), |
|
_target(target), |
|
_request_copy(*request), | _request_copy(*request), |
_response_copy(*response) |
_response_copy(*response), |
|
_indicationCallback(indicationCallback) |
{ | { |
PEGASUS_ASSERT(_source != 0); |
|
|
|
_provider = provider; | _provider = provider; |
|
|
// get indication service |
|
if(_target == 0) |
|
{ |
|
Array<Uint32> serviceIds; |
|
|
|
_source->find_services(PEGASUS_QUEUENAME_INDICATIONSERVICE, 0, 0, &serviceIds); |
|
|
|
PEGASUS_ASSERT(serviceIds.size() != 0); |
|
|
|
_target = dynamic_cast<MessageQueueService *>(MessageQueue::lookup(serviceIds[0])); |
|
|
|
PEGASUS_ASSERT(_target != 0); |
|
} |
|
} | } |
| |
virtual void deliver(const CIMIndication & cimIndication) | virtual void deliver(const CIMIndication & cimIndication) |
|
|
subscriptionInstanceNames = | subscriptionInstanceNames = |
container.getInstanceNames(); | container.getInstanceNames(); |
} | } |
catch (Exception& e) |
catch (Exception&) |
{ | { |
subscriptionInstanceNames.clear(); | subscriptionInstanceNames.clear(); |
} | } |
|
|
(ContentLanguageListContainer::NAME); | (ContentLanguageListContainer::NAME); |
| |
contentLangs = langContainer.getLanguages(); | contentLangs = langContainer.getLanguages(); |
} catch (Exception & e) |
} |
|
catch (Exception&) |
{ | { |
// The provider did not explicitly set a Content-Language for | // The provider did not explicitly set a Content-Language for |
// the indication. Fall back to the lang set in this object. | // the indication. Fall back to the lang set in this object. |
|
|
cimInstance, | cimInstance, |
subscriptionInstanceNames, | subscriptionInstanceNames, |
_provider, | _provider, |
QueueIdStack(_target->getQueueId(), _source->getQueueId()), |
QueueIdStack(), // Must be filled in by the callback function |
contentLangs); | contentLangs); |
request->operationContext = context; | request->operationContext = context; |
| |
// send message |
_indicationCallback(request); |
// <<< Wed Apr 10 21:04:00 2002 mdd >>> |
|
// AsyncOpNode * op = _source->get_op(); |
|
|
|
AsyncLegacyOperationStart * asyncRequest = |
|
new AsyncLegacyOperationStart( |
|
_source->get_next_xid(), |
|
0, |
|
_target->getQueueId(), |
|
request, |
|
_target->getQueueId()); |
|
|
|
PEGASUS_ASSERT(asyncRequest != 0); |
|
|
|
//AsyncReply * asyncReply = _source->SendWait(asyncRequest); |
|
// <<< Wed Apr 10 21:04:50 2002 mdd >>> |
|
_source->SendForget(asyncRequest); |
|
//PEGASUS_ASSERT(asyncReply != 0); |
|
|
|
// Chip - receiver of the request should delete it |
|
//delete asyncRequest; |
|
// <<< Wed Apr 10 21:05:10 2002 mdd >>> |
|
} | } |
| |
virtual void deliver(const Array<CIMIndication> & cimIndications) | virtual void deliver(const Array<CIMIndication> & cimIndications) |
|
|
} | } |
} | } |
| |
protected: |
|
MessageQueueService * _source; |
|
MessageQueueService * _target; |
|
|
|
private: | private: |
CIMEnableIndicationsRequestMessage _request_copy; | CIMEnableIndicationsRequestMessage _request_copy; |
CIMEnableIndicationsResponseMessage _response_copy; | CIMEnableIndicationsResponseMessage _response_copy; |
|
PEGASUS_INDICATION_CALLBACK _indicationCallback; |
}; | }; |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |