version 1.9, 2012/02/20 07:00:55
|
version 1.10, 2013/06/11 11:18:31
|
|
|
#include <Pegasus/Common/Tracer.h> | #include <Pegasus/Common/Tracer.h> |
#include <Pegasus/Common/Constants.h> | #include <Pegasus/Common/Constants.h> |
#include <Pegasus/Common/StringConversion.h> | #include <Pegasus/Common/StringConversion.h> |
|
#include <Pegasus/Common/MessageQueueService.h> |
#include <Pegasus/Config/ConfigManager.h> | #include <Pegasus/Config/ConfigManager.h> |
#include <Pegasus/Provider/CIMOMHandle.h> | #include <Pegasus/Provider/CIMOMHandle.h> |
#include "DestinationQueue.h" | #include "DestinationQueue.h" |
|
|
// Initialize with default values. | // Initialize with default values. |
Uint16 DestinationQueue::_maxDeliveryRetryAttempts = 3; | Uint16 DestinationQueue::_maxDeliveryRetryAttempts = 3; |
Uint64 DestinationQueue::_minDeliveryRetryIntervalUsec = 20 * 1000000; | Uint64 DestinationQueue::_minDeliveryRetryIntervalUsec = 20 * 1000000; |
|
Uint64 DestinationQueue::_minSubscriptionRemovalTimeIntervalUsec |
|
= 2592000 * 1000000ULL; // Default 30 days, Refer DSP1054. |
Uint64 DestinationQueue::_sequenceIdentifierLifetimeUsec = 600 * 1000000; | Uint64 DestinationQueue::_sequenceIdentifierLifetimeUsec = 600 * 1000000; |
|
|
String DestinationQueue::_indicationServiceName = "PG:IndicationService"; | String DestinationQueue::_indicationServiceName = "PG:IndicationService"; |
String DestinationQueue::_objectManagerName = "Pegasus"; | String DestinationQueue::_objectManagerName = "Pegasus"; |
|
Uint32 DestinationQueue::_indicationServiceQid; |
| |
DestinationQueue::IndDiscardedReasonMsgs | DestinationQueue::IndDiscardedReasonMsgs |
DestinationQueue::indDiscardedReasonMsgs[] = { | DestinationQueue::indDiscardedReasonMsgs[] = { |
|
|
// See DSP 1054 ver 1.1.0 Sec 7.10 | // See DSP 1054 ver 1.1.0 Sec 7.10 |
_sequenceIdentifierLifetimeUsec = _maxDeliveryRetryAttempts * | _sequenceIdentifierLifetimeUsec = _maxDeliveryRetryAttempts * |
_minDeliveryRetryIntervalUsec * 10; | _minDeliveryRetryIntervalUsec * 10; |
|
|
|
Uint32 subRemoveIntervalValue; |
|
instance.getProperty( |
|
instance.findProperty( |
|
_PROPERTY_SUBSCRIPTIONREMOVALTIMEINTERVAL)).getValue(). |
|
get(subRemoveIntervalValue); |
|
|
|
_minSubscriptionRemovalTimeIntervalUsec = |
|
subRemoveIntervalValue * 1000000ULL; |
|
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
} | } |
| |
|
|
"Initializaing the Destination Queue"); | "Initializaing the Destination Queue"); |
_initIndicationServiceProperties(); | _initIndicationServiceProperties(); |
_initObjectManagerProperties(); | _initObjectManagerProperties(); |
|
_indicationServiceQid = MessageQueueService::find_service_qid( |
|
PEGASUS_QUEUENAME_INDICATIONSERVICE); |
} | } |
catch(const Exception &e) | catch(const Exception &e) |
{ | { |
|
|
_retryAttemptsExceededIndications = 0; | _retryAttemptsExceededIndications = 0; |
_subscriptionDeleteDroppedIndications = 0; | _subscriptionDeleteDroppedIndications = 0; |
_calcMaxQueueSize = true; | _calcMaxQueueSize = true; |
_lastSuccessfulDeliveryTimeUsec = 0; |
|
_maxIndicationDeliveryQueueSize = 2400; | _maxIndicationDeliveryQueueSize = 2400; |
| |
|
_lastSuccessfulDeliveryTimeUsec = |
_queueCreationTimeUsec = System::getCurrentTimeUsec(); | _queueCreationTimeUsec = System::getCurrentTimeUsec(); |
|
|
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
} | } |
| |
|
|
_lastDeliveryRetryStatus = FAIL; | _lastDeliveryRetryStatus = FAIL; |
info->deliveryRetryAttemptsMade++; | info->deliveryRetryAttemptsMade++; |
| |
|
// If the last successful delivery time is greater than or equal to |
|
// SubscriptionRemovalTimeInterval, send message to indication service |
|
// to reconcile OnFatalErrorPolicy |
|
if (System::getCurrentTimeUsec() - _lastSuccessfulDeliveryTimeUsec >= |
|
_minSubscriptionRemovalTimeIntervalUsec) |
|
{ |
|
CIMProcessIndicationResponseMessage *response = |
|
new CIMProcessIndicationResponseMessage( |
|
XmlWriter::getNextMessageId(), |
|
CIMException(CIM_ERR_FAILED), |
|
QueueIdStack(_indicationServiceQid), |
|
String(), |
|
info->subscription); |
|
response->dest = _indicationServiceQid; |
|
MessageQueueService::SendForget(response); |
|
} |
|
|
// Check for DeliveryRetryAttempts by adding the original delivery attempt. | // Check for DeliveryRetryAttempts by adding the original delivery attempt. |
if (info->deliveryRetryAttemptsMade >= _maxDeliveryRetryAttempts + 1) | if (info->deliveryRetryAttemptsMade >= _maxDeliveryRetryAttempts + 1) |
{ | { |
|
|
qinfo.retryAttemptsExceededIndications = _retryAttemptsExceededIndications; | qinfo.retryAttemptsExceededIndications = _retryAttemptsExceededIndications; |
qinfo.subscriptionDisableDroppedIndications = | qinfo.subscriptionDisableDroppedIndications = |
_subscriptionDeleteDroppedIndications; | _subscriptionDeleteDroppedIndications; |
qinfo.lastSuccessfulDeliveryTimeUsec = _lastSuccessfulDeliveryTimeUsec; |
/* If the last successful delivery time is equals to the queue creation |
|
* time, indication delivery for this destination was never successful |
|
*/ |
|
qinfo.lastSuccessfulDeliveryTimeUsec = |
|
_lastSuccessfulDeliveryTimeUsec == _queueCreationTimeUsec ? 0 : |
|
_lastSuccessfulDeliveryTimeUsec; |
} | } |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |