version 1.217, 2007/05/25 20:48:47
|
version 1.218, 2007/06/19 17:58:03
|
|
|
#include <Pegasus/Common/ContentLanguageList.h> | #include <Pegasus/Common/ContentLanguageList.h> |
#include <Pegasus/Common/LanguageParser.h> | #include <Pegasus/Common/LanguageParser.h> |
#include <Pegasus/Common/OperationContextInternal.h> | #include <Pegasus/Common/OperationContextInternal.h> |
// l10n |
|
#include <Pegasus/Common/MessageLoader.h> | #include <Pegasus/Common/MessageLoader.h> |
#include <Pegasus/Common/String.h> | #include <Pegasus/Common/String.h> |
#include <Pegasus/Common/IndicationFormatter.h> | #include <Pegasus/Common/IndicationFormatter.h> |
|
// NOCHKSRC |
#include <Pegasus/Server/ProviderRegistrationManager/ProviderRegistrationManager.h> | #include <Pegasus/Server/ProviderRegistrationManager/ProviderRegistrationManager.h> |
|
// DOCHKSRC |
#include <Pegasus/Query/QueryExpression/QueryExpression.h> | #include <Pegasus/Query/QueryExpression/QueryExpression.h> |
#include <Pegasus/Query/QueryCommon/QueryException.h> | #include <Pegasus/Query/QueryCommon/QueryException.h> |
#include <Pegasus/Repository/RepositoryQueryContext.h> | #include <Pegasus/Repository/RepositoryQueryContext.h> |
|
|
IndicationService::IndicationService ( | IndicationService::IndicationService ( |
CIMRepository * repository, | CIMRepository * repository, |
ProviderRegistrationManager * providerRegManager) | ProviderRegistrationManager * providerRegManager) |
: MessageQueueService (PEGASUS_QUEUENAME_INDICATIONSERVICE, |
: MessageQueueService( |
MessageQueue::getNextQueueId ()), |
PEGASUS_QUEUENAME_INDICATIONSERVICE, MessageQueue::getNextQueueId()), |
_providerRegManager (providerRegManager), | _providerRegManager (providerRegManager), |
_cimRepository(repository) | _cimRepository(repository) |
{ | { |
|
|
// default to false (i.e., the more restrictive security | // default to false (i.e., the more restrictive security |
// setting. | // setting. |
PEG_TRACE_CSTRING(TRC_INDICATION_SERVICE, Tracer::LEVEL4, | PEG_TRACE_CSTRING(TRC_INDICATION_SERVICE, Tracer::LEVEL4, |
"Failure attempting to read configuration parameters during initialization."); |
"Failure attempting to read configuration parameters during " |
|
"initialization."); |
} | } |
| |
PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL4, | PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL4, |
|
|
} | } |
} | } |
| |
IndicationService::~IndicationService (void) |
IndicationService::~IndicationService() |
{ | { |
delete _subscriptionTable; | delete _subscriptionTable; |
delete _subscriptionRepository; | delete _subscriptionRepository; |
|
|
{ | { |
req->op->processing(); | req->op->processing(); |
Message *legacy = | Message *legacy = |
(static_cast<AsyncLegacyOperationStart *>(req)->get_action()); |
static_cast<AsyncLegacyOperationStart *>(req)->get_action(); |
legacy->put_async(req); | legacy->put_async(req); |
| |
handleEnqueue(legacy); | handleEnqueue(legacy); |
|
|
catch(Exception & ) | catch(Exception & ) |
{ | { |
PEG_TRACE_CSTRING(TRC_INDICATION_SERVICE, Tracer::LEVEL3, | PEG_TRACE_CSTRING(TRC_INDICATION_SERVICE, Tracer::LEVEL3, |
"Caught Exception in IndicationService while handling a wrapped legacy message "); |
"Caught Exception in IndicationService while handling a " |
|
"wrapped legacy message "); |
_make_response(req, async_results::CIM_NAK ); | _make_response(req, async_results::CIM_NAK ); |
} | } |
| |
|
|
stopWatch.start(); | stopWatch.start(); |
#endif | #endif |
| |
// l10n |
|
// Set the client's requested language into this service thread. | // Set the client's requested language into this service thread. |
// This will allow functions in this service to return messages | // This will allow functions in this service to return messages |
// in the correct language. | // in the correct language. |
|
|
{ | { |
if (msg->thread_changed()) | if (msg->thread_changed()) |
{ | { |
AcceptLanguageList *langs = new AcceptLanguageList |
AcceptLanguageList *langs = new AcceptLanguageList( |
(((AcceptLanguageListContainer)msg->operationContext.get |
((AcceptLanguageListContainer)msg->operationContext.get( |
(AcceptLanguageListContainer::NAME)).getLanguages()); |
AcceptLanguageListContainer::NAME)).getLanguages()); |
Thread::setLanguages(langs); | Thread::setLanguages(langs); |
} | } |
} | } |
|
|
stopWatch.stop(); | stopWatch.stop(); |
| |
PEG_TRACE((TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL2, | PEG_TRACE((TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL2, |
"%s: %.3f seconds", MessageTypeToString(message->getType()), stopWatch.getElapsed())); |
"%s: %.3f seconds", |
|
MessageTypeToString(message->getType()), |
|
stopWatch.getElapsed())); |
#endif | #endif |
| |
delete message; | delete message; |
} | } |
| |
void IndicationService::handleEnqueue(void) |
void IndicationService::handleEnqueue() |
{ | { |
Message * message = dequeue(); | Message * message = dequeue(); |
| |
|
|
handleEnqueue(message); | handleEnqueue(message); |
} | } |
| |
void IndicationService::_initialize (void) |
void IndicationService::_initialize() |
{ | { |
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, "IndicationService::_initialize"); | PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, "IndicationService::_initialize"); |
| |
|
|
_supportedSubscriptionProperties.append (PEGASUS_PROPERTYNAME_HANDLER); | _supportedSubscriptionProperties.append (PEGASUS_PROPERTYNAME_HANDLER); |
_supportedSubscriptionProperties.append (_PROPERTY_ONFATALERRORPOLICY); | _supportedSubscriptionProperties.append (_PROPERTY_ONFATALERRORPOLICY); |
_supportedSubscriptionProperties.append (_PROPERTY_OTHERONFATALERRORPOLICY); | _supportedSubscriptionProperties.append (_PROPERTY_OTHERONFATALERRORPOLICY); |
_supportedSubscriptionProperties.append |
_supportedSubscriptionProperties.append( |
(_PROPERTY_FAILURETRIGGERTIMEINTERVAL); |
_PROPERTY_FAILURETRIGGERTIMEINTERVAL); |
_supportedSubscriptionProperties.append (PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE); |
_supportedSubscriptionProperties.append( |
|
PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE); |
_supportedSubscriptionProperties.append (_PROPERTY_OTHERSTATE); | _supportedSubscriptionProperties.append (_PROPERTY_OTHERSTATE); |
_supportedSubscriptionProperties.append (_PROPERTY_LASTCHANGE); | _supportedSubscriptionProperties.append (_PROPERTY_LASTCHANGE); |
_supportedSubscriptionProperties.append (_PROPERTY_DURATION); | _supportedSubscriptionProperties.append (_PROPERTY_DURATION); |
_supportedSubscriptionProperties.append (_PROPERTY_STARTTIME); | _supportedSubscriptionProperties.append (_PROPERTY_STARTTIME); |
_supportedSubscriptionProperties.append (_PROPERTY_TIMEREMAINING); | _supportedSubscriptionProperties.append (_PROPERTY_TIMEREMAINING); |
_supportedSubscriptionProperties.append |
_supportedSubscriptionProperties.append(_PROPERTY_REPEATNOTIFICATIONPOLICY); |
(_PROPERTY_REPEATNOTIFICATIONPOLICY); |
_supportedSubscriptionProperties.append( |
_supportedSubscriptionProperties.append |
_PROPERTY_OTHERREPEATNOTIFICATIONPOLICY); |
(_PROPERTY_OTHERREPEATNOTIFICATIONPOLICY); |
_supportedSubscriptionProperties.append( |
_supportedSubscriptionProperties.append |
_PROPERTY_REPEATNOTIFICATIONINTERVAL); |
(_PROPERTY_REPEATNOTIFICATIONINTERVAL); |
|
_supportedSubscriptionProperties.append (_PROPERTY_REPEATNOTIFICATIONGAP); | _supportedSubscriptionProperties.append (_PROPERTY_REPEATNOTIFICATIONGAP); |
_supportedSubscriptionProperties.append (_PROPERTY_REPEATNOTIFICATIONCOUNT); | _supportedSubscriptionProperties.append (_PROPERTY_REPEATNOTIFICATIONCOUNT); |
| |
_supportedFormattedSubscriptionProperties = | _supportedFormattedSubscriptionProperties = |
_supportedSubscriptionProperties; | _supportedSubscriptionProperties; |
_supportedFormattedSubscriptionProperties.append |
_supportedFormattedSubscriptionProperties.append( |
(_PROPERTY_TEXTFORMATOWNINGENTITY); |
_PROPERTY_TEXTFORMATOWNINGENTITY); |
_supportedFormattedSubscriptionProperties.append |
_supportedFormattedSubscriptionProperties.append( |
(_PROPERTY_TEXTFORMATID); |
_PROPERTY_TEXTFORMATID); |
_supportedFormattedSubscriptionProperties.append |
_supportedFormattedSubscriptionProperties.append( |
(_PROPERTY_TEXTFORMAT); |
_PROPERTY_TEXTFORMAT); |
_supportedFormattedSubscriptionProperties.append |
_supportedFormattedSubscriptionProperties.append( |
(_PROPERTY_TEXTFORMATPARAMETERS); |
_PROPERTY_TEXTFORMATPARAMETERS); |
| |
_supportedFilterProperties.append (_PROPERTY_CAPTION); | _supportedFilterProperties.append (_PROPERTY_CAPTION); |
_supportedFilterProperties.append (_PROPERTY_DESCRIPTION); | _supportedFilterProperties.append (_PROPERTY_DESCRIPTION); |
|
|
commonListenerDestinationProperties.append (_PROPERTY_CAPTION); | commonListenerDestinationProperties.append (_PROPERTY_CAPTION); |
commonListenerDestinationProperties.append (_PROPERTY_DESCRIPTION); | commonListenerDestinationProperties.append (_PROPERTY_DESCRIPTION); |
commonListenerDestinationProperties.append (_PROPERTY_ELEMENTNAME); | commonListenerDestinationProperties.append (_PROPERTY_ELEMENTNAME); |
commonListenerDestinationProperties.append |
commonListenerDestinationProperties.append( |
(_PROPERTY_SYSTEMCREATIONCLASSNAME); |
_PROPERTY_SYSTEMCREATIONCLASSNAME); |
commonListenerDestinationProperties.append (_PROPERTY_SYSTEMNAME); | commonListenerDestinationProperties.append (_PROPERTY_SYSTEMNAME); |
commonListenerDestinationProperties.append (PEGASUS_PROPERTYNAME_CREATIONCLASSNAME); |
commonListenerDestinationProperties.append( |
|
PEGASUS_PROPERTYNAME_CREATIONCLASSNAME); |
commonListenerDestinationProperties.append (PEGASUS_PROPERTYNAME_NAME); | commonListenerDestinationProperties.append (PEGASUS_PROPERTYNAME_NAME); |
commonListenerDestinationProperties.append (PEGASUS_PROPERTYNAME_PERSISTENCETYPE); |
commonListenerDestinationProperties.append( |
|
PEGASUS_PROPERTYNAME_PERSISTENCETYPE); |
commonListenerDestinationProperties.append (_PROPERTY_OTHERPERSISTENCETYPE); | commonListenerDestinationProperties.append (_PROPERTY_OTHERPERSISTENCETYPE); |
| |
_supportedCIMXMLHandlerProperties = commonListenerDestinationProperties; | _supportedCIMXMLHandlerProperties = commonListenerDestinationProperties; |
_supportedCIMXMLHandlerProperties.append (_PROPERTY_OWNER); | _supportedCIMXMLHandlerProperties.append (_PROPERTY_OWNER); |
_supportedCIMXMLHandlerProperties.append |
_supportedCIMXMLHandlerProperties.append( |
(PEGASUS_PROPERTYNAME_LSTNRDST_DESTINATION); |
PEGASUS_PROPERTYNAME_LSTNRDST_DESTINATION); |
| |
_supportedCIMXMLListenerDestinationProperties = | _supportedCIMXMLListenerDestinationProperties = |
commonListenerDestinationProperties; | commonListenerDestinationProperties; |
_supportedCIMXMLListenerDestinationProperties.append |
_supportedCIMXMLListenerDestinationProperties.append( |
(PEGASUS_PROPERTYNAME_LSTNRDST_DESTINATION); |
PEGASUS_PROPERTYNAME_LSTNRDST_DESTINATION); |
| |
_supportedSNMPHandlerProperties = commonListenerDestinationProperties; | _supportedSNMPHandlerProperties = commonListenerDestinationProperties; |
_supportedSNMPHandlerProperties.append (_PROPERTY_OWNER); | _supportedSNMPHandlerProperties.append (_PROPERTY_OWNER); |
_supportedSNMPHandlerProperties.append |
_supportedSNMPHandlerProperties.append( |
(PEGASUS_PROPERTYNAME_LSTNRDST_TARGETHOST); |
PEGASUS_PROPERTYNAME_LSTNRDST_TARGETHOST); |
_supportedSNMPHandlerProperties.append (_PROPERTY_TARGETHOSTFORMAT); | _supportedSNMPHandlerProperties.append (_PROPERTY_TARGETHOSTFORMAT); |
_supportedSNMPHandlerProperties.append (_PROPERTY_OTHERTARGETHOSTFORMAT); | _supportedSNMPHandlerProperties.append (_PROPERTY_OTHERTARGETHOSTFORMAT); |
_supportedSNMPHandlerProperties.append (_PROPERTY_PORTNUMBER); | _supportedSNMPHandlerProperties.append (_PROPERTY_PORTNUMBER); |
|
|
| |
_supportedEmailListenerDestinationProperties = | _supportedEmailListenerDestinationProperties = |
commonListenerDestinationProperties; | commonListenerDestinationProperties; |
_supportedEmailListenerDestinationProperties.append |
_supportedEmailListenerDestinationProperties.append( |
(PEGASUS_PROPERTYNAME_LSTNRDST_MAILTO); |
PEGASUS_PROPERTYNAME_LSTNRDST_MAILTO); |
_supportedEmailListenerDestinationProperties.append |
_supportedEmailListenerDestinationProperties.append( |
(PEGASUS_PROPERTYNAME_LSTNRDST_MAILCC); |
PEGASUS_PROPERTYNAME_LSTNRDST_MAILCC); |
_supportedEmailListenerDestinationProperties.append |
_supportedEmailListenerDestinationProperties.append( |
(PEGASUS_PROPERTYNAME_LSTNRDST_MAILSUBJECT); |
PEGASUS_PROPERTYNAME_LSTNRDST_MAILSUBJECT); |
| |
// | // |
// Get existing active subscriptions from each namespace in the repository | // Get existing active subscriptions from each namespace in the repository |
// | // |
invalidInstance = _subscriptionRepository->getActiveSubscriptions |
invalidInstance = _subscriptionRepository->getActiveSubscriptions( |
(activeSubscriptions); |
activeSubscriptions); |
noProviderSubscriptions.clear (); | noProviderSubscriptions.clear (); |
| |
PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL4, | PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL4, |
|
|
// Append this subscription to no provider list and | // Append this subscription to no provider list and |
// Insert entries into the subscription hash tables | // Insert entries into the subscription hash tables |
// | // |
if (!_subscriptionRepository->reconcileFatalError |
if (!_subscriptionRepository->reconcileFatalError( |
(activeSubscriptions [i])) |
activeSubscriptions[i])) |
{ | { |
noProviderSubscriptions.append (activeSubscriptions [i]); | noProviderSubscriptions.append (activeSubscriptions [i]); |
| |
|
|
continue; | continue; |
} | } |
| |
//l10n start |
|
// Get the language tags that were saved with the subscription instance | // Get the language tags that were saved with the subscription instance |
AcceptLanguageList acceptLangs; | AcceptLanguageList acceptLangs; |
Uint32 propIndex = instance.findProperty |
Uint32 propIndex = instance.findProperty( |
(PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); |
PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
String acceptLangsString; | String acceptLangsString; |
|
|
} | } |
} | } |
ContentLanguageList contentLangs; | ContentLanguageList contentLangs; |
propIndex = instance.findProperty |
propIndex = instance.findProperty( |
(PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); |
PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
String contentLangsString; | String contentLangsString; |
|
|
contentLangsString); | contentLangsString); |
} | } |
} | } |
// l10n end |
|
| |
// | // |
// Send Create request message to each provider | // Send Create request message to each provider |
|
|
// significant performance issue. | // significant performance issue. |
// | // |
Array <ProviderClassList> acceptedProviders; | Array <ProviderClassList> acceptedProviders; |
acceptedProviders = _sendWaitCreateRequests |
acceptedProviders = _sendWaitCreateRequests( |
(indicationProviders, sourceNameSpace, |
indicationProviders, sourceNameSpace, |
propertyList, condition, query, queryLanguage, | propertyList, condition, query, queryLanguage, |
activeSubscriptions [i], | activeSubscriptions [i], |
acceptLangs, | acceptLangs, |
|
|
// If subscription is not disabled or removed, send alert and | // If subscription is not disabled or removed, send alert and |
// Insert entries into the subscription hash tables | // Insert entries into the subscription hash tables |
// | // |
if (!_subscriptionRepository->reconcileFatalError |
if (!_subscriptionRepository->reconcileFatalError( |
(activeSubscriptions [i])) |
activeSubscriptions[i])) |
{ | { |
// | // |
// Insert entries into the subscription hash tables | // Insert entries into the subscription hash tables |
// | // |
_subscriptionTable->insertSubscription |
_subscriptionTable->insertSubscription( |
(activeSubscriptions [i], |
activeSubscriptions[i], |
acceptedProviders, | acceptedProviders, |
indicationSubclasses, | indicationSubclasses, |
sourceNameSpace); | sourceNameSpace); |
|
|
// | // |
Array <CIMInstance> subscriptions; | Array <CIMInstance> subscriptions; |
subscriptions.append (activeSubscriptions [i]); | subscriptions.append (activeSubscriptions [i]); |
CIMInstance indicationInstance = _createAlertInstance |
CIMInstance indicationInstance = _createAlertInstance( |
(_CLASS_NO_PROVIDER_ALERT, subscriptions); |
_CLASS_NO_PROVIDER_ALERT, subscriptions); |
| |
PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL4, | PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL4, |
"Sending NoProvider Alert for %u subscriptions", | "Sending NoProvider Alert for %u subscriptions", |
|
|
// | // |
// Get Subscription Filter Name and Handler Name | // Get Subscription Filter Name and Handler Name |
// | // |
String logString = _getSubscriptionLogString |
String logString = _getSubscriptionLogString( |
(activeSubscriptions [i]); |
activeSubscriptions[i]); |
| |
// | // |
// Log a message for the subscription | // Log a message for the subscription |
|
|
Logger::put_l (Logger::STANDARD_LOG, System::CIMSERVER, | Logger::put_l (Logger::STANDARD_LOG, System::CIMSERVER, |
Logger::WARNING, _MSG_NO_PROVIDER_KEY, _MSG_NO_PROVIDER, | Logger::WARNING, _MSG_NO_PROVIDER_KEY, _MSG_NO_PROVIDER, |
logString, | logString, |
activeSubscriptions[i].getPath().getNameSpace().getString()); |
activeSubscriptions[i].getPath().getNameSpace(). |
|
getString()); |
} | } |
} | } |
else | else |
|
|
// At least one provider accepted the subscription | // At least one provider accepted the subscription |
// Insert entries into the subscription hash tables | // Insert entries into the subscription hash tables |
// | // |
_subscriptionTable->insertSubscription |
_subscriptionTable->insertSubscription( |
(activeSubscriptions [i], |
activeSubscriptions[i], |
acceptedProviders, | acceptedProviders, |
indicationSubclasses, | indicationSubclasses, |
sourceNameSpace); | sourceNameSpace); |
|
|
// Send NoProviderAlertIndication to handler instances | // Send NoProviderAlertIndication to handler instances |
// ATTN: NoProviderAlertIndication must be defined | // ATTN: NoProviderAlertIndication must be defined |
// | // |
CIMInstance indicationInstance = _createAlertInstance |
CIMInstance indicationInstance = _createAlertInstance( |
(_CLASS_NO_PROVIDER_ALERT, noProviderSubscriptions); |
_CLASS_NO_PROVIDER_ALERT, noProviderSubscriptions); |
| |
PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL4, | PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL4, |
"Sending NoProvider Alert for %u subscriptions", | "Sending NoProvider Alert for %u subscriptions", |
|
|
// | // |
// Get Subscription Filter Name and Handler Name | // Get Subscription Filter Name and Handler Name |
// | // |
String logString = _getSubscriptionLogString |
String logString = |
(noProviderSubscriptions [i]); |
_getSubscriptionLogString(noProviderSubscriptions[i]); |
| |
Logger::put_l (Logger::STANDARD_LOG, System::CIMSERVER, |
Logger::put_l( |
Logger::WARNING, _MSG_NO_PROVIDER_KEY, _MSG_NO_PROVIDER, |
Logger::STANDARD_LOG, System::CIMSERVER, Logger::WARNING, |
|
_MSG_NO_PROVIDER_KEY, |
|
_MSG_NO_PROVIDER, |
logString, | logString, |
noProviderSubscriptions[i].getPath().getNameSpace().getString()); |
noProviderSubscriptions[i].getPath().getNameSpace(). |
|
getString()); |
} | } |
} | } |
| |
|
|
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
} | } |
| |
void IndicationService::_terminate (void) |
void IndicationService::_terminate() |
{ | { |
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, "IndicationService::_terminate"); | PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, "IndicationService::_terminate"); |
| |
|
|
// Create CimomShutdownAlertIndication instance | // Create CimomShutdownAlertIndication instance |
// ATTN: CimomShutdownAlertIndication must be defined | // ATTN: CimomShutdownAlertIndication must be defined |
// | // |
indicationInstance = _createAlertInstance (_CLASS_CIMOM_SHUTDOWN_ALERT, |
indicationInstance = _createAlertInstance( |
activeSubscriptions); |
_CLASS_CIMOM_SHUTDOWN_ALERT, activeSubscriptions); |
| |
// | // |
// Send CimomShutdownAlertIndication to each unique handler instance | // Send CimomShutdownAlertIndication to each unique handler instance |
|
|
else | else |
{ | { |
PEG_TRACE_STRING (TRC_INDICATION_SERVICE, Tracer::LEVEL4, | PEG_TRACE_STRING (TRC_INDICATION_SERVICE, Tracer::LEVEL4, |
"_checkNonprivilegedAuthorization - checking whether user is privileged" |
"_checkNonprivilegedAuthorization - checking whether user is " |
|
"privileged" |
+ userName); | + userName); |
if (!System::isPrivilegedUser(userName)) | if (!System::isPrivilegedUser(userName)) |
{ | { |
|
|
| |
try | try |
{ | { |
String userName = ((IdentityContainer)request->operationContext.get |
String userName = ((IdentityContainer)request->operationContext.get( |
(IdentityContainer :: NAME)).getUserName(); |
IdentityContainer::NAME)).getUserName(); |
_checkNonprivilegedAuthorization(userName); | _checkNonprivilegedAuthorization(userName); |
| |
AcceptLanguageList acceptLangs = | AcceptLanguageList acceptLangs = |
((AcceptLanguageListContainer)request->operationContext.get |
((AcceptLanguageListContainer)request->operationContext.get( |
(AcceptLanguageListContainer::NAME)).getLanguages(); |
AcceptLanguageListContainer::NAME)).getLanguages(); |
ContentLanguageList contentLangs = | ContentLanguageList contentLangs = |
((ContentLanguageListContainer)request->operationContext.get |
((ContentLanguageListContainer)request->operationContext.get( |
(ContentLanguageListContainer::NAME)).getLanguages(); |
ContentLanguageListContainer::NAME)).getLanguages(); |
| |
if (_canCreate (instance, request->nameSpace)) | if (_canCreate (instance, request->nameSpace)) |
{ | { |
|
|
Array <CIMName> indicationSubclasses; | Array <CIMName> indicationSubclasses; |
Array <ProviderClassList> indicationProviders; | Array <ProviderClassList> indicationProviders; |
| |
if ((instance.getClassName ().equal |
if ((instance.getClassName().equal( |
(PEGASUS_CLASSNAME_INDSUBSCRIPTION)) || |
PEGASUS_CLASSNAME_INDSUBSCRIPTION)) || |
(instance.getClassName ().equal |
(instance.getClassName().equal( |
(PEGASUS_CLASSNAME_FORMATTEDINDSUBSCRIPTION))) |
PEGASUS_CLASSNAME_FORMATTEDINDSUBSCRIPTION))) |
{ | { |
// | // |
// Get subscription state | // Get subscription state |
|
|
// the default value; if invalid, an exception was thrown | // the default value; if invalid, an exception was thrown |
// | // |
CIMValue subscriptionStateValue; | CIMValue subscriptionStateValue; |
subscriptionStateValue = instance.getProperty |
subscriptionStateValue = instance.getProperty( |
(instance.findProperty (PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE)).getValue (); |
instance.findProperty( |
|
PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE)).getValue(); |
subscriptionStateValue.get (subscriptionState); | subscriptionStateValue.get (subscriptionState); |
| |
if ((subscriptionState == STATE_ENABLED) || | if ((subscriptionState == STATE_ENABLED) || |
|
|
// | // |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
| |
// l10n |
|
// throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED, |
|
// _MSG_NO_PROVIDERS); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_NOT_SUPPORTED, | throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_NOT_SUPPORTED, |
MessageLoaderParms(_MSG_NO_PROVIDERS_KEY, | MessageLoaderParms(_MSG_NO_PROVIDERS_KEY, |
_MSG_NO_PROVIDERS)); | _MSG_NO_PROVIDERS)); |
|
|
// | // |
// Send Create request message to each provider | // Send Create request message to each provider |
// | // |
// l10n |
|
_sendAsyncCreateRequests (indicationProviders, | _sendAsyncCreateRequests (indicationProviders, |
sourceNameSpace, requiredProperties, condition, | sourceNameSpace, requiredProperties, condition, |
query, queryLanguage, instance, | query, queryLanguage, instance, |
|
|
// | // |
// Create instance for disabled subscription | // Create instance for disabled subscription |
// | // |
instanceRef = _subscriptionRepository->createInstance |
instanceRef = _subscriptionRepository->createInstance( |
(instance, request->nameSpace, userName, |
instance, request->nameSpace, userName, |
acceptLangs, contentLangs, |
acceptLangs, contentLangs, false); |
false); |
|
} | } |
} | } |
else | else |
|
|
// | // |
// Create instance for filter or handler | // Create instance for filter or handler |
// | // |
instanceRef = _subscriptionRepository->createInstance |
instanceRef = _subscriptionRepository->createInstance( |
(instance, request->nameSpace, userName, |
instance, request->nameSpace, userName, |
acceptLangs, contentLangs, |
acceptLangs, contentLangs, false); |
false); |
|
} | } |
} | } |
} | } |
|
|
| |
try | try |
{ | { |
String userName = ((IdentityContainer)request->operationContext.get |
String userName = ((IdentityContainer)request->operationContext.get( |
(IdentityContainer :: NAME)).getUserName(); |
IdentityContainer::NAME)).getUserName(); |
_checkNonprivilegedAuthorization(userName ); | _checkNonprivilegedAuthorization(userName ); |
| |
// | // |
|
|
// | // |
// Get instance from repository | // Get instance from repository |
// | // |
instance = _subscriptionRepository->getInstance |
instance = _subscriptionRepository->getInstance( |
(request->nameSpace, request->instanceName, request->localOnly, |
request->nameSpace, request->instanceName, request->localOnly, |
request->includeQualifiers, request->includeClassOrigin, | request->includeQualifiers, request->includeClassOrigin, |
propertyList); | propertyList); |
| |
|
|
// L10N TODO DONE -- new throw of exception | // L10N TODO DONE -- new throw of exception |
// | // |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
//throw PEGASUS_CIM_EXCEPTION (CIM_ERR_FAILED, |
|
//_MSG_INVALID_INSTANCES); |
|
MessageLoaderParms parms(_MSG_INVALID_INSTANCES_KEY, | MessageLoaderParms parms(_MSG_INVALID_INSTANCES_KEY, |
_MSG_INVALID_INSTANCES); | _MSG_INVALID_INSTANCES); |
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms); | throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms); |
} | } |
instance.removeProperty (instance.findProperty |
instance.removeProperty(instance.findProperty( |
(PEGASUS_PROPERTYNAME_INDSUB_CREATOR)); |
PEGASUS_PROPERTYNAME_INDSUB_CREATOR)); |
| |
// l10n start |
|
// | // |
// Remove the language properties from instance before returning | // Remove the language properties from instance before returning |
// | // |
Uint32 propIndex = instance.findProperty |
Uint32 propIndex = instance.findProperty( |
(PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); |
PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
instance.removeProperty (propIndex); | instance.removeProperty (propIndex); |
} | } |
| |
propIndex = instance.findProperty |
propIndex = instance.findProperty( |
(PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); |
PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
// Get the content languages to be sent in the Content-Language header |
// Get the content languages to be sent in the Content-Language |
|
// header |
instance.getProperty(propIndex).getValue().get(contentLangsString); | instance.getProperty(propIndex).getValue().get(contentLangsString); |
instance.removeProperty (propIndex); | instance.removeProperty (propIndex); |
} | } |
// l10n end |
|
| |
// | // |
// If a subscription with a duration, calculate subscription time | // If a subscription with a duration, calculate subscription time |
|
|
} | } |
if (startTimeAdded) | if (startTimeAdded) |
{ | { |
instance.removeProperty (instance.findProperty |
instance.removeProperty(instance.findProperty( |
(_PROPERTY_STARTTIME)); |
_PROPERTY_STARTTIME)); |
} | } |
if (durationAdded) | if (durationAdded) |
{ | { |
instance.removeProperty (instance.findProperty |
instance.removeProperty(instance.findProperty( |
(_PROPERTY_DURATION)); |
_PROPERTY_DURATION)); |
} | } |
} | } |
} | } |
|
|
} | } |
catch (Exception& exception) | catch (Exception& exception) |
{ | { |
cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
cimException = |
exception.getMessage()); |
PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, exception.getMessage()); |
} | } |
| |
CIMGetInstanceResponseMessage * response = dynamic_cast |
CIMGetInstanceResponseMessage * response = |
<CIMGetInstanceResponseMessage *> (request->buildResponse ()); |
dynamic_cast<CIMGetInstanceResponseMessage *>(request->buildResponse()); |
response->cimException = cimException; | response->cimException = cimException; |
if (contentLangsString.size()) | if (contentLangsString.size()) |
{ | { |
|
|
| |
try | try |
{ | { |
String userName = ((IdentityContainer)request->operationContext.get |
String userName = ((IdentityContainer)request->operationContext.get( |
(IdentityContainer :: NAME)).getUserName(); |
IdentityContainer::NAME)).getUserName(); |
_checkNonprivilegedAuthorization(userName); | _checkNonprivilegedAuthorization(userName); |
| |
// | // |
|
|
request->includeQualifiers, request->includeClassOrigin, | request->includeQualifiers, request->includeClassOrigin, |
propertyList); | propertyList); |
| |
// l10n |
|
// Vars used to aggregate the content languages of the subscription | // Vars used to aggregate the content languages of the subscription |
// instances. | // instances. |
Boolean langMismatch = false; | Boolean langMismatch = false; |
|
|
// | // |
continue; | continue; |
} | } |
enumInstances [i].removeProperty |
enumInstances[i].removeProperty( |
(enumInstances [i].findProperty |
enumInstances[i].findProperty( |
(PEGASUS_PROPERTYNAME_INDSUB_CREATOR)); |
PEGASUS_PROPERTYNAME_INDSUB_CREATOR)); |
| |
// l10n start |
propIndex = enumInstances[i].findProperty( |
propIndex = enumInstances [i].findProperty |
PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); |
(PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); |
|
String contentLangs; | String contentLangs; |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
enumInstances [i].getProperty(propIndex).getValue().get |
enumInstances[i].getProperty(propIndex).getValue().get( |
(contentLangs); |
contentLangs); |
enumInstances [i].removeProperty(propIndex); | enumInstances [i].removeProperty(propIndex); |
} | } |
| |
propIndex = enumInstances [i].findProperty |
propIndex = enumInstances[i].findProperty( |
(PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); |
PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
enumInstances [i].removeProperty(propIndex); | enumInstances [i].removeProperty(propIndex); |
} | } |
| |
// Determine what to set into the Content-Language header back to the client |
// Determine what to set into the Content-Language header back to |
|
// the client |
if (!langMismatch) | if (!langMismatch) |
{ | { |
if (contentLangs == String::EMPTY) | if (contentLangs == String::EMPTY) |
|
|
} | } |
} | } |
} | } |
// l10n end |
|
| |
// | // |
// If a subscription with a duration, calculate subscription time | // If a subscription with a duration, calculate subscription time |
|
|
try | try |
{ | { |
_setTimeRemaining (enumInstances [i]); | _setTimeRemaining (enumInstances [i]); |
} catch (DateTimeOutOfRangeException &) |
} |
|
catch (DateTimeOutOfRangeException&) |
{ | { |
// | // |
// This instance from the repository is invalid | // This instance from the repository is invalid |
|
|
} | } |
if (startTimeAdded) | if (startTimeAdded) |
{ | { |
enumInstances [i].removeProperty |
enumInstances[i].removeProperty( |
(enumInstances [i].findProperty (_PROPERTY_STARTTIME)); |
enumInstances[i].findProperty(_PROPERTY_STARTTIME)); |
} | } |
if (durationAdded) | if (durationAdded) |
{ | { |
enumInstances [i].removeProperty |
enumInstances[i].removeProperty( |
(enumInstances [i].findProperty (_PROPERTY_DURATION)); |
enumInstances[i].findProperty(_PROPERTY_DURATION)); |
} | } |
} | } |
| |
|
|
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
} | } |
| |
void IndicationService::_handleEnumerateInstanceNamesRequest |
void IndicationService::_handleEnumerateInstanceNamesRequest( |
(const Message* message) |
const Message* message) |
{ | { |
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, | PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, |
"IndicationService::_handleEnumerateInstanceNamesRequest"); | "IndicationService::_handleEnumerateInstanceNamesRequest"); |
|
|
| |
try | try |
{ | { |
String userName = ((IdentityContainer)request->operationContext.get |
String userName = ((IdentityContainer)request->operationContext.get( |
(IdentityContainer :: NAME)).getUserName(); |
IdentityContainer::NAME)).getUserName(); |
_checkNonprivilegedAuthorization(userName); | _checkNonprivilegedAuthorization(userName); |
enumInstanceNames = | enumInstanceNames = |
_subscriptionRepository->enumerateInstanceNamesForClass |
_subscriptionRepository->enumerateInstanceNamesForClass( |
(request->nameSpace, request->className); |
request->nameSpace, request->className); |
} | } |
catch (CIMException& exception) | catch (CIMException& exception) |
{ | { |
|
|
| |
try | try |
{ | { |
String userName = ((IdentityContainer)request->operationContext.get |
String userName = ((IdentityContainer)request->operationContext.get( |
(IdentityContainer :: NAME)).getUserName(); |
IdentityContainer::NAME)).getUserName(); |
_checkNonprivilegedAuthorization(userName); | _checkNonprivilegedAuthorization(userName); |
| |
// | // |
// Get the instance name | // Get the instance name |
// | // |
CIMObjectPath instanceReference = |
CIMObjectPath instanceReference = request->modifiedInstance.getPath(); |
request->modifiedInstance.getPath (); |
|
| |
// | // |
// Get instance from repository | // Get instance from repository |
// | // |
CIMInstance instance; | CIMInstance instance; |
| |
instance = _subscriptionRepository->getInstance |
instance = _subscriptionRepository->getInstance( |
(request->nameSpace, instanceReference); |
request->nameSpace, instanceReference); |
| |
CIMInstance modifiedInstance = request->modifiedInstance; | CIMInstance modifiedInstance = request->modifiedInstance; |
if (_canModify (request, instanceReference, instance, modifiedInstance)) | if (_canModify (request, instanceReference, instance, modifiedInstance)) |
|
|
| |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
| |
// l10n |
|
|
|
// String exceptionStr = _MSG_EXPIRED; |
|
// throw PEGASUS_CIM_EXCEPTION (CIM_ERR_FAILED, exceptionStr); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, | throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
MessageLoaderParms(_MSG_EXPIRED_KEY, _MSG_EXPIRED)); | MessageLoaderParms(_MSG_EXPIRED_KEY, _MSG_EXPIRED)); |
} | } |
} catch (DateTimeOutOfRangeException &) |
} |
|
catch (DateTimeOutOfRangeException&) |
{ | { |
// | // |
// This instance from the repository is invalid | // This instance from the repository is invalid |
|
|
// L10N TODO DONE -- new throw of exception | // L10N TODO DONE -- new throw of exception |
// | // |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
//throw PEGASUS_CIM_EXCEPTION (CIM_ERR_FAILED, |
|
//_MSG_INVALID_INSTANCES); |
|
MessageLoaderParms parms (_MSG_INVALID_INSTANCES_KEY, | MessageLoaderParms parms (_MSG_INVALID_INSTANCES_KEY, |
_MSG_INVALID_INSTANCES); | _MSG_INVALID_INSTANCES); |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, parms); | throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, parms); |
|
|
// the default value; if invalid, an exception was thrown | // the default value; if invalid, an exception was thrown |
// | // |
Uint16 newState; | Uint16 newState; |
modifiedInstance.getProperty (modifiedInstance.findProperty |
modifiedInstance.getProperty(modifiedInstance.findProperty( |
(PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE)).getValue ().get (newState); |
PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE)).getValue().get( |
|
newState); |
| |
// | // |
// If Subscription State has changed, | // If Subscription State has changed, |
|
|
if (modifiedInstance.findProperty (_PROPERTY_LASTCHANGE) != | if (modifiedInstance.findProperty (_PROPERTY_LASTCHANGE) != |
PEG_NOT_FOUND) | PEG_NOT_FOUND) |
{ | { |
CIMProperty lastChange = modifiedInstance.getProperty |
CIMProperty lastChange = modifiedInstance.getProperty( |
(modifiedInstance.findProperty |
modifiedInstance.findProperty( |
(_PROPERTY_LASTCHANGE)); |
_PROPERTY_LASTCHANGE)); |
lastChange.setValue (CIMValue (currentDateTime)); | lastChange.setValue (CIMValue (currentDateTime)); |
} | } |
else | else |
{ | { |
modifiedInstance.addProperty (CIMProperty |
modifiedInstance.addProperty(CIMProperty( |
(_PROPERTY_LASTCHANGE, CIMValue (currentDateTime))); |
_PROPERTY_LASTCHANGE, CIMValue(currentDateTime))); |
} | } |
Array <CIMName> properties = | Array <CIMName> properties = |
propertyList.getPropertyNameArray (); | propertyList.getPropertyNameArray (); |
|
|
// to the current date time | // to the current date time |
// | // |
CIMDateTime startTime; | CIMDateTime startTime; |
CIMProperty startTimeProperty = instance.getProperty |
CIMProperty startTimeProperty = instance.getProperty( |
(instance.findProperty (_PROPERTY_STARTTIME)); |
instance.findProperty(_PROPERTY_STARTTIME)); |
CIMValue startTimeValue = instance.getProperty |
CIMValue startTimeValue = instance.getProperty( |
(instance.findProperty |
instance.findProperty(_PROPERTY_STARTTIME)).getValue(); |
(_PROPERTY_STARTTIME)).getValue (); |
|
Boolean setStart = false; | Boolean setStart = false; |
if (startTimeValue.isNull ()) | if (startTimeValue.isNull ()) |
{ | { |
|
|
| |
if (startTime.isInterval()) | if (startTime.isInterval()) |
{ | { |
if (startTime.equal |
if (startTime.equal( |
(CIMDateTime (_ZERO_INTERVAL_STRING))) |
CIMDateTime(_ZERO_INTERVAL_STRING))) |
{ | { |
setStart = true; | setStart = true; |
} | } |
|
|
if (modifiedInstance.findProperty (_PROPERTY_STARTTIME) | if (modifiedInstance.findProperty (_PROPERTY_STARTTIME) |
!= PEG_NOT_FOUND) | != PEG_NOT_FOUND) |
{ | { |
CIMProperty startTime = modifiedInstance.getProperty |
CIMProperty startTime = |
(modifiedInstance.findProperty |
modifiedInstance.getProperty( |
(_PROPERTY_STARTTIME)); |
modifiedInstance.findProperty( |
|
_PROPERTY_STARTTIME)); |
startTime.setValue (CIMValue (currentDateTime)); | startTime.setValue (CIMValue (currentDateTime)); |
} | } |
else | else |
{ | { |
modifiedInstance.addProperty (CIMProperty |
modifiedInstance.addProperty(CIMProperty( |
(_PROPERTY_STARTTIME, |
_PROPERTY_STARTTIME, |
CIMValue (currentDateTime))); | CIMValue (currentDateTime))); |
} | } |
| |
|
|
} | } |
} | } |
| |
// l10n |
|
// Add the language properties to the modified instance. | // Add the language properties to the modified instance. |
// Note: These came from the Accept-Language and Content-Language |
// Note: These came from the Accept-Language and |
// headers in the HTTP messages, and may be empty. |
// Content-Language headers in the HTTP messages, and may be |
|
// empty. |
AcceptLanguageList acceptLangs = | AcceptLanguageList acceptLangs = |
((AcceptLanguageListContainer)request->operationContext.get |
((AcceptLanguageListContainer)request->operationContext.get( |
(AcceptLanguageListContainer::NAME)).getLanguages(); |
AcceptLanguageListContainer::NAME)).getLanguages(); |
modifiedInstance.addProperty (CIMProperty |
modifiedInstance.addProperty(CIMProperty( |
(PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS, |
PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS, |
LanguageParser::buildAcceptLanguageHeader(acceptLangs))); | LanguageParser::buildAcceptLanguageHeader(acceptLangs))); |
| |
ContentLanguageList contentLangs = | ContentLanguageList contentLangs = |
|
|
properties.append (PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); | properties.append (PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); |
properties.append (PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); | properties.append (PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); |
propertyList.set (properties); | propertyList.set (properties); |
// l10n -end |
|
| |
// | // |
// If subscription is to be enabled, determine if there are | // If subscription is to be enabled, determine if there are |
|
|
_subscriptionRepository->reconcileFatalError (instance); | _subscriptionRepository->reconcileFatalError (instance); |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
| |
// l10n |
|
// throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED, |
|
// _MSG_NO_PROVIDERS); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_NOT_SUPPORTED, | throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_NOT_SUPPORTED, |
MessageLoaderParms (_MSG_NO_PROVIDERS_KEY, | MessageLoaderParms (_MSG_NO_PROVIDERS_KEY, |
_MSG_NO_PROVIDERS)); | _MSG_NO_PROVIDERS)); |
|
|
try | try |
{ | { |
modifiedInstance.setPath (instanceReference); | modifiedInstance.setPath (instanceReference); |
_subscriptionRepository->modifyInstance |
_subscriptionRepository->modifyInstance( |
(request->nameSpace, modifiedInstance, |
request->nameSpace, modifiedInstance, |
request->includeQualifiers, propertyList); | request->includeQualifiers, propertyList); |
| |
Logger::put (Logger::STANDARD_LOG, System::CIMSERVER, | Logger::put (Logger::STANDARD_LOG, System::CIMSERVER, |
Logger::TRACE, | Logger::TRACE, |
"IndicationService::_handleModifyInstanceRequest - Name Space: $0 Instance name: $1", |
"IndicationService::_handleModifyInstanceRequest - " |
|
"Name Space: $0 Instance name: $1", |
request->nameSpace.getString (), | request->nameSpace.getString (), |
modifiedInstance.getClassName ().getString ()); | modifiedInstance.getClassName ().getString ()); |
} | } |
|
|
{ | { |
instanceReference.setNameSpace (request->nameSpace); | instanceReference.setNameSpace (request->nameSpace); |
instance.setPath (instanceReference); | instance.setPath (instanceReference); |
// l10n |
|
_sendAsyncCreateRequests (indicationProviders, |
_sendAsyncCreateRequests( |
sourceNameSpace, requiredProperties, condition, |
indicationProviders, |
|
sourceNameSpace, |
|
requiredProperties, |
|
condition, |
query, | query, |
queryLanguage, | queryLanguage, |
instance, | instance, |
|
|
contentLangs, | contentLangs, |
request, | request, |
indicationSubclasses, | indicationSubclasses, |
userName, request->authType); |
userName, |
|
request->authType); |
| |
// | // |
// Response is sent from _handleCreateResponseAggregation | // Response is sent from _handleCreateResponseAggregation |
|
|
// | // |
// Send Delete requests | // Send Delete requests |
// | // |
//l10n |
|
if (indicationProviders.size () > 0) | if (indicationProviders.size () > 0) |
{ | { |
_sendAsyncDeleteRequests (indicationProviders, |
_sendAsyncDeleteRequests( |
|
indicationProviders, |
sourceNameSpace, | sourceNameSpace, |
instance, | instance, |
acceptLangs, | acceptLangs, |
contentLangs, | contentLangs, |
request, | request, |
indicationSubclasses, | indicationSubclasses, |
userName, request->authType); |
userName, |
|
request->authType); |
| |
// | // |
// Response is sent from | // Response is sent from |
|
|
} | } |
catch (Exception& exception) | catch (Exception& exception) |
{ | { |
cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
cimException = |
exception.getMessage()); |
PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, exception.getMessage()); |
} | } |
| |
// | // |
|
|
// | // |
if (!responseSent) | if (!responseSent) |
{ | { |
// l10n |
|
// Note: don't need to set content-language in the response. | // Note: don't need to set content-language in the response. |
CIMResponseMessage * response = request->buildResponse (); | CIMResponseMessage * response = request->buildResponse (); |
response->cimException = cimException; | response->cimException = cimException; |
|
|
| |
try | try |
{ | { |
String userName = ((IdentityContainer)request->operationContext.get |
String userName = ((IdentityContainer)request->operationContext.get( |
(IdentityContainer :: NAME)).getUserName(); |
IdentityContainer::NAME)).getUserName(); |
_checkNonprivilegedAuthorization(userName); | _checkNonprivilegedAuthorization(userName); |
| |
// | // |
// Check if instance may be deleted -- a filter or handler instance | // Check if instance may be deleted -- a filter or handler instance |
// referenced by a subscription instance may not be deleted | // referenced by a subscription instance may not be deleted |
// | // |
if (_canDelete (request->instanceName, request->nameSpace, |
if (_canDelete(request->instanceName, request->nameSpace, userName)) |
userName)) |
|
{ | { |
// | // |
// If a subscription, get the instance from the repository | // If a subscription, get the instance from the repository |
// | // |
CIMInstance subscriptionInstance; | CIMInstance subscriptionInstance; |
if (request->instanceName.getClassName ().equal |
if (request->instanceName.getClassName().equal( |
(PEGASUS_CLASSNAME_INDSUBSCRIPTION) || |
PEGASUS_CLASSNAME_INDSUBSCRIPTION) || |
request->instanceName.getClassName ().equal |
request->instanceName.getClassName ().equal( |
(PEGASUS_CLASSNAME_FORMATTEDINDSUBSCRIPTION)) |
PEGASUS_CLASSNAME_FORMATTEDINDSUBSCRIPTION)) |
{ | { |
subscriptionInstance = | subscriptionInstance = |
_subscriptionRepository->getInstance |
_subscriptionRepository->getInstance( |
(request->nameSpace, request->instanceName); |
request->nameSpace, request->instanceName); |
} | } |
| |
// | // |
|
|
// | // |
try | try |
{ | { |
_subscriptionRepository->deleteInstance |
_subscriptionRepository->deleteInstance( |
(request->nameSpace, request->instanceName); |
request->nameSpace, request->instanceName); |
| |
Logger::put (Logger::STANDARD_LOG, System::CIMSERVER, | Logger::put (Logger::STANDARD_LOG, System::CIMSERVER, |
Logger::TRACE, | Logger::TRACE, |
"IndicationService::_handleDeleteInstanceRequest - Name Space: $0 Instance name: $1", |
"IndicationService::_handleDeleteInstanceRequest - " |
|
"Name Space: $0 Instance name: $1", |
request->nameSpace.getString (), | request->nameSpace.getString (), |
request->instanceName.getClassName ().getString ()); | request->instanceName.getClassName ().getString ()); |
} | } |
|
|
return; | return; |
} | } |
| |
if (request->instanceName.getClassName ().equal |
if (request->instanceName.getClassName().equal( |
(PEGASUS_CLASSNAME_INDSUBSCRIPTION) || |
PEGASUS_CLASSNAME_INDSUBSCRIPTION) || |
request->instanceName.getClassName ().equal |
request->instanceName.getClassName ().equal( |
(PEGASUS_CLASSNAME_FORMATTEDINDSUBSCRIPTION)) |
PEGASUS_CLASSNAME_FORMATTEDINDSUBSCRIPTION)) |
{ | { |
// | // |
// If subscription is active, send delete requests to providers | // If subscription is active, send delete requests to providers |
|
|
// | // |
Uint16 subscriptionState; | Uint16 subscriptionState; |
CIMValue subscriptionStateValue; | CIMValue subscriptionStateValue; |
subscriptionStateValue = subscriptionInstance.getProperty |
subscriptionStateValue = subscriptionInstance.getProperty( |
(subscriptionInstance.findProperty |
subscriptionInstance.findProperty( |
(PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE)).getValue (); |
PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE)).getValue(); |
subscriptionStateValue.get (subscriptionState); | subscriptionStateValue.get (subscriptionState); |
| |
if ((subscriptionState == STATE_ENABLED) || | if ((subscriptionState == STATE_ENABLED) || |
|
|
instanceReference.setNameSpace (request->nameSpace); | instanceReference.setNameSpace (request->nameSpace); |
subscriptionInstance.setPath (instanceReference); | subscriptionInstance.setPath (instanceReference); |
| |
indicationProviders = _getDeleteParams |
indicationProviders = _getDeleteParams( |
(subscriptionInstance, indicationSubclasses, |
subscriptionInstance, |
|
indicationSubclasses, |
sourceNamespaceName); | sourceNamespaceName); |
| |
if (indicationProviders.size () > 0) | if (indicationProviders.size () > 0) |
|
|
// | // |
// Send Delete requests | // Send Delete requests |
// | // |
// l10n |
_sendAsyncDeleteRequests( |
_sendAsyncDeleteRequests (indicationProviders, |
indicationProviders, |
sourceNamespaceName, subscriptionInstance, |
sourceNamespaceName, |
|
subscriptionInstance, |
((AcceptLanguageListContainer) | ((AcceptLanguageListContainer) |
request->operationContext.get |
request->operationContext.get( |
(AcceptLanguageListContainer::NAME)).getLanguages(), |
AcceptLanguageListContainer::NAME)). |
|
getLanguages(), |
((ContentLanguageListContainer) | ((ContentLanguageListContainer) |
request->operationContext.get |
request->operationContext.get( |
(ContentLanguageListContainer::NAME)).getLanguages(), |
ContentLanguageListContainer::NAME)). |
|
getLanguages(), |
request, | request, |
indicationSubclasses, | indicationSubclasses, |
userName, request->authType); |
userName, |
|
request->authType); |
| |
// | // |
// Response is sent from | // Response is sent from |
|
|
// Subscription was enabled, but had no providers | // Subscription was enabled, but had no providers |
// Remove entries from the subscription hash tables | // Remove entries from the subscription hash tables |
// | // |
_subscriptionTable->removeSubscription |
_subscriptionTable->removeSubscription( |
(subscriptionInstance, |
subscriptionInstance, |
indicationSubclasses, sourceNamespaceName, |
indicationSubclasses, |
|
sourceNamespaceName, |
indicationProviders); | indicationProviders); |
} | } |
} | } |
|
|
} | } |
catch (Exception& exception) | catch (Exception& exception) |
{ | { |
cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
cimException = |
exception.getMessage()); |
PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, exception.getMessage()); |
} | } |
| |
// | // |
|
|
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
} | } |
| |
// l10n TODO - might need to globalize another flow and another consumer interface |
// l10n TODO - might need to globalize another flow and another consumer |
// (ie. mdd's) if we can't agree on one export flow and consumer interface |
// interface (ie. mdd's) if we can't agree on one export flow and consumer |
// (see PEP67) |
// interface (see PEP67) |
| |
void IndicationService::_handleProcessIndicationRequest (const Message* message) | void IndicationService::_handleProcessIndicationRequest (const Message* message) |
{ | { |
|
|
getClassName().getString().getCString()))); | getClassName().getString().getCString()))); |
continue; | continue; |
} | } |
} catch (DateTimeOutOfRangeException &) |
} |
|
catch (DateTimeOutOfRangeException&) |
{ | { |
// | // |
// This instance from the repository is invalid | // This instance from the repository is invalid |
|
|
queryLanguage, | queryLanguage, |
filterName); | filterName); |
| |
QueryExpression queryExpr = _getQueryExpression(filterQuery, |
QueryExpression queryExpr = _getQueryExpression( |
queryLanguage, |
filterQuery, queryLanguage, request->nameSpace); |
request->nameSpace); |
|
| |
#ifdef PEGASUS_INDICATION_PERFINST | #ifdef PEGASUS_INDICATION_PERFINST |
stopWatch.reset(); | stopWatch.reset(); |
|
|
// | // |
// This is a two part process: | // This is a two part process: |
// | // |
// 1) Call QueryExpression::applyProjection to remove properties |
// 1) Call QueryExpression::applyProjection to remove |
// not listed in the SELECT clause. Note: for CQL, this will handle |
// properties not listed in the SELECT clause. Note: for CQL, |
// properties on embedded objects. |
// this will handle properties on embedded objects. |
// | // |
// QueryExpression::applyProjection throws an exception if | // QueryExpression::applyProjection throws an exception if |
// the indication is missing a required property in the SELECT | // the indication is missing a required property in the SELECT |
// clause. Although _getMatchingSubscriptions checked for | // clause. Although _getMatchingSubscriptions checked for |
// the indication missing required properties, it would have | // the indication missing required properties, it would have |
// not detected missing required embedded object properties for CQL. |
// not detected missing required embedded object properties for |
// So, we need to catch the missing property exception here. |
// CQL. So, we need to catch the missing property exception |
|
// here. |
// | // |
// 2) Remove any properties that may be left on the indication | // 2) Remove any properties that may be left on the indication |
// that are not in the indication class. These are properties | // that are not in the indication class. These are properties |
|
|
// SELECT clause happens to have a property name not on the | // SELECT clause happens to have a property name not on the |
// indication class, and the indication has that same property. | // indication class, and the indication has that same property. |
// Note: If SELECT includes all properties ("*"), it's still | // Note: If SELECT includes all properties ("*"), it's still |
// necessary to check, in case the provider added properties not in |
// necessary to check, in case the provider added properties |
// the indication class. |
// not in the indication class. |
// | // |
try | try |
{ | { |
|
|
{ | { |
// The indication was missing a required property. | // The indication was missing a required property. |
// The call to _getMatchingSubscriptions above checked for | // The call to _getMatchingSubscriptions above checked for |
// missing required properties on the base indication object |
// missing required properties on the base indication |
// so this can only happen for CQL when an embedded object |
// object so this can only happen for CQL when an embedded |
// property is missing. |
// object property is missing. |
// | // |
// Since this is the same as the indication |
// Since this is the same as the indication not matching |
// not matching the subscription, just swallow the exception, |
// the subscription, just swallow the exception, |
// and skip this subscription. | // and skip this subscription. |
PEG_TRACE_STRING (TRC_INDICATION_SERVICE, Tracer::LEVEL4, | PEG_TRACE_STRING (TRC_INDICATION_SERVICE, Tracer::LEVEL4, |
"Apply Projection error: " + re.getMessage()); | "Apply Projection error: " + re.getMessage()); |
|
|
// | // |
for (Uint32 j = 0; j < propertyNames.size(); j++) | for (Uint32 j = 0; j < propertyNames.size(); j++) |
{ | { |
Uint32 rmIndex = formattedIndication.findProperty(propertyNames[j]); |
Uint32 rmIndex = |
|
formattedIndication.findProperty(propertyNames[j]); |
if (rmIndex != PEG_NOT_FOUND && | if (rmIndex != PEG_NOT_FOUND && |
!ContainsCIMName (indicationClassProperties, |
!ContainsCIMName( |
propertyNames[j])) |
indicationClassProperties, propertyNames[j])) |
{ | { |
formattedIndication.removeProperty(rmIndex); | formattedIndication.removeProperty(rmIndex); |
} | } |
} | } |
| |
handlerNamedInstance = _subscriptionRepository->getHandler |
handlerNamedInstance = _subscriptionRepository->getHandler( |
(matchedSubscriptions[i]); |
matchedSubscriptions[i]); |
PEG_TRACE ((TRC_INDICATION_GENERATION, Tracer::LEVEL3, | PEG_TRACE ((TRC_INDICATION_GENERATION, Tracer::LEVEL3, |
"Handler %s:%s.%s found for %s Indication %s", | "Handler %s:%s.%s found for %s Indication %s", |
(const char*)(request->nameSpace.getString().getCString()), | (const char*)(request->nameSpace.getString().getCString()), |
|
|
AsyncReply * asyncReply = | AsyncReply * asyncReply = |
static_cast<AsyncReply *>(operation->removeResponse()); | static_cast<AsyncReply *>(operation->removeResponse()); |
CIMHandleIndicationResponseMessage * handlerResponse = | CIMHandleIndicationResponseMessage * handlerResponse = |
reinterpret_cast <CIMHandleIndicationResponseMessage *> |
reinterpret_cast<CIMHandleIndicationResponseMessage *>( |
((static_cast <AsyncLegacyOperationResult *> |
(static_cast<AsyncLegacyOperationResult *>( |
(asyncReply))->get_result ()); |
asyncReply))->get_result()); |
PEGASUS_ASSERT (handlerResponse != 0); | PEGASUS_ASSERT (handlerResponse != 0); |
| |
if (handlerResponse->cimException.getCode () != CIM_ERR_SUCCESS) | if (handlerResponse->cimException.getCode () != CIM_ERR_SUCCESS) |
|
|
// | // |
// Send Modify requests | // Send Modify requests |
// | // |
// l10n |
|
_sendWaitModifyRequests (indicationProviders, | _sendWaitModifyRequests (indicationProviders, |
sourceNameSpace, | sourceNameSpace, |
requiredProperties, condition, query, queryLanguage, | requiredProperties, condition, query, queryLanguage, |
|
|
// | // |
// Send Create requests | // Send Create requests |
// | // |
// l10n |
|
Array <ProviderClassList> acceptedProviders; | Array <ProviderClassList> acceptedProviders; |
acceptedProviders = _sendWaitCreateRequests | acceptedProviders = _sendWaitCreateRequests |
(indicationProviders, | (indicationProviders, |
|
|
CIMInstance instance = formerSubscriptions [i]; | CIMInstance instance = formerSubscriptions [i]; |
String creator = instance.getProperty (instance.findProperty | String creator = instance.getProperty (instance.findProperty |
(PEGASUS_PROPERTYNAME_INDSUB_CREATOR)).getValue ().toString (); | (PEGASUS_PROPERTYNAME_INDSUB_CREATOR)).getValue ().toString (); |
// l10n start |
|
AcceptLanguageList acceptLangs; | AcceptLanguageList acceptLangs; |
Uint32 propIndex = instance.findProperty | Uint32 propIndex = instance.findProperty |
(PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); | (PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); |
|
|
contentLangsString); | contentLangsString); |
} | } |
} | } |
// l10n end |
|
| |
// | // |
// Look up the subscription in the active subscriptions table | // Look up the subscription in the active subscriptions table |
|
|
// | // |
if ((tableValue.providers [providerIndex].classList.size () | if ((tableValue.providers [providerIndex].classList.size () |
== 1) && | == 1) && |
(tableValue.providers [providerIndex].classList |
(tableValue.providers[providerIndex].classList[0].equal( |
[0].equal (className))) |
className))) |
{ | { |
// l10n |
|
_sendWaitDeleteRequests (indicationProviders, | _sendWaitDeleteRequests (indicationProviders, |
sourceNameSpace, | sourceNameSpace, |
formerSubscriptions [i], | formerSubscriptions [i], |
|
|
// | // |
// Send Modify requests | // Send Modify requests |
// | // |
// l10n |
|
_sendWaitModifyRequests (indicationProviders, | _sendWaitModifyRequests (indicationProviders, |
sourceNameSpace, | sourceNameSpace, |
requiredProperties, condition, | requiredProperties, condition, |
|
|
// On Fatal Error policy, if necessary | // On Fatal Error policy, if necessary |
// | // |
providerSubscriptions.clear (); | providerSubscriptions.clear (); |
providerSubscriptions = _subscriptionTable->reflectProviderDisable |
providerSubscriptions = _subscriptionTable->reflectProviderDisable( |
(providers [i]); |
providers[i]); |
| |
if (providerSubscriptions.size () > 0) | if (providerSubscriptions.size () > 0) |
{ | { |
|
|
// | // |
// Log a message for each subscription | // Log a message for each subscription |
// | // |
CIMClass providerClass = _subscriptionRepository->getClass |
CIMClass providerClass = _subscriptionRepository->getClass( |
(PEGASUS_NAMESPACENAME_INTEROP, PEGASUS_CLASSNAME_PROVIDER, |
PEGASUS_NAMESPACENAME_INTEROP, PEGASUS_CLASSNAME_PROVIDER, |
true, true, false, CIMPropertyList ()); | true, true, false, CIMPropertyList ()); |
CIMInstance providerCopy = providers [i].clone (); | CIMInstance providerCopy = providers [i].clone (); |
CIMObjectPath path = providerCopy.buildPath (providerClass); | CIMObjectPath path = providerCopy.buildPath (providerClass); |
|
|
Logger::put_l (Logger::STANDARD_LOG, System::CIMSERVER, | Logger::put_l (Logger::STANDARD_LOG, System::CIMSERVER, |
Logger::WARNING, _MSG_PROVIDER_NO_LONGER_SERVING_KEY, | Logger::WARNING, _MSG_PROVIDER_NO_LONGER_SERVING_KEY, |
_MSG_PROVIDER_NO_LONGER_SERVING, logString1, logString2, | _MSG_PROVIDER_NO_LONGER_SERVING, logString1, logString2, |
providerSubscriptions[j].getPath().getNameSpace().getString()); |
providerSubscriptions[j].getPath().getNameSpace(). |
|
getString()); |
} | } |
} | } |
} | } |
|
|
System::CIMSERVER, Logger::WARNING, | System::CIMSERVER, Logger::WARNING, |
_MSG_PROVIDER_NOW_SERVING_KEY, | _MSG_PROVIDER_NOW_SERVING_KEY, |
_MSG_PROVIDER_NOW_SERVING, logString1, logString2, | _MSG_PROVIDER_NOW_SERVING, logString1, logString2, |
subscriptions[s].getPath().getNameSpace().getString()); |
subscriptions[s].getPath().getNameSpace(). |
|
getString()); |
} | } |
} | } |
} // if any provider accepted the create subscription request | } // if any provider accepted the create subscription request |
|
|
// Filter and Handler are key properties for Subscription | // Filter and Handler are key properties for Subscription |
// No other properties are required | // No other properties are required |
// | // |
_checkRequiredProperty (instance, PEGASUS_PROPERTYNAME_FILTER, CIMTYPE_REFERENCE, |
_checkRequiredProperty( |
|
instance, |
|
PEGASUS_PROPERTYNAME_FILTER, |
|
CIMTYPE_REFERENCE, |
_MSG_KEY_PROPERTY); | _MSG_KEY_PROPERTY); |
_checkRequiredProperty (instance, PEGASUS_PROPERTYNAME_HANDLER, CIMTYPE_REFERENCE, |
_checkRequiredProperty( |
|
instance, |
|
PEGASUS_PROPERTYNAME_HANDLER, |
|
CIMTYPE_REFERENCE, |
_MSG_KEY_PROPERTY); | _MSG_KEY_PROPERTY); |
| |
// | // |
|
|
exceptionStr.append ("$1"); | exceptionStr.append ("$1"); |
| |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_INVALID_PARAMETER, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms (_MSG_INVALID_VALUE_FOR_PROPERTY_KEY, |
CIM_ERR_INVALID_PARAMETER, |
|
MessageLoaderParms( |
|
_MSG_INVALID_VALUE_FOR_PROPERTY_KEY, |
exceptionStr, | exceptionStr, |
origFilterPath.toString(), PEGASUS_PROPERTYNAME_FILTER.getString())); |
origFilterPath.toString(), |
|
PEGASUS_PROPERTYNAME_FILTER.getString())); |
} | } |
} | } |
| |
|
|
exceptionStr.append ("$1"); | exceptionStr.append ("$1"); |
| |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_INVALID_PARAMETER, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms (_MSG_INVALID_VALUE_FOR_PROPERTY_KEY, |
CIM_ERR_INVALID_PARAMETER, |
|
MessageLoaderParms( |
|
_MSG_INVALID_VALUE_FOR_PROPERTY_KEY, |
exceptionStr, | exceptionStr, |
origHandlerPath.toString(), PEGASUS_PROPERTYNAME_HANDLER.getString())); |
origHandlerPath.toString(), |
|
PEGASUS_PROPERTYNAME_HANDLER.getString())); |
} | } |
} | } |
| |
|
|
// Policy properties each has a default value, a corresponding | // Policy properties each has a default value, a corresponding |
// Other___ property, and a set of valid values | // Other___ property, and a set of valid values |
// | // |
_checkPropertyWithOther (instance, PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE, |
_checkPropertyWithOther( |
_PROPERTY_OTHERSTATE, (Uint16) STATE_ENABLED, |
instance, |
(Uint16) STATE_OTHER, _validStates, _supportedStates); |
PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE, |
|
_PROPERTY_OTHERSTATE, |
_checkPropertyWithOther (instance, _PROPERTY_REPEATNOTIFICATIONPOLICY, |
(Uint16) STATE_ENABLED, |
_PROPERTY_OTHERREPEATNOTIFICATIONPOLICY, (Uint16) _POLICY_NONE, |
(Uint16) STATE_OTHER, |
(Uint16) _POLICY_OTHER, _validRepeatPolicies, |
_validStates, |
|
_supportedStates); |
|
|
|
_checkPropertyWithOther( |
|
instance, |
|
_PROPERTY_REPEATNOTIFICATIONPOLICY, |
|
_PROPERTY_OTHERREPEATNOTIFICATIONPOLICY, |
|
(Uint16) _POLICY_NONE, |
|
(Uint16) _POLICY_OTHER, |
|
_validRepeatPolicies, |
_supportedRepeatPolicies); | _supportedRepeatPolicies); |
| |
_checkPropertyWithOther (instance, _PROPERTY_ONFATALERRORPOLICY, |
_checkPropertyWithOther( |
_PROPERTY_OTHERONFATALERRORPOLICY, (Uint16) _ERRORPOLICY_IGNORE, |
instance, |
(Uint16) _ERRORPOLICY_OTHER, _validErrorPolicies, |
_PROPERTY_ONFATALERRORPOLICY, |
|
_PROPERTY_OTHERONFATALERRORPOLICY, |
|
(Uint16) _ERRORPOLICY_IGNORE, |
|
(Uint16) _ERRORPOLICY_OTHER, |
|
_validErrorPolicies, |
_supportedErrorPolicies); | _supportedErrorPolicies); |
| |
// | // |
|
|
// If they exist but are NULL, set value to the default | // If they exist but are NULL, set value to the default |
// If they exist and are not NULL, validate the value | // If they exist and are not NULL, validate the value |
// | // |
_checkRequiredProperty (instance, PEGASUS_PROPERTYNAME_NAME, CIMTYPE_STRING, |
_checkRequiredProperty( |
|
instance, |
|
PEGASUS_PROPERTYNAME_NAME, |
|
CIMTYPE_STRING, |
_MSG_KEY_PROPERTY); | _MSG_KEY_PROPERTY); |
| |
_initOrValidateStringProperty (instance,PEGASUS_PROPERTYNAME_CREATIONCLASSNAME, |
_initOrValidateStringProperty( |
|
instance, |
|
PEGASUS_PROPERTYNAME_CREATIONCLASSNAME, |
instance.getClassName ().getString ()); | instance.getClassName ().getString ()); |
| |
_initOrValidateStringProperty (instance, _PROPERTY_SYSTEMNAME, |
_initOrValidateStringProperty( |
|
instance, |
|
_PROPERTY_SYSTEMNAME, |
System::getFullyQualifiedHostName ()); | System::getFullyQualifiedHostName ()); |
| |
_initOrValidateStringProperty (instance, |
_initOrValidateStringProperty( |
|
instance, |
_PROPERTY_SYSTEMCREATIONCLASSNAME, | _PROPERTY_SYSTEMCREATIONCLASSNAME, |
System::getSystemCreationClassName ()); | System::getSystemCreationClassName ()); |
| |
|
|
// | // |
// Query and QueryLanguage properties are required for Filter | // Query and QueryLanguage properties are required for Filter |
// | // |
_checkRequiredProperty (instance, PEGASUS_PROPERTYNAME_QUERY, CIMTYPE_STRING, |
_checkRequiredProperty( |
|
instance, |
|
PEGASUS_PROPERTYNAME_QUERY, |
|
CIMTYPE_STRING, |
|
_MSG_PROPERTY); |
|
_checkRequiredProperty( |
|
instance, |
|
PEGASUS_PROPERTYNAME_QUERYLANGUAGE, |
|
CIMTYPE_STRING, |
_MSG_PROPERTY); | _MSG_PROPERTY); |
_checkRequiredProperty (instance, PEGASUS_PROPERTYNAME_QUERYLANGUAGE, |
|
CIMTYPE_STRING, _MSG_PROPERTY); |
|
| |
// | // |
// Validate the query language is supported | // Validate the query language is supported |
// | // |
String queryLanguage; | String queryLanguage; |
instance.getProperty (instance.findProperty |
instance.getProperty( |
(PEGASUS_PROPERTYNAME_QUERYLANGUAGE)).getValue ().get (queryLanguage); |
instance.findProperty(PEGASUS_PROPERTYNAME_QUERYLANGUAGE)). |
|
getValue().get(queryLanguage); |
| |
#ifdef PEGASUS_DISABLE_CQL | #ifdef PEGASUS_DISABLE_CQL |
// Special code to block CQL, if CQL is disabled | // Special code to block CQL, if CQL is disabled |
|
|
{ | { |
// CQL is not allowed in this case | // CQL is not allowed in this case |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
throw PEGASUS_CIM_EXCEPTION( |
queryLanguage); |
CIM_ERR_NOT_SUPPORTED, queryLanguage); |
} | } |
#endif | #endif |
| |
|
|
// Default value for Source Namespace is the namespace of the | // Default value for Source Namespace is the namespace of the |
// Filter registration | // Filter registration |
// | // |
CIMNamespaceName sourceNameSpace = CIMNamespaceName |
CIMNamespaceName sourceNameSpace = CIMNamespaceName( |
(_checkPropertyWithDefault (instance, _PROPERTY_SOURCENAMESPACE, |
_checkPropertyWithDefault( |
|
instance, |
|
_PROPERTY_SOURCENAMESPACE, |
nameSpace.getString())); | nameSpace.getString())); |
| |
// | // |
|
|
QueryExpression queryExpression; | QueryExpression queryExpression; |
try | try |
{ | { |
queryExpression = |
queryExpression = _getQueryExpression( |
_getQueryExpression (filterQuery, queryLanguage, sourceNameSpace); |
filterQuery, queryLanguage, sourceNameSpace); |
} | } |
catch (QueryLanguageInvalidException&) | catch (QueryLanguageInvalidException&) |
{ | { |
// The filter query had an invalid language name. | // The filter query had an invalid language name. |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, |
throw PEGASUS_CIM_EXCEPTION( |
queryLanguage); |
CIM_ERR_NOT_SUPPORTED, queryLanguage); |
} | } |
| |
CIMName indicationClassName = _getIndicationClassName | CIMName indicationClassName = _getIndicationClassName |
|
|
_MSG_CLASS_NOT_SERVED)); | _MSG_CLASS_NOT_SERVED)); |
} | } |
#endif | #endif |
_checkPropertyWithOther (instance, PEGASUS_PROPERTYNAME_PERSISTENCETYPE, |
_checkPropertyWithOther( |
_PROPERTY_OTHERPERSISTENCETYPE, (Uint16) PERSISTENCE_PERMANENT, |
instance, |
(Uint16) PERSISTENCE_OTHER, _validPersistenceTypes, |
PEGASUS_PROPERTYNAME_PERSISTENCETYPE, |
|
_PROPERTY_OTHERPERSISTENCETYPE, |
|
(Uint16) PERSISTENCE_PERMANENT, |
|
(Uint16) PERSISTENCE_OTHER, |
|
_validPersistenceTypes, |
_supportedPersistenceTypes); | _supportedPersistenceTypes); |
| |
// | // |
|
|
// | // |
_checkProperty (instance, _PROPERTY_OWNER, CIMTYPE_STRING); | _checkProperty (instance, _PROPERTY_OWNER, CIMTYPE_STRING); |
| |
if (instance.getClassName ().equal |
if (instance.getClassName().equal( |
(PEGASUS_CLASSNAME_INDHANDLER_CIMXML) || |
PEGASUS_CLASSNAME_INDHANDLER_CIMXML) || |
instance.getClassName ().equal |
instance.getClassName().equal( |
(PEGASUS_CLASSNAME_LSTNRDST_CIMXML)) |
PEGASUS_CLASSNAME_LSTNRDST_CIMXML)) |
{ | { |
// | // |
// Destination property is required for CIMXML | // Destination property is required for CIMXML |
// Handler subclass | // Handler subclass |
// | // |
_checkRequiredProperty (instance, |
_checkRequiredProperty( |
|
instance, |
PEGASUS_PROPERTYNAME_LSTNRDST_DESTINATION, | PEGASUS_PROPERTYNAME_LSTNRDST_DESTINATION, |
CIMTYPE_STRING, _MSG_PROPERTY); |
CIMTYPE_STRING, |
|
_MSG_PROPERTY); |
} | } |
| |
if (instance.getClassName ().equal | if (instance.getClassName ().equal |
|
|
// TargetHost property is required for SNMP | // TargetHost property is required for SNMP |
// Handler subclass | // Handler subclass |
// | // |
_checkRequiredProperty (instance, |
_checkRequiredProperty( |
|
instance, |
PEGASUS_PROPERTYNAME_LSTNRDST_TARGETHOST, | PEGASUS_PROPERTYNAME_LSTNRDST_TARGETHOST, |
CIMTYPE_STRING, _MSG_PROPERTY); |
CIMTYPE_STRING, |
|
_MSG_PROPERTY); |
| |
// | // |
// TargetHostFormat property is required for SNMP | // TargetHostFormat property is required for SNMP |
// Handler subclass | // Handler subclass |
// | // |
_checkRequiredProperty (instance, _PROPERTY_TARGETHOSTFORMAT, |
_checkRequiredProperty( |
CIMTYPE_UINT16, _MSG_PROPERTY); |
instance, |
|
_PROPERTY_TARGETHOSTFORMAT, |
|
CIMTYPE_UINT16, |
|
_MSG_PROPERTY); |
| |
// | // |
// SNMPVersion property is required for SNMP Handler | // SNMPVersion property is required for SNMP Handler |
// | // |
_checkRequiredProperty (instance, PEGASUS_PROPERTYNAME_SNMPVERSION, |
_checkRequiredProperty( |
CIMTYPE_UINT16, _MSG_PROPERTY); |
instance, |
|
PEGASUS_PROPERTYNAME_SNMPVERSION, |
|
CIMTYPE_UINT16, |
|
_MSG_PROPERTY); |
| |
// Currently, only SNMPv1 trap and SNMPv2C trap are supported, | // Currently, only SNMPv1 trap and SNMPv2C trap are supported, |
// verify if the value of SNMPVersion is one of them | // verify if the value of SNMPVersion is one of them |
| |
_checkValue(instance, PEGASUS_PROPERTYNAME_SNMPVERSION, |
_checkValue( |
_validSNMPVersion, _supportedSNMPVersion); |
instance, |
|
PEGASUS_PROPERTYNAME_SNMPVERSION, |
|
_validSNMPVersion, |
|
_supportedSNMPVersion); |
| |
// | // |
// For each remaining property, verify that if the property | // For each remaining property, verify that if the property |
|
|
// MailTo property is required for Email | // MailTo property is required for Email |
// Handler subclass | // Handler subclass |
// | // |
_checkRequiredProperty (instance, |
_checkRequiredProperty( |
|
instance, |
PEGASUS_PROPERTYNAME_LSTNRDST_MAILTO, | PEGASUS_PROPERTYNAME_LSTNRDST_MAILTO, |
CIMTYPE_STRING, _MSG_PROPERTY, true); |
CIMTYPE_STRING, |
|
_MSG_PROPERTY, |
|
true); |
| |
// get MailTo from handler instance | // get MailTo from handler instance |
Array<String> mailTo; | Array<String> mailTo; |
instance.getProperty(instance.findProperty( | instance.getProperty(instance.findProperty( |
PEGASUS_PROPERTYNAME_LSTNRDST_MAILTO)).getValue().get(mailTo); |
PEGASUS_PROPERTYNAME_LSTNRDST_MAILTO)).getValue().get( |
|
mailTo); |
| |
// Build mail address string | // Build mail address string |
String mailAddrStr; | String mailAddrStr; |
|
|
if (mailAddrStr == String::EMPTY) | if (mailAddrStr == String::EMPTY) |
{ | { |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms("IndicationService.IndicationService._MSG_DO_NOT_HAVE_EMAIL_ADDRESS", |
CIM_ERR_FAILED, |
|
MessageLoaderParms( |
|
"IndicationService.IndicationService." |
|
"_MSG_DO_NOT_HAVE_EMAIL_ADDRESS", |
"Do not have an e-mail address.")); | "Do not have an e-mail address.")); |
} | } |
| |
|
|
// MailSubject property is required for Email | // MailSubject property is required for Email |
// Handler subclass | // Handler subclass |
// | // |
_checkRequiredProperty (instance, |
_checkRequiredProperty( |
|
instance, |
PEGASUS_PROPERTYNAME_LSTNRDST_MAILSUBJECT, | PEGASUS_PROPERTYNAME_LSTNRDST_MAILSUBJECT, |
CIMTYPE_STRING, _MSG_PROPERTY); |
CIMTYPE_STRING, |
|
_MSG_PROPERTY); |
| |
// | // |
// For MailCc property, verify that if the property | // For MailCc property, verify that if the property |
// exists in the instance it is of the correct type | // exists in the instance it is of the correct type |
// | // |
_checkProperty (instance, |
_checkProperty( |
|
instance, |
PEGASUS_PROPERTYNAME_LSTNRDST_MAILCC, | PEGASUS_PROPERTYNAME_LSTNRDST_MAILCC, |
CIMTYPE_STRING, true); |
CIMTYPE_STRING, |
|
true); |
} | } |
} | } |
| |
|
|
// | // |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
| |
// l10n |
throw PEGASUS_CIM_EXCEPTION_L( |
|
CIM_ERR_NOT_SUPPORTED, |
// throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED, |
MessageLoaderParms( |
// _MSG_CLASS_NOT_SERVED); |
_MSG_CLASS_NOT_SERVED_KEY, |
|
_MSG_CLASS_NOT_SERVED)); |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_NOT_SUPPORTED, |
|
MessageLoaderParms(_MSG_CLASS_NOT_SERVED_KEY, _MSG_CLASS_NOT_SERVED)); |
|
} | } |
} | } |
| |
|
|
if (theValue.isArray ()) | if (theValue.isArray ()) |
{ | { |
MessageLoaderParms parms( | MessageLoaderParms parms( |
"IndicationService.IndicationService._MSG_INVALID_TYPE_ARRAY_OF_FOR_PROPERTY", |
"IndicationService.IndicationService." |
|
"_MSG_INVALID_TYPE_ARRAY_OF_FOR_PROPERTY", |
"Invalid type array of $0 for property $1", | "Invalid type array of $0 for property $1", |
cimTypeToString(theValue.getType()), | cimTypeToString(theValue.getType()), |
propertyName.getString()); | propertyName.getString()); |
|
|
else | else |
{ | { |
MessageLoaderParms parms( | MessageLoaderParms parms( |
"IndicationService.IndicationService._MSG_INVALID_TYPE_FOR_PROPERTY", |
"IndicationService.IndicationService." |
|
"_MSG_INVALID_TYPE_FOR_PROPERTY", |
"Invalid type $0 for property $1", | "Invalid type $0 for property $1", |
cimTypeToString(theValue.getType()), | cimTypeToString(theValue.getType()), |
propertyName.getString()); | propertyName.getString()); |
|
|
// | // |
if (!Contains (validValues, result)) | if (!Contains (validValues, result)) |
{ | { |
// l10n |
|
|
|
String exceptionStr = _MSG_INVALID_VALUE; | String exceptionStr = _MSG_INVALID_VALUE; |
// exceptionStr.append (theValue.toString ()); |
|
exceptionStr.append ("$0"); | exceptionStr.append ("$0"); |
exceptionStr.append (_MSG_FOR_PROPERTY); | exceptionStr.append (_MSG_FOR_PROPERTY); |
// exceptionStr.append (propertyName.getString()); |
|
exceptionStr.append ("$1"); | exceptionStr.append ("$1"); |
| |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
| |
// throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER, |
|
// exceptionStr); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_INVALID_PARAMETER, | throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_INVALID_PARAMETER, |
MessageLoaderParms(_MSG_INVALID_VALUE_FOR_PROPERTY_KEY, | MessageLoaderParms(_MSG_INVALID_VALUE_FOR_PROPERTY_KEY, |
exceptionStr, | exceptionStr, |
|
|
| |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_NOT_SUPPORTED, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms (_MSG_UNSUPPORTED_VALUE_FOR_PROPERTY_KEY, |
CIM_ERR_NOT_SUPPORTED, |
|
MessageLoaderParms( |
|
_MSG_UNSUPPORTED_VALUE_FOR_PROPERTY_KEY, |
exceptionStr, | exceptionStr, |
theValue.toString (), propertyName.getString ())); |
theValue.toString(), |
|
propertyName.getString())); |
} | } |
} | } |
| |
|
|
{ | { |
if (instance.findProperty (otherPropertyName) == PEG_NOT_FOUND) | if (instance.findProperty (otherPropertyName) == PEG_NOT_FOUND) |
{ | { |
// l10n |
|
|
|
String exceptionStr = _MSG_MISSING_REQUIRED; | String exceptionStr = _MSG_MISSING_REQUIRED; |
// exceptionStr.append (otherPropertyName.getString()); |
|
exceptionStr.append ("$0"); | exceptionStr.append ("$0"); |
exceptionStr.append (_MSG_PROPERTY); | exceptionStr.append (_MSG_PROPERTY); |
| |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
| |
// l10n |
throw PEGASUS_CIM_EXCEPTION_L( |
|
CIM_ERR_INVALID_PARAMETER, |
// throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER, |
MessageLoaderParms( |
// exceptionStr); |
_MSG_PROPERTY_KEY, |
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_INVALID_PARAMETER, |
|
MessageLoaderParms(_MSG_PROPERTY_KEY, |
|
exceptionStr, | exceptionStr, |
otherPropertyName.getString())); | otherPropertyName.getString())); |
} | } |
|
|
CIMValue theOtherValue = otherProperty.getValue (); | CIMValue theOtherValue = otherProperty.getValue (); |
if (theOtherValue.isNull ()) | if (theOtherValue.isNull ()) |
{ | { |
// l10n |
|
|
|
String exceptionStr = _MSG_MISSING_REQUIRED; | String exceptionStr = _MSG_MISSING_REQUIRED; |
// exceptionStr.append (otherPropertyName.getString()); |
|
exceptionStr.append ("$0"); | exceptionStr.append ("$0"); |
exceptionStr.append (_MSG_PROPERTY); | exceptionStr.append (_MSG_PROPERTY); |
| |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
| |
// l10n |
throw PEGASUS_CIM_EXCEPTION_L( |
// throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER, |
CIM_ERR_INVALID_PARAMETER, |
// exceptionStr); |
MessageLoaderParms( |
|
_MSG_PROPERTY_KEY, |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_INVALID_PARAMETER, |
|
MessageLoaderParms(_MSG_PROPERTY_KEY, |
|
exceptionStr, | exceptionStr, |
otherPropertyName.getString())); | otherPropertyName.getString())); |
} | } |
|
|
exceptionStr.append ("$1"); | exceptionStr.append ("$1"); |
| |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_INVALID_PARAMETER, |
throw PEGASUS_CIM_EXCEPTION_L( |
MessageLoaderParms |
CIM_ERR_INVALID_PARAMETER, |
(_MSG_INVALID_TYPE_FOR_PROPERTY_KEY, |
MessageLoaderParms( |
|
_MSG_INVALID_TYPE_FOR_PROPERTY_KEY, |
exceptionStr, | exceptionStr, |
cimTypeToString (theOtherValue.getType ()), | cimTypeToString (theOtherValue.getType ()), |
otherPropertyName.getString ())); | otherPropertyName.getString ())); |
|
|
// | // |
else if (instance.findProperty (otherPropertyName) != PEG_NOT_FOUND) | else if (instance.findProperty (otherPropertyName) != PEG_NOT_FOUND) |
{ | { |
CIMProperty otherProperty = instance.getProperty |
CIMProperty otherProperty = instance.getProperty( |
(instance.findProperty (otherPropertyName)); |
instance.findProperty(otherPropertyName)); |
CIMValue theOtherValue = otherProperty.getValue (); | CIMValue theOtherValue = otherProperty.getValue (); |
if (!theOtherValue.isNull ()) | if (!theOtherValue.isNull ()) |
{ | { |
// l10n |
|
|
|
// String exceptionStr = otherPropertyName.getString(); |
|
String exceptionStr ("$0"); | String exceptionStr ("$0"); |
exceptionStr.append (_MSG_PROPERTY_PRESENT); | exceptionStr.append (_MSG_PROPERTY_PRESENT); |
// exceptionStr.append (propertyName.getString()); |
|
exceptionStr.append ("$1"); | exceptionStr.append ("$1"); |
exceptionStr.append (_MSG_VALUE_NOT); | exceptionStr.append (_MSG_VALUE_NOT); |
// exceptionStr.append (CIMValue (otherValue).toString ()); |
|
exceptionStr.append ("$2"); | exceptionStr.append ("$2"); |
| |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
| |
// l10n |
throw PEGASUS_CIM_EXCEPTION_L( |
|
CIM_ERR_INVALID_PARAMETER, |
// throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER, |
MessageLoaderParms( |
// exceptionStr); |
_MSG_PROPERTY_PRESENT_BUT_VALUE_NOT_KEY, |
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_INVALID_PARAMETER, |
|
MessageLoaderParms(_MSG_PROPERTY_PRESENT_BUT_VALUE_NOT_KEY, |
|
exceptionStr, | exceptionStr, |
otherPropertyName.getString(), | otherPropertyName.getString(), |
propertyName.getString(), | propertyName.getString(), |
|
|
exceptionStr, | exceptionStr, |
theValue, | theValue, |
propertyName.getString())); | propertyName.getString())); |
|
|
} | } |
} | } |
|
|
} | } |
| |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
|
|
// If one property specified, it must be Subscription State property | // If one property specified, it must be Subscription State property |
// | // |
else if ((request->propertyList.size () == 1) && | else if ((request->propertyList.size () == 1) && |
(!request->propertyList[0].equal (PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE))) |
(!request->propertyList[0].equal( |
|
PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE))) |
{ | { |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); | throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
|
|
// | // |
// Check the SubscriptionState property in the modified instance | // Check the SubscriptionState property in the modified instance |
// | // |
_checkPropertyWithOther (modifiedInstance, PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE, |
_checkPropertyWithOther( |
_PROPERTY_OTHERSTATE, (Uint16) STATE_ENABLED, (Uint16) STATE_OTHER, |
modifiedInstance, |
_validStates, _supportedStates); |
PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE, |
|
_PROPERTY_OTHERSTATE, |
|
(Uint16) STATE_ENABLED, |
|
(Uint16) STATE_OTHER, |
|
_validStates, |
|
_supportedStates); |
| |
// | // |
// Get creator from instance | // Get creator from instance |
|
|
// L10N TODO DONE -- new throw of exception | // L10N TODO DONE -- new throw of exception |
// | // |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
//throw PEGASUS_CIM_EXCEPTION (CIM_ERR_FAILED, |
|
//_MSG_INVALID_INSTANCES); |
|
MessageLoaderParms parms(_MSG_INVALID_INSTANCES_KEY, | MessageLoaderParms parms(_MSG_INVALID_INSTANCES_KEY, |
_MSG_INVALID_INSTANCES); | _MSG_INVALID_INSTANCES); |
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms); | throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms); |
|
|
(subscriptions [i], filterQuery, sourceNameSpace, | (subscriptions [i], filterQuery, sourceNameSpace, |
queryLanguage, filterName); | queryLanguage, filterName); |
| |
QueryExpression queryExpr = _getQueryExpression(filterQuery, |
QueryExpression queryExpr = _getQueryExpression( |
queryLanguage, |
filterQuery, queryLanguage, sourceNameSpace); |
sourceNameSpace); |
|
| |
// | // |
// Get indication class name from filter query | // Get indication class name from filter query |
|
|
// | // |
_subscriptionRepository->getFilterProperties (newList [n], filterQuery, | _subscriptionRepository->getFilterProperties (newList [n], filterQuery, |
sourceNameSpace, queryLanguage, filterName); | sourceNameSpace, queryLanguage, filterName); |
QueryExpression queryExpression = _getQueryExpression(filterQuery, |
QueryExpression queryExpression = _getQueryExpression( |
queryLanguage, |
filterQuery, queryLanguage, sourceNameSpace); |
sourceNameSpace); |
|
| |
// | // |
// Get indication class name from filter query (FROM clause) | // Get indication class name from filter query (FROM clause) |
|
|
// | // |
_subscriptionRepository->getFilterProperties (bothList [b], filterQuery, | _subscriptionRepository->getFilterProperties (bothList [b], filterQuery, |
sourceNameSpace, queryLanguage, filterName); | sourceNameSpace, queryLanguage, filterName); |
QueryExpression queryExpression = _getQueryExpression(filterQuery, |
QueryExpression queryExpression = _getQueryExpression( |
queryLanguage, |
filterQuery, queryLanguage, sourceNameSpace); |
sourceNameSpace); |
|
| |
// | // |
// Get indication class name from filter query (FROM clause) | // Get indication class name from filter query (FROM clause) |
|
|
return true; | return true; |
} | } |
| |
QueryExpression IndicationService::_getQueryExpression (const String& filterQuery, |
QueryExpression IndicationService::_getQueryExpression( |
|
const String& filterQuery, |
const String& queryLanguage, | const String& queryLanguage, |
const CIMNamespaceName ns) const |
const CIMNamespaceName& ns) const |
{ | { |
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, | PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, |
"IndicationService::_getQueryExpression"); | "IndicationService::_getQueryExpression"); |
|
|
provider.classList.append (indicationSubclasses [i]); | provider.classList.append (indicationSubclasses [i]); |
#ifdef PEGASUS_ENABLE_REMOTE_CMPI | #ifdef PEGASUS_ENABLE_REMOTE_CMPI |
String remoteInformation; | String remoteInformation; |
Boolean isRemote = _cimRepository->isRemoteNameSpace(nameSpace,remoteInformation); |
Boolean isRemote = _cimRepository->isRemoteNameSpace( |
|
nameSpace, remoteInformation); |
provider.isRemoteNameSpace = isRemote; | provider.isRemoteNameSpace = isRemote; |
provider.remoteInfo = remoteInformation; | provider.remoteInfo = remoteInformation; |
#endif | #endif |
|
|
return indicationProviders; | return indicationProviders; |
} | } |
| |
CIMPropertyList IndicationService::_getPropertyList |
CIMPropertyList IndicationService::_getPropertyList( |
(const QueryExpression & queryExpression, |
const QueryExpression& queryExpression, |
const CIMNamespaceName & nameSpaceName, | const CIMNamespaceName & nameSpaceName, |
const CIMName & indicationClassName) const | const CIMName & indicationClassName) const |
{ | { |
|
|
} | } |
} | } |
| |
CIMPropertyList IndicationService::_checkPropertyList |
CIMPropertyList IndicationService::_checkPropertyList( |
(const Array <CIMName> & propertyList, |
const Array<CIMName>& propertyList, |
const CIMNamespaceName & nameSpaceName, | const CIMNamespaceName & nameSpaceName, |
const CIMName & indicationClassName, | const CIMName & indicationClassName, |
Array <CIMName> & indicationClassProperties) const | Array <CIMName> & indicationClassProperties) const |
|
|
// Specify localOnly=false because superclass properties are needed | // Specify localOnly=false because superclass properties are needed |
// Specify includeQualifiers=false because qualifiers are not needed | // Specify includeQualifiers=false because qualifiers are not needed |
// | // |
indicationClass = _subscriptionRepository->getClass |
indicationClass = _subscriptionRepository->getClass( |
(nameSpaceName, indicationClassName, false, false, false, |
nameSpaceName, indicationClassName, false, false, false, |
CIMPropertyList ()); | CIMPropertyList ()); |
| |
Boolean allProperties = true; | Boolean allProperties = true; |
for (Uint32 i = 0; i < indicationClass.getPropertyCount (); i++) | for (Uint32 i = 0; i < indicationClass.getPropertyCount (); i++) |
{ | { |
indicationClassProperties.append |
indicationClassProperties.append( |
(indicationClass.getProperty (i).getName ()); |
indicationClass.getProperty(i).getName()); |
if (!ContainsCIMName (propertyList, | if (!ContainsCIMName (propertyList, |
indicationClass.getProperty (i).getName ())) | indicationClass.getProperty (i).getName ())) |
{ | { |
|
|
} | } |
} | } |
| |
String IndicationService::_getCondition |
String IndicationService::_getCondition( |
(const String & filterQuery) const |
const String& filterQuery) const |
{ | { |
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, | PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, |
"IndicationService::_getCondition"); | "IndicationService::_getCondition"); |
|
|
// | // |
if (filterQuery.find (_QUERY_WHERE) != PEG_NOT_FOUND) | if (filterQuery.find (_QUERY_WHERE) != PEG_NOT_FOUND) |
{ | { |
condition = filterQuery.subString (filterQuery.find |
condition = filterQuery.subString(filterQuery.find(_QUERY_WHERE) + 6); |
(_QUERY_WHERE) + 6); |
|
} | } |
| |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
|
|
// Delete referencing subscriptions from the repository | // Delete referencing subscriptions from the repository |
// | // |
deletedSubscriptions = | deletedSubscriptions = |
_subscriptionRepository->deleteReferencingSubscriptions |
_subscriptionRepository->deleteReferencingSubscriptions( |
(nameSpace, referenceProperty, handler); |
nameSpace, referenceProperty, handler); |
| |
// | // |
// Send delete request to each provider for each deleted subscription | // Send delete request to each provider for each deleted subscription |
|
|
| |
// l10n start | // l10n start |
AcceptLanguageList acceptLangs; | AcceptLanguageList acceptLangs; |
Uint32 propIndex = instance.findProperty |
Uint32 propIndex = instance.findProperty( |
(PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); |
PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
String acceptLangsString; | String acceptLangsString; |
|
|
} | } |
} | } |
ContentLanguageList contentLangs; | ContentLanguageList contentLangs; |
propIndex = instance.findProperty |
propIndex = instance.findProperty( |
(PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); |
PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
String contentLangsString; | String contentLangsString; |
|
|
} | } |
// l10n end | // l10n end |
| |
// l10n |
_sendAsyncDeleteRequests( |
_sendAsyncDeleteRequests (indicationProviders, sourceNamespaceName, |
indicationProviders, |
|
sourceNamespaceName, |
deletedSubscriptions [i], | deletedSubscriptions [i], |
acceptLangs, | acceptLangs, |
contentLangs, | contentLangs, |
|
|
// | // |
// Delete instance from repository | // Delete instance from repository |
// | // |
subscriptionInstance = _subscriptionRepository->deleteSubscription |
subscriptionInstance = |
(subscription); |
_subscriptionRepository->deleteSubscription(subscription); |
| |
// | // |
// If a valid instance object was returned, the subscription was | // If a valid instance object was returned, the subscription was |
|
|
// | // |
Uint16 subscriptionState; | Uint16 subscriptionState; |
CIMValue subscriptionStateValue; | CIMValue subscriptionStateValue; |
subscriptionStateValue = subscriptionInstance.getProperty |
subscriptionStateValue = subscriptionInstance.getProperty( |
(subscriptionInstance.findProperty |
subscriptionInstance.findProperty( |
(PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE)).getValue (); |
PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE)).getValue(); |
subscriptionStateValue.get (subscriptionState); | subscriptionStateValue.get (subscriptionState); |
| |
if ((subscriptionState == STATE_ENABLED) || | if ((subscriptionState == STATE_ENABLED) || |
|
|
// instance | // instance |
// | // |
AcceptLanguageList acceptLangs; | AcceptLanguageList acceptLangs; |
Uint32 propIndex = subscriptionInstance.findProperty |
Uint32 propIndex = subscriptionInstance.findProperty( |
(PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); |
PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS); |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
String acceptLangsString; | String acceptLangsString; |
|
|
} | } |
} | } |
ContentLanguageList contentLangs; | ContentLanguageList contentLangs; |
propIndex = subscriptionInstance.findProperty |
propIndex = subscriptionInstance.findProperty( |
(PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); |
PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS); |
if (propIndex != PEG_NOT_FOUND) | if (propIndex != PEG_NOT_FOUND) |
{ | { |
String contentLangsString; | String contentLangsString; |
|
|
} | } |
} | } |
| |
// l10n |
|
subscriptionInstance.setPath (subscription); | subscriptionInstance.setPath (subscription); |
_sendAsyncDeleteRequests (indicationProviders, | _sendAsyncDeleteRequests (indicationProviders, |
sourceNamespaceName, subscriptionInstance, | sourceNamespaceName, subscriptionInstance, |
|
|
Sint64 difference; | Sint64 difference; |
try | try |
{ | { |
difference = CIMDateTime::getDifference |
difference = CIMDateTime::getDifference( |
(startTime, currentDateTime); |
startTime, currentDateTime); |
} | } |
| |
// Check if the date time is out of range. | // Check if the date time is out of range. |
|
|
// | // |
if (instance.findProperty (_PROPERTY_TIMEREMAINING) == PEG_NOT_FOUND) | if (instance.findProperty (_PROPERTY_TIMEREMAINING) == PEG_NOT_FOUND) |
{ | { |
instance.addProperty (CIMProperty |
instance.addProperty( |
(_PROPERTY_TIMEREMAINING, timeRemaining)); |
CIMProperty(_PROPERTY_TIMEREMAINING, timeRemaining)); |
} | } |
else | else |
{ | { |
CIMProperty remaining = instance.getProperty |
CIMProperty remaining = instance.getProperty( |
(instance.findProperty (_PROPERTY_TIMEREMAINING)); |
instance.findProperty(_PROPERTY_TIMEREMAINING)); |
remaining.setValue (CIMValue (timeRemaining)); | remaining.setValue (CIMValue (timeRemaining)); |
} | } |
} | } |
|
|
// | // |
// Get list of subclass names for indication class | // Get list of subclass names for indication class |
// | // |
indicationSubclasses = _subscriptionRepository->getIndicationSubclasses |
indicationSubclasses = _subscriptionRepository->getIndicationSubclasses( |
(sourceNameSpace, indicationClassName); |
sourceNameSpace, indicationClassName); |
| |
| |
// | // |
|
|
// | // |
_subscriptionRepository->getFilterProperties (subscriptionInstance, query, | _subscriptionRepository->getFilterProperties (subscriptionInstance, query, |
sourceNameSpace, queryLanguage, filterName); | sourceNameSpace, queryLanguage, filterName); |
QueryExpression queryExpression = _getQueryExpression(query, |
QueryExpression queryExpression = _getQueryExpression( |
|
query, |
queryLanguage, | queryLanguage, |
sourceNameSpace); | sourceNameSpace); |
| |
// | // |
// Get indication class name from filter query (FROM clause) | // Get indication class name from filter query (FROM clause) |
// | // |
CIMName indicationClassName = _getIndicationClassName (queryExpression, |
CIMName indicationClassName = |
sourceNameSpace); |
_getIndicationClassName(queryExpression, sourceNameSpace); |
|
|
// | // |
// Get required property list from filter query (WHERE clause) | // Get required property list from filter query (WHERE clause) |
// | // |
|
|
// | // |
// Get list of subclass names for indication class | // Get list of subclass names for indication class |
// | // |
indicationSubclasses = _subscriptionRepository->getIndicationSubclasses |
indicationSubclasses = _subscriptionRepository->getIndicationSubclasses( |
(sourceNameSpace, indicationClassName); |
sourceNameSpace, indicationClassName); |
| |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
} | } |
|
|
// | // |
_subscriptionRepository->getFilterProperties (subscriptionInstance, | _subscriptionRepository->getFilterProperties (subscriptionInstance, |
filterQuery, sourceNameSpace, queryLanguage, filterName); | filterQuery, sourceNameSpace, queryLanguage, filterName); |
QueryExpression queryExpression = _getQueryExpression(filterQuery, |
QueryExpression queryExpression = |
queryLanguage, |
_getQueryExpression(filterQuery, queryLanguage, sourceNameSpace); |
sourceNameSpace); |
|
| |
// | // |
// Get indication class name from filter query (FROM clause) | // Get indication class name from filter query (FROM clause) |
// | // |
indicationClassName = _getIndicationClassName (queryExpression, |
indicationClassName = |
sourceNameSpace); |
_getIndicationClassName(queryExpression, sourceNameSpace); |
| |
// | // |
// Get list of subclass names for indication class | // Get list of subclass names for indication class |
// | // |
indicationSubclasses = _subscriptionRepository->getIndicationSubclasses |
indicationSubclasses = _subscriptionRepository->getIndicationSubclasses( |
(sourceNameSpace, indicationClassName); |
sourceNameSpace, indicationClassName); |
| |
// | // |
// Get indication provider class lists from Active Subscriptions table | // Get indication provider class lists from Active Subscriptions table |
// | // |
ActiveSubscriptionsTableEntry tableValue; | ActiveSubscriptionsTableEntry tableValue; |
if (_subscriptionTable->getSubscriptionEntry |
if (_subscriptionTable->getSubscriptionEntry( |
(subscriptionInstance.getPath (), tableValue)) |
subscriptionInstance.getPath(), tableValue)) |
{ | { |
indicationProviders = tableValue.providers; | indicationProviders = tableValue.providers; |
} | } |
|
|
return indicationProviders; | return indicationProviders; |
} | } |
| |
// l10n |
void IndicationService::_sendAsyncCreateRequests( |
void IndicationService::_sendAsyncCreateRequests |
const Array<ProviderClassList>& indicationProviders, |
(const Array <ProviderClassList> & indicationProviders, |
|
const CIMNamespaceName & nameSpace, | const CIMNamespaceName & nameSpace, |
const CIMPropertyList & propertyList, | const CIMPropertyList & propertyList, |
const String & condition, | const String & condition, |
|
|
// | // |
// Get repeat notification policy value from subscription instance | // Get repeat notification policy value from subscription instance |
// | // |
propValue = subscription.getProperty |
propValue = subscription.getProperty( |
(subscription.findProperty |
subscription.findProperty( |
(_PROPERTY_REPEATNOTIFICATIONPOLICY)).getValue (); |
_PROPERTY_REPEATNOTIFICATIONPOLICY)).getValue(); |
propValue.get (repeatNotificationPolicy); | propValue.get (repeatNotificationPolicy); |
| |
CIMRequestMessage * aggRequest=0; | CIMRequestMessage * aggRequest=0; |
|
|
// | // |
// Create the create subscription request | // Create the create subscription request |
// | // |
// l10n |
|
CIMCreateSubscriptionRequestMessage * request = | CIMCreateSubscriptionRequestMessage * request = |
new CIMCreateSubscriptionRequestMessage |
new CIMCreateSubscriptionRequestMessage( |
(XmlWriter::getNextMessageId (), |
XmlWriter::getNextMessageId(), |
nameSpace, | nameSpace, |
subscription, | subscription, |
indicationProviders [i].classList, | indicationProviders [i].classList, |
|
|
// | // |
CIMCreateSubscriptionRequestMessage * requestCopy = | CIMCreateSubscriptionRequestMessage * requestCopy = |
new CIMCreateSubscriptionRequestMessage (* request); | new CIMCreateSubscriptionRequestMessage (* request); |
requestCopy->operationContext.insert(ProviderIdContainer |
requestCopy->operationContext.insert(ProviderIdContainer( |
(indicationProviders [i].providerModule |
indicationProviders[i].providerModule |
,indicationProviders [i].provider | ,indicationProviders [i].provider |
#ifdef PEGASUS_ENABLE_REMOTE_CMPI | #ifdef PEGASUS_ENABLE_REMOTE_CMPI |
,indicationProviders [i].isRemoteNameSpace | ,indicationProviders [i].isRemoteNameSpace |
|
|
#endif | #endif |
)); | )); |
operationAggregate->appendRequest (requestCopy); | operationAggregate->appendRequest (requestCopy); |
request->operationContext.insert(ProviderIdContainer |
request->operationContext.insert(ProviderIdContainer( |
(indicationProviders [i].providerModule |
indicationProviders[i].providerModule |
,indicationProviders [i].provider | ,indicationProviders [i].provider |
#ifdef PEGASUS_ENABLE_REMOTE_CMPI | #ifdef PEGASUS_ENABLE_REMOTE_CMPI |
,indicationProviders [i].isRemoteNameSpace | ,indicationProviders [i].isRemoteNameSpace |
,indicationProviders [i].remoteInfo | ,indicationProviders [i].remoteInfo |
#endif | #endif |
)); | )); |
request->operationContext.insert(SubscriptionInstanceContainer |
request->operationContext.insert( |
(subscription)); |
SubscriptionInstanceContainer(subscription)); |
request->operationContext.insert(SubscriptionFilterConditionContainer |
request->operationContext.insert( |
(condition,queryLanguage)); |
SubscriptionFilterConditionContainer(condition,queryLanguage)); |
request->operationContext.insert(SubscriptionFilterQueryContainer |
request->operationContext.insert( |
(query,queryLanguage,nameSpace)); |
SubscriptionFilterQueryContainer(query,queryLanguage,nameSpace)); |
request->operationContext.insert(IdentityContainer(userName)); | request->operationContext.insert(IdentityContainer(userName)); |
request->operationContext.set(ContentLanguageListContainer |
request->operationContext.set( |
(contentLangs)); |
ContentLanguageListContainer(contentLangs)); |
request->operationContext.set(AcceptLanguageListContainer(acceptLangs)); | request->operationContext.set(AcceptLanguageListContainer(acceptLangs)); |
| |
AsyncOpNode * op = this->get_op (); | AsyncOpNode * op = this->get_op (); |
|
|
request, | request, |
_queueId); | _queueId); |
| |
SendAsync |
SendAsync( |
(op, |
op, |
_providerManager, | _providerManager, |
IndicationService::_aggregationCallBack, | IndicationService::_aggregationCallBack, |
this, | this, |
|
|
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
} | } |
| |
Array <ProviderClassList> IndicationService::_sendWaitCreateRequests |
Array<ProviderClassList> IndicationService::_sendWaitCreateRequests( |
(const Array <ProviderClassList> & indicationProviders, |
const Array<ProviderClassList>& indicationProviders, |
const CIMNamespaceName & nameSpace, | const CIMNamespaceName & nameSpace, |
const CIMPropertyList & propertyList, | const CIMPropertyList & propertyList, |
const String & condition, | const String & condition, |
|
|
// | // |
// Get repeat notification policy value from subscription instance | // Get repeat notification policy value from subscription instance |
// | // |
propValue = subscription.getProperty |
propValue = subscription.getProperty( |
(subscription.findProperty |
subscription.findProperty( |
(_PROPERTY_REPEATNOTIFICATIONPOLICY)).getValue (); |
_PROPERTY_REPEATNOTIFICATIONPOLICY)).getValue(); |
propValue.get (repeatNotificationPolicy); | propValue.get (repeatNotificationPolicy); |
| |
// | // |
|
|
// Create the create subscription request | // Create the create subscription request |
// | // |
CIMCreateSubscriptionRequestMessage * request = | CIMCreateSubscriptionRequestMessage * request = |
new CIMCreateSubscriptionRequestMessage |
new CIMCreateSubscriptionRequestMessage( |
(XmlWriter::getNextMessageId (), |
XmlWriter::getNextMessageId(), |
nameSpace, | nameSpace, |
subscription, | subscription, |
indicationProviders [i].classList, | indicationProviders [i].classList, |
|
|
// | // |
// Set operation context | // Set operation context |
// | // |
request->operationContext.insert(ProviderIdContainer |
request->operationContext.insert(ProviderIdContainer( |
(indicationProviders [i].providerModule |
indicationProviders[i].providerModule |
,indicationProviders [i].provider | ,indicationProviders [i].provider |
#ifdef PEGASUS_ENABLE_REMOTE_CMPI | #ifdef PEGASUS_ENABLE_REMOTE_CMPI |
,indicationProviders [i].isRemoteNameSpace | ,indicationProviders [i].isRemoteNameSpace |
,indicationProviders [i].remoteInfo | ,indicationProviders [i].remoteInfo |
#endif | #endif |
)); | )); |
request->operationContext.insert(SubscriptionInstanceContainer |
request->operationContext.insert( |
(subscription)); |
SubscriptionInstanceContainer(subscription)); |
request->operationContext.insert(SubscriptionFilterConditionContainer |
request->operationContext.insert( |
(condition,queryLanguage)); |
SubscriptionFilterConditionContainer(condition,queryLanguage)); |
request->operationContext.insert(SubscriptionFilterQueryContainer |
request->operationContext.insert( |
(query,queryLanguage,nameSpace)); |
SubscriptionFilterQueryContainer(query,queryLanguage,nameSpace)); |
request->operationContext.insert(IdentityContainer(userName)); | request->operationContext.insert(IdentityContainer(userName)); |
request->operationContext.set(ContentLanguageListContainer |
request->operationContext.set( |
(contentLangs)); |
ContentLanguageListContainer(contentLangs)); |
request->operationContext.set(AcceptLanguageListContainer(acceptLangs)); | request->operationContext.set(AcceptLanguageListContainer(acceptLangs)); |
| |
AsyncLegacyOperationStart * asyncRequest = | AsyncLegacyOperationStart * asyncRequest = |
|
|
AsyncReply * asyncReply = SendWait (asyncRequest); | AsyncReply * asyncReply = SendWait (asyncRequest); |
| |
CIMCreateSubscriptionResponseMessage * response = | CIMCreateSubscriptionResponseMessage * response = |
reinterpret_cast <CIMCreateSubscriptionResponseMessage *> |
reinterpret_cast<CIMCreateSubscriptionResponseMessage *>( |
((static_cast <AsyncLegacyOperationResult *> |
(static_cast<AsyncLegacyOperationResult *>( |
(asyncReply))->get_result ()); |
asyncReply))->get_result()); |
| |
if (response->cimException.getCode () == CIM_ERR_SUCCESS) | if (response->cimException.getCode () == CIM_ERR_SUCCESS) |
{ | { |
|
|
return acceptedProviders; | return acceptedProviders; |
} | } |
| |
// l10n |
void IndicationService::_sendWaitModifyRequests( |
void IndicationService::_sendWaitModifyRequests |
const Array<ProviderClassList>& indicationProviders, |
(const Array <ProviderClassList> & indicationProviders, |
|
const CIMNamespaceName & nameSpace, | const CIMNamespaceName & nameSpace, |
const CIMPropertyList & propertyList, | const CIMPropertyList & propertyList, |
const String & condition, | const String & condition, |
|
|
// | // |
// Get repeat notification policy value from subscription instance | // Get repeat notification policy value from subscription instance |
// | // |
propValue = subscription.getProperty |
propValue = subscription.getProperty( |
(subscription.findProperty |
subscription.findProperty( |
(_PROPERTY_REPEATNOTIFICATIONPOLICY)).getValue (); |
_PROPERTY_REPEATNOTIFICATIONPOLICY)).getValue(); |
propValue.get (repeatNotificationPolicy); | propValue.get (repeatNotificationPolicy); |
| |
// | // |
|
|
// | // |
for (Uint32 i = 0; i < indicationProviders.size (); i++) | for (Uint32 i = 0; i < indicationProviders.size (); i++) |
{ | { |
// l10n |
|
CIMModifySubscriptionRequestMessage * request = | CIMModifySubscriptionRequestMessage * request = |
new CIMModifySubscriptionRequestMessage |
new CIMModifySubscriptionRequestMessage( |
(XmlWriter::getNextMessageId (), |
XmlWriter::getNextMessageId(), |
nameSpace, | nameSpace, |
subscription, | subscription, |
indicationProviders [i].classList, | indicationProviders [i].classList, |
|
|
// | // |
// Set operation context | // Set operation context |
// | // |
request->operationContext.insert(ProviderIdContainer |
request->operationContext.insert(ProviderIdContainer( |
(indicationProviders [i].providerModule |
indicationProviders[i].providerModule |
,indicationProviders [i].provider | ,indicationProviders [i].provider |
#ifdef PEGASUS_ENABLE_REMOTE_CMPI | #ifdef PEGASUS_ENABLE_REMOTE_CMPI |
,indicationProviders [i].isRemoteNameSpace | ,indicationProviders [i].isRemoteNameSpace |
,indicationProviders [i].remoteInfo | ,indicationProviders [i].remoteInfo |
#endif | #endif |
)); | )); |
request->operationContext.insert(SubscriptionInstanceContainer |
request->operationContext.insert( |
(subscription)); |
SubscriptionInstanceContainer(subscription)); |
request->operationContext.insert(SubscriptionFilterConditionContainer |
request->operationContext.insert( |
(condition,queryLanguage)); |
SubscriptionFilterConditionContainer(condition,queryLanguage)); |
request->operationContext.insert(SubscriptionFilterQueryContainer |
request->operationContext.insert( |
(query,queryLanguage,nameSpace)); |
SubscriptionFilterQueryContainer(query,queryLanguage,nameSpace)); |
request->operationContext.insert(IdentityContainer(userName)); | request->operationContext.insert(IdentityContainer(userName)); |
request->operationContext.set(ContentLanguageListContainer |
request->operationContext.set( |
(contentLangs)); |
ContentLanguageListContainer(contentLangs)); |
request->operationContext.set(AcceptLanguageListContainer(acceptLangs)); | request->operationContext.set(AcceptLanguageListContainer(acceptLangs)); |
| |
AsyncLegacyOperationStart * asyncRequest = | AsyncLegacyOperationStart * asyncRequest = |
|
|
AsyncReply * asyncReply = SendWait (asyncRequest); | AsyncReply * asyncReply = SendWait (asyncRequest); |
| |
CIMModifySubscriptionResponseMessage * response = | CIMModifySubscriptionResponseMessage * response = |
reinterpret_cast <CIMModifySubscriptionResponseMessage *> |
reinterpret_cast<CIMModifySubscriptionResponseMessage *>( |
((static_cast <AsyncLegacyOperationResult *> |
(static_cast<AsyncLegacyOperationResult *>( |
(asyncReply))->get_result ()); |
asyncReply))->get_result()); |
| |
if (!(response->cimException.getCode () == CIM_ERR_SUCCESS)) | if (!(response->cimException.getCode () == CIM_ERR_SUCCESS)) |
{ | { |
|
|
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
} | } |
| |
// l10n |
void IndicationService::_sendAsyncDeleteRequests( |
void IndicationService::_sendAsyncDeleteRequests |
const Array<ProviderClassList>& indicationProviders, |
(const Array <ProviderClassList> & indicationProviders, |
|
const CIMNamespaceName & nameSpace, | const CIMNamespaceName & nameSpace, |
const CIMInstance & subscription, | const CIMInstance & subscription, |
const AcceptLanguageList & acceptLangs, | const AcceptLanguageList & acceptLangs, |
|
|
// | // |
// Update subscription hash tables | // Update subscription hash tables |
// | // |
_subscriptionTable->removeSubscription |
_subscriptionTable->removeSubscription( |
(subscription, |
subscription, |
indicationSubclasses, | indicationSubclasses, |
nameSpace, | nameSpace, |
indicationProviders); | indicationProviders); |
|
|
// | // |
for (Uint32 i = 0; i < indicationProviders.size (); i++) | for (Uint32 i = 0; i < indicationProviders.size (); i++) |
{ | { |
// l10n |
|
CIMDeleteSubscriptionRequestMessage * request = | CIMDeleteSubscriptionRequestMessage * request = |
new CIMDeleteSubscriptionRequestMessage |
new CIMDeleteSubscriptionRequestMessage( |
(XmlWriter::getNextMessageId (), |
XmlWriter::getNextMessageId(), |
nameSpace, | nameSpace, |
subscription, | subscription, |
indicationProviders [i].classList, | indicationProviders [i].classList, |
|
|
// | // |
CIMDeleteSubscriptionRequestMessage * requestCopy = | CIMDeleteSubscriptionRequestMessage * requestCopy = |
new CIMDeleteSubscriptionRequestMessage (* request); | new CIMDeleteSubscriptionRequestMessage (* request); |
requestCopy->operationContext.insert(ProviderIdContainer |
requestCopy->operationContext.insert(ProviderIdContainer( |
(indicationProviders [i].providerModule |
indicationProviders[i].providerModule |
,indicationProviders [i].provider | ,indicationProviders [i].provider |
#ifdef PEGASUS_ENABLE_REMOTE_CMPI | #ifdef PEGASUS_ENABLE_REMOTE_CMPI |
,indicationProviders [i].isRemoteNameSpace | ,indicationProviders [i].isRemoteNameSpace |
|
|
#endif | #endif |
)); | )); |
operationAggregate->appendRequest (requestCopy); | operationAggregate->appendRequest (requestCopy); |
request->operationContext.insert(ProviderIdContainer |
request->operationContext.insert(ProviderIdContainer( |
(indicationProviders [i].providerModule |
indicationProviders[i].providerModule |
,indicationProviders [i].provider | ,indicationProviders [i].provider |
#ifdef PEGASUS_ENABLE_REMOTE_CMPI | #ifdef PEGASUS_ENABLE_REMOTE_CMPI |
,indicationProviders [i].isRemoteNameSpace | ,indicationProviders [i].isRemoteNameSpace |
|
|
#endif | #endif |
)); | )); |
| |
request->operationContext.insert(SubscriptionInstanceContainer |
request->operationContext.insert( |
(subscription)); |
SubscriptionInstanceContainer(subscription)); |
request->operationContext.insert(IdentityContainer(userName)); | request->operationContext.insert(IdentityContainer(userName)); |
request->operationContext.set(ContentLanguageListContainer |
request->operationContext.set( |
(contentLangs)); |
ContentLanguageListContainer(contentLangs)); |
request->operationContext.set(AcceptLanguageListContainer(acceptLangs)); | request->operationContext.set(AcceptLanguageListContainer(acceptLangs)); |
| |
AsyncOpNode * op = this->get_op (); | AsyncOpNode * op = this->get_op (); |
|
|
request, | request, |
_queueId); | _queueId); |
| |
SendAsync |
SendAsync( |
(op, |
op, |
_providerManager, | _providerManager, |
IndicationService::_aggregationCallBack, | IndicationService::_aggregationCallBack, |
this, | this, |
|
|
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
} | } |
| |
void IndicationService::_sendWaitDeleteRequests |
void IndicationService::_sendWaitDeleteRequests( |
(const Array <ProviderClassList> & indicationProviders, |
const Array<ProviderClassList>& indicationProviders, |
const CIMNamespaceName & nameSpace, | const CIMNamespaceName & nameSpace, |
const CIMInstance & subscription, | const CIMInstance & subscription, |
const AcceptLanguageList & acceptLangs, | const AcceptLanguageList & acceptLangs, |
|
|
for (Uint32 i = 0; i < indicationProviders.size (); i++) | for (Uint32 i = 0; i < indicationProviders.size (); i++) |
{ | { |
CIMDeleteSubscriptionRequestMessage * request = | CIMDeleteSubscriptionRequestMessage * request = |
new CIMDeleteSubscriptionRequestMessage |
new CIMDeleteSubscriptionRequestMessage( |
(XmlWriter::getNextMessageId (), |
XmlWriter::getNextMessageId(), |
nameSpace, | nameSpace, |
subscription, | subscription, |
indicationProviders [i].classList, | indicationProviders [i].classList, |
|
|
// | // |
// Set operation context | // Set operation context |
// | // |
request->operationContext.insert(ProviderIdContainer |
request->operationContext.insert(ProviderIdContainer( |
(indicationProviders [i].providerModule |
indicationProviders[i].providerModule |
,indicationProviders [i].provider | ,indicationProviders [i].provider |
#ifdef PEGASUS_ENABLE_REMOTE_CMPI | #ifdef PEGASUS_ENABLE_REMOTE_CMPI |
,indicationProviders [i].isRemoteNameSpace | ,indicationProviders [i].isRemoteNameSpace |
,indicationProviders [i].remoteInfo | ,indicationProviders [i].remoteInfo |
#endif | #endif |
)); | )); |
request->operationContext.insert(SubscriptionInstanceContainer |
request->operationContext.insert( |
(subscription)); |
SubscriptionInstanceContainer(subscription)); |
request->operationContext.insert(IdentityContainer(userName)); | request->operationContext.insert(IdentityContainer(userName)); |
request->operationContext.set(ContentLanguageListContainer |
request->operationContext.set( |
(contentLangs)); |
ContentLanguageListContainer(contentLangs)); |
request->operationContext.set(AcceptLanguageListContainer(acceptLangs)); | request->operationContext.set(AcceptLanguageListContainer(acceptLangs)); |
| |
AsyncLegacyOperationStart * asyncRequest = | AsyncLegacyOperationStart * asyncRequest = |
|
|
AsyncReply * asyncReply = SendWait (asyncRequest); | AsyncReply * asyncReply = SendWait (asyncRequest); |
| |
CIMDeleteSubscriptionResponseMessage * response = | CIMDeleteSubscriptionResponseMessage * response = |
reinterpret_cast <CIMDeleteSubscriptionResponseMessage *> |
reinterpret_cast<CIMDeleteSubscriptionResponseMessage *>( |
((static_cast <AsyncLegacyOperationResult *> |
(static_cast<AsyncLegacyOperationResult *>( |
(asyncReply))->get_result ()); |
asyncReply))->get_result()); |
| |
if (!(response->cimException.getCode () == CIM_ERR_SUCCESS)) | if (!(response->cimException.getCode () == CIM_ERR_SUCCESS)) |
{ | { |
|
|
| |
if (msgType == async_messages::ASYNC_LEGACY_OP_RESULT) | if (msgType == async_messages::ASYNC_LEGACY_OP_RESULT) |
{ | { |
response = reinterpret_cast <CIMResponseMessage *> |
response = reinterpret_cast<CIMResponseMessage *>( |
((static_cast <AsyncLegacyOperationResult *> |
(static_cast<AsyncLegacyOperationResult *>( |
(asyncReply))->get_result ()); |
asyncReply))->get_result()); |
} | } |
else if (msgType == async_messages::ASYNC_MODULE_OP_RESULT) | else if (msgType == async_messages::ASYNC_MODULE_OP_RESULT) |
{ | { |
response = reinterpret_cast <CIMResponseMessage *> |
response = reinterpret_cast<CIMResponseMessage *>( |
((static_cast <AsyncModuleOperationResult *> |
(static_cast<AsyncModuleOperationResult *>( |
(asyncReply))->get_result ()); |
asyncReply))->get_result()); |
} | } |
| |
PEGASUS_ASSERT (response != 0); | PEGASUS_ASSERT (response != 0); |
|
|
default: | default: |
{ | { |
PEG_TRACE_STRING (TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL2, | PEG_TRACE_STRING (TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL2, |
"Unexpected request type " + String (MessageTypeToString |
"Unexpected request type " + String(MessageTypeToString( |
(operationAggregate->getRequest (0)->getType ())) + |
operationAggregate->getRequest(0)->getType())) + |
" in _handleOperationResponseAggregation"); | " in _handleOperationResponseAggregation"); |
PEGASUS_ASSERT (false); | PEGASUS_ASSERT (false); |
break; | break; |
|
|
// Find provider from which response was sent | // Find provider from which response was sent |
// | // |
CIMResponseMessage * response = operationAggregate->getResponse (i); | CIMResponseMessage * response = operationAggregate->getResponse (i); |
ProviderClassList provider = operationAggregate->findProvider |
ProviderClassList provider = operationAggregate->findProvider( |
(response->messageId); |
response->messageId); |
if (response->cimException.getCode () == CIM_ERR_SUCCESS) | if (response->cimException.getCode () == CIM_ERR_SUCCESS) |
{ | { |
// | // |
|
|
CIMInstance instance = request->subscriptionInstance; | CIMInstance instance = request->subscriptionInstance; |
try | try |
{ | { |
instanceRef = _subscriptionRepository->createInstance |
instanceRef = _subscriptionRepository->createInstance( |
(request->subscriptionInstance, origRequest->nameSpace, |
request->subscriptionInstance, origRequest->nameSpace, |
((IdentityContainer)origRequest->operationContext.get | ((IdentityContainer)origRequest->operationContext.get |
(IdentityContainer::NAME)).getUserName(), | (IdentityContainer::NAME)).getUserName(), |
((AcceptLanguageListContainer)request->operationContext.get | ((AcceptLanguageListContainer)request->operationContext.get |
|
|
((ContentLanguageListContainer)request->operationContext.get | ((ContentLanguageListContainer)request->operationContext.get |
(ContentLanguageListContainer::NAME)).getLanguages(), | (ContentLanguageListContainer::NAME)).getLanguages(), |
true); | true); |
instanceRef.setNameSpace |
instanceRef.setNameSpace( |
(request->subscriptionInstance.getPath().getNameSpace()); |
request->subscriptionInstance.getPath().getNameSpace()); |
instance.setPath (instanceRef); | instance.setPath (instanceRef); |
} | } |
catch (CIMException & exception) | catch (CIMException & exception) |
|
|
} | } |
catch (Exception & exception) | catch (Exception & exception) |
{ | { |
cimException = PEGASUS_CIM_EXCEPTION |
cimException = PEGASUS_CIM_EXCEPTION( |
(CIM_ERR_FAILED, exception.getMessage ()); |
CIM_ERR_FAILED, exception.getMessage()); |
} | } |
| |
if (cimException.getCode () == CIM_ERR_SUCCESS) | if (cimException.getCode () == CIM_ERR_SUCCESS) |
|
|
// | // |
// Insert entries into the subscription hash tables | // Insert entries into the subscription hash tables |
// | // |
_subscriptionTable->insertSubscription |
_subscriptionTable->insertSubscription( |
(instance, |
instance, |
acceptedProviders, | acceptedProviders, |
operationAggregate->getIndicationSubclasses (), | operationAggregate->getIndicationSubclasses (), |
request->nameSpace); | request->nameSpace); |
|
|
// | // |
// Insert entries into the subscription hash tables | // Insert entries into the subscription hash tables |
// | // |
_subscriptionTable->insertSubscription |
_subscriptionTable->insertSubscription( |
(request->subscriptionInstance, |
request->subscriptionInstance, |
acceptedProviders, | acceptedProviders, |
operationAggregate->getIndicationSubclasses (), | operationAggregate->getIndicationSubclasses (), |
request->nameSpace); | request->nameSpace); |
|
|
// Find provider from which response was sent and add to list | // Find provider from which response was sent and add to list |
// | // |
CIMResponseMessage * response = operationAggregate->getResponse (i); | CIMResponseMessage * response = operationAggregate->getResponse (i); |
ProviderClassList provider = operationAggregate->findProvider |
ProviderClassList provider = operationAggregate->findProvider( |
(response->messageId); |
response->messageId); |
checkProviders.append (provider); | checkProviders.append (provider); |
| |
// | // |
|
|
// | // |
// Add property values for all required properties of CIM_AlertIndication | // Add property values for all required properties of CIM_AlertIndication |
// | // |
indicationInstance.addProperty |
indicationInstance.addProperty( |
(CIMProperty (_PROPERTY_ALERTTYPE, CIMValue ((Uint16) _TYPE_OTHER))); |
CIMProperty(_PROPERTY_ALERTTYPE, CIMValue((Uint16) _TYPE_OTHER))); |
// | // |
// ATTN: what should Other Alert Type value be?? | // ATTN: what should Other Alert Type value be?? |
// Currently using Alert class name | // Currently using Alert class name |
// | // |
indicationInstance.addProperty |
indicationInstance.addProperty( |
(CIMProperty (_PROPERTY_OTHERALERTTYPE, alertClassName.getString())); |
CIMProperty(_PROPERTY_OTHERALERTTYPE, alertClassName.getString())); |
| |
indicationInstance.addProperty |
indicationInstance.addProperty( |
(CIMProperty (_PROPERTY_PERCEIVEDSEVERITY, |
CIMProperty(_PROPERTY_PERCEIVEDSEVERITY, |
CIMValue ((Uint16) _SEVERITY_WARNING))); | CIMValue ((Uint16) _SEVERITY_WARNING))); |
// | // |
// ATTN: what should Probable Cause value be?? | // ATTN: what should Probable Cause value be?? |
// Currently using Unknown | // Currently using Unknown |
// | // |
indicationInstance.addProperty |
indicationInstance.addProperty( |
(CIMProperty (_PROPERTY_PROBABLECAUSE, |
CIMProperty(_PROPERTY_PROBABLECAUSE, |
CIMValue ((Uint16) _CAUSE_UNKNOWN))); | CIMValue ((Uint16) _CAUSE_UNKNOWN))); |
| |
// | // |
|
|
| |
AsyncRequest *asyncRequest = static_cast<AsyncRequest *>(op->get_request()); | AsyncRequest *asyncRequest = static_cast<AsyncRequest *>(op->get_request()); |
AsyncReply *asyncReply = static_cast<AsyncReply *>(op->get_response()); | AsyncReply *asyncReply = static_cast<AsyncReply *>(op->get_response()); |
CIMRequestMessage *request = reinterpret_cast<CIMRequestMessage *> |
CIMRequestMessage *request = reinterpret_cast<CIMRequestMessage *>( |
((static_cast<AsyncLegacyOperationStart *>(asyncRequest))->get_action()); |
(static_cast<AsyncLegacyOperationStart *>(asyncRequest))->get_action()); |
| |
CIMHandleIndicationResponseMessage* response = | CIMHandleIndicationResponseMessage* response = |
reinterpret_cast<CIMHandleIndicationResponseMessage *> |
reinterpret_cast<CIMHandleIndicationResponseMessage *>( |
((static_cast<AsyncLegacyOperationResult *> |
(static_cast<AsyncLegacyOperationResult *>( |
(asyncReply))->get_result()); |
asyncReply))->get_result()); |
| |
PEGASUS_ASSERT(response != 0); | PEGASUS_ASSERT(response != 0); |
if (response->cimException.getCode() == CIM_ERR_SUCCESS) | if (response->cimException.getCode() == CIM_ERR_SUCCESS) |
|
|
// again | // again |
// | // |
| |
// << Mon Jul 15 09:59:16 2002 mdd >> handler is allocated as an element in an array, |
// << Mon Jul 15 09:59:16 2002 mdd >> handler is allocated as an element in |
// don't delete here. |
// an array, don't delete here. |
// delete _handler; | // delete _handler; |
delete request; | delete request; |
delete response; | delete response; |
|
|
// Create the Subscription Init Complete request | // Create the Subscription Init Complete request |
// | // |
CIMSubscriptionInitCompleteRequestMessage * request = | CIMSubscriptionInitCompleteRequestMessage * request = |
new CIMSubscriptionInitCompleteRequestMessage |
new CIMSubscriptionInitCompleteRequestMessage( |
(XmlWriter::getNextMessageId (), |
XmlWriter::getNextMessageId(), |
QueueIdStack (_providerManager, getQueueId ())); | QueueIdStack (_providerManager, getQueueId ())); |
| |
// | // |
|
|
{ | { |
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, "IndicationService::_getCreator"); | PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, "IndicationService::_getCreator"); |
| |
Uint32 creatorIndex = instance.findProperty |
Uint32 creatorIndex = instance.findProperty( |
(PEGASUS_PROPERTYNAME_INDSUB_CREATOR); |
PEGASUS_PROPERTYNAME_INDSUB_CREATOR); |
if (creatorIndex != PEG_NOT_FOUND) | if (creatorIndex != PEG_NOT_FOUND) |
{ | { |
CIMValue creatorValue = instance.getProperty |
CIMValue creatorValue = instance.getProperty(creatorIndex).getValue(); |
(creatorIndex).getValue (); |
|
if (creatorValue.isNull ()) | if (creatorValue.isNull ()) |
{ | { |
PEG_TRACE_CSTRING (TRC_INDICATION_SERVICE_INTERNAL, | PEG_TRACE_CSTRING (TRC_INDICATION_SERVICE_INTERNAL, |
|
|
return true; | return true; |
} | } |
| |
void IndicationService::_updatePropertyList |
void IndicationService::_updatePropertyList( |
(CIMName & className, |
CIMName& className, |
CIMPropertyList & propertyList, | CIMPropertyList & propertyList, |
Boolean & setTimeRemaining, | Boolean & setTimeRemaining, |
Boolean & startTimeAdded, | Boolean & startTimeAdded, |
|
|
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
} | } |
| |
String IndicationService::_getSubscriptionLogString |
String IndicationService::_getSubscriptionLogString(CIMInstance& subscription) |
(CIMInstance & subscription) |
|
{ | { |
// | // |
// Get Subscription Filter namespace and Name, and Handler namespace and | // Get Subscription Filter namespace and Name, and Handler namespace and |
|
|
CIMObjectPath handlerPath; | CIMObjectPath handlerPath; |
CIMNamespaceName handlerNS; | CIMNamespaceName handlerNS; |
Array <CIMKeyBinding> handlerKeyBindings; | Array <CIMKeyBinding> handlerKeyBindings; |
filterValue = subscription.getProperty (subscription.findProperty |
filterValue = subscription.getProperty(subscription.findProperty( |
(PEGASUS_PROPERTYNAME_FILTER)).getValue (); |
PEGASUS_PROPERTYNAME_FILTER)).getValue(); |
filterValue.get (filterPath); | filterValue.get (filterPath); |
| |
// | // |
|
|
break; | break; |
} | } |
} | } |
handlerValue = subscription.getProperty |
handlerValue = subscription.getProperty( |
(subscription.findProperty |
subscription.findProperty(PEGASUS_PROPERTYNAME_HANDLER)).getValue(); |
(PEGASUS_PROPERTYNAME_HANDLER)).getValue (); |
|
handlerValue.get (handlerPath); | handlerValue.get (handlerPath); |
| |
// | // |
|
|
return logString; | return logString; |
} | } |
| |
String IndicationService::getProviderLogString |
String IndicationService::getProviderLogString(CIMInstance& provider) |
(CIMInstance & provider) |
|
{ | { |
String logString; | String logString; |
| |
logString = provider.getProperty (provider.findProperty |
logString = provider.getProperty( |
(PEGASUS_PROPERTYNAME_NAME)).getValue ().toString (); |
provider.findProperty(PEGASUS_PROPERTYNAME_NAME)).getValue().toString(); |
| |
return logString; | return logString; |
} | } |
|
|
// Specify localOnly=false because superclass properties are needed | // Specify localOnly=false because superclass properties are needed |
// Specify includeQualifiers=false because qualifiers are not needed | // Specify includeQualifiers=false because qualifiers are not needed |
// | // |
indicationClass = _subscriptionRepository->getClass |
indicationClass = _subscriptionRepository->getClass( |
(sourceNameSpace, indicationClassName, false, false, false, |
sourceNameSpace, indicationClassName, false, false, false, |
CIMPropertyList ()); | CIMPropertyList ()); |
| |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |