#include <Pegasus/Common/ContentLanguageList.h>
#include <Pegasus/Common/LanguageParser.h>
#include <Pegasus/Common/OperationContextInternal.h>
-// l10n
#include <Pegasus/Common/MessageLoader.h>
#include <Pegasus/Common/String.h>
#include <Pegasus/Common/IndicationFormatter.h>
+// NOCHKSRC
#include <Pegasus/Server/ProviderRegistrationManager/ProviderRegistrationManager.h>
+// DOCHKSRC
#include <Pegasus/Query/QueryExpression/QueryExpression.h>
#include <Pegasus/Query/QueryCommon/QueryException.h>
#include <Pegasus/Repository/RepositoryQueryContext.h>
Mutex IndicationService::_mutex;
-IndicationService::IndicationService (
- CIMRepository * repository,
- ProviderRegistrationManager * providerRegManager)
- : MessageQueueService (PEGASUS_QUEUENAME_INDICATIONSERVICE,
- MessageQueue::getNextQueueId ()),
- _providerRegManager (providerRegManager),
+IndicationService::IndicationService(
+ CIMRepository* repository,
+ ProviderRegistrationManager* providerRegManager)
+ : MessageQueueService(
+ PEGASUS_QUEUENAME_INDICATIONSERVICE, MessageQueue::getNextQueueId()),
+ _providerRegManager(providerRegManager),
_cimRepository(repository)
{
_enableSubscriptionsForNonprivilegedUsers = false;
// default to false (i.e., the more restrictive security
// setting.
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,
//
// Create Subscription Repository
//
- _subscriptionRepository = new SubscriptionRepository (repository);
+ _subscriptionRepository = new SubscriptionRepository(repository);
//
// Create Subscription Table
//
- _subscriptionTable = new SubscriptionTable (_subscriptionRepository);
+ _subscriptionTable = new SubscriptionTable(_subscriptionRepository);
// Initialize the Indication Service
- _initialize ();
+ _initialize();
}
- catch (Exception & e)
+ catch (Exception& e)
{
- PEG_TRACE_STRING (TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL2,
+ PEG_TRACE_STRING(TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL2,
"Exception caught in attempting to initialize Indication Service: " +
- e.getMessage ());
+ e.getMessage());
}
}
-IndicationService::~IndicationService (void)
+IndicationService::~IndicationService()
{
delete _subscriptionTable;
delete _subscriptionRepository;
void IndicationService::_handle_async_request(AsyncRequest *req)
{
- if ( req->getType() == async_messages::CIMSERVICE_STOP )
+ if (req->getType() == async_messages::CIMSERVICE_STOP)
{
req->op->processing();
//
// Call _terminate
//
- _terminate ();
+ _terminate();
handle_CimServiceStop(static_cast<CimServiceStop *>(req));
}
- else if (req->getType () == async_messages::CIMSERVICE_START)
+ else if (req->getType() == async_messages::CIMSERVICE_START)
{
- req->op->processing ();
+ req->op->processing();
- handle_CimServiceStart (static_cast <CimServiceStart *> (req));
+ handle_CimServiceStart(static_cast<CimServiceStart *>(req));
}
- else if ( req->getType() == async_messages::ASYNC_LEGACY_OP_START )
+ else if (req->getType() == async_messages::ASYNC_LEGACY_OP_START)
{
- try
- {
- req->op->processing();
- Message *legacy =
- (static_cast<AsyncLegacyOperationStart *>(req)->get_action());
- legacy->put_async(req);
+ try
+ {
+ req->op->processing();
+ Message* legacy =
+ static_cast<AsyncLegacyOperationStart *>(req)->get_action();
+ legacy->put_async(req);
- handleEnqueue(legacy);
- }
- catch(Exception & )
- {
- PEG_TRACE_CSTRING(TRC_INDICATION_SERVICE, Tracer::LEVEL3,
- "Caught Exception in IndicationService while handling a wrapped legacy message ");
- _make_response(req, async_results::CIM_NAK );
- }
+ handleEnqueue(legacy);
+ }
+ catch(Exception& )
+ {
+ PEG_TRACE_CSTRING(TRC_INDICATION_SERVICE, Tracer::LEVEL3,
+ "Caught Exception in IndicationService while handling a "
+ "wrapped legacy message ");
+ _make_response(req, async_results::CIM_NAK);
+ }
return;
}
else
- MessageQueueService::_handle_async_request (req);
+ MessageQueueService::_handle_async_request(req);
}
void IndicationService::handleEnqueue(Message* message)
stopWatch.start();
#endif
-// l10n
// Set the client's requested language into this service thread.
// This will allow functions in this service to return messages
// in the correct language.
{
if (msg->thread_changed())
{
- AcceptLanguageList *langs = new AcceptLanguageList
- (((AcceptLanguageListContainer)msg->operationContext.get
- (AcceptLanguageListContainer::NAME)).getLanguages());
+ AcceptLanguageList *langs = new AcceptLanguageList(
+ ((AcceptLanguageListContainer)msg->operationContext.get(
+ AcceptLanguageListContainer::NAME)).getLanguages());
Thread::setLanguages(langs);
}
}
"The requested operation is not supported or not "
"recognized by the indication service.")),
- _enqueueResponse (cimRequest, response);
+ _enqueueResponse(cimRequest, response);
break;
}
}
stopWatch.stop();
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
delete message;
}
-void IndicationService::handleEnqueue(void)
+void IndicationService::handleEnqueue()
{
Message * message = dequeue();
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");
#ifdef PEGASUS_INDICATION_PERFINST
Stopwatch stopWatch;
stopWatch.start();
#endif
- Array <CIMInstance> activeSubscriptions;
- Array <CIMInstance> noProviderSubscriptions;
+ Array<CIMInstance> activeSubscriptions;
+ Array<CIMInstance> noProviderSubscriptions;
Boolean invalidInstance = false;
//
// NOTE: Indication Service expects to find exactly one Provider Manager
// Service and exactly one Handler Manager Service
//
- Array <Uint32> pmservices;
- find_services (PEGASUS_QUEUENAME_PROVIDERMANAGER_CPP, 0, 0, &pmservices);
- PEGASUS_ASSERT (pmservices.size () == 1);
- _providerManager = pmservices [0];
+ Array<Uint32> pmservices;
+ find_services(PEGASUS_QUEUENAME_PROVIDERMANAGER_CPP, 0, 0, &pmservices);
+ PEGASUS_ASSERT(pmservices.size() == 1);
+ _providerManager = pmservices[0];
- Array <Uint32> hmservices;
- find_services (PEGASUS_QUEUENAME_INDHANDLERMANAGER, 0, 0, &hmservices);
- PEGASUS_ASSERT (hmservices.size () == 1);
- _handlerService = hmservices [0];
+ Array<Uint32> hmservices;
+ find_services(PEGASUS_QUEUENAME_INDHANDLERMANAGER, 0, 0, &hmservices);
+ PEGASUS_ASSERT(hmservices.size() == 1);
+ _handlerService = hmservices[0];
//
// Set arrays of valid and supported property values
// Some valid values, as defined in the MOF, are not currently supported
// by the Pegasus IndicationService
//
- _validStates.append (STATE_UNKNOWN);
- _validStates.append (STATE_OTHER);
- _validStates.append (STATE_ENABLED);
- _validStates.append (STATE_ENABLEDDEGRADED);
- _validStates.append (STATE_DISABLED);
- _supportedStates.append (STATE_ENABLED);
- _supportedStates.append (STATE_DISABLED);
- _validRepeatPolicies.append (_POLICY_UNKNOWN);
- _validRepeatPolicies.append (_POLICY_OTHER);
- _validRepeatPolicies.append (_POLICY_NONE);
- _validRepeatPolicies.append (_POLICY_SUPPRESS);
- _validRepeatPolicies.append (_POLICY_DELAY);
- _supportedRepeatPolicies.append (_POLICY_UNKNOWN);
- _supportedRepeatPolicies.append (_POLICY_OTHER);
- _supportedRepeatPolicies.append (_POLICY_NONE);
- _supportedRepeatPolicies.append (_POLICY_SUPPRESS);
- _supportedRepeatPolicies.append (_POLICY_DELAY);
- _validErrorPolicies.append (_ERRORPOLICY_OTHER);
- _validErrorPolicies.append (_ERRORPOLICY_IGNORE);
- _validErrorPolicies.append (_ERRORPOLICY_DISABLE);
- _validErrorPolicies.append (_ERRORPOLICY_REMOVE);
- _supportedErrorPolicies.append (_ERRORPOLICY_IGNORE);
- _supportedErrorPolicies.append (_ERRORPOLICY_DISABLE);
- _supportedErrorPolicies.append (_ERRORPOLICY_REMOVE);
- _validPersistenceTypes.append (PERSISTENCE_OTHER);
- _validPersistenceTypes.append (PERSISTENCE_PERMANENT);
- _validPersistenceTypes.append (PERSISTENCE_TRANSIENT);
- _supportedPersistenceTypes.append (PERSISTENCE_PERMANENT);
- _supportedPersistenceTypes.append (PERSISTENCE_TRANSIENT);
- _validSNMPVersion.append (SNMPV1_TRAP);
- _validSNMPVersion.append (SNMPV2C_TRAP);
- _validSNMPVersion.append (SNMPV2C_INFORM);
- _validSNMPVersion.append (SNMPV3_TRAP);
- _validSNMPVersion.append (SNMPV3_INFORM);
- _supportedSNMPVersion.append (SNMPV1_TRAP);
- _supportedSNMPVersion.append (SNMPV2C_TRAP);
+ _validStates.append(STATE_UNKNOWN);
+ _validStates.append(STATE_OTHER);
+ _validStates.append(STATE_ENABLED);
+ _validStates.append(STATE_ENABLEDDEGRADED);
+ _validStates.append(STATE_DISABLED);
+ _supportedStates.append(STATE_ENABLED);
+ _supportedStates.append(STATE_DISABLED);
+ _validRepeatPolicies.append(_POLICY_UNKNOWN);
+ _validRepeatPolicies.append(_POLICY_OTHER);
+ _validRepeatPolicies.append(_POLICY_NONE);
+ _validRepeatPolicies.append(_POLICY_SUPPRESS);
+ _validRepeatPolicies.append(_POLICY_DELAY);
+ _supportedRepeatPolicies.append(_POLICY_UNKNOWN);
+ _supportedRepeatPolicies.append(_POLICY_OTHER);
+ _supportedRepeatPolicies.append(_POLICY_NONE);
+ _supportedRepeatPolicies.append(_POLICY_SUPPRESS);
+ _supportedRepeatPolicies.append(_POLICY_DELAY);
+ _validErrorPolicies.append(_ERRORPOLICY_OTHER);
+ _validErrorPolicies.append(_ERRORPOLICY_IGNORE);
+ _validErrorPolicies.append(_ERRORPOLICY_DISABLE);
+ _validErrorPolicies.append(_ERRORPOLICY_REMOVE);
+ _supportedErrorPolicies.append(_ERRORPOLICY_IGNORE);
+ _supportedErrorPolicies.append(_ERRORPOLICY_DISABLE);
+ _supportedErrorPolicies.append(_ERRORPOLICY_REMOVE);
+ _validPersistenceTypes.append(PERSISTENCE_OTHER);
+ _validPersistenceTypes.append(PERSISTENCE_PERMANENT);
+ _validPersistenceTypes.append(PERSISTENCE_TRANSIENT);
+ _supportedPersistenceTypes.append(PERSISTENCE_PERMANENT);
+ _supportedPersistenceTypes.append(PERSISTENCE_TRANSIENT);
+ _validSNMPVersion.append(SNMPV1_TRAP);
+ _validSNMPVersion.append(SNMPV2C_TRAP);
+ _validSNMPVersion.append(SNMPV2C_INFORM);
+ _validSNMPVersion.append(SNMPV3_TRAP);
+ _validSNMPVersion.append(SNMPV3_INFORM);
+ _supportedSNMPVersion.append(SNMPV1_TRAP);
+ _supportedSNMPVersion.append(SNMPV2C_TRAP);
//
// Set arrays of names of supported properties for each class
// must be appended here. When support for a new property is added, the
// property name must be appended to the appropriate array(s) here.
//
- _supportedSubscriptionProperties.append (PEGASUS_PROPERTYNAME_FILTER);
- _supportedSubscriptionProperties.append (PEGASUS_PROPERTYNAME_HANDLER);
- _supportedSubscriptionProperties.append (_PROPERTY_ONFATALERRORPOLICY);
- _supportedSubscriptionProperties.append (_PROPERTY_OTHERONFATALERRORPOLICY);
- _supportedSubscriptionProperties.append
- (_PROPERTY_FAILURETRIGGERTIMEINTERVAL);
- _supportedSubscriptionProperties.append (PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE);
- _supportedSubscriptionProperties.append (_PROPERTY_OTHERSTATE);
- _supportedSubscriptionProperties.append (_PROPERTY_LASTCHANGE);
- _supportedSubscriptionProperties.append (_PROPERTY_DURATION);
- _supportedSubscriptionProperties.append (_PROPERTY_STARTTIME);
- _supportedSubscriptionProperties.append (_PROPERTY_TIMEREMAINING);
- _supportedSubscriptionProperties.append
- (_PROPERTY_REPEATNOTIFICATIONPOLICY);
- _supportedSubscriptionProperties.append
- (_PROPERTY_OTHERREPEATNOTIFICATIONPOLICY);
- _supportedSubscriptionProperties.append
- (_PROPERTY_REPEATNOTIFICATIONINTERVAL);
- _supportedSubscriptionProperties.append (_PROPERTY_REPEATNOTIFICATIONGAP);
- _supportedSubscriptionProperties.append (_PROPERTY_REPEATNOTIFICATIONCOUNT);
+ _supportedSubscriptionProperties.append(PEGASUS_PROPERTYNAME_FILTER);
+ _supportedSubscriptionProperties.append(PEGASUS_PROPERTYNAME_HANDLER);
+ _supportedSubscriptionProperties.append(_PROPERTY_ONFATALERRORPOLICY);
+ _supportedSubscriptionProperties.append(_PROPERTY_OTHERONFATALERRORPOLICY);
+ _supportedSubscriptionProperties.append(
+ _PROPERTY_FAILURETRIGGERTIMEINTERVAL);
+ _supportedSubscriptionProperties.append(
+ PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE);
+ _supportedSubscriptionProperties.append(_PROPERTY_OTHERSTATE);
+ _supportedSubscriptionProperties.append(_PROPERTY_LASTCHANGE);
+ _supportedSubscriptionProperties.append(_PROPERTY_DURATION);
+ _supportedSubscriptionProperties.append(_PROPERTY_STARTTIME);
+ _supportedSubscriptionProperties.append(_PROPERTY_TIMEREMAINING);
+ _supportedSubscriptionProperties.append(_PROPERTY_REPEATNOTIFICATIONPOLICY);
+ _supportedSubscriptionProperties.append(
+ _PROPERTY_OTHERREPEATNOTIFICATIONPOLICY);
+ _supportedSubscriptionProperties.append(
+ _PROPERTY_REPEATNOTIFICATIONINTERVAL);
+ _supportedSubscriptionProperties.append(_PROPERTY_REPEATNOTIFICATIONGAP);
+ _supportedSubscriptionProperties.append(_PROPERTY_REPEATNOTIFICATIONCOUNT);
_supportedFormattedSubscriptionProperties =
_supportedSubscriptionProperties;
- _supportedFormattedSubscriptionProperties.append
- (_PROPERTY_TEXTFORMATOWNINGENTITY);
- _supportedFormattedSubscriptionProperties.append
- (_PROPERTY_TEXTFORMATID);
- _supportedFormattedSubscriptionProperties.append
- (_PROPERTY_TEXTFORMAT);
- _supportedFormattedSubscriptionProperties.append
- (_PROPERTY_TEXTFORMATPARAMETERS);
-
- _supportedFilterProperties.append (_PROPERTY_CAPTION);
- _supportedFilterProperties.append (_PROPERTY_DESCRIPTION);
- _supportedFilterProperties.append (_PROPERTY_ELEMENTNAME);
- _supportedFilterProperties.append (_PROPERTY_SYSTEMCREATIONCLASSNAME);
- _supportedFilterProperties.append (_PROPERTY_SYSTEMNAME);
- _supportedFilterProperties.append (PEGASUS_PROPERTYNAME_CREATIONCLASSNAME);
- _supportedFilterProperties.append (PEGASUS_PROPERTYNAME_NAME);
- _supportedFilterProperties.append (_PROPERTY_SOURCENAMESPACE);
- _supportedFilterProperties.append (PEGASUS_PROPERTYNAME_QUERY);
- _supportedFilterProperties.append (PEGASUS_PROPERTYNAME_QUERYLANGUAGE);
-
- Array <CIMName> commonListenerDestinationProperties;
- commonListenerDestinationProperties.append (_PROPERTY_CAPTION);
- commonListenerDestinationProperties.append (_PROPERTY_DESCRIPTION);
- commonListenerDestinationProperties.append (_PROPERTY_ELEMENTNAME);
- commonListenerDestinationProperties.append
- (_PROPERTY_SYSTEMCREATIONCLASSNAME);
- commonListenerDestinationProperties.append (_PROPERTY_SYSTEMNAME);
- commonListenerDestinationProperties.append (PEGASUS_PROPERTYNAME_CREATIONCLASSNAME);
- commonListenerDestinationProperties.append (PEGASUS_PROPERTYNAME_NAME);
- commonListenerDestinationProperties.append (PEGASUS_PROPERTYNAME_PERSISTENCETYPE);
- commonListenerDestinationProperties.append (_PROPERTY_OTHERPERSISTENCETYPE);
+ _supportedFormattedSubscriptionProperties.append(
+ _PROPERTY_TEXTFORMATOWNINGENTITY);
+ _supportedFormattedSubscriptionProperties.append(
+ _PROPERTY_TEXTFORMATID);
+ _supportedFormattedSubscriptionProperties.append(
+ _PROPERTY_TEXTFORMAT);
+ _supportedFormattedSubscriptionProperties.append(
+ _PROPERTY_TEXTFORMATPARAMETERS);
+
+ _supportedFilterProperties.append(_PROPERTY_CAPTION);
+ _supportedFilterProperties.append(_PROPERTY_DESCRIPTION);
+ _supportedFilterProperties.append(_PROPERTY_ELEMENTNAME);
+ _supportedFilterProperties.append(_PROPERTY_SYSTEMCREATIONCLASSNAME);
+ _supportedFilterProperties.append(_PROPERTY_SYSTEMNAME);
+ _supportedFilterProperties.append(PEGASUS_PROPERTYNAME_CREATIONCLASSNAME);
+ _supportedFilterProperties.append(PEGASUS_PROPERTYNAME_NAME);
+ _supportedFilterProperties.append(_PROPERTY_SOURCENAMESPACE);
+ _supportedFilterProperties.append(PEGASUS_PROPERTYNAME_QUERY);
+ _supportedFilterProperties.append(PEGASUS_PROPERTYNAME_QUERYLANGUAGE);
+
+ Array<CIMName> commonListenerDestinationProperties;
+ commonListenerDestinationProperties.append(_PROPERTY_CAPTION);
+ commonListenerDestinationProperties.append(_PROPERTY_DESCRIPTION);
+ commonListenerDestinationProperties.append(_PROPERTY_ELEMENTNAME);
+ commonListenerDestinationProperties.append(
+ _PROPERTY_SYSTEMCREATIONCLASSNAME);
+ commonListenerDestinationProperties.append(_PROPERTY_SYSTEMNAME);
+ commonListenerDestinationProperties.append(
+ PEGASUS_PROPERTYNAME_CREATIONCLASSNAME);
+ commonListenerDestinationProperties.append(PEGASUS_PROPERTYNAME_NAME);
+ commonListenerDestinationProperties.append(
+ PEGASUS_PROPERTYNAME_PERSISTENCETYPE);
+ commonListenerDestinationProperties.append(_PROPERTY_OTHERPERSISTENCETYPE);
_supportedCIMXMLHandlerProperties = commonListenerDestinationProperties;
- _supportedCIMXMLHandlerProperties.append (_PROPERTY_OWNER);
- _supportedCIMXMLHandlerProperties.append
- (PEGASUS_PROPERTYNAME_LSTNRDST_DESTINATION);
+ _supportedCIMXMLHandlerProperties.append(_PROPERTY_OWNER);
+ _supportedCIMXMLHandlerProperties.append(
+ PEGASUS_PROPERTYNAME_LSTNRDST_DESTINATION);
_supportedCIMXMLListenerDestinationProperties =
commonListenerDestinationProperties;
- _supportedCIMXMLListenerDestinationProperties.append
- (PEGASUS_PROPERTYNAME_LSTNRDST_DESTINATION);
+ _supportedCIMXMLListenerDestinationProperties.append(
+ PEGASUS_PROPERTYNAME_LSTNRDST_DESTINATION);
_supportedSNMPHandlerProperties = commonListenerDestinationProperties;
- _supportedSNMPHandlerProperties.append (_PROPERTY_OWNER);
- _supportedSNMPHandlerProperties.append
- (PEGASUS_PROPERTYNAME_LSTNRDST_TARGETHOST);
- _supportedSNMPHandlerProperties.append (_PROPERTY_TARGETHOSTFORMAT);
- _supportedSNMPHandlerProperties.append (_PROPERTY_OTHERTARGETHOSTFORMAT);
- _supportedSNMPHandlerProperties.append (_PROPERTY_PORTNUMBER);
- _supportedSNMPHandlerProperties.append (PEGASUS_PROPERTYNAME_SNMPVERSION);
- _supportedSNMPHandlerProperties.append (_PROPERTY_SNMPSECURITYNAME);
- _supportedSNMPHandlerProperties.append (_PROPERTY_SNMPENGINEID);
+ _supportedSNMPHandlerProperties.append(_PROPERTY_OWNER);
+ _supportedSNMPHandlerProperties.append(
+ PEGASUS_PROPERTYNAME_LSTNRDST_TARGETHOST);
+ _supportedSNMPHandlerProperties.append(_PROPERTY_TARGETHOSTFORMAT);
+ _supportedSNMPHandlerProperties.append(_PROPERTY_OTHERTARGETHOSTFORMAT);
+ _supportedSNMPHandlerProperties.append(_PROPERTY_PORTNUMBER);
+ _supportedSNMPHandlerProperties.append(PEGASUS_PROPERTYNAME_SNMPVERSION);
+ _supportedSNMPHandlerProperties.append(_PROPERTY_SNMPSECURITYNAME);
+ _supportedSNMPHandlerProperties.append(_PROPERTY_SNMPENGINEID);
_supportedSyslogListenerDestinationProperties =
commonListenerDestinationProperties;
_supportedEmailListenerDestinationProperties =
commonListenerDestinationProperties;
- _supportedEmailListenerDestinationProperties.append
- (PEGASUS_PROPERTYNAME_LSTNRDST_MAILTO);
- _supportedEmailListenerDestinationProperties.append
- (PEGASUS_PROPERTYNAME_LSTNRDST_MAILCC);
- _supportedEmailListenerDestinationProperties.append
- (PEGASUS_PROPERTYNAME_LSTNRDST_MAILSUBJECT);
+ _supportedEmailListenerDestinationProperties.append(
+ PEGASUS_PROPERTYNAME_LSTNRDST_MAILTO);
+ _supportedEmailListenerDestinationProperties.append(
+ PEGASUS_PROPERTYNAME_LSTNRDST_MAILCC);
+ _supportedEmailListenerDestinationProperties.append(
+ PEGASUS_PROPERTYNAME_LSTNRDST_MAILSUBJECT);
//
// Get existing active subscriptions from each namespace in the repository
//
- invalidInstance = _subscriptionRepository->getActiveSubscriptions
- (activeSubscriptions);
- noProviderSubscriptions.clear ();
+ invalidInstance = _subscriptionRepository->getActiveSubscriptions(
+ activeSubscriptions);
+ noProviderSubscriptions.clear();
PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL4,
"%u active subscription(s) found on initialization",
- activeSubscriptions.size ()));
+ activeSubscriptions.size()));
String condition;
String query;
String queryLanguage;
CIMPropertyList propertyList;
- Array <ProviderClassList> indicationProviders;
+ Array<ProviderClassList> indicationProviders;
- for (Uint32 i = 0; i < activeSubscriptions.size (); i++)
+ for (Uint32 i = 0; i < activeSubscriptions.size(); i++)
{
//
// Check for expired subscription
//
try
{
- if (_isExpired (activeSubscriptions [i]))
+ if (_isExpired(activeSubscriptions[i]))
{
- CIMObjectPath path = activeSubscriptions [i].getPath ();
+ CIMObjectPath path = activeSubscriptions[i].getPath();
PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL4,
"Deleting expired subscription on initialization: %s",
- (const char *) path.toString ().getCString ()));
+ (const char *) path.toString().getCString()));
- _deleteExpiredSubscription (path);
+ _deleteExpiredSubscription(path);
// If subscription is expired delete the subscription
// and continue on to the next one.
continue;
// This instance from the repository is invalid
// Log a message and skip it
//
- Logger::put_l (Logger::STANDARD_LOG, System::CIMSERVER,
+ Logger::put_l(Logger::STANDARD_LOG, System::CIMSERVER,
Logger::WARNING,
_MSG_INVALID_INSTANCE_KEY, _MSG_INVALID_INSTANCE,
- e.getMessage ());
+ e.getMessage());
continue;
}
CIMNamespaceName sourceNameSpace;
- Array <CIMName> indicationSubclasses;
- _getCreateParams (activeSubscriptions [i], indicationSubclasses,
+ Array<CIMName> indicationSubclasses;
+ _getCreateParams(activeSubscriptions[i], indicationSubclasses,
indicationProviders, propertyList, sourceNameSpace, condition,
query, queryLanguage);
- if (indicationProviders.size () == 0)
+ if (indicationProviders.size() == 0)
{
PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL4,
"No providers found for subscription on initialization: %s",
(const char *)
- activeSubscriptions [i].getPath ().toString ().getCString ()));
+ activeSubscriptions[i].getPath().toString().getCString()));
//
// There are no providers that can support this subscription
// Append this subscription to no provider list and
// Insert entries into the subscription hash tables
//
- if (!_subscriptionRepository->reconcileFatalError
- (activeSubscriptions [i]))
+ if (!_subscriptionRepository->reconcileFatalError(
+ activeSubscriptions[i]))
{
- noProviderSubscriptions.append (activeSubscriptions [i]);
+ noProviderSubscriptions.append(activeSubscriptions[i]);
- _subscriptionTable->insertSubscription (activeSubscriptions [i],
+ _subscriptionTable->insertSubscription(activeSubscriptions[i],
indicationProviders, indicationSubclasses, sourceNameSpace);
}
continue;
// The Creator from the subscription instance is used for userName,
// and authType is not set
//
- CIMInstance instance = activeSubscriptions [i];
+ CIMInstance instance = activeSubscriptions[i];
String creator;
- if (!_getCreator (instance, creator))
+ if (!_getCreator(instance, creator))
{
//
// This instance from the repository is corrupted
continue;
}
-//l10n start
// Get the language tags that were saved with the subscription instance
AcceptLanguageList acceptLangs;
- Uint32 propIndex = instance.findProperty
- (PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS);
+ Uint32 propIndex = instance.findProperty(
+ PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS);
if (propIndex != PEG_NOT_FOUND)
{
String acceptLangsString;
}
}
ContentLanguageList contentLangs;
- propIndex = instance.findProperty
- (PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS);
+ propIndex = instance.findProperty(
+ PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS);
if (propIndex != PEG_NOT_FOUND)
{
String contentLangsString;
contentLangsString);
}
}
-// l10n end
//
// Send Create request message to each provider
// from all the providers, use of SendWait should not cause a
// significant performance issue.
//
- Array <ProviderClassList> acceptedProviders;
- acceptedProviders = _sendWaitCreateRequests
- (indicationProviders, sourceNameSpace,
+ Array<ProviderClassList> acceptedProviders;
+ acceptedProviders = _sendWaitCreateRequests(
+ indicationProviders, sourceNameSpace,
propertyList, condition, query, queryLanguage,
- activeSubscriptions [i],
+ activeSubscriptions[i],
acceptLangs,
contentLangs,
creator);
- if (acceptedProviders.size () == 0)
+ if (acceptedProviders.size() == 0)
{
PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL4,
"No providers accepted subscription on initialization: %s",
(const char *)
- activeSubscriptions [i].getPath ().toString ().getCString ()));
+ activeSubscriptions[i].getPath().toString().getCString()));
//
// No providers accepted the subscription
// If subscription is not disabled or removed, send alert and
// Insert entries into the subscription hash tables
//
- if (!_subscriptionRepository->reconcileFatalError
- (activeSubscriptions [i]))
+ if (!_subscriptionRepository->reconcileFatalError(
+ activeSubscriptions[i]))
{
//
// Insert entries into the subscription hash tables
//
- _subscriptionTable->insertSubscription
- (activeSubscriptions [i],
+ _subscriptionTable->insertSubscription(
+ activeSubscriptions[i],
acceptedProviders,
indicationSubclasses,
sourceNameSpace);
// Send NoProviderAlertIndication to handler instances
// ATTN: NoProviderAlertIndication must be defined
//
- Array <CIMInstance> subscriptions;
- subscriptions.append (activeSubscriptions [i]);
- CIMInstance indicationInstance = _createAlertInstance
- (_CLASS_NO_PROVIDER_ALERT, subscriptions);
+ Array<CIMInstance> subscriptions;
+ subscriptions.append(activeSubscriptions[i]);
+ CIMInstance indicationInstance = _createAlertInstance(
+ _CLASS_NO_PROVIDER_ALERT, subscriptions);
PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL4,
"Sending NoProvider Alert for %u subscriptions",
- subscriptions.size ()));
- _sendAlerts (subscriptions, indicationInstance);
+ subscriptions.size()));
+ _sendAlerts(subscriptions, indicationInstance);
#endif
//
// Get Subscription Filter Name and Handler Name
//
- String logString = _getSubscriptionLogString
- (activeSubscriptions [i]);
+ String logString = _getSubscriptionLogString(
+ activeSubscriptions[i]);
//
// 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,
logString,
- activeSubscriptions[i].getPath().getNameSpace().getString());
+ activeSubscriptions[i].getPath().getNameSpace().
+ getString());
}
}
else
// At least one provider accepted the subscription
// Insert entries into the subscription hash tables
//
- _subscriptionTable->insertSubscription
- (activeSubscriptions [i],
+ _subscriptionTable->insertSubscription(
+ activeSubscriptions[i],
acceptedProviders,
indicationSubclasses,
sourceNameSpace);
//
if (invalidInstance)
{
- Logger::put_l (Logger::STANDARD_LOG, System::CIMSERVER, Logger::WARNING,
+ Logger::put_l(Logger::STANDARD_LOG, System::CIMSERVER, Logger::WARNING,
_MSG_INVALID_INSTANCES_KEY, _MSG_INVALID_INSTANCES);
}
// Log a message for any subscription for which there is no longer any
// provider
//
- if (noProviderSubscriptions.size () > 0)
+ if (noProviderSubscriptions.size() > 0)
{
#if 0
//
// Send NoProviderAlertIndication to handler instances
// ATTN: NoProviderAlertIndication must be defined
//
- CIMInstance indicationInstance = _createAlertInstance
- (_CLASS_NO_PROVIDER_ALERT, noProviderSubscriptions);
+ CIMInstance indicationInstance = _createAlertInstance(
+ _CLASS_NO_PROVIDER_ALERT, noProviderSubscriptions);
PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL4,
"Sending NoProvider Alert for %u subscriptions",
- noProviderSubscriptions.size ()));
- _sendAlerts (noProviderSubscriptions, indicationInstance);
+ noProviderSubscriptions.size()));
+ _sendAlerts(noProviderSubscriptions, indicationInstance);
#endif
//
// Log a message for each subscription
//
- for (Uint32 i = 0; i < noProviderSubscriptions.size (); i++)
+ for (Uint32 i = 0; i < noProviderSubscriptions.size(); i++)
{
//
// Get Subscription Filter Name and Handler Name
//
- String logString = _getSubscriptionLogString
- (noProviderSubscriptions [i]);
+ String logString =
+ _getSubscriptionLogString(noProviderSubscriptions[i]);
- Logger::put_l (Logger::STANDARD_LOG, System::CIMSERVER,
- Logger::WARNING, _MSG_NO_PROVIDER_KEY, _MSG_NO_PROVIDER,
+ Logger::put_l(
+ Logger::STANDARD_LOG, System::CIMSERVER, Logger::WARNING,
+ _MSG_NO_PROVIDER_KEY,
+ _MSG_NO_PROVIDER,
logString,
- noProviderSubscriptions[i].getPath().getNameSpace().getString());
+ noProviderSubscriptions[i].getPath().getNameSpace().
+ getString());
}
}
// initialization is complete
// Provider Manager calls providers' enableIndications method
//
- _sendSubscriptionInitComplete ();
+ _sendSubscriptionInitComplete();
#ifdef PEGASUS_INDICATION_PERFINST
stopWatch.stop();
"%s: %.3f seconds", "Initialize", stopWatch.getElapsed()));
#endif
- 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");
- Array <CIMInstance> activeSubscriptions;
+ Array<CIMInstance> activeSubscriptions;
CIMInstance indicationInstance;
//
//
// Get existing active subscriptions from hash table
//
- activeSubscriptions = _getActiveSubscriptions ();
+ activeSubscriptions = _getActiveSubscriptions();
- if (activeSubscriptions.size () > 0)
+ if (activeSubscriptions.size() > 0)
{
//
// Create CimomShutdownAlertIndication instance
// ATTN: CimomShutdownAlertIndication must be defined
//
- indicationInstance = _createAlertInstance (_CLASS_CIMOM_SHUTDOWN_ALERT,
- activeSubscriptions);
+ indicationInstance = _createAlertInstance(
+ _CLASS_CIMOM_SHUTDOWN_ALERT, activeSubscriptions);
//
// Send CimomShutdownAlertIndication to each unique handler instance
//
PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL4,
"Sending CIMServerShutdown Alert for %u subscriptions",
- activeSubscriptions.size ()));
- _sendAlerts (activeSubscriptions, indicationInstance);
+ activeSubscriptions.size()));
+ _sendAlerts(activeSubscriptions, indicationInstance);
}
#endif
// currently the IndicationService destructor is never called, so the
// IndicationService must call the SubscriptionTable clear() function to
// remove the table entries.
- _subscriptionTable->clear ();
+ _subscriptionTable->clear();
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
void IndicationService::_checkNonprivilegedAuthorization(
- const String & userName)
+ const String& userName)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_checkNonprivilegedAuthorization");
Boolean accessDenied = false;
}
else
{
- PEG_TRACE_STRING (TRC_INDICATION_SERVICE, Tracer::LEVEL4,
- "_checkNonprivilegedAuthorization - checking whether user is privileged"
+ PEG_TRACE_STRING(TRC_INDICATION_SERVICE, Tracer::LEVEL4,
+ "_checkNonprivilegedAuthorization - checking whether user is "
+ "privileged"
+ userName);
if (!System::isPrivilegedUser(userName))
{
}
}
-void IndicationService::_handleCreateInstanceRequest (const Message * message)
+void IndicationService::_handleCreateInstanceRequest(const Message * message)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_handleCreateInstanceRequest");
CIMCreateInstanceRequestMessage* request =
CIMObjectPath instanceRef;
- CIMInstance instance = request->newInstance.clone ();
+ CIMInstance instance = request->newInstance.clone();
try
{
- String userName = ((IdentityContainer)request->operationContext.get
- (IdentityContainer :: NAME)).getUserName();
+ String userName = ((IdentityContainer)request->operationContext.get(
+ IdentityContainer::NAME)).getUserName();
_checkNonprivilegedAuthorization(userName);
AcceptLanguageList acceptLangs =
- ((AcceptLanguageListContainer)request->operationContext.get
- (AcceptLanguageListContainer::NAME)).getLanguages();
+ ((AcceptLanguageListContainer)request->operationContext.get(
+ AcceptLanguageListContainer::NAME)).getLanguages();
ContentLanguageList contentLangs =
- ((ContentLanguageListContainer)request->operationContext.get
- (ContentLanguageListContainer::NAME)).getLanguages();
+ ((ContentLanguageListContainer)request->operationContext.get(
+ ContentLanguageListContainer::NAME)).getLanguages();
- if (_canCreate (instance, request->nameSpace))
+ if (_canCreate(instance, request->nameSpace))
{
//
// If the instance is of the PEGASUS_CLASSNAME_INDSUBSCRIPTION
String queryLanguage;
CIMPropertyList requiredProperties;
CIMNamespaceName sourceNameSpace;
- Array <CIMName> indicationSubclasses;
- Array <ProviderClassList> indicationProviders;
+ Array<CIMName> indicationSubclasses;
+ Array<ProviderClassList> indicationProviders;
- if ((instance.getClassName ().equal
- (PEGASUS_CLASSNAME_INDSUBSCRIPTION)) ||
- (instance.getClassName ().equal
- (PEGASUS_CLASSNAME_FORMATTEDINDSUBSCRIPTION)))
+ if ((instance.getClassName().equal(
+ PEGASUS_CLASSNAME_INDSUBSCRIPTION)) ||
+ (instance.getClassName().equal(
+ PEGASUS_CLASSNAME_FORMATTEDINDSUBSCRIPTION)))
{
//
// Get subscription state
// the default value; if invalid, an exception was thrown
//
CIMValue subscriptionStateValue;
- subscriptionStateValue = instance.getProperty
- (instance.findProperty (PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE)).getValue ();
- subscriptionStateValue.get (subscriptionState);
+ subscriptionStateValue = instance.getProperty(
+ instance.findProperty(
+ PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE)).getValue();
+ subscriptionStateValue.get(subscriptionState);
if ((subscriptionState == STATE_ENABLED) ||
(subscriptionState == STATE_ENABLEDDEGRADED))
{
- _getCreateParams (instance, indicationSubclasses,
+ _getCreateParams(instance, indicationSubclasses,
indicationProviders, requiredProperties,
sourceNameSpace, condition, query, queryLanguage);
- if (indicationProviders.size () == 0)
+ if (indicationProviders.size() == 0)
{
//
// There are no providers that can support this
// subscription
//
- PEG_METHOD_EXIT ();
-
- // l10n
- // throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED,
- // _MSG_NO_PROVIDERS);
+ PEG_METHOD_EXIT();
- throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_NOT_SUPPORTED,
+ throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED,
MessageLoaderParms(_MSG_NO_PROVIDERS_KEY,
_MSG_NO_PROVIDERS));
}
//
// Send Create request message to each provider
//
- // l10n
- _sendAsyncCreateRequests (indicationProviders,
+ _sendAsyncCreateRequests(indicationProviders,
sourceNameSpace, requiredProperties, condition,
query, queryLanguage, instance,
acceptLangs,
//
// Create instance for disabled subscription
//
- instanceRef = _subscriptionRepository->createInstance
- (instance, request->nameSpace, userName,
- acceptLangs, contentLangs,
- false);
+ instanceRef = _subscriptionRepository->createInstance(
+ instance, request->nameSpace, userName,
+ acceptLangs, contentLangs, false);
}
}
else
//
// Create instance for filter or handler
//
- instanceRef = _subscriptionRepository->createInstance
- (instance, request->nameSpace, userName,
- acceptLangs, contentLangs,
- false);
+ instanceRef = _subscriptionRepository->createInstance(
+ instance, request->nameSpace, userName,
+ acceptLangs, contentLangs, false);
}
}
}
- catch (CIMException & exception)
+ catch (CIMException& exception)
{
cimException = exception;
}
- catch (Exception & exception)
+ catch (Exception& exception)
{
cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,
exception.getMessage());
PEGASUS_ASSERT(response != 0);
response->cimException = cimException;
response->instanceName = instanceRef;
- _enqueueResponse (request, response);
+ _enqueueResponse(request, response);
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-void IndicationService::_handleGetInstanceRequest (const Message* message)
+void IndicationService::_handleGetInstanceRequest(const Message* message)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_handleGetInstanceRequest");
CIMGetInstanceRequestMessage* request =
try
{
- String userName = ((IdentityContainer)request->operationContext.get
- (IdentityContainer :: NAME)).getUserName();
- _checkNonprivilegedAuthorization(userName );
+ String userName = ((IdentityContainer)request->operationContext.get(
+ IdentityContainer::NAME)).getUserName();
+ _checkNonprivilegedAuthorization(userName);
//
// Add Creator to property list, if not null
Boolean startTimeAdded;
Boolean durationAdded;
CIMPropertyList propertyList = request->propertyList;
- CIMName className = request->instanceName.getClassName ();
- _updatePropertyList (className, propertyList, setTimeRemaining,
+ CIMName className = request->instanceName.getClassName();
+ _updatePropertyList(className, propertyList, setTimeRemaining,
startTimeAdded, durationAdded);
//
// Get instance from repository
//
- instance = _subscriptionRepository->getInstance
- (request->nameSpace, request->instanceName, request->localOnly,
+ instance = _subscriptionRepository->getInstance(
+ request->nameSpace, request->instanceName, request->localOnly,
request->includeQualifiers, request->includeClassOrigin,
propertyList);
// Remove Creator property from instance before returning
//
String creator;
- if (!_getCreator (instance, creator))
+ if (!_getCreator(instance, creator))
{
//
// This instance from the repository is corrupted
// L10N TODO DONE -- new throw of exception
//
- PEG_METHOD_EXIT ();
- //throw PEGASUS_CIM_EXCEPTION (CIM_ERR_FAILED,
- //_MSG_INVALID_INSTANCES);
+ PEG_METHOD_EXIT();
MessageLoaderParms parms(_MSG_INVALID_INSTANCES_KEY,
_MSG_INVALID_INSTANCES);
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms);
}
- instance.removeProperty (instance.findProperty
- (PEGASUS_PROPERTYNAME_INDSUB_CREATOR));
+ instance.removeProperty(instance.findProperty(
+ PEGASUS_PROPERTYNAME_INDSUB_CREATOR));
-// l10n start
//
// Remove the language properties from instance before returning
//
- Uint32 propIndex = instance.findProperty
- (PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS);
+ Uint32 propIndex = instance.findProperty(
+ PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS);
if (propIndex != PEG_NOT_FOUND)
{
- instance.removeProperty (propIndex);
+ instance.removeProperty(propIndex);
}
- propIndex = instance.findProperty
- (PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS);
+ propIndex = instance.findProperty(
+ PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS);
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.removeProperty (propIndex);
+ instance.removeProperty(propIndex);
}
-// l10n end
//
// If a subscription with a duration, calculate subscription time
{
try
{
- _setTimeRemaining (instance);
+ _setTimeRemaining(instance);
}
- catch (DateTimeOutOfRangeException &)
+ catch (DateTimeOutOfRangeException&)
{
//
// This instance from the repository is invalid
}
if (startTimeAdded)
{
- instance.removeProperty (instance.findProperty
- (_PROPERTY_STARTTIME));
+ instance.removeProperty(instance.findProperty(
+ _PROPERTY_STARTTIME));
}
if (durationAdded)
{
- instance.removeProperty (instance.findProperty
- (_PROPERTY_DURATION));
+ instance.removeProperty(instance.findProperty(
+ _PROPERTY_DURATION));
}
}
}
}
catch (Exception& exception)
{
- cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,
- exception.getMessage());
+ cimException =
+ PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, exception.getMessage());
}
- CIMGetInstanceResponseMessage * response = dynamic_cast
- <CIMGetInstanceResponseMessage *> (request->buildResponse ());
+ CIMGetInstanceResponseMessage * response =
+ dynamic_cast<CIMGetInstanceResponseMessage *>(request->buildResponse());
response->cimException = cimException;
if (contentLangsString.size())
{
LanguageParser::parseContentLanguageHeader(contentLangsString)));
}
response->cimInstance = instance;
- _enqueueResponse (request, response);
+ _enqueueResponse(request, response);
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
void IndicationService::_handleEnumerateInstancesRequest(const Message* message)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_handleEnumerateInstancesRequest");
CIMEnumerateInstancesRequestMessage* request =
(CIMEnumerateInstancesRequestMessage*) message;
- Array <CIMInstance> enumInstances;
- Array <CIMInstance> returnedInstances;
+ Array<CIMInstance> enumInstances;
+ Array<CIMInstance> returnedInstances;
CIMException cimException;
CIMInstance cimInstance;
try
{
- String userName = ((IdentityContainer)request->operationContext.get
- (IdentityContainer :: NAME)).getUserName();
+ String userName = ((IdentityContainer)request->operationContext.get(
+ IdentityContainer::NAME)).getUserName();
_checkNonprivilegedAuthorization(userName);
//
Boolean startTimeAdded;
Boolean durationAdded;
CIMPropertyList propertyList = request->propertyList;
- _updatePropertyList (request->className,
+ _updatePropertyList(request->className,
propertyList, setTimeRemaining, startTimeAdded, durationAdded);
enumInstances = _subscriptionRepository->enumerateInstancesForClass(
request->includeQualifiers, request->includeClassOrigin,
propertyList);
-// l10n
// Vars used to aggregate the content languages of the subscription
// instances.
Boolean langMismatch = false;
// Remove Creator and language properties from instances before
// returning
//
- for (Uint32 i = 0; i < enumInstances.size (); i++)
+ for (Uint32 i = 0; i < enumInstances.size(); i++)
{
String creator;
- if (!_getCreator (enumInstances [i], creator))
+ if (!_getCreator(enumInstances[i], creator))
{
//
// This instance from the repository is corrupted
//
continue;
}
- enumInstances [i].removeProperty
- (enumInstances [i].findProperty
- (PEGASUS_PROPERTYNAME_INDSUB_CREATOR));
+ enumInstances[i].removeProperty(
+ enumInstances[i].findProperty(
+ PEGASUS_PROPERTYNAME_INDSUB_CREATOR));
-// l10n start
- propIndex = enumInstances [i].findProperty
- (PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS);
+ propIndex = enumInstances[i].findProperty(
+ PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS);
String contentLangs;
if (propIndex != PEG_NOT_FOUND)
{
- enumInstances [i].getProperty(propIndex).getValue().get
- (contentLangs);
- enumInstances [i].removeProperty(propIndex);
+ enumInstances[i].getProperty(propIndex).getValue().get(
+ contentLangs);
+ enumInstances[i].removeProperty(propIndex);
}
- propIndex = enumInstances [i].findProperty
- (PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS);
+ propIndex = enumInstances[i].findProperty(
+ PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS);
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 (contentLangs == String::EMPTY)
}
}
}
-// l10n end
//
// If a subscription with a duration, calculate subscription time
{
try
{
- _setTimeRemaining (enumInstances [i]);
- } catch (DateTimeOutOfRangeException &)
+ _setTimeRemaining(enumInstances[i]);
+ }
+ catch (DateTimeOutOfRangeException&)
{
//
// This instance from the repository is invalid
}
if (startTimeAdded)
{
- enumInstances [i].removeProperty
- (enumInstances [i].findProperty (_PROPERTY_STARTTIME));
+ enumInstances[i].removeProperty(
+ enumInstances[i].findProperty(_PROPERTY_STARTTIME));
}
if (durationAdded)
{
- enumInstances [i].removeProperty
- (enumInstances [i].findProperty (_PROPERTY_DURATION));
+ enumInstances[i].removeProperty(
+ enumInstances[i].findProperty(_PROPERTY_DURATION));
}
}
- returnedInstances.append (enumInstances [i]);
+ returnedInstances.append(enumInstances[i]);
}
}
catch (CIMException& exception)
LanguageParser::parseContentLanguageHeader(aggregatedLangs)));
}
response->cimNamedInstances = returnedInstances;
- _enqueueResponse (request, response);
+ _enqueueResponse(request, response);
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-void IndicationService::_handleEnumerateInstanceNamesRequest
- (const Message* message)
+void IndicationService::_handleEnumerateInstanceNamesRequest(
+ const Message* message)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_handleEnumerateInstanceNamesRequest");
CIMEnumerateInstanceNamesRequestMessage* request =
try
{
- String userName = ((IdentityContainer)request->operationContext.get
- (IdentityContainer :: NAME)).getUserName();
+ String userName = ((IdentityContainer)request->operationContext.get(
+ IdentityContainer::NAME)).getUserName();
_checkNonprivilegedAuthorization(userName);
enumInstanceNames =
- _subscriptionRepository->enumerateInstanceNamesForClass
- (request->nameSpace, request->className);
+ _subscriptionRepository->enumerateInstanceNamesForClass(
+ request->nameSpace, request->className);
}
catch (CIMException& exception)
{
PEGASUS_ASSERT(response != 0);
response->cimException = cimException;
response->instanceNames = enumInstanceNames;
- _enqueueResponse (request, response);
+ _enqueueResponse(request, response);
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-void IndicationService::_handleModifyInstanceRequest (const Message* message)
+void IndicationService::_handleModifyInstanceRequest(const Message* message)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_handleModifyInstanceRequest");
CIMModifyInstanceRequestMessage* request =
try
{
- String userName = ((IdentityContainer)request->operationContext.get
- (IdentityContainer :: NAME)).getUserName();
+ String userName = ((IdentityContainer)request->operationContext.get(
+ IdentityContainer::NAME)).getUserName();
_checkNonprivilegedAuthorization(userName);
//
// Get the instance name
//
- CIMObjectPath instanceReference =
- request->modifiedInstance.getPath ();
+ CIMObjectPath instanceReference = request->modifiedInstance.getPath();
//
// Get instance from repository
//
CIMInstance instance;
- instance = _subscriptionRepository->getInstance
- (request->nameSpace, instanceReference);
+ instance = _subscriptionRepository->getInstance(
+ request->nameSpace, instanceReference);
CIMInstance modifiedInstance = request->modifiedInstance;
- if (_canModify (request, instanceReference, instance, modifiedInstance))
+ if (_canModify(request, instanceReference, instance, modifiedInstance))
{
//
// Set path in instance
//
- instanceReference.setNameSpace (request->nameSpace);
- instance.setPath (instanceReference);
+ instanceReference.setNameSpace(request->nameSpace);
+ instance.setPath(instanceReference);
//
// Check for expired subscription
//
try
{
- if (_isExpired (instance))
+ if (_isExpired(instance))
{
- //
- // Delete the subscription instance
- //
- _deleteExpiredSubscription (instanceReference);
-
- PEG_METHOD_EXIT ();
-
- // l10n
+ //
+ // Delete the subscription instance
+ //
+ _deleteExpiredSubscription(instanceReference);
- // String exceptionStr = _MSG_EXPIRED;
- // throw PEGASUS_CIM_EXCEPTION (CIM_ERR_FAILED, exceptionStr);
+ PEG_METHOD_EXIT();
- throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
- MessageLoaderParms(_MSG_EXPIRED_KEY, _MSG_EXPIRED));
+ throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
+ MessageLoaderParms(_MSG_EXPIRED_KEY, _MSG_EXPIRED));
}
- } catch (DateTimeOutOfRangeException &)
+ }
+ catch (DateTimeOutOfRangeException&)
{
//
// This instance from the repository is invalid
// null, and that numProperties is 0 or 1
//
CIMPropertyList propertyList = request->propertyList;
- if (request->propertyList.size () > 0)
+ if (request->propertyList.size() > 0)
{
//
// Get current state from instance
//
Uint16 currentState;
Boolean valid = true;
- if (_subscriptionRepository->getState (instance, currentState))
+ if (_subscriptionRepository->getState(instance, currentState))
{
- valid = _validateState (currentState);
+ valid = _validateState(currentState);
}
if (!valid)
// This instance from the repository is corrupted
// L10N TODO DONE -- new throw of exception
//
- PEG_METHOD_EXIT ();
- //throw PEGASUS_CIM_EXCEPTION (CIM_ERR_FAILED,
- //_MSG_INVALID_INSTANCES);
- MessageLoaderParms parms (_MSG_INVALID_INSTANCES_KEY,
+ PEG_METHOD_EXIT();
+ MessageLoaderParms parms(_MSG_INVALID_INSTANCES_KEY,
_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
//
Uint16 newState;
- modifiedInstance.getProperty (modifiedInstance.findProperty
- (PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE)).getValue ().get (newState);
+ modifiedInstance.getProperty(modifiedInstance.findProperty(
+ PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE)).getValue().get(
+ newState);
//
// If Subscription State has changed,
// Set Time of Last State Change to current date time
//
CIMDateTime currentDateTime =
- CIMDateTime::getCurrentDateTime ();
+ CIMDateTime::getCurrentDateTime();
if (newState != currentState)
{
- if (modifiedInstance.findProperty (_PROPERTY_LASTCHANGE) !=
+ if (modifiedInstance.findProperty(_PROPERTY_LASTCHANGE) !=
PEG_NOT_FOUND)
{
- CIMProperty lastChange = modifiedInstance.getProperty
- (modifiedInstance.findProperty
- (_PROPERTY_LASTCHANGE));
- lastChange.setValue (CIMValue (currentDateTime));
+ CIMProperty lastChange = modifiedInstance.getProperty(
+ modifiedInstance.findProperty(
+ _PROPERTY_LASTCHANGE));
+ lastChange.setValue(CIMValue(currentDateTime));
}
else
{
- modifiedInstance.addProperty (CIMProperty
- (_PROPERTY_LASTCHANGE, CIMValue (currentDateTime)));
+ modifiedInstance.addProperty(CIMProperty(
+ _PROPERTY_LASTCHANGE, CIMValue(currentDateTime)));
}
- Array <CIMName> properties =
- propertyList.getPropertyNameArray ();
- properties.append (_PROPERTY_LASTCHANGE);
- propertyList.set (properties);
+ Array<CIMName> properties =
+ propertyList.getPropertyNameArray();
+ properties.append(_PROPERTY_LASTCHANGE);
+ propertyList.set(properties);
}
//
// to the current date time
//
CIMDateTime startTime;
- CIMProperty startTimeProperty = instance.getProperty
- (instance.findProperty (_PROPERTY_STARTTIME));
- CIMValue startTimeValue = instance.getProperty
- (instance.findProperty
- (_PROPERTY_STARTTIME)).getValue ();
+ CIMProperty startTimeProperty = instance.getProperty(
+ instance.findProperty(_PROPERTY_STARTTIME));
+ CIMValue startTimeValue = instance.getProperty(
+ instance.findProperty(_PROPERTY_STARTTIME)).getValue();
Boolean setStart = false;
- if (startTimeValue.isNull ())
+ if (startTimeValue.isNull())
{
setStart = true;
}
else
{
- startTimeValue.get (startTime);
+ startTimeValue.get(startTime);
if (startTime.isInterval())
{
- if (startTime.equal
- (CIMDateTime (_ZERO_INTERVAL_STRING)))
- {
- setStart = true;
- }
+ if (startTime.equal(
+ CIMDateTime(_ZERO_INTERVAL_STRING)))
+ {
+ setStart = true;
+ }
}
}
if (setStart)
{
- if (modifiedInstance.findProperty (_PROPERTY_STARTTIME)
+ if (modifiedInstance.findProperty(_PROPERTY_STARTTIME)
!= PEG_NOT_FOUND)
{
- CIMProperty startTime = modifiedInstance.getProperty
- (modifiedInstance.findProperty
- (_PROPERTY_STARTTIME));
- startTime.setValue (CIMValue (currentDateTime));
+ CIMProperty startTime =
+ modifiedInstance.getProperty(
+ modifiedInstance.findProperty(
+ _PROPERTY_STARTTIME));
+ startTime.setValue(CIMValue(currentDateTime));
}
else
{
- modifiedInstance.addProperty (CIMProperty
- (_PROPERTY_STARTTIME,
- CIMValue (currentDateTime)));
+ modifiedInstance.addProperty(CIMProperty(
+ _PROPERTY_STARTTIME,
+ CIMValue(currentDateTime)));
}
- Array <CIMName> properties =
- propertyList.getPropertyNameArray ();
- properties.append (_PROPERTY_STARTTIME);
- propertyList.set (properties);
+ Array<CIMName> properties =
+ propertyList.getPropertyNameArray();
+ properties.append(_PROPERTY_STARTTIME);
+ propertyList.set(properties);
}
}
-// l10n
// Add the language properties to the modified instance.
- // Note: These came from the Accept-Language and Content-Language
- // headers in the HTTP messages, and may be empty.
+ // Note: These came from the Accept-Language and
+ // Content-Language headers in the HTTP messages, and may be
+ // empty.
AcceptLanguageList acceptLangs =
- ((AcceptLanguageListContainer)request->operationContext.get
- (AcceptLanguageListContainer::NAME)).getLanguages();
- modifiedInstance.addProperty (CIMProperty
- (PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS,
+ ((AcceptLanguageListContainer)request->operationContext.get(
+ AcceptLanguageListContainer::NAME)).getLanguages();
+ modifiedInstance.addProperty(CIMProperty(
+ PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS,
LanguageParser::buildAcceptLanguageHeader(acceptLangs)));
ContentLanguageList contentLangs =
(PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS,
LanguageParser::buildContentLanguageHeader(contentLangs)));
- Array <CIMName> properties = propertyList.getPropertyNameArray ();
+ Array<CIMName> properties = propertyList.getPropertyNameArray();
properties.append (PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS);
properties.append (PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS);
propertyList.set (properties);
-// l10n -end
//
// If subscription is to be enabled, determine if there are
// any indication providers that can serve the subscription
//
- Array <ProviderClassList> indicationProviders;
+ Array<ProviderClassList> indicationProviders;
CIMPropertyList requiredProperties;
CIMNamespaceName sourceNameSpace;
String condition;
String query;
String queryLanguage;
- Array <CIMName> indicationSubclasses;
+ Array<CIMName> indicationSubclasses;
if (((newState == STATE_ENABLED) ||
(newState == STATE_ENABLEDDEGRADED))
// Subscription was previously not enabled but is now to
// be enabled
//
- _getCreateParams (instance, indicationSubclasses,
+ _getCreateParams(instance, indicationSubclasses,
indicationProviders, requiredProperties,
sourceNameSpace, condition, query, queryLanguage);
- if (indicationProviders.size () == 0)
+ if (indicationProviders.size() == 0)
{
//
// There are no providers that can support this
// subscription
//
- instance.setPath (instanceReference);
- _subscriptionRepository->reconcileFatalError (instance);
- PEG_METHOD_EXIT ();
-
- // l10n
- // throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED,
- // _MSG_NO_PROVIDERS);
+ instance.setPath(instanceReference);
+ _subscriptionRepository->reconcileFatalError(instance);
+ PEG_METHOD_EXIT();
- throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_NOT_SUPPORTED,
- MessageLoaderParms (_MSG_NO_PROVIDERS_KEY,
+ throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED,
+ MessageLoaderParms(_MSG_NO_PROVIDERS_KEY,
_MSG_NO_PROVIDERS));
}
}
//
try
{
- modifiedInstance.setPath (instanceReference);
- _subscriptionRepository->modifyInstance
- (request->nameSpace, modifiedInstance,
+ modifiedInstance.setPath(instanceReference);
+ _subscriptionRepository->modifyInstance(
+ request->nameSpace, modifiedInstance,
request->includeQualifiers, propertyList);
- Logger::put (Logger::STANDARD_LOG, System::CIMSERVER,
+ Logger::put(Logger::STANDARD_LOG, System::CIMSERVER,
Logger::TRACE,
- "IndicationService::_handleModifyInstanceRequest - Name Space: $0 Instance name: $1",
- request->nameSpace.getString (),
- modifiedInstance.getClassName ().getString ());
+ "IndicationService::_handleModifyInstanceRequest - "
+ "Name Space: $0 Instance name: $1",
+ request->nameSpace.getString(),
+ modifiedInstance.getClassName().getString());
}
- catch (CIMException & exception)
+ catch (CIMException& exception)
{
cimException = exception;
}
- catch (Exception & exception)
+ catch (Exception& exception)
{
cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,
exception.getMessage());
if (cimException.getCode() != CIM_ERR_SUCCESS)
{
- CIMResponseMessage * response = request->buildResponse ();
+ CIMResponseMessage * response = request->buildResponse();
response->cimException = cimException;
- _enqueueResponse (request, response);
+ _enqueueResponse(request, response);
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
return;
}
&& ((currentState != STATE_ENABLED) &&
(currentState != STATE_ENABLEDDEGRADED)))
{
- instanceReference.setNameSpace (request->nameSpace);
- instance.setPath (instanceReference);
-// l10n
- _sendAsyncCreateRequests (indicationProviders,
- sourceNameSpace, requiredProperties, condition,
+ instanceReference.setNameSpace(request->nameSpace);
+ instance.setPath(instanceReference);
+
+ _sendAsyncCreateRequests(
+ indicationProviders,
+ sourceNameSpace,
+ requiredProperties,
+ condition,
query,
queryLanguage,
instance,
contentLangs,
request,
indicationSubclasses,
- userName, request->authType);
+ userName,
+ request->authType);
//
// Response is sent from _handleCreateResponseAggregation
// Subscription was previously enabled but is now to be
// disabled
//
- Array <ProviderClassList> indicationProviders;
- instanceReference.setNameSpace (request->nameSpace);
- instance.setPath (instanceReference);
- indicationProviders = _getDeleteParams (instance,
+ Array<ProviderClassList> indicationProviders;
+ instanceReference.setNameSpace(request->nameSpace);
+ instance.setPath(instanceReference);
+ indicationProviders = _getDeleteParams(instance,
indicationSubclasses, sourceNameSpace);
//
// Send Delete requests
//
-//l10n
- if (indicationProviders.size () > 0)
+ if (indicationProviders.size() > 0)
{
- _sendAsyncDeleteRequests (indicationProviders,
+ _sendAsyncDeleteRequests(
+ indicationProviders,
sourceNameSpace,
instance,
acceptLangs,
contentLangs,
request,
indicationSubclasses,
- userName, request->authType);
+ userName,
+ request->authType);
//
// Response is sent from
}
catch (Exception& exception)
{
- cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,
- exception.getMessage());
+ cimException =
+ PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, exception.getMessage());
}
//
//
if (!responseSent)
{
-// l10n
// Note: don't need to set content-language in the response.
- CIMResponseMessage * response = request->buildResponse ();
+ CIMResponseMessage * response = request->buildResponse();
response->cimException = cimException;
- _enqueueResponse (request, response);
+ _enqueueResponse(request, response);
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-void IndicationService::_handleDeleteInstanceRequest (const Message* message)
+void IndicationService::_handleDeleteInstanceRequest(const Message* message)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_handleDeleteInstanceRequest");
CIMDeleteInstanceRequestMessage* request =
try
{
- String userName = ((IdentityContainer)request->operationContext.get
- (IdentityContainer :: NAME)).getUserName();
+ String userName = ((IdentityContainer)request->operationContext.get(
+ IdentityContainer::NAME)).getUserName();
_checkNonprivilegedAuthorization(userName);
//
// Check if instance may be deleted -- a filter or handler instance
// referenced by a subscription instance may not be deleted
//
- if (_canDelete (request->instanceName, request->nameSpace,
- userName))
+ if (_canDelete(request->instanceName, request->nameSpace, userName))
{
//
// If a subscription, get the instance from the repository
//
CIMInstance subscriptionInstance;
- if (request->instanceName.getClassName ().equal
- (PEGASUS_CLASSNAME_INDSUBSCRIPTION) ||
- request->instanceName.getClassName ().equal
- (PEGASUS_CLASSNAME_FORMATTEDINDSUBSCRIPTION))
+ if (request->instanceName.getClassName().equal(
+ PEGASUS_CLASSNAME_INDSUBSCRIPTION) ||
+ request->instanceName.getClassName ().equal(
+ PEGASUS_CLASSNAME_FORMATTEDINDSUBSCRIPTION))
{
subscriptionInstance =
- _subscriptionRepository->getInstance
- (request->nameSpace, request->instanceName);
+ _subscriptionRepository->getInstance(
+ request->nameSpace, request->instanceName);
}
//
//
try
{
- _subscriptionRepository->deleteInstance
- (request->nameSpace, request->instanceName);
+ _subscriptionRepository->deleteInstance(
+ request->nameSpace, request->instanceName);
- Logger::put (Logger::STANDARD_LOG, System::CIMSERVER,
+ Logger::put(Logger::STANDARD_LOG, System::CIMSERVER,
Logger::TRACE,
- "IndicationService::_handleDeleteInstanceRequest - Name Space: $0 Instance name: $1",
- request->nameSpace.getString (),
- request->instanceName.getClassName ().getString ());
+ "IndicationService::_handleDeleteInstanceRequest - "
+ "Name Space: $0 Instance name: $1",
+ request->nameSpace.getString(),
+ request->instanceName.getClassName().getString());
}
- catch (CIMException & exception)
+ catch (CIMException& exception)
{
cimException = exception;
}
- catch (Exception & exception)
+ catch (Exception& exception)
{
cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,
exception.getMessage());
if (cimException.getCode() != CIM_ERR_SUCCESS)
{
- CIMResponseMessage * response = request->buildResponse ();
+ CIMResponseMessage * response = request->buildResponse();
response->cimException = cimException;
- _enqueueResponse (request, response);
+ _enqueueResponse(request, response);
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
return;
}
- if (request->instanceName.getClassName ().equal
- (PEGASUS_CLASSNAME_INDSUBSCRIPTION) ||
- request->instanceName.getClassName ().equal
- (PEGASUS_CLASSNAME_FORMATTEDINDSUBSCRIPTION))
+ if (request->instanceName.getClassName().equal(
+ PEGASUS_CLASSNAME_INDSUBSCRIPTION) ||
+ request->instanceName.getClassName ().equal(
+ PEGASUS_CLASSNAME_FORMATTEDINDSUBSCRIPTION))
{
//
// If subscription is active, send delete requests to providers
//
Uint16 subscriptionState;
CIMValue subscriptionStateValue;
- subscriptionStateValue = subscriptionInstance.getProperty
- (subscriptionInstance.findProperty
- (PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE)).getValue ();
- subscriptionStateValue.get (subscriptionState);
+ subscriptionStateValue = subscriptionInstance.getProperty(
+ subscriptionInstance.findProperty(
+ PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE)).getValue();
+ subscriptionStateValue.get(subscriptionState);
if ((subscriptionState == STATE_ENABLED) ||
(subscriptionState == STATE_ENABLEDDEGRADED))
{
- Array <ProviderClassList> indicationProviders;
- Array <CIMName> indicationSubclasses;
+ Array<ProviderClassList> indicationProviders;
+ Array<CIMName> indicationSubclasses;
CIMNamespaceName sourceNamespaceName;
CIMObjectPath instanceReference = request->instanceName;
- instanceReference.setNameSpace (request->nameSpace);
- subscriptionInstance.setPath (instanceReference);
+ instanceReference.setNameSpace(request->nameSpace);
+ subscriptionInstance.setPath(instanceReference);
- indicationProviders = _getDeleteParams
- (subscriptionInstance, indicationSubclasses,
+ indicationProviders = _getDeleteParams(
+ subscriptionInstance,
+ indicationSubclasses,
sourceNamespaceName);
- if (indicationProviders.size () > 0)
+ if (indicationProviders.size() > 0)
{
//
// Send Delete requests
//
-// l10n
- _sendAsyncDeleteRequests (indicationProviders,
- sourceNamespaceName, subscriptionInstance,
+ _sendAsyncDeleteRequests(
+ indicationProviders,
+ sourceNamespaceName,
+ subscriptionInstance,
((AcceptLanguageListContainer)
- request->operationContext.get
- (AcceptLanguageListContainer::NAME)).getLanguages(),
+ request->operationContext.get(
+ AcceptLanguageListContainer::NAME)).
+ getLanguages(),
((ContentLanguageListContainer)
- request->operationContext.get
- (ContentLanguageListContainer::NAME)).getLanguages(),
+ request->operationContext.get(
+ ContentLanguageListContainer::NAME)).
+ getLanguages(),
request,
indicationSubclasses,
- userName, request->authType);
+ userName,
+ request->authType);
//
// Response is sent from
// Subscription was enabled, but had no providers
// Remove entries from the subscription hash tables
//
- _subscriptionTable->removeSubscription
- (subscriptionInstance,
- indicationSubclasses, sourceNamespaceName,
+ _subscriptionTable->removeSubscription(
+ subscriptionInstance,
+ indicationSubclasses,
+ sourceNamespaceName,
indicationProviders);
}
}
}
catch (Exception& exception)
{
- cimException = PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED,
- exception.getMessage());
+ cimException =
+ PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, exception.getMessage());
}
//
//
if (!responseSent)
{
- CIMResponseMessage * response = request->buildResponse ();
+ CIMResponseMessage * response = request->buildResponse();
response->cimException = cimException;
- _enqueueResponse (request, response);
+ _enqueueResponse(request, response);
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-// l10n TODO - might need to globalize another flow and another consumer interface
-// (ie. mdd's) if we can't agree on one export flow and consumer interface
-// (see PEP67)
+// l10n TODO - might need to globalize another flow and another consumer
+// interface (ie. mdd's) if we can't agree on one export flow and consumer
+// interface (see PEP67)
-void IndicationService::_handleProcessIndicationRequest (const Message* message)
+void IndicationService::_handleProcessIndicationRequest(const Message* message)
{
#ifdef PEGASUS_INDICATION_PERFINST
Stopwatch stopWatch;
#endif
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_handleProcessIndicationRequest");
CIMProcessIndicationRequestMessage* request =
String filterQuery;
Boolean match;
- Array <CIMInstance> matchedSubscriptions;
+ Array<CIMInstance> matchedSubscriptions;
CIMInstance handlerNamedInstance;
CIMInstance indication = request->indicationInstance;
-
+
try
{
PEG_TRACE ((TRC_INDICATION_GENERATION, Tracer::LEVEL3,
// Check if property list contains all properties of class
// If so, set to null
//
- Array <CIMName> propertyNames;
- Array <CIMName> indicationClassProperties;
+ Array<CIMName> propertyNames;
+ Array<CIMName> indicationClassProperties;
CIMPropertyList propertyList;
for (Uint32 i = 0; i < indication.getPropertyCount(); i++)
{
// represent the subscriptions to which the indication should be
// forwarded, if the filter criteria are met
//
- Array <CIMNamespaceName> nameSpaces;
+ Array<CIMNamespaceName> nameSpaces;
nameSpaces.append (request->nameSpace);
#ifdef PEGASUS_INDICATION_PERFINST
//
if (request->subscriptionInstanceNames.size() > 0)
{
- Array <CIMInstance> providedSubscriptions;
+ Array<CIMInstance> providedSubscriptions;
#ifdef PEGASUS_INDICATION_PERFINST
stopWatch.reset();
//
ActiveSubscriptionsTableEntry tableValue;
if (_subscriptionTable->getSubscriptionEntry
- (request->subscriptionInstanceNames [i], tableValue))
+ (request->subscriptionInstanceNames[i], tableValue))
{
//
// Verify that each subscription specified by the provider
Boolean found = false;
for (Uint32 i = 0; i < matchedSubscriptions.size(); i++)
{
- if (matchedSubscriptions [i].identical
+ if (matchedSubscriptions[i].identical
(tableValue.subscription))
{
found = true;
//
try
{
- if (_isExpired (matchedSubscriptions [i]))
+ if (_isExpired(matchedSubscriptions[i]))
{
- CIMObjectPath path = matchedSubscriptions [i].getPath ();
+ CIMObjectPath path = matchedSubscriptions[i].getPath ();
_deleteExpiredSubscription (path);
// If the subscription is expired, delete and continue
// to the next one.
getClassName().getString().getCString())));
continue;
}
- } catch (DateTimeOutOfRangeException &)
+ }
+ catch (DateTimeOutOfRangeException&)
{
//
// This instance from the repository is invalid
queryLanguage,
filterName);
- QueryExpression queryExpr = _getQueryExpression(filterQuery,
- queryLanguage,
- request->nameSpace);
+ QueryExpression queryExpr = _getQueryExpression(
+ filterQuery, queryLanguage, request->nameSpace);
#ifdef PEGASUS_INDICATION_PERFINST
stopWatch.reset();
{
PEG_TRACE ((TRC_INDICATION_GENERATION, Tracer::LEVEL3,
"%s Indication %s satisfies filter %s:%s query expression"
- " \"%s\"",
+ " \"%s\"",
(const char*)(indication.getClassName().getString().
getCString()),
(const char*)(request->messageId.getCString()),
//
// This is a two part process:
//
- // 1) Call QueryExpression::applyProjection to remove properties
- // not listed in the SELECT clause. Note: for CQL, this will handle
- // properties on embedded objects.
+ // 1) Call QueryExpression::applyProjection to remove
+ // properties not listed in the SELECT clause. Note: for CQL,
+ // this will handle properties on embedded objects.
//
// QueryExpression::applyProjection throws an exception if
// the indication is missing a required property in the SELECT
// clause. Although _getMatchingSubscriptions checked for
// the indication missing required properties, it would have
- // not detected missing required embedded object properties for CQL.
- // So, we need to catch the missing property exception here.
+ // not detected missing required embedded object properties for
+ // CQL. So, we need to catch the missing property exception
+ // here.
//
// 2) Remove any properties that may be left on the indication
// that are not in the indication class. These are properties
// SELECT clause happens to have a property name not on the
// indication class, and the indication has that same property.
// Note: If SELECT includes all properties ("*"), it's still
- // necessary to check, in case the provider added properties not in
- // the indication class.
+ // necessary to check, in case the provider added properties
+ // not in the indication class.
//
try
{
- queryExpr.applyProjection(formattedIndication, true);
+ queryExpr.applyProjection(formattedIndication, true);
}
catch (QueryRuntimePropertyException& re)
{
- // The indication was missing a required property.
- // The call to _getMatchingSubscriptions above checked for
- // missing required properties on the base indication object
- // so this can only happen for CQL when an embedded object
- // property is missing.
- //
- // Since this is the same as the indication
- // not matching the subscription, just swallow the exception,
- // and skip this subscription.
- PEG_TRACE_STRING (TRC_INDICATION_SERVICE, Tracer::LEVEL4,
- "Apply Projection error: " + re.getMessage());
- continue;
+ // The indication was missing a required property.
+ // The call to _getMatchingSubscriptions above checked for
+ // missing required properties on the base indication
+ // object so this can only happen for CQL when an embedded
+ // object property is missing.
+ //
+ // Since this is the same as the indication not matching
+ // the subscription, just swallow the exception,
+ // and skip this subscription.
+ PEG_TRACE_STRING(TRC_INDICATION_SERVICE, Tracer::LEVEL4,
+ "Apply Projection error: " + re.getMessage());
+ continue;
}
// Remove any remaining properties not in the indication class
//
for (Uint32 j = 0; j < propertyNames.size(); j++)
{
- Uint32 rmIndex = formattedIndication.findProperty(propertyNames[j]);
- if (rmIndex != PEG_NOT_FOUND &&
- !ContainsCIMName (indicationClassProperties,
- propertyNames[j]))
- {
- formattedIndication.removeProperty(rmIndex);
- }
+ Uint32 rmIndex =
+ formattedIndication.findProperty(propertyNames[j]);
+ if (rmIndex != PEG_NOT_FOUND &&
+ !ContainsCIMName(
+ indicationClassProperties, propertyNames[j]))
+ {
+ formattedIndication.removeProperty(rmIndex);
+ }
}
- handlerNamedInstance = _subscriptionRepository->getHandler
- (matchedSubscriptions[i]);
- PEG_TRACE ((TRC_INDICATION_GENERATION, Tracer::LEVEL3,
+ handlerNamedInstance = _subscriptionRepository->getHandler(
+ matchedSubscriptions[i]);
+ PEG_TRACE((TRC_INDICATION_GENERATION, Tracer::LEVEL3,
"Handler %s:%s.%s found for %s Indication %s",
(const char*)(request->nameSpace.getString().getCString()),
(const char*)(handlerNamedInstance.getClassName().
- getString().getCString()),
+ getString().getCString()),
(const char*)(handlerNamedInstance.getProperty(
- handlerNamedInstance.findProperty(
- PEGASUS_PROPERTYNAME_NAME)).getValue().toString().
- getCString()),
+ handlerNamedInstance.findProperty(
+ PEGASUS_PROPERTYNAME_NAME)).getValue().toString().
+ getCString()),
(const char*)(indication.getClassName().getString().
- getCString()),
+ getCString()),
(const char*)(request->messageId.getCString())));
// l10n
_handlerService,
IndicationService::_handleIndicationCallBack,
this,
- (void *) & (matchedSubscriptions [i]));
+ (void *) &(matchedSubscriptions[i]));
}
}
"IndicationService::_handleIndicationCallBack");
IndicationService * service =
- static_cast <IndicationService *> (destination);
+ static_cast<IndicationService *> (destination);
CIMInstance * subscription =
- reinterpret_cast <CIMInstance *> (userParameter);
+ reinterpret_cast<CIMInstance *> (userParameter);
AsyncReply * asyncReply =
static_cast<AsyncReply *>(operation->removeResponse());
- CIMHandleIndicationResponseMessage * handlerResponse =
- reinterpret_cast <CIMHandleIndicationResponseMessage *>
- ((static_cast <AsyncLegacyOperationResult *>
- (asyncReply))->get_result ());
+ CIMHandleIndicationResponseMessage* handlerResponse =
+ reinterpret_cast<CIMHandleIndicationResponseMessage *>(
+ (static_cast<AsyncLegacyOperationResult *>(
+ asyncReply))->get_result());
PEGASUS_ASSERT (handlerResponse != 0);
if (handlerResponse->cimException.getCode () != CIM_ERR_SUCCESS)
#endif
CIMName className = request->className;
- Array <CIMNamespaceName> newNameSpaces = request->newNamespaces;
- Array <CIMNamespaceName> oldNameSpaces = request->oldNamespaces;
+ Array<CIMNamespaceName> newNameSpaces = request->newNamespaces;
+ Array<CIMNamespaceName> oldNameSpaces = request->oldNamespaces;
CIMPropertyList newPropertyNames = request->newPropertyNames;
CIMPropertyList oldPropertyNames = request->oldPropertyNames;
- Array <CIMInstance> newSubscriptions;
- Array <CIMInstance> formerSubscriptions;
- Array <ProviderClassList> indicationProviders;
+ Array<CIMInstance> newSubscriptions;
+ Array<CIMInstance> formerSubscriptions;
+ Array<ProviderClassList> indicationProviders;
ProviderClassList indicationProvider;
newSubscriptions.clear ();
for (Uint32 i = 0; i < newSubscriptions.size (); i++)
{
CIMNamespaceName sourceNameSpace;
- Array <CIMName> indicationSubclasses;
- _getCreateParams (newSubscriptions [i], indicationSubclasses,
+ Array<CIMName> indicationSubclasses;
+ _getCreateParams (newSubscriptions[i], indicationSubclasses,
requiredProperties, sourceNameSpace, condition,
query, queryLanguage);
// the IndicationService's internal hash tables, and thus
// each instance is known to have a valid Creator property
//
- CIMInstance instance = newSubscriptions [i];
+ CIMInstance instance = newSubscriptions[i];
String creator = instance.getProperty (instance.findProperty
(PEGASUS_PROPERTYNAME_INDSUB_CREATOR)).getValue ().toString ();
//
ActiveSubscriptionsTableEntry tableValue;
if (_subscriptionTable->getSubscriptionEntry
- (newSubscriptions [i].getPath (), tableValue))
+ (newSubscriptions[i].getPath (), tableValue))
{
//
// If the provider is already in the subscription's list,
//
// Send Modify requests
//
-// l10n
_sendWaitModifyRequests (indicationProviders,
sourceNameSpace,
requiredProperties, condition, query, queryLanguage,
- newSubscriptions [i],
+ newSubscriptions[i],
acceptLangs,
contentLangs,
creator);
//
// Send Create requests
//
-// l10n
- Array <ProviderClassList> acceptedProviders;
+ Array<ProviderClassList> acceptedProviders;
acceptedProviders = _sendWaitCreateRequests
(indicationProviders,
sourceNameSpace, requiredProperties, condition,
- query, queryLanguage, newSubscriptions [i],
+ query, queryLanguage, newSubscriptions[i],
acceptLangs,
contentLangs,
creator);
// Get Provider Name, Subscription Filter Name and Handler Name
//
String logString2 = _getSubscriptionLogString
- (newSubscriptions [j]);
+ (newSubscriptions[j]);
Logger::put_l (Logger::STANDARD_LOG, System::CIMSERVER,
Logger::WARNING, _MSG_PROVIDER_NOW_SERVING_KEY,
_MSG_PROVIDER_NOW_SERVING, logString1, logString2,
- newSubscriptions [j].getPath ().getNameSpace ().getString ());
+ newSubscriptions[j].getPath ().getNameSpace ().getString ());
}
}
// from the IndicationService's internal hash tables, and thus
// each instance is known to have a valid Creator property
//
- CIMInstance instance = formerSubscriptions [i];
+ CIMInstance instance = formerSubscriptions[i];
String creator = instance.getProperty (instance.findProperty
(PEGASUS_PROPERTYNAME_INDSUB_CREATOR)).getValue ().toString ();
-// l10n start
AcceptLanguageList acceptLangs;
Uint32 propIndex = instance.findProperty
(PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS);
contentLangsString);
}
}
-// l10n end
//
// Look up the subscription in the active subscriptions table
//
ActiveSubscriptionsTableEntry tableValue;
if (_subscriptionTable->getSubscriptionEntry
- (formerSubscriptions [i].getPath (), tableValue))
+ (formerSubscriptions[i].getPath (), tableValue))
{
Uint32 providerIndex = _subscriptionTable->providerInList
(provider, tableValue);
if (providerIndex != PEG_NOT_FOUND)
{
CIMNamespaceName sourceNameSpace;
- Array <CIMName> indicationSubclasses;
- _getCreateParams (formerSubscriptions [i],
+ Array<CIMName> indicationSubclasses;
+ _getCreateParams (formerSubscriptions[i],
indicationSubclasses, requiredProperties,
sourceNameSpace, condition, query, queryLanguage);
// If class list contains only the class name from the
// current delete, send a Delete request
//
- if ((tableValue.providers [providerIndex].classList.size ()
+ if ((tableValue.providers[providerIndex].classList.size()
== 1) &&
- (tableValue.providers [providerIndex].classList
- [0].equal (className)))
+ (tableValue.providers[providerIndex].classList[0].equal(
+ className)))
{
-// l10n
_sendWaitDeleteRequests (indicationProviders,
sourceNameSpace,
- formerSubscriptions [i],
+ formerSubscriptions[i],
acceptLangs,
contentLangs,
creator);
else
{
Uint32 classIndex = _subscriptionTable->classInList
- (className, tableValue.providers [providerIndex]);
+ (className, tableValue.providers[providerIndex]);
if (classIndex != PEG_NOT_FOUND)
{
//
// Send Modify requests
//
-// l10n
_sendWaitModifyRequests (indicationProviders,
sourceNameSpace,
requiredProperties, condition,
query, queryLanguage,
- formerSubscriptions [i],
+ formerSubscriptions[i],
acceptLangs,
contentLangs,
creator);
// Get Provider Name, Subscription Filter Name and Handler Name
//
String logString2 = _getSubscriptionLogString
- (formerSubscriptions [j]);
+ (formerSubscriptions[j]);
Logger::put_l (Logger::STANDARD_LOG, System::CIMSERVER,
Logger::WARNING, _MSG_PROVIDER_NO_LONGER_SERVING_KEY,
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
"IndicationService::_handleNotifyProviderTermination");
- Array <CIMInstance> providerSubscriptions;
+ Array<CIMInstance> providerSubscriptions;
CIMInstance indicationInstance;
CIMNotifyProviderTerminationRequestMessage* request =
(CIMNotifyProviderTerminationRequestMessage*) message;
- Array <CIMInstance> providers = request->providers;
+ Array<CIMInstance> providers = request->providers;
for (Uint32 i = 0; i < providers.size (); i++)
{
// Active Subscriptions hash table, and implements each subscription's
// On Fatal Error policy, if necessary
//
- providerSubscriptions.clear ();
- providerSubscriptions = _subscriptionTable->reflectProviderDisable
- (providers [i]);
+ providerSubscriptions.clear();
+ providerSubscriptions = _subscriptionTable->reflectProviderDisable(
+ providers[i]);
- if (providerSubscriptions.size () > 0)
+ if (providerSubscriptions.size() > 0)
{
//
// NOTE: When a provider that was previously serving a subscription
//
// Log a message for each subscription
//
- CIMClass providerClass = _subscriptionRepository->getClass
- (PEGASUS_NAMESPACENAME_INTEROP, PEGASUS_CLASSNAME_PROVIDER,
- true, true, false, CIMPropertyList ());
- CIMInstance providerCopy = providers [i].clone ();
+ CIMClass providerClass = _subscriptionRepository->getClass(
+ PEGASUS_NAMESPACENAME_INTEROP, PEGASUS_CLASSNAME_PROVIDER,
+ true, true, false, CIMPropertyList());
+ CIMInstance providerCopy = providers[i].clone();
CIMObjectPath path = providerCopy.buildPath (providerClass);
providerCopy.setPath (path);
for (Uint32 j = 0; j < providerSubscriptions.size (); j++)
//
String logString1 = getProviderLogString (providerCopy);
String logString2 = _getSubscriptionLogString
- (providerSubscriptions [j]);
+ (providerSubscriptions[j]);
Logger::put_l (Logger::STANDARD_LOG, System::CIMSERVER,
Logger::WARNING, _MSG_PROVIDER_NO_LONGER_SERVING_KEY,
_MSG_PROVIDER_NO_LONGER_SERVING, logString1, logString2,
- providerSubscriptions[j].getPath().getNameSpace().getString());
+ providerSubscriptions[j].getPath().getNameSpace().
+ getString());
}
}
}
Boolean isRemoteNameSpace = pidc.isRemoteNameSpace();
String remoteInfo = pidc.getRemoteInfo();
#endif
- Array <CIMInstance> capabilities = request->capInstances;
+ Array<CIMInstance> capabilities = request->capInstances;
CIMException cimException;
- Array <CIMInstance> subscriptions;
- Array <ProviderClassList> indicationProviders;
+ Array<CIMInstance> subscriptions;
+ Array<ProviderClassList> indicationProviders;
//
// Get class name, namespace names, and property list
for (Uint32 i = 0; i < numCapabilities; i++)
{
CIMName className;
- Array <CIMNamespaceName> namespaceNames;
+ Array<CIMNamespaceName> namespaceNames;
CIMPropertyList propertyList;
- Array <CIMInstance> currentSubscriptions;
+ Array<CIMInstance> currentSubscriptions;
try
{
String cName;
- capabilities [i].getProperty (capabilities [i].findProperty
+ capabilities[i].getProperty (capabilities[i].findProperty
(_PROPERTY_CLASSNAME)).getValue ().get (cName);
className = CIMName (cName);
- Array <String> nsNames;
- capabilities [i].getProperty (capabilities [i].findProperty
+ Array<String> nsNames;
+ capabilities[i].getProperty (capabilities[i].findProperty
(_PROPERTY_NAMESPACES)).getValue ().get (nsNames);
for (Uint32 j = 0; j < nsNames.size (); j++)
{
- namespaceNames.append (CIMNamespaceName (nsNames [j]));
+ namespaceNames.append (CIMNamespaceName (nsNames[j]));
}
- Array <String> pNames;
- Array <CIMName> propertyNames;
- Uint32 propertiesIndex = capabilities [i].findProperty
+ Array<String> pNames;
+ Array<CIMName> propertyNames;
+ Uint32 propertiesIndex = capabilities[i].findProperty
(_PROPERTY_SUPPORTEDPROPERTIES);
if (propertiesIndex != PEG_NOT_FOUND)
{
- CIMValue propertiesValue = capabilities [i].getProperty
+ CIMValue propertiesValue = capabilities[i].getProperty
(propertiesIndex).getValue ();
//
// If the property list is not null, set the property names
propertiesValue.get (pNames);
for (Uint32 k = 0; k < pNames.size (); k++)
{
- propertyNames.append (CIMName (pNames [k]));
+ propertyNames.append (CIMName (pNames[k]));
}
propertyList.set (propertyNames);
}
}
}
- catch (Exception & exception)
+ catch (Exception& exception)
{
//
// Error getting information from Capabilities instance
// matching subscriptions, add the current class to the
// indication provider class list for the subscription
//
- if (currentSubscriptions [c].identical (subscriptions [m]))
+ if (currentSubscriptions[c].identical (subscriptions[m]))
{
inList = true;
- indicationProviders [m].classList.append (className);
+ indicationProviders[m].classList.append (className);
break;
}
}
// matching subscriptions, add it to the list and add the
// indication provider class list for the subscription
//
- subscriptions.append (currentSubscriptions [c]);
+ subscriptions.append (currentSubscriptions[c]);
ProviderClassList indicationProvider;
indicationProvider.provider = provider;
indicationProvider.providerModule = providerModule;
for (Uint32 s = 0; s < subscriptions.size (); s++)
{
CIMNamespaceName sourceNameSpace;
- Array <CIMName> indicationSubclasses;
- CIMInstance instance = subscriptions [s];
+ Array<CIMName> indicationSubclasses;
+ CIMInstance instance = subscriptions[s];
_getCreateParams (instance, indicationSubclasses,
requiredProperties, sourceNameSpace, condition, query,
queryLanguage);
//
// Send Create requests
//
- Array <ProviderClassList> currentIndicationProviders;
- currentIndicationProviders.append (indicationProviders [s]);
- Array <ProviderClassList> acceptedProviders;
+ Array<ProviderClassList> currentIndicationProviders;
+ currentIndicationProviders.append (indicationProviders[s]);
+ Array<ProviderClassList> acceptedProviders;
acceptedProviders = _sendWaitCreateRequests
(currentIndicationProviders,
sourceNameSpace, requiredProperties, condition,
//
Uint32 providerIndex =
_subscriptionTable->providerInList
- (indicationProviders [s].provider, tableValue);
+ (indicationProviders[s].provider, tableValue);
if (providerIndex != PEG_NOT_FOUND)
{
//
// subscription; add class to provider class list
//
for (Uint32 cn = 0;
- cn < indicationProviders [s].classList.size ();
+ cn < indicationProviders[s].classList.size ();
cn++)
{
_subscriptionTable->updateClasses
(instance.getPath (),
- indicationProviders [s].provider,
- indicationProviders [s].classList [cn]);
+ indicationProviders[s].provider,
+ indicationProviders[s].classList[cn]);
}
}
else
// subscription; add provider to the list
//
_subscriptionTable->updateProviders
- (instance.getPath (), indicationProviders [s],
+ (instance.getPath (), indicationProviders[s],
true);
//
// Get Subscription Filter Name and Handler Name
//
String logString2 = _getSubscriptionLogString
- (subscriptions [s]);
+ (subscriptions[s]);
//
// Log a message for each subscription
System::CIMSERVER, Logger::WARNING,
_MSG_PROVIDER_NOW_SERVING_KEY,
_MSG_PROVIDER_NOW_SERVING, logString1, logString2,
- subscriptions[s].getPath().getNameSpace().getString());
+ subscriptions[s].getPath().getNameSpace().
+ getString());
}
}
} // if any provider accepted the create subscription request
// Determine providers in module that were serving active subscriptions
// and update the Active Subscriptions Table
//
- Array <ActiveSubscriptionsTableEntry> providerModuleSubscriptions =
+ Array<ActiveSubscriptionsTableEntry> providerModuleSubscriptions =
_subscriptionTable->reflectProviderModuleFailure
(moduleName, userName, _authenticationEnabled);
}
Boolean IndicationService::_canCreate (
- CIMInstance & instance,
- const CIMNamespaceName & nameSpace)
+ CIMInstance& instance,
+ const CIMNamespaceName& nameSpace)
{
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, "IndicationService::_canCreate");
// Filter and Handler are key properties for Subscription
// No other properties are required
//
- _checkRequiredProperty (instance, PEGASUS_PROPERTYNAME_FILTER, CIMTYPE_REFERENCE,
+ _checkRequiredProperty(
+ instance,
+ PEGASUS_PROPERTYNAME_FILTER,
+ CIMTYPE_REFERENCE,
_MSG_KEY_PROPERTY);
- _checkRequiredProperty (instance, PEGASUS_PROPERTYNAME_HANDLER, CIMTYPE_REFERENCE,
+ _checkRequiredProperty(
+ instance,
+ PEGASUS_PROPERTYNAME_HANDLER,
+ CIMTYPE_REFERENCE,
_MSG_KEY_PROPERTY);
//
exceptionStr.append ("$1");
PEG_METHOD_EXIT ();
- throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_INVALID_PARAMETER,
- MessageLoaderParms (_MSG_INVALID_VALUE_FOR_PROPERTY_KEY,
- exceptionStr,
- origFilterPath.toString(), PEGASUS_PROPERTYNAME_FILTER.getString()));
+ throw PEGASUS_CIM_EXCEPTION_L(
+ CIM_ERR_INVALID_PARAMETER,
+ MessageLoaderParms(
+ _MSG_INVALID_VALUE_FOR_PROPERTY_KEY,
+ exceptionStr,
+ origFilterPath.toString(),
+ PEGASUS_PROPERTYNAME_FILTER.getString()));
}
}
exceptionStr.append ("$1");
PEG_METHOD_EXIT ();
- throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_INVALID_PARAMETER,
- MessageLoaderParms (_MSG_INVALID_VALUE_FOR_PROPERTY_KEY,
- exceptionStr,
- origHandlerPath.toString(), PEGASUS_PROPERTYNAME_HANDLER.getString()));
+ throw PEGASUS_CIM_EXCEPTION_L(
+ CIM_ERR_INVALID_PARAMETER,
+ MessageLoaderParms(
+ _MSG_INVALID_VALUE_FOR_PROPERTY_KEY,
+ exceptionStr,
+ origHandlerPath.toString(),
+ PEGASUS_PROPERTYNAME_HANDLER.getString()));
}
}
// Get Handler namespace - if not set in Handler reference property
// value, namespace is the namespace of the subscription
//
- CIMNamespaceName handlerNS = handlerPath.getNameSpace ();
- if (handlerNS.isNull ())
+ CIMNamespaceName handlerNS = handlerPath.getNameSpace();
+ if (handlerNS.isNull())
{
handlerNS = nameSpace;
}
// repository
//
CIMInstance filterInstance =
- _subscriptionRepository->getInstance (filterNS, filterPath,
- true, false, false, CIMPropertyList ());
+ _subscriptionRepository->getInstance(filterNS, filterPath,
+ true, false, false, CIMPropertyList());
CIMInstance handlerInstance =
- _subscriptionRepository->getInstance (handlerNS, handlerPath,
- true, false, false, CIMPropertyList ());
+ _subscriptionRepository->getInstance(handlerNS, handlerPath,
+ true, false, false, CIMPropertyList());
//
// Set the key bindings in the subscription instance
//
- Array <CIMKeyBinding> kb;
- kb.append (CIMKeyBinding (PEGASUS_PROPERTYNAME_FILTER, filterValue));
- kb.append (CIMKeyBinding (PEGASUS_PROPERTYNAME_HANDLER, handlerValue));
+ Array<CIMKeyBinding> kb;
+ kb.append(CIMKeyBinding(PEGASUS_PROPERTYNAME_FILTER, filterValue));
+ kb.append(CIMKeyBinding(PEGASUS_PROPERTYNAME_HANDLER, handlerValue));
CIMObjectPath instanceRef = instance.getPath ();
- instanceRef.setKeyBindings (kb);
- instanceRef.setNameSpace (nameSpace);
- instance.setPath (instanceRef);
+ instanceRef.setKeyBindings(kb);
+ instanceRef.setNameSpace(nameSpace);
+ instance.setPath(instanceRef);
//
// Subscription State, Repeat Notification Policy, and On Fatal Error
// Policy properties each has a default value, a corresponding
// Other___ property, and a set of valid values
//
- _checkPropertyWithOther (instance, PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE,
- _PROPERTY_OTHERSTATE, (Uint16) STATE_ENABLED,
- (Uint16) STATE_OTHER, _validStates, _supportedStates);
-
- _checkPropertyWithOther (instance, _PROPERTY_REPEATNOTIFICATIONPOLICY,
- _PROPERTY_OTHERREPEATNOTIFICATIONPOLICY, (Uint16) _POLICY_NONE,
- (Uint16) _POLICY_OTHER, _validRepeatPolicies,
+ _checkPropertyWithOther(
+ instance,
+ PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE,
+ _PROPERTY_OTHERSTATE,
+ (Uint16) STATE_ENABLED,
+ (Uint16) STATE_OTHER,
+ _validStates,
+ _supportedStates);
+
+ _checkPropertyWithOther(
+ instance,
+ _PROPERTY_REPEATNOTIFICATIONPOLICY,
+ _PROPERTY_OTHERREPEATNOTIFICATIONPOLICY,
+ (Uint16) _POLICY_NONE,
+ (Uint16) _POLICY_OTHER,
+ _validRepeatPolicies,
_supportedRepeatPolicies);
- _checkPropertyWithOther (instance, _PROPERTY_ONFATALERRORPOLICY,
- _PROPERTY_OTHERONFATALERRORPOLICY, (Uint16) _ERRORPOLICY_IGNORE,
- (Uint16) _ERRORPOLICY_OTHER, _validErrorPolicies,
+ _checkPropertyWithOther(
+ instance,
+ _PROPERTY_ONFATALERRORPOLICY,
+ _PROPERTY_OTHERONFATALERRORPOLICY,
+ (Uint16) _ERRORPOLICY_IGNORE,
+ (Uint16) _ERRORPOLICY_OTHER,
+ _validErrorPolicies,
_supportedErrorPolicies);
//
// For each remaining property, verify that if the property exists in
// the instance it is of the correct type
//
- _checkProperty (instance, _PROPERTY_FAILURETRIGGERTIMEINTERVAL,
+ _checkProperty(instance, _PROPERTY_FAILURETRIGGERTIMEINTERVAL,
CIMTYPE_UINT64);
- _checkProperty (instance, _PROPERTY_LASTCHANGE, CIMTYPE_DATETIME);
- _checkProperty (instance, _PROPERTY_DURATION, CIMTYPE_UINT64);
- _checkProperty (instance, _PROPERTY_STARTTIME, CIMTYPE_DATETIME);
- _checkProperty (instance, _PROPERTY_TIMEREMAINING, CIMTYPE_UINT64);
- _checkProperty (instance, _PROPERTY_REPEATNOTIFICATIONINTERVAL,
+ _checkProperty(instance, _PROPERTY_LASTCHANGE, CIMTYPE_DATETIME);
+ _checkProperty(instance, _PROPERTY_DURATION, CIMTYPE_UINT64);
+ _checkProperty(instance, _PROPERTY_STARTTIME, CIMTYPE_DATETIME);
+ _checkProperty(instance, _PROPERTY_TIMEREMAINING, CIMTYPE_UINT64);
+ _checkProperty(instance, _PROPERTY_REPEATNOTIFICATIONINTERVAL,
CIMTYPE_UINT64);
- _checkProperty (instance, _PROPERTY_REPEATNOTIFICATIONGAP,
+ _checkProperty(instance, _PROPERTY_REPEATNOTIFICATIONGAP,
CIMTYPE_UINT64);
- _checkProperty (instance, _PROPERTY_REPEATNOTIFICATIONCOUNT,
+ _checkProperty(instance, _PROPERTY_REPEATNOTIFICATIONCOUNT,
CIMTYPE_UINT16);
- if (instance.getClassName ().equal (
+ if (instance.getClassName().equal(
PEGASUS_CLASSNAME_FORMATTEDINDSUBSCRIPTION))
{
Array<String> textFormatParams;
// If they exist but are NULL, set value to the default
// 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);
- _initOrValidateStringProperty (instance,PEGASUS_PROPERTYNAME_CREATIONCLASSNAME,
- instance.getClassName ().getString ());
+ _initOrValidateStringProperty(
+ instance,
+ PEGASUS_PROPERTYNAME_CREATIONCLASSNAME,
+ instance.getClassName().getString());
- _initOrValidateStringProperty (instance, _PROPERTY_SYSTEMNAME,
- System::getFullyQualifiedHostName ());
+ _initOrValidateStringProperty(
+ instance,
+ _PROPERTY_SYSTEMNAME,
+ System::getFullyQualifiedHostName());
- _initOrValidateStringProperty (instance,
+ _initOrValidateStringProperty(
+ instance,
_PROPERTY_SYSTEMCREATIONCLASSNAME,
- System::getSystemCreationClassName ());
+ System::getSystemCreationClassName());
if (instance.getClassName ().equal (PEGASUS_CLASSNAME_INDFILTER))
{
//
// 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);
- _checkRequiredProperty (instance, PEGASUS_PROPERTYNAME_QUERYLANGUAGE,
- CIMTYPE_STRING, _MSG_PROPERTY);
//
// Validate the query language is supported
//
String queryLanguage;
- instance.getProperty (instance.findProperty
- (PEGASUS_PROPERTYNAME_QUERYLANGUAGE)).getValue ().get (queryLanguage);
+ instance.getProperty(
+ instance.findProperty(PEGASUS_PROPERTYNAME_QUERYLANGUAGE)).
+ getValue().get(queryLanguage);
#ifdef PEGASUS_DISABLE_CQL
// Special code to block CQL, if CQL is disabled
if (queryLanguage == "CIM:CQL")
{
- // CQL is not allowed in this case
- PEG_METHOD_EXIT();
- throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED,
- queryLanguage);
+ // CQL is not allowed in this case
+ PEG_METHOD_EXIT();
+ throw PEGASUS_CIM_EXCEPTION(
+ CIM_ERR_NOT_SUPPORTED, queryLanguage);
}
#endif
// Default value for Source Namespace is the namespace of the
// Filter registration
//
- CIMNamespaceName sourceNameSpace = CIMNamespaceName
- (_checkPropertyWithDefault (instance, _PROPERTY_SOURCENAMESPACE,
- nameSpace.getString()));
+ CIMNamespaceName sourceNameSpace = CIMNamespaceName(
+ _checkPropertyWithDefault(
+ instance,
+ _PROPERTY_SOURCENAMESPACE,
+ nameSpace.getString()));
//
// Validate the query and indication class name
QueryExpression queryExpression;
try
{
- queryExpression =
- _getQueryExpression (filterQuery, queryLanguage, sourceNameSpace);
+ queryExpression = _getQueryExpression(
+ filterQuery, queryLanguage, sourceNameSpace);
}
catch (QueryLanguageInvalidException&)
{
- // The filter query had an invalid language name.
- PEG_METHOD_EXIT();
- throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED,
- queryLanguage);
+ // The filter query had an invalid language name.
+ PEG_METHOD_EXIT();
+ throw PEGASUS_CIM_EXCEPTION(
+ CIM_ERR_NOT_SUPPORTED, queryLanguage);
}
CIMName indicationClassName = _getIndicationClassName
_MSG_CLASS_NOT_SERVED));
}
#endif
- _checkPropertyWithOther (instance, PEGASUS_PROPERTYNAME_PERSISTENCETYPE,
- _PROPERTY_OTHERPERSISTENCETYPE, (Uint16) PERSISTENCE_PERMANENT,
- (Uint16) PERSISTENCE_OTHER, _validPersistenceTypes,
+ _checkPropertyWithOther(
+ instance,
+ PEGASUS_PROPERTYNAME_PERSISTENCETYPE,
+ _PROPERTY_OTHERPERSISTENCETYPE,
+ (Uint16) PERSISTENCE_PERMANENT,
+ (Uint16) PERSISTENCE_OTHER,
+ _validPersistenceTypes,
_supportedPersistenceTypes);
//
// For remaining property, verify that if the property exists in
// the instance it is of the correct type
//
- _checkProperty (instance, _PROPERTY_OWNER, CIMTYPE_STRING);
+ _checkProperty(instance, _PROPERTY_OWNER, CIMTYPE_STRING);
- if (instance.getClassName ().equal
- (PEGASUS_CLASSNAME_INDHANDLER_CIMXML) ||
- instance.getClassName ().equal
- (PEGASUS_CLASSNAME_LSTNRDST_CIMXML))
+ if (instance.getClassName().equal(
+ PEGASUS_CLASSNAME_INDHANDLER_CIMXML) ||
+ instance.getClassName().equal(
+ PEGASUS_CLASSNAME_LSTNRDST_CIMXML))
{
//
// Destination property is required for CIMXML
// Handler subclass
//
- _checkRequiredProperty (instance,
- PEGASUS_PROPERTYNAME_LSTNRDST_DESTINATION,
- CIMTYPE_STRING, _MSG_PROPERTY);
+ _checkRequiredProperty(
+ instance,
+ PEGASUS_PROPERTYNAME_LSTNRDST_DESTINATION,
+ CIMTYPE_STRING,
+ _MSG_PROPERTY);
}
- if (instance.getClassName ().equal
+ if (instance.getClassName().equal
(PEGASUS_CLASSNAME_INDHANDLER_SNMP))
{
//
// TargetHost property is required for SNMP
// Handler subclass
//
- _checkRequiredProperty (instance,
- PEGASUS_PROPERTYNAME_LSTNRDST_TARGETHOST,
- CIMTYPE_STRING, _MSG_PROPERTY);
+ _checkRequiredProperty(
+ instance,
+ PEGASUS_PROPERTYNAME_LSTNRDST_TARGETHOST,
+ CIMTYPE_STRING,
+ _MSG_PROPERTY);
//
// TargetHostFormat property is required for SNMP
// Handler subclass
//
- _checkRequiredProperty (instance, _PROPERTY_TARGETHOSTFORMAT,
- CIMTYPE_UINT16, _MSG_PROPERTY);
+ _checkRequiredProperty(
+ instance,
+ _PROPERTY_TARGETHOSTFORMAT,
+ CIMTYPE_UINT16,
+ _MSG_PROPERTY);
//
// SNMPVersion property is required for SNMP Handler
//
- _checkRequiredProperty (instance, PEGASUS_PROPERTYNAME_SNMPVERSION,
- CIMTYPE_UINT16, _MSG_PROPERTY);
-
+ _checkRequiredProperty(
+ instance,
+ PEGASUS_PROPERTYNAME_SNMPVERSION,
+ CIMTYPE_UINT16,
+ _MSG_PROPERTY);
+
// Currently, only SNMPv1 trap and SNMPv2C trap are supported,
// verify if the value of SNMPVersion is one of them
- _checkValue(instance, PEGASUS_PROPERTYNAME_SNMPVERSION,
- _validSNMPVersion, _supportedSNMPVersion);
+ _checkValue(
+ instance,
+ PEGASUS_PROPERTYNAME_SNMPVERSION,
+ _validSNMPVersion,
+ _supportedSNMPVersion);
//
// For each remaining property, verify that if the property
// exists in the instance it is of the correct type
//
- _checkProperty (instance, _PROPERTY_PORTNUMBER, CIMTYPE_UINT32);
- _checkProperty (instance, _PROPERTY_SNMPSECURITYNAME,
+ _checkProperty(instance, _PROPERTY_PORTNUMBER, CIMTYPE_UINT32);
+ _checkProperty(instance, _PROPERTY_SNMPSECURITYNAME,
CIMTYPE_STRING);
- _checkProperty (instance, _PROPERTY_SNMPENGINEID,
+ _checkProperty(instance, _PROPERTY_SNMPENGINEID,
CIMTYPE_STRING);
}
- if (instance.getClassName ().equal
+ if (instance.getClassName().equal
(PEGASUS_CLASSNAME_LSTNRDST_EMAIL))
{
//
// MailTo property is required for Email
// Handler subclass
//
- _checkRequiredProperty (instance,
- PEGASUS_PROPERTYNAME_LSTNRDST_MAILTO,
- CIMTYPE_STRING, _MSG_PROPERTY, true);
-
- // get MailTo from handler instance
+ _checkRequiredProperty(
+ instance,
+ PEGASUS_PROPERTYNAME_LSTNRDST_MAILTO,
+ CIMTYPE_STRING,
+ _MSG_PROPERTY,
+ true);
+
+ // get MailTo from handler instance
Array<String> mailTo;
- instance.getProperty(instance.findProperty(
- PEGASUS_PROPERTYNAME_LSTNRDST_MAILTO)).getValue().get(mailTo);
+ instance.getProperty(instance.findProperty(
+ PEGASUS_PROPERTYNAME_LSTNRDST_MAILTO)).getValue().get(
+ mailTo);
- // Build mail address string
- String mailAddrStr;
- Uint32 mailAddrSize = mailTo.size();
+ // Build mail address string
+ String mailAddrStr;
+ Uint32 mailAddrSize = mailTo.size();
- for (Uint32 i=0; i < mailAddrSize; i++)
- {
- mailAddrStr.append(mailTo[i]);
+ for (Uint32 i=0; i < mailAddrSize; i++)
+ {
+ mailAddrStr.append(mailTo[i]);
- if (i < (mailAddrSize - 1))
- {
- mailAddrStr.append(",");
- }
- }
+ if (i < (mailAddrSize - 1))
+ {
+ mailAddrStr.append(",");
+ }
+ }
- //
- // Email address can not be an empty string
- //
- if (mailAddrStr == String::EMPTY)
- {
- PEG_METHOD_EXIT();
- throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED,
- MessageLoaderParms("IndicationService.IndicationService._MSG_DO_NOT_HAVE_EMAIL_ADDRESS",
- "Do not have an e-mail address."));
- }
+ //
+ // Email address can not be an empty string
+ //
+ if (mailAddrStr == String::EMPTY)
+ {
+ PEG_METHOD_EXIT();
+ throw PEGASUS_CIM_EXCEPTION_L(
+ CIM_ERR_FAILED,
+ MessageLoaderParms(
+ "IndicationService.IndicationService."
+ "_MSG_DO_NOT_HAVE_EMAIL_ADDRESS",
+ "Do not have an e-mail address."));
+ }
//
// MailSubject property is required for Email
// Handler subclass
//
- _checkRequiredProperty (instance,
- PEGASUS_PROPERTYNAME_LSTNRDST_MAILSUBJECT,
- CIMTYPE_STRING, _MSG_PROPERTY);
+ _checkRequiredProperty(
+ instance,
+ PEGASUS_PROPERTYNAME_LSTNRDST_MAILSUBJECT,
+ CIMTYPE_STRING,
+ _MSG_PROPERTY);
//
// For MailCc property, verify that if the property
// exists in the instance it is of the correct type
//
- _checkProperty (instance,
- PEGASUS_PROPERTYNAME_LSTNRDST_MAILCC,
- CIMTYPE_STRING, true);
+ _checkProperty(
+ instance,
+ PEGASUS_PROPERTYNAME_LSTNRDST_MAILCC,
+ CIMTYPE_STRING,
+ true);
}
}
//
// A class not currently served by the Indication Service
//
- PEG_METHOD_EXIT ();
-
- // l10n
-
- // throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED,
- // _MSG_CLASS_NOT_SERVED);
+ PEG_METHOD_EXIT();
- throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_NOT_SUPPORTED,
- MessageLoaderParms(_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));
}
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
return true;
}
-void IndicationService::_checkRequiredProperty (
- CIMInstance & instance,
- const CIMName & propertyName,
+void IndicationService::_checkRequiredProperty(
+ CIMInstance& instance,
+ const CIMName& propertyName,
const CIMType expectedType,
- const String & message,
+ const String& message,
const Boolean isArray)
{
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
}
void IndicationService::_checkPropertyWithOther (
- CIMInstance & instance,
- const CIMName & propertyName,
- const CIMName & otherPropertyName,
+ CIMInstance& instance,
+ const CIMName& propertyName,
+ const CIMName& otherPropertyName,
const Uint16 defaultValue,
const Uint16 otherValue,
- const Array <Uint16> & validValues,
- const Array <Uint16> & supportedValues)
+ const Array<Uint16>& validValues,
+ const Array<Uint16>& supportedValues)
{
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
"IndicationService::_checkPropertyWithOther");
if (theValue.isArray ())
{
MessageLoaderParms parms(
- "IndicationService.IndicationService._MSG_INVALID_TYPE_ARRAY_OF_FOR_PROPERTY",
- "Invalid type array of $0 for property $1",
- cimTypeToString(theValue.getType()),
- propertyName.getString());
+ "IndicationService.IndicationService."
+ "_MSG_INVALID_TYPE_ARRAY_OF_FOR_PROPERTY",
+ "Invalid type array of $0 for property $1",
+ cimTypeToString(theValue.getType()),
+ propertyName.getString());
exceptionStr.append(MessageLoader::getMessage(parms));
}
else
{
MessageLoaderParms parms(
- "IndicationService.IndicationService._MSG_INVALID_TYPE_FOR_PROPERTY",
- "Invalid type $0 for property $1",
- cimTypeToString(theValue.getType()),
- propertyName.getString());
+ "IndicationService.IndicationService."
+ "_MSG_INVALID_TYPE_FOR_PROPERTY",
+ "Invalid type $0 for property $1",
+ cimTypeToString(theValue.getType()),
+ propertyName.getString());
exceptionStr.append(MessageLoader::getMessage(parms));
}
//
if (!Contains (validValues, result))
{
- // l10n
-
String exceptionStr = _MSG_INVALID_VALUE;
- // exceptionStr.append (theValue.toString ());
- exceptionStr.append ("$0");
- exceptionStr.append (_MSG_FOR_PROPERTY);
- // exceptionStr.append (propertyName.getString());
- exceptionStr.append ("$1");
+ exceptionStr.append("$0");
+ exceptionStr.append(_MSG_FOR_PROPERTY);
+ exceptionStr.append("$1");
PEG_METHOD_EXIT ();
- // throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER,
- // exceptionStr);
-
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_INVALID_PARAMETER,
MessageLoaderParms(_MSG_INVALID_VALUE_FOR_PROPERTY_KEY,
exceptionStr,
// Some valid values, as defined in the MOF, are not currently
// supported by the Pegasus IndicationService
//
- if (!Contains (supportedValues, result))
+ if (!Contains(supportedValues, result))
{
String exceptionStr = _MSG_UNSUPPORTED_VALUE;
- exceptionStr.append ("$0");
- exceptionStr.append (_MSG_FOR_PROPERTY);
- exceptionStr.append ("$1");
+ exceptionStr.append("$0");
+ exceptionStr.append(_MSG_FOR_PROPERTY);
+ exceptionStr.append("$1");
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
- throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_NOT_SUPPORTED,
- MessageLoaderParms (_MSG_UNSUPPORTED_VALUE_FOR_PROPERTY_KEY,
- exceptionStr,
- theValue.toString (), propertyName.getString ()));
+ throw PEGASUS_CIM_EXCEPTION_L(
+ CIM_ERR_NOT_SUPPORTED,
+ MessageLoaderParms(
+ _MSG_UNSUPPORTED_VALUE_FOR_PROPERTY_KEY,
+ exceptionStr,
+ theValue.toString(),
+ propertyName.getString()));
}
}
//
if (result == otherValue)
{
- if (instance.findProperty (otherPropertyName) == PEG_NOT_FOUND)
+ if (instance.findProperty(otherPropertyName) == PEG_NOT_FOUND)
{
- // l10n
-
String exceptionStr = _MSG_MISSING_REQUIRED;
- // exceptionStr.append (otherPropertyName.getString());
- exceptionStr.append ("$0");
- exceptionStr.append (_MSG_PROPERTY);
-
- PEG_METHOD_EXIT ();
-
- // l10n
+ exceptionStr.append("$0");
+ exceptionStr.append(_MSG_PROPERTY);
- // throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER,
- // exceptionStr);
+ PEG_METHOD_EXIT();
- throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_INVALID_PARAMETER,
- MessageLoaderParms(_MSG_PROPERTY_KEY,
- exceptionStr,
- otherPropertyName.getString()));
+ throw PEGASUS_CIM_EXCEPTION_L(
+ CIM_ERR_INVALID_PARAMETER,
+ MessageLoaderParms(
+ _MSG_PROPERTY_KEY,
+ exceptionStr,
+ otherPropertyName.getString()));
}
else
{
CIMProperty otherProperty = instance.getProperty
- (instance.findProperty (otherPropertyName));
- CIMValue theOtherValue = otherProperty.getValue ();
- if (theOtherValue.isNull ())
+ (instance.findProperty(otherPropertyName));
+ CIMValue theOtherValue = otherProperty.getValue();
+ if (theOtherValue.isNull())
{
- // l10n
-
String exceptionStr = _MSG_MISSING_REQUIRED;
- // exceptionStr.append (otherPropertyName.getString());
- exceptionStr.append ("$0");
- exceptionStr.append (_MSG_PROPERTY);
-
- PEG_METHOD_EXIT ();
+ exceptionStr.append("$0");
+ exceptionStr.append(_MSG_PROPERTY);
- // l10n
- // throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER,
- // exceptionStr);
+ PEG_METHOD_EXIT();
- throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_INVALID_PARAMETER,
- MessageLoaderParms(_MSG_PROPERTY_KEY,
- exceptionStr,
- otherPropertyName.getString()));
+ throw PEGASUS_CIM_EXCEPTION_L(
+ CIM_ERR_INVALID_PARAMETER,
+ MessageLoaderParms(
+ _MSG_PROPERTY_KEY,
+ exceptionStr,
+ otherPropertyName.getString()));
}
- else if (theOtherValue.getType () != CIMTYPE_STRING)
+ else if (theOtherValue.getType() != CIMTYPE_STRING)
{
//
// Property exists and is not null,
// but is not of correct type
//
String exceptionStr = _MSG_INVALID_TYPE;
- exceptionStr.append ("$0");
- exceptionStr.append (_MSG_FOR_PROPERTY);
- exceptionStr.append ("$1");
+ exceptionStr.append("$0");
+ exceptionStr.append(_MSG_FOR_PROPERTY);
+ exceptionStr.append("$1");
PEG_METHOD_EXIT ();
- throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_INVALID_PARAMETER,
- MessageLoaderParms
- (_MSG_INVALID_TYPE_FOR_PROPERTY_KEY,
+ throw PEGASUS_CIM_EXCEPTION_L(
+ CIM_ERR_INVALID_PARAMETER,
+ MessageLoaderParms(
+ _MSG_INVALID_TYPE_FOR_PROPERTY_KEY,
exceptionStr,
- cimTypeToString (theOtherValue.getType ()),
- otherPropertyName.getString ()));
+ cimTypeToString(theOtherValue.getType()),
+ otherPropertyName.getString()));
}
}
}
//
else if (instance.findProperty (otherPropertyName) != PEG_NOT_FOUND)
{
- CIMProperty otherProperty = instance.getProperty
- (instance.findProperty (otherPropertyName));
- CIMValue theOtherValue = otherProperty.getValue ();
- if (!theOtherValue.isNull ())
+ CIMProperty otherProperty = instance.getProperty(
+ instance.findProperty(otherPropertyName));
+ CIMValue theOtherValue = otherProperty.getValue();
+ if (!theOtherValue.isNull())
{
- // l10n
-
- // String exceptionStr = otherPropertyName.getString();
- String exceptionStr ("$0");
- exceptionStr.append (_MSG_PROPERTY_PRESENT);
- // exceptionStr.append (propertyName.getString());
- exceptionStr.append ("$1");
- exceptionStr.append (_MSG_VALUE_NOT);
- // exceptionStr.append (CIMValue (otherValue).toString ());
- exceptionStr.append ("$2");
+ String exceptionStr("$0");
+ exceptionStr.append(_MSG_PROPERTY_PRESENT);
+ exceptionStr.append("$1");
+ exceptionStr.append(_MSG_VALUE_NOT);
+ exceptionStr.append("$2");
- PEG_METHOD_EXIT ();
-
- // l10n
-
- // throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER,
- // exceptionStr);
+ PEG_METHOD_EXIT();
- throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_INVALID_PARAMETER,
- MessageLoaderParms(_MSG_PROPERTY_PRESENT_BUT_VALUE_NOT_KEY,
- exceptionStr,
- otherPropertyName.getString(),
- propertyName.getString(),
- CIMValue (otherValue).toString ()));
+ throw PEGASUS_CIM_EXCEPTION_L(
+ CIM_ERR_INVALID_PARAMETER,
+ MessageLoaderParms(
+ _MSG_PROPERTY_PRESENT_BUT_VALUE_NOT_KEY,
+ exceptionStr,
+ otherPropertyName.getString(),
+ propertyName.getString(),
+ CIMValue(otherValue).toString()));
}
}
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-String IndicationService::_checkPropertyWithDefault (
- CIMInstance & instance,
- const CIMName & propertyName,
- const String & defaultValue)
+String IndicationService::_checkPropertyWithDefault(
+ CIMInstance& instance,
+ const CIMName& propertyName,
+ const String& defaultValue)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_checkPropertyWithDefault");
String result = defaultValue;
}
String IndicationService::_initOrValidateStringProperty (
- CIMInstance & instance,
- const CIMName & propertyName,
- const String & defaultValue)
+ CIMInstance& instance,
+ const CIMName& propertyName,
+ const String& defaultValue)
{
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
"IndicationService::_initOrValidateStringProperty");
}
void IndicationService::_checkProperty (
- CIMInstance & instance,
- const CIMName & propertyName,
+ CIMInstance& instance,
+ const CIMName& propertyName,
const CIMType expectedType,
const Boolean isArray)
{
//
if (!theValue.isNull ())
{
- if ((theValue.getType () != expectedType) ||
+ if ((theValue.getType () != expectedType) ||
(theValue.isArray () != isArray))
{
//
}
void IndicationService::_checkSupportedProperties (
- const CIMInstance & instance)
+ const CIMInstance& instance)
{
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
"IndicationService::_checkSupportedProperties");
CIMName className = instance.getClassName ();
- Array <CIMName> emptyArray;
- Array <CIMName> & supportedProperties = emptyArray;
+ Array<CIMName> emptyArray;
+ Array<CIMName>& supportedProperties = emptyArray;
//
// Get list of supported properties for the class
PEG_METHOD_EXIT ();
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_NOT_SUPPORTED,
MessageLoaderParms (_MSG_PROPERTY_NOT_SUPPORTED_KEY,
- _MSG_PROPERTY_NOT_SUPPORTED,
+ _MSG_PROPERTY_NOT_SUPPORTED,
instance.getProperty (i).getName ().getString (),
className.getString ()));
}
}
void IndicationService::_checkValue (
- const CIMInstance & instance,
- const CIMName & propertyName,
- const Array <Uint16> & validValues,
- const Array <Uint16> & supportedValues)
+ const CIMInstance& instance,
+ const CIMName& propertyName,
+ const Array<Uint16>& validValues,
+ const Array<Uint16>& supportedValues)
{
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
"IndicationService::_checkValue");
exceptionStr,
theValue,
propertyName.getString()));
-
+
}
- // Check for valid values that are not supported
- // Note: Supported values are a subset of the valid values
- // Some valid values, as defined in the MOF, are not currently
- // supported
+ // Check for valid values that are not supported
+ // Note: Supported values are a subset of the valid values
+ // Some valid values, as defined in the MOF, are not currently
+ // supported
if (!Contains(supportedValues, theValue))
{
String exceptionStr = _MSG_UNSUPPORTED_VALUE;
exceptionStr,
theValue,
propertyName.getString()));
-
}
}
-
}
PEG_METHOD_EXIT ();
Boolean IndicationService::_canModify (
const CIMModifyInstanceRequestMessage * request,
- const CIMObjectPath & instanceReference,
- const CIMInstance & instance,
- CIMInstance & modifiedInstance)
+ const CIMObjectPath& instanceReference,
+ const CIMInstance& instance,
+ CIMInstance& modifiedInstance)
{
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, "IndicationService::_canModify");
//
// Request is invalid if more than one property is specified
//
- else if (request->propertyList.size () > 1)
+ else if (request->propertyList.size() > 1)
{
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY);
}
// For request to be valid, zero or one property must be specified
// If one property specified, it must be Subscription State property
//
- else if ((request->propertyList.size () == 1) &&
- (!request->propertyList[0].equal (PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE)))
+ else if ((request->propertyList.size() == 1) &&
+ (!request->propertyList[0].equal(
+ PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE)))
{
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY);
}
//
// Check the SubscriptionState property in the modified instance
//
- _checkPropertyWithOther (modifiedInstance, PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE,
- _PROPERTY_OTHERSTATE, (Uint16) STATE_ENABLED, (Uint16) STATE_OTHER,
- _validStates, _supportedStates);
+ _checkPropertyWithOther(
+ modifiedInstance,
+ PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE,
+ _PROPERTY_OTHERSTATE,
+ (Uint16) STATE_ENABLED,
+ (Uint16) STATE_OTHER,
+ _validStates,
+ _supportedStates);
//
// Get creator from instance
// L10N TODO DONE -- new throw of exception
//
PEG_METHOD_EXIT ();
- //throw PEGASUS_CIM_EXCEPTION (CIM_ERR_FAILED,
- //_MSG_INVALID_INSTANCES);
MessageLoaderParms parms(_MSG_INVALID_INSTANCES_KEY,
_MSG_INVALID_INSTANCES);
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms);
}
Boolean IndicationService::_canDelete (
- const CIMObjectPath & instanceReference,
- const CIMNamespaceName & nameSpace,
- const String & currentUser)
+ const CIMObjectPath& instanceReference,
+ const CIMNamespaceName& nameSpace,
+ const String& currentUser)
{
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, "IndicationService::_canDelete");
//
// Get all the subscriptions from the repository
//
- Array <CIMInstance> subscriptions =
+ Array<CIMInstance> subscriptions =
_subscriptionRepository->getAllSubscriptions ();
CIMValue propValue;
// is the namespace of the Filter or Handler being deleted.
//
CIMNamespaceName instanceNS = ref.getNameSpace ();
- if (((instanceNS.isNull ()) &&
- (subscriptions[i].getPath ().getNameSpace () == nameSpace))
+ if (((instanceNS.isNull ()) &&
+ (subscriptions[i].getPath ().getNameSpace () == nameSpace))
|| (instanceNS == nameSpace))
{
return true;
}
-Array <CIMInstance> IndicationService::_getMatchingSubscriptions (
- const CIMName & supportedClass,
- const Array <CIMNamespaceName> nameSpaces,
- const CIMPropertyList & supportedProperties,
+Array<CIMInstance> IndicationService::_getMatchingSubscriptions (
+ const CIMName& supportedClass,
+ const Array<CIMNamespaceName> nameSpaces,
+ const CIMPropertyList& supportedProperties,
const Boolean checkProvider,
- const CIMInstance & provider)
+ const CIMInstance& provider)
{
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
"IndicationService::_getMatchingSubscriptions");
- Array <CIMInstance> matchingSubscriptions;
- Array <CIMInstance> subscriptions;
+ Array<CIMInstance> matchingSubscriptions;
+ Array<CIMInstance> subscriptions;
subscriptions = _subscriptionTable->getMatchingSubscriptions
(supportedClass, nameSpaces, checkProvider, provider);
// Get filter properties
//
_subscriptionRepository->getFilterProperties
- (subscriptions [i], filterQuery, sourceNameSpace,
+ (subscriptions[i], filterQuery, sourceNameSpace,
queryLanguage, filterName);
- QueryExpression queryExpr = _getQueryExpression(filterQuery,
- queryLanguage,
- sourceNameSpace);
+ QueryExpression queryExpr = _getQueryExpression(
+ filterQuery, queryLanguage, sourceNameSpace);
//
// Get indication class name from filter query
{
if (!ContainsCIMName
(supportedProperties.getPropertyNameArray(),
- propertyList [j]))
+ propertyList[j]))
{
match = false;
break;
//
// Add current subscription to list
//
- matchingSubscriptions.append (subscriptions [i]);
+ matchingSubscriptions.append (subscriptions[i]);
}
}
}
void IndicationService::_getModifiedSubscriptions (
- const CIMName & supportedClass,
- const Array <CIMNamespaceName> & newNameSpaces,
- const Array <CIMNamespaceName> & oldNameSpaces,
- const CIMPropertyList & newProperties,
- const CIMPropertyList & oldProperties,
- Array <CIMInstance> & newSubscriptions,
- Array <CIMInstance> & formerSubscriptions)
+ const CIMName& supportedClass,
+ const Array<CIMNamespaceName>& newNameSpaces,
+ const Array<CIMNamespaceName>& oldNameSpaces,
+ const CIMPropertyList& newProperties,
+ const CIMPropertyList& oldProperties,
+ Array<CIMInstance>& newSubscriptions,
+ Array<CIMInstance>& formerSubscriptions)
{
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
"IndicationService::_getModifiedSubscriptions");
- Array <CIMInstance> newList;
- Array <CIMInstance> formerList;
- Array <CIMInstance> bothList;
+ Array<CIMInstance> newList;
+ Array<CIMInstance> formerList;
+ Array<CIMInstance> bothList;
newSubscriptions.clear ();
formerSubscriptions.clear ();
found = -1;
for (Uint32 q = 0; q < formerList.size (); q++)
{
- if (newList [p].identical (formerList [q]))
+ if (newList[p].identical (formerList[q]))
{
found = q;
- bothList.append (newList [p]);
+ bothList.append (newList[p]);
break;
}
}
//
// Get filter properties
//
- _subscriptionRepository->getFilterProperties (newList [n], filterQuery,
+ _subscriptionRepository->getFilterProperties (newList[n], filterQuery,
sourceNameSpace, queryLanguage, filterName);
- QueryExpression queryExpression = _getQueryExpression(filterQuery,
- queryLanguage,
- sourceNameSpace);
+ QueryExpression queryExpression = _getQueryExpression(
+ filterQuery, queryLanguage, sourceNameSpace);
//
// Get indication class name from filter query (FROM clause)
//
if (_inPropertyList (requiredProperties, newProperties))
{
- newSubscriptions.append (newList [n]);
+ newSubscriptions.append (newList[n]);
}
}
//
for (Uint32 f = 0; f < formerList.size (); f++)
{
- formerSubscriptions.append (formerList [f]);
+ formerSubscriptions.append (formerList[f]);
}
//
//
// Get filter properties
//
- _subscriptionRepository->getFilterProperties (bothList [b], filterQuery,
+ _subscriptionRepository->getFilterProperties (bothList[b], filterQuery,
sourceNameSpace, queryLanguage, filterName);
- QueryExpression queryExpression = _getQueryExpression(filterQuery,
- queryLanguage,
- sourceNameSpace);
+ QueryExpression queryExpression = _getQueryExpression(
+ filterQuery, queryLanguage, sourceNameSpace);
//
// Get indication class name from filter query (FROM clause)
//
if (newMatch && !formerMatch)
{
- newSubscriptions.append (bothList [b]);
+ newSubscriptions.append (bothList[b]);
}
else if (!newMatch && formerMatch)
{
- formerSubscriptions.append (bothList [b]);
+ formerSubscriptions.append (bothList[b]);
}
}
}
Boolean IndicationService::_inPropertyList (
- const CIMPropertyList & requiredProperties,
- const CIMPropertyList & supportedProperties)
+ const CIMPropertyList& requiredProperties,
+ const CIMPropertyList& supportedProperties)
{
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
"IndicationService::_inPropertyList");
return true;
}
-QueryExpression IndicationService::_getQueryExpression (const String& filterQuery,
- const String& queryLanguage,
- const CIMNamespaceName ns) const
+QueryExpression IndicationService::_getQueryExpression(
+ const String& filterQuery,
+ const String& queryLanguage,
+ const CIMNamespaceName& ns) const
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
- "IndicationService::_getQueryExpression");
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
+ "IndicationService::_getQueryExpression");
- try
- {
- RepositoryQueryContext ctx(ns, _cimRepository);
- QueryExpression queryExpression(queryLanguage, filterQuery, ctx);
- PEG_METHOD_EXIT ();
- return queryExpression;
- }
- catch (QueryParseException & qpe)
- {
- String exceptionStr = qpe.getMessage ();
+ try
+ {
+ RepositoryQueryContext ctx(ns, _cimRepository);
+ QueryExpression queryExpression(queryLanguage, filterQuery, ctx);
+ PEG_METHOD_EXIT();
+ return queryExpression;
+ }
+ catch (QueryParseException& qpe)
+ {
+ String exceptionStr = qpe.getMessage();
- PEG_METHOD_EXIT ();
- throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER, exceptionStr);
- }
- catch (ParseError & pe)
- {
- String exceptionStr = pe.getMessage ();
+ PEG_METHOD_EXIT();
+ throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, exceptionStr);
+ }
+ catch (ParseError& pe)
+ {
+ String exceptionStr = pe.getMessage();
- PEG_METHOD_EXIT ();
- throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER, exceptionStr);
- }
- catch (MissingNullTerminator & mnt)
- {
- String exceptionStr = mnt.getMessage ();
+ PEG_METHOD_EXIT();
+ throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, exceptionStr);
+ }
+ catch (MissingNullTerminator& mnt)
+ {
+ String exceptionStr = mnt.getMessage();
- PEG_METHOD_EXIT ();
- throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER, exceptionStr);
- }
+ PEG_METHOD_EXIT();
+ throw PEGASUS_CIM_EXCEPTION(CIM_ERR_INVALID_PARAMETER, exceptionStr);
+ }
}
CIMName IndicationService::_getIndicationClassName (
- const QueryExpression & queryExpression,
- const CIMNamespaceName & nameSpaceName) const
+ const QueryExpression& queryExpression,
+ const CIMNamespaceName& nameSpaceName) const
{
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
"IndicationService::_getIndicationClassName");
CIMName indicationClassName;
- Array <CIMName> indicationSubclasses;
+ Array<CIMName> indicationSubclasses;
// Get the class paths in the FROM list.
// Note: neither WQL nor CQL support joins, so we can
return indicationClassName;
}
-Array <ProviderClassList> IndicationService::_getIndicationProviders (
- const QueryExpression & queryExpression,
- const CIMNamespaceName & nameSpace,
- const CIMName & indicationClassName,
- const Array <CIMName> & indicationSubclasses) const
+Array<ProviderClassList> IndicationService::_getIndicationProviders (
+ const QueryExpression& queryExpression,
+ const CIMNamespaceName& nameSpace,
+ const CIMName& indicationClassName,
+ const Array<CIMName>& indicationSubclasses) const
{
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
"IndicationService::_getIndicationProviders");
ProviderClassList provider;
- Array <ProviderClassList> indicationProviders;
- Array <CIMInstance> providerInstances;
- Array <CIMInstance> providerModuleInstances;
+ Array<ProviderClassList> indicationProviders;
+ Array<CIMInstance> providerInstances;
+ Array<CIMInstance> providerModuleInstances;
CIMPropertyList requiredPropertyList;
providerModuleInstances.clear ();
if (_providerRegManager->getIndicationProviders
(nameSpace,
- indicationSubclasses [i],
+ indicationSubclasses[i],
requiredPropertyList,
providerInstances,
providerModuleInstances))
PEG_TRACE((TRC_INDICATION_SERVICE, Tracer::LEVEL4,
"%u indication provider(s) found for class %s",
providerInstances.size (),
- (const char *)
+ (const char *)
indicationSubclasses[i].getString ().getCString ()));
//
for (Uint32 k = 0, n = indicationProviders.size ();
k < n && !duplicate; k++)
{
- if ((providerInstances [j].getPath ().identical
- (indicationProviders [k].provider.getPath ())) &&
- (providerModuleInstances [j].getPath ().identical
- (indicationProviders [k].providerModule.getPath ())))
+ if ((providerInstances[j].getPath ().identical
+ (indicationProviders[k].provider.getPath ())) &&
+ (providerModuleInstances[j].getPath ().identical
+ (indicationProviders[k].providerModule.getPath ())))
{
//
// Indication provider is already in list
// Add subclass to provider's class list
//
- indicationProviders [k].classList.append
- (indicationSubclasses [i]);
+ indicationProviders[k].classList.append
+ (indicationSubclasses[i]);
duplicate = true;
}
}
// Current provider is not yet in list
// Create new list entry
//
- provider.provider = providerInstances [j];
- provider.providerModule = providerModuleInstances [j];
- provider.classList.append (indicationSubclasses [i]);
+ provider.provider = providerInstances[j];
+ provider.providerModule = providerModuleInstances[j];
+ provider.classList.append (indicationSubclasses[i]);
#ifdef PEGASUS_ENABLE_REMOTE_CMPI
String remoteInformation;
- Boolean isRemote = _cimRepository->isRemoteNameSpace(nameSpace,remoteInformation);
+ Boolean isRemote = _cimRepository->isRemoteNameSpace(
+ nameSpace, remoteInformation);
provider.isRemoteNameSpace = isRemote;
- provider.remoteInfo = remoteInformation;
+ provider.remoteInfo = remoteInformation;
#endif
- indicationProviders.append (provider);
+ indicationProviders.append(provider);
}
} // for each indication provider instance
} // if any providers
} // for each indication subclass
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
return indicationProviders;
}
-CIMPropertyList IndicationService::_getPropertyList
- (const QueryExpression & queryExpression,
- const CIMNamespaceName & nameSpaceName,
- const CIMName & indicationClassName) const
+CIMPropertyList IndicationService::_getPropertyList(
+ const QueryExpression& queryExpression,
+ const CIMNamespaceName& nameSpaceName,
+ const CIMName& indicationClassName) const
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_getPropertyList");
CIMPropertyList propertyList;
//
try
{
- CIMObjectPath classPath (String::EMPTY,
+ CIMObjectPath classPath(String::EMPTY,
nameSpaceName,
indicationClassName);
- propertyList = queryExpression.getWherePropertyList (classPath);
+ propertyList = queryExpression.getWherePropertyList(classPath);
}
- catch (QueryException & qe)
+ catch (QueryException& qe)
{
// The class path was not the FROM class, or a subclass
// of the FROM class.
- String exceptionStr = qe.getMessage ();
+ String exceptionStr = qe.getMessage();
- PEG_METHOD_EXIT ();
- throw PEGASUS_CIM_EXCEPTION (CIM_ERR_FAILED, exceptionStr);
+ PEG_METHOD_EXIT();
+ throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, exceptionStr);
}
- if (propertyList.isNull ())
+ if (propertyList.isNull())
{
//
// Return null property list for all properties
}
else
{
- Array <CIMName> propertyArray;
+ Array<CIMName> propertyArray;
// Get the property names
//
- propertyArray = propertyList.getPropertyNameArray ();
+ propertyArray = propertyList.getPropertyNameArray();
- Array <CIMName> indicationClassProperties;
+ Array<CIMName> indicationClassProperties;
PEG_METHOD_EXIT();
- return _checkPropertyList (propertyArray, nameSpaceName,
+ return _checkPropertyList(propertyArray, nameSpaceName,
indicationClassName, indicationClassProperties);
}
}
-CIMPropertyList IndicationService::_checkPropertyList
- (const Array <CIMName> & propertyList,
- const CIMNamespaceName & nameSpaceName,
- const CIMName & indicationClassName,
- Array <CIMName> & indicationClassProperties) const
+CIMPropertyList IndicationService::_checkPropertyList(
+ const Array<CIMName>& propertyList,
+ const CIMNamespaceName& nameSpaceName,
+ const CIMName& indicationClassName,
+ Array<CIMName>& indicationClassProperties) const
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_checkPropertyList");
//
// Specify localOnly=false because superclass properties are needed
// Specify includeQualifiers=false because qualifiers are not needed
//
- indicationClass = _subscriptionRepository->getClass
- (nameSpaceName, indicationClassName, false, false, false,
- CIMPropertyList ());
+ indicationClass = _subscriptionRepository->getClass(
+ nameSpaceName, indicationClassName, false, false, false,
+ CIMPropertyList());
Boolean allProperties = true;
- for (Uint32 i = 0; i < indicationClass.getPropertyCount (); i++)
+ for (Uint32 i = 0; i < indicationClass.getPropertyCount(); i++)
{
- indicationClassProperties.append
- (indicationClass.getProperty (i).getName ());
- if (!ContainsCIMName (propertyList,
- indicationClass.getProperty (i).getName ()))
+ indicationClassProperties.append(
+ indicationClass.getProperty(i).getName());
+ if (!ContainsCIMName(propertyList,
+ indicationClass.getProperty(i).getName()))
{
allProperties = false;
}
//
// Return NULL CIMPropertyList
//
- PEG_METHOD_EXIT ();
- return CIMPropertyList ();
+ PEG_METHOD_EXIT();
+ return CIMPropertyList();
}
else
{
- PEG_METHOD_EXIT ();
- return CIMPropertyList (propertyList);
+ PEG_METHOD_EXIT();
+ return CIMPropertyList(propertyList);
}
}
-String IndicationService::_getCondition
- (const String & filterQuery) const
+String IndicationService::_getCondition(
+ const String& filterQuery) const
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_getCondition");
String condition;
//
// Get condition substring from filter query
//
- if (filterQuery.find (_QUERY_WHERE) != PEG_NOT_FOUND)
+ if (filterQuery.find(_QUERY_WHERE) != PEG_NOT_FOUND)
{
- condition = filterQuery.subString (filterQuery.find
- (_QUERY_WHERE) + 6);
+ condition = filterQuery.subString(filterQuery.find(_QUERY_WHERE) + 6);
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
return condition;
}
-void IndicationService::_deleteReferencingSubscriptions (
- const CIMNamespaceName & nameSpace,
- const CIMName & referenceProperty,
- const CIMObjectPath & handler)
+void IndicationService::_deleteReferencingSubscriptions(
+ const CIMNamespaceName& nameSpace,
+ const CIMName& referenceProperty,
+ const CIMObjectPath& handler)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_deleteReferencingSubscriptions");
- Array <CIMInstance> deletedSubscriptions;
+ Array<CIMInstance> deletedSubscriptions;
//
// Delete referencing subscriptions from the repository
//
deletedSubscriptions =
- _subscriptionRepository->deleteReferencingSubscriptions
- (nameSpace, referenceProperty, handler);
+ _subscriptionRepository->deleteReferencingSubscriptions(
+ nameSpace, referenceProperty, handler);
//
// Send delete request to each provider for each deleted subscription
//
- for (Uint32 i = 0; i < deletedSubscriptions.size (); i++)
+ for (Uint32 i = 0; i < deletedSubscriptions.size(); i++)
{
- Array <ProviderClassList> indicationProviders;
- Array <CIMName> indicationSubclasses;
+ Array<ProviderClassList> indicationProviders;
+ Array<CIMName> indicationSubclasses;
CIMNamespaceName sourceNamespaceName;
- indicationProviders = _getDeleteParams (deletedSubscriptions [i],
+ indicationProviders = _getDeleteParams(deletedSubscriptions[i],
indicationSubclasses, sourceNamespaceName);
//
// The Creator from the subscription instance is used for userName,
// and authType is not set
//
- CIMInstance instance = deletedSubscriptions [i];
+ CIMInstance instance = deletedSubscriptions[i];
String creator;
- _getCreator (instance, creator);
+ _getCreator(instance, creator);
// l10n start
AcceptLanguageList acceptLangs;
- Uint32 propIndex = instance.findProperty
- (PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS);
+ Uint32 propIndex = instance.findProperty(
+ PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS);
if (propIndex != PEG_NOT_FOUND)
{
String acceptLangsString;
}
}
ContentLanguageList contentLangs;
- propIndex = instance.findProperty
- (PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS);
+ propIndex = instance.findProperty(
+ PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS);
if (propIndex != PEG_NOT_FOUND)
{
String contentLangsString;
}
// l10n end
-// l10n
- _sendAsyncDeleteRequests (indicationProviders, sourceNamespaceName,
- deletedSubscriptions [i],
+ _sendAsyncDeleteRequests(
+ indicationProviders,
+ sourceNamespaceName,
+ deletedSubscriptions[i],
acceptLangs,
contentLangs,
0, // no request
creator);
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-Boolean IndicationService::_isExpired (
- const CIMInstance & instance) const
+Boolean IndicationService::_isExpired(
+ const CIMInstance& instance) const
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, "IndicationService::_isExpired");
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE, "IndicationService::_isExpired");
Boolean isExpired = true;
Uint64 timeRemaining = 0;
//
// Get time remaining, if subscription has a duration
//
- if (_getTimeRemaining (instance, timeRemaining))
+ if (_getTimeRemaining(instance, timeRemaining))
{
if (timeRemaining > 0)
{
isExpired = false;
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
return isExpired;
}
-void IndicationService::_deleteExpiredSubscription (
- CIMObjectPath & subscription)
+void IndicationService::_deleteExpiredSubscription(
+ CIMObjectPath& subscription)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_deleteExpiredSubscription");
CIMInstance subscriptionInstance;
//
// Delete instance from repository
//
- subscriptionInstance = _subscriptionRepository->deleteSubscription
- (subscription);
+ subscriptionInstance =
+ _subscriptionRepository->deleteSubscription(subscription);
//
// If a valid instance object was returned, the subscription was
// successfully deleted
//
- if (!subscriptionInstance.isUninitialized ())
+ if (!subscriptionInstance.isUninitialized())
{
//
// If subscription was active, send delete requests to providers
//
Uint16 subscriptionState;
CIMValue subscriptionStateValue;
- subscriptionStateValue = subscriptionInstance.getProperty
- (subscriptionInstance.findProperty
- (PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE)).getValue ();
- subscriptionStateValue.get (subscriptionState);
+ subscriptionStateValue = subscriptionInstance.getProperty(
+ subscriptionInstance.findProperty(
+ PEGASUS_PROPERTYNAME_SUBSCRIPTION_STATE)).getValue();
+ subscriptionStateValue.get(subscriptionState);
if ((subscriptionState == STATE_ENABLED) ||
(subscriptionState == STATE_ENABLEDDEGRADED))
{
- Array <ProviderClassList> indicationProviders;
- Array <CIMName> indicationSubclasses;
+ Array<ProviderClassList> indicationProviders;
+ Array<CIMName> indicationSubclasses;
CIMNamespaceName sourceNamespaceName;
- subscriptionInstance.setPath (subscription);
+ subscriptionInstance.setPath(subscription);
- indicationProviders = _getDeleteParams (subscriptionInstance,
+ indicationProviders = _getDeleteParams(subscriptionInstance,
indicationSubclasses, sourceNamespaceName);
//
// and authType is not set
//
String creator;
- _getCreator (subscriptionInstance, creator);
+ _getCreator(subscriptionInstance, creator);
//
// Get the language tags that were saved with the subscription
// instance
//
AcceptLanguageList acceptLangs;
- Uint32 propIndex = subscriptionInstance.findProperty
- (PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS);
+ Uint32 propIndex = subscriptionInstance.findProperty(
+ PEGASUS_PROPERTYNAME_INDSUB_ACCEPTLANGS);
if (propIndex != PEG_NOT_FOUND)
{
String acceptLangsString;
}
}
ContentLanguageList contentLangs;
- propIndex = subscriptionInstance.findProperty
- (PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS);
+ propIndex = subscriptionInstance.findProperty(
+ PEGASUS_PROPERTYNAME_INDSUB_CONTENTLANGS);
if (propIndex != PEG_NOT_FOUND)
{
String contentLangsString;
}
}
-// l10n
- subscriptionInstance.setPath (subscription);
- _sendAsyncDeleteRequests (indicationProviders,
+ subscriptionInstance.setPath(subscription);
+ _sendAsyncDeleteRequests(indicationProviders,
sourceNamespaceName, subscriptionInstance,
acceptLangs,
contentLangs,
//
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-Boolean IndicationService::_getTimeRemaining (
- const CIMInstance & instance,
- Uint64 & timeRemaining) const
+Boolean IndicationService::_getTimeRemaining(
+ const CIMInstance& instance,
+ Uint64& timeRemaining) const
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_getTimeRemaining");
Boolean hasDuration = true;
//
CIMValue startTimeValue;
CIMDateTime startTime;
- Uint32 startTimeIndex = instance.findProperty (_PROPERTY_STARTTIME);
- PEGASUS_ASSERT (startTimeIndex != PEG_NOT_FOUND);
- startTimeValue = instance.getProperty (startTimeIndex).getValue ();
- PEGASUS_ASSERT (!(startTimeValue.isNull ()));
- startTimeValue.get (startTime);
+ Uint32 startTimeIndex = instance.findProperty(_PROPERTY_STARTTIME);
+ PEGASUS_ASSERT(startTimeIndex != PEG_NOT_FOUND);
+ startTimeValue = instance.getProperty(startTimeIndex).getValue();
+ PEGASUS_ASSERT(!(startTimeValue.isNull()));
+ startTimeValue.get(startTime);
//
// Get Subscription Duration
//
- Uint32 durationIndex = instance.findProperty (_PROPERTY_DURATION);
+ Uint32 durationIndex = instance.findProperty(_PROPERTY_DURATION);
if (durationIndex != PEG_NOT_FOUND)
{
CIMValue durationValue;
- durationValue = instance.getProperty (durationIndex).getValue ();
- if (durationValue.isNull ())
+ durationValue = instance.getProperty(durationIndex).getValue();
+ if (durationValue.isNull())
{
hasDuration = false;
}
else
{
Uint64 duration;
- durationValue.get (duration);
+ durationValue.get(duration);
//
// A Start Time set to the _ZERO_INTERVAL_STRING indicates that
// the subscription has not yet been enabled for the first time
// In this case, the time remaining is equal to the Duration
//
- if (startTime.isInterval ())
+ if (startTime.isInterval())
{
- if (startTime.equal (CIMDateTime (_ZERO_INTERVAL_STRING)))
+ if (startTime.equal(CIMDateTime(_ZERO_INTERVAL_STRING)))
{
timeRemaining = (Sint64) duration;
}
//
else
{
- PEGASUS_ASSERT (false);
+ PEGASUS_ASSERT(false);
}
}
Sint64 difference;
try
{
- difference = CIMDateTime::getDifference
- (startTime, currentDateTime);
+ difference = CIMDateTime::getDifference(
+ startTime, currentDateTime);
}
// Check if the date time is out of range.
- catch (const DateTimeOutOfRangeException& )
+ catch (const DateTimeOutOfRangeException&)
{
PEG_METHOD_EXIT();
throw;
}
- PEGASUS_ASSERT (difference >= 0);
+ PEGASUS_ASSERT(difference >= 0);
if (((Sint64) duration - difference) >= 0)
{
timeRemaining = (Sint64) duration - difference;
hasDuration = false;
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
return hasDuration;
}
-void IndicationService::_setTimeRemaining (
- CIMInstance & instance)
+void IndicationService::_setTimeRemaining(
+ CIMInstance& instance)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_setTimeRemaining");
Uint64 timeRemaining = 0;
- if (_getTimeRemaining (instance, timeRemaining))
+ if (_getTimeRemaining(instance, timeRemaining))
{
//
// Add or set the value of the property with the calculated value
//
- if (instance.findProperty (_PROPERTY_TIMEREMAINING) == PEG_NOT_FOUND)
+ if (instance.findProperty(_PROPERTY_TIMEREMAINING) == PEG_NOT_FOUND)
{
- instance.addProperty (CIMProperty
- (_PROPERTY_TIMEREMAINING, timeRemaining));
+ instance.addProperty(
+ CIMProperty(_PROPERTY_TIMEREMAINING, timeRemaining));
}
else
{
- CIMProperty remaining = instance.getProperty
- (instance.findProperty (_PROPERTY_TIMEREMAINING));
- remaining.setValue (CIMValue (timeRemaining));
+ CIMProperty remaining = instance.getProperty(
+ instance.findProperty(_PROPERTY_TIMEREMAINING));
+ remaining.setValue(CIMValue(timeRemaining));
}
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-void IndicationService::_getCreateParams (
- const CIMInstance & subscriptionInstance,
- Array <CIMName> & indicationSubclasses,
- Array <ProviderClassList> & indicationProviders,
- CIMPropertyList & propertyList,
- CIMNamespaceName & sourceNameSpace,
- String & condition,
- String & query,
- String & queryLanguage)
+void IndicationService::_getCreateParams(
+ const CIMInstance& subscriptionInstance,
+ Array<CIMName>& indicationSubclasses,
+ Array<ProviderClassList>& indicationProviders,
+ CIMPropertyList& propertyList,
+ CIMNamespaceName& sourceNameSpace,
+ String& condition,
+ String& query,
+ String& queryLanguage)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_getCreateParams");
CIMName indicationClassName;
//
// Get filter properties
//
- _subscriptionRepository->getFilterProperties (subscriptionInstance, query,
+ _subscriptionRepository->getFilterProperties(subscriptionInstance, query,
sourceNameSpace, queryLanguage, filterName);
//
//
// Get indication class name from filter query (FROM clause)
//
- indicationClassName = _getIndicationClassName (queryExpression,
+ indicationClassName = _getIndicationClassName(queryExpression,
sourceNameSpace);
//
// Get list of subclass names for indication class
//
- indicationSubclasses = _subscriptionRepository->getIndicationSubclasses
- (sourceNameSpace, indicationClassName);
+ indicationSubclasses = _subscriptionRepository->getIndicationSubclasses(
+ sourceNameSpace, indicationClassName);
//
indicationClassName,
indicationSubclasses);
- if (indicationProviders.size () > 0)
+ if (indicationProviders.size() > 0)
{
- condition = _getCondition (query);
+ condition = _getCondition(query);
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-void IndicationService::_getCreateParams (
- const CIMInstance & subscriptionInstance,
- Array <CIMName> & indicationSubclasses,
- CIMPropertyList & propertyList,
- CIMNamespaceName & sourceNameSpace,
- String & condition,
- String & query,
- String & queryLanguage)
+void IndicationService::_getCreateParams(
+ const CIMInstance& subscriptionInstance,
+ Array<CIMName>& indicationSubclasses,
+ CIMPropertyList& propertyList,
+ CIMNamespaceName& sourceNameSpace,
+ String& condition,
+ String& query,
+ String& queryLanguage)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_getCreateParams");
condition = String::EMPTY;
//
// Get filter properties
//
- _subscriptionRepository->getFilterProperties (subscriptionInstance, query,
+ _subscriptionRepository->getFilterProperties(subscriptionInstance, query,
sourceNameSpace, queryLanguage, filterName);
- QueryExpression queryExpression = _getQueryExpression(query,
- queryLanguage,
- sourceNameSpace);
+ QueryExpression queryExpression = _getQueryExpression(
+ query,
+ queryLanguage,
+ sourceNameSpace);
//
// Get indication class name from filter query (FROM clause)
//
- CIMName indicationClassName = _getIndicationClassName (queryExpression,
- sourceNameSpace);
+ CIMName indicationClassName =
+ _getIndicationClassName(queryExpression, sourceNameSpace);
+
//
// Get required property list from filter query (WHERE clause)
//
- propertyList = _getPropertyList (queryExpression,
+ propertyList = _getPropertyList(queryExpression,
sourceNameSpace, indicationClassName);
//
// Get condition from filter query (WHERE clause)
//
- condition = _getCondition (query);
+ condition = _getCondition(query);
//
// Get list of subclass names for indication class
//
- indicationSubclasses = _subscriptionRepository->getIndicationSubclasses
- (sourceNameSpace, indicationClassName);
+ indicationSubclasses = _subscriptionRepository->getIndicationSubclasses(
+ sourceNameSpace, indicationClassName);
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-Array <ProviderClassList> IndicationService::_getDeleteParams (
- const CIMInstance & subscriptionInstance,
- Array <CIMName> & indicationSubclasses,
- CIMNamespaceName & sourceNameSpace)
+Array<ProviderClassList> IndicationService::_getDeleteParams(
+ const CIMInstance& subscriptionInstance,
+ Array<CIMName>& indicationSubclasses,
+ CIMNamespaceName& sourceNameSpace)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_getDeleteParams");
String filterQuery;
String queryLanguage;
String filterName;
CIMName indicationClassName;
- Array <ProviderClassList> indicationProviders;
+ Array<ProviderClassList> indicationProviders;
//
// Get filter properties
//
- _subscriptionRepository->getFilterProperties (subscriptionInstance,
+ _subscriptionRepository->getFilterProperties(subscriptionInstance,
filterQuery, sourceNameSpace, queryLanguage, filterName);
- QueryExpression queryExpression = _getQueryExpression(filterQuery,
- queryLanguage,
- sourceNameSpace);
+ QueryExpression queryExpression =
+ _getQueryExpression(filterQuery, queryLanguage, sourceNameSpace);
//
// Get indication class name from filter query (FROM clause)
//
- indicationClassName = _getIndicationClassName (queryExpression,
- sourceNameSpace);
+ indicationClassName =
+ _getIndicationClassName(queryExpression, sourceNameSpace);
//
// Get list of subclass names for indication class
//
- indicationSubclasses = _subscriptionRepository->getIndicationSubclasses
- (sourceNameSpace, indicationClassName);
+ indicationSubclasses = _subscriptionRepository->getIndicationSubclasses(
+ sourceNameSpace, indicationClassName);
//
// Get indication provider class lists from Active Subscriptions table
//
ActiveSubscriptionsTableEntry tableValue;
- if (_subscriptionTable->getSubscriptionEntry
- (subscriptionInstance.getPath (), tableValue))
+ if (_subscriptionTable->getSubscriptionEntry(
+ subscriptionInstance.getPath(), tableValue))
{
indicationProviders = tableValue.providers;
}
//
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
return indicationProviders;
}
-// l10n
-void IndicationService::_sendAsyncCreateRequests
- (const Array <ProviderClassList> & indicationProviders,
- const CIMNamespaceName & nameSpace,
- const CIMPropertyList & propertyList,
- const String & condition,
- const String & query,
- const String & queryLanguage,
- const CIMInstance & subscription,
- const AcceptLanguageList & acceptLangs,
- const ContentLanguageList & contentLangs,
- const CIMRequestMessage * origRequest,
- const Array <CIMName> & indicationSubclasses,
- const String & userName,
- const String & authType)
+void IndicationService::_sendAsyncCreateRequests(
+ const Array<ProviderClassList>& indicationProviders,
+ const CIMNamespaceName& nameSpace,
+ const CIMPropertyList& propertyList,
+ const String& condition,
+ const String& query,
+ const String& queryLanguage,
+ const CIMInstance& subscription,
+ const AcceptLanguageList& acceptLangs,
+ const ContentLanguageList& contentLangs,
+ const CIMRequestMessage * origRequest,
+ const Array<CIMName>& indicationSubclasses,
+ const String& userName,
+ const String& authType)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_sendAsyncCreateRequests");
CIMValue propValue;
//
// Get repeat notification policy value from subscription instance
//
- propValue = subscription.getProperty
- (subscription.findProperty
- (_PROPERTY_REPEATNOTIFICATIONPOLICY)).getValue ();
- propValue.get (repeatNotificationPolicy);
+ propValue = subscription.getProperty(
+ subscription.findProperty(
+ _PROPERTY_REPEATNOTIFICATIONPOLICY)).getValue();
+ propValue.get(repeatNotificationPolicy);
CIMRequestMessage * aggRequest=0;
//
// Create Instance or Modify Instance
//
- switch (origRequest->getType ())
+ switch (origRequest->getType())
{
case CIM_CREATE_INSTANCE_REQUEST_MESSAGE:
{
CIMCreateInstanceRequestMessage * request =
(CIMCreateInstanceRequestMessage *) origRequest;
CIMCreateInstanceRequestMessage * requestCopy =
- new CIMCreateInstanceRequestMessage (* request);
+ new CIMCreateInstanceRequestMessage(*request);
aggRequest = requestCopy;
break;
}
CIMModifyInstanceRequestMessage * request =
(CIMModifyInstanceRequestMessage *) origRequest;
CIMModifyInstanceRequestMessage * requestCopy =
- new CIMModifyInstanceRequestMessage (* request);
+ new CIMModifyInstanceRequestMessage(*request);
aggRequest = requestCopy;
break;
}
default:
{
- PEG_TRACE_STRING (TRC_INDICATION_SERVICE_INTERNAL,
+ PEG_TRACE_STRING(TRC_INDICATION_SERVICE_INTERNAL,
Tracer::LEVEL2, "Unexpected origRequest type " +
- String (MessageTypeToString (origRequest->getType ())) +
+ String(MessageTypeToString(origRequest->getType())) +
" in _sendAsyncCreateRequests");
- PEGASUS_ASSERT (false);
+ PEGASUS_ASSERT(false);
break;
}
}
// Create an aggregate object for the create subscription requests
//
IndicationOperationAggregate * operationAggregate =
- new IndicationOperationAggregate (aggRequest, indicationSubclasses);
- operationAggregate->setNumberIssued (indicationProviders.size ());
+ new IndicationOperationAggregate(aggRequest, indicationSubclasses);
+ operationAggregate->setNumberIssued(indicationProviders.size());
//
// Send Create request to each provider
//
- for (Uint32 i = 0; i < indicationProviders.size (); i++)
+ for (Uint32 i = 0; i < indicationProviders.size(); i++)
{
//
// Create the create subscription request
//
-// l10n
CIMCreateSubscriptionRequestMessage * request =
- new CIMCreateSubscriptionRequestMessage
- (XmlWriter::getNextMessageId (),
+ new CIMCreateSubscriptionRequestMessage(
+ XmlWriter::getNextMessageId(),
nameSpace,
subscription,
- indicationProviders [i].classList,
+ indicationProviders[i].classList,
propertyList,
repeatNotificationPolicy,
query,
- QueueIdStack (_providerManager, getQueueId ()),
+ QueueIdStack(_providerManager, getQueueId()),
authType,
userName);
// Store a copy of the request in the operation aggregate instance
//
CIMCreateSubscriptionRequestMessage * requestCopy =
- new CIMCreateSubscriptionRequestMessage (* request);
- requestCopy->operationContext.insert(ProviderIdContainer
- (indicationProviders [i].providerModule
- ,indicationProviders [i].provider
+ new CIMCreateSubscriptionRequestMessage(*request);
+ requestCopy->operationContext.insert(ProviderIdContainer(
+ indicationProviders[i].providerModule
+ ,indicationProviders[i].provider
#ifdef PEGASUS_ENABLE_REMOTE_CMPI
- ,indicationProviders [i].isRemoteNameSpace
- ,indicationProviders [i].remoteInfo
+ ,indicationProviders[i].isRemoteNameSpace
+ ,indicationProviders[i].remoteInfo
#endif
));
- operationAggregate->appendRequest (requestCopy);
- request->operationContext.insert(ProviderIdContainer
- (indicationProviders [i].providerModule
- ,indicationProviders [i].provider
+ operationAggregate->appendRequest(requestCopy);
+ request->operationContext.insert(ProviderIdContainer(
+ indicationProviders[i].providerModule
+ ,indicationProviders[i].provider
#ifdef PEGASUS_ENABLE_REMOTE_CMPI
- ,indicationProviders [i].isRemoteNameSpace
- ,indicationProviders [i].remoteInfo
+ ,indicationProviders[i].isRemoteNameSpace
+ ,indicationProviders[i].remoteInfo
#endif
));
- request->operationContext.insert(SubscriptionInstanceContainer
- (subscription));
- request->operationContext.insert(SubscriptionFilterConditionContainer
- (condition,queryLanguage));
- request->operationContext.insert(SubscriptionFilterQueryContainer
- (query,queryLanguage,nameSpace));
+ request->operationContext.insert(
+ SubscriptionInstanceContainer(subscription));
+ request->operationContext.insert(
+ SubscriptionFilterConditionContainer(condition,queryLanguage));
+ request->operationContext.insert(
+ SubscriptionFilterQueryContainer(query,queryLanguage,nameSpace));
request->operationContext.insert(IdentityContainer(userName));
- request->operationContext.set(ContentLanguageListContainer
- (contentLangs));
+ request->operationContext.set(
+ ContentLanguageListContainer(contentLangs));
request->operationContext.set(AcceptLanguageListContainer(acceptLangs));
- AsyncOpNode * op = this->get_op ();
+ AsyncOpNode * op = this->get_op();
AsyncLegacyOperationStart * async_req =
new AsyncLegacyOperationStart(
request,
_queueId);
- SendAsync
- (op,
+ SendAsync(
+ op,
_providerManager,
IndicationService::_aggregationCallBack,
this,
operationAggregate);
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-Array <ProviderClassList> IndicationService::_sendWaitCreateRequests
- (const Array <ProviderClassList> & indicationProviders,
- const CIMNamespaceName & nameSpace,
- const CIMPropertyList & propertyList,
- const String & condition,
- const String & query,
- const String & queryLanguage,
- const CIMInstance & subscription,
- const AcceptLanguageList & acceptLangs,
- const ContentLanguageList & contentLangs,
- const String & userName,
- const String & authType)
+Array<ProviderClassList> IndicationService::_sendWaitCreateRequests(
+ const Array<ProviderClassList>& indicationProviders,
+ const CIMNamespaceName& nameSpace,
+ const CIMPropertyList& propertyList,
+ const String& condition,
+ const String& query,
+ const String& queryLanguage,
+ const CIMInstance& subscription,
+ const AcceptLanguageList& acceptLangs,
+ const ContentLanguageList& contentLangs,
+ const String& userName,
+ const String& authType)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_sendWaitCreateRequests");
CIMValue propValue;
Uint16 repeatNotificationPolicy;
- Array <ProviderClassList> acceptedProviders;
- acceptedProviders.clear ();
+ Array<ProviderClassList> acceptedProviders;
+ acceptedProviders.clear();
// If there are no providers to accept the subscription, just return
if (indicationProviders.size() == 0)
//
// Get repeat notification policy value from subscription instance
//
- propValue = subscription.getProperty
- (subscription.findProperty
- (_PROPERTY_REPEATNOTIFICATIONPOLICY)).getValue ();
- propValue.get (repeatNotificationPolicy);
+ propValue = subscription.getProperty(
+ subscription.findProperty(
+ _PROPERTY_REPEATNOTIFICATIONPOLICY)).getValue();
+ propValue.get(repeatNotificationPolicy);
//
// Send Create request to each provider
//
- for (Uint32 i = 0; i < indicationProviders.size (); i++)
+ for (Uint32 i = 0; i < indicationProviders.size(); i++)
{
//
// Create the create subscription request
//
CIMCreateSubscriptionRequestMessage * request =
- new CIMCreateSubscriptionRequestMessage
- (XmlWriter::getNextMessageId (),
+ new CIMCreateSubscriptionRequestMessage(
+ XmlWriter::getNextMessageId(),
nameSpace,
subscription,
- indicationProviders [i].classList,
+ indicationProviders[i].classList,
propertyList,
repeatNotificationPolicy,
query,
- QueueIdStack (_providerManager, getQueueId ()),
+ QueueIdStack(_providerManager, getQueueId()),
authType,
userName);
//
// Set operation context
//
- request->operationContext.insert(ProviderIdContainer
- (indicationProviders [i].providerModule
- ,indicationProviders [i].provider
+ request->operationContext.insert(ProviderIdContainer(
+ indicationProviders[i].providerModule
+ ,indicationProviders[i].provider
#ifdef PEGASUS_ENABLE_REMOTE_CMPI
- ,indicationProviders [i].isRemoteNameSpace
- ,indicationProviders [i].remoteInfo
+ ,indicationProviders[i].isRemoteNameSpace
+ ,indicationProviders[i].remoteInfo
#endif
));
- request->operationContext.insert(SubscriptionInstanceContainer
- (subscription));
- request->operationContext.insert(SubscriptionFilterConditionContainer
- (condition,queryLanguage));
- request->operationContext.insert(SubscriptionFilterQueryContainer
- (query,queryLanguage,nameSpace));
+ request->operationContext.insert(
+ SubscriptionInstanceContainer(subscription));
+ request->operationContext.insert(
+ SubscriptionFilterConditionContainer(condition,queryLanguage));
+ request->operationContext.insert(
+ SubscriptionFilterQueryContainer(query,queryLanguage,nameSpace));
request->operationContext.insert(IdentityContainer(userName));
- request->operationContext.set(ContentLanguageListContainer
- (contentLangs));
+ request->operationContext.set(
+ ContentLanguageListContainer(contentLangs));
request->operationContext.set(AcceptLanguageListContainer(acceptLangs));
AsyncLegacyOperationStart * asyncRequest =
request,
_queueId);
- AsyncReply * asyncReply = SendWait (asyncRequest);
+ AsyncReply * asyncReply = SendWait(asyncRequest);
CIMCreateSubscriptionResponseMessage * response =
- reinterpret_cast <CIMCreateSubscriptionResponseMessage *>
- ((static_cast <AsyncLegacyOperationResult *>
- (asyncReply))->get_result ());
+ reinterpret_cast<CIMCreateSubscriptionResponseMessage *>(
+ (static_cast<AsyncLegacyOperationResult *>(
+ asyncReply))->get_result());
- if (response->cimException.getCode () == CIM_ERR_SUCCESS)
+ if (response->cimException.getCode() == CIM_ERR_SUCCESS)
{
- acceptedProviders.append (indicationProviders [i]);
+ acceptedProviders.append(indicationProviders[i]);
}
else
{
//
// Provider rejected the subscription
//
- PEG_TRACE_STRING (TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL3,
+ PEG_TRACE_STRING(TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL3,
"Provider (" +
- indicationProviders [i].provider.getPath ().toString () +
+ indicationProviders[i].provider.getPath().toString() +
") rejected create subscription: " +
- response->cimException.getMessage ());
+ response->cimException.getMessage());
}
delete response;
delete asyncReply;
} // for each indication provider
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
return acceptedProviders;
}
-// l10n
-void IndicationService::_sendWaitModifyRequests
- (const Array <ProviderClassList> & indicationProviders,
- const CIMNamespaceName & nameSpace,
- const CIMPropertyList & propertyList,
- const String & condition,
- const String & query,
- const String & queryLanguage,
- const CIMInstance & subscription,
- const AcceptLanguageList & acceptLangs,
- const ContentLanguageList & contentLangs,
- const String & userName,
- const String & authType)
+void IndicationService::_sendWaitModifyRequests(
+ const Array<ProviderClassList>& indicationProviders,
+ const CIMNamespaceName& nameSpace,
+ const CIMPropertyList& propertyList,
+ const String& condition,
+ const String& query,
+ const String& queryLanguage,
+ const CIMInstance& subscription,
+ const AcceptLanguageList& acceptLangs,
+ const ContentLanguageList& contentLangs,
+ const String& userName,
+ const String& authType)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_sendWaitModifyRequests");
CIMValue propValue;
//
// Get repeat notification policy value from subscription instance
//
- propValue = subscription.getProperty
- (subscription.findProperty
- (_PROPERTY_REPEATNOTIFICATIONPOLICY)).getValue ();
- propValue.get (repeatNotificationPolicy);
+ propValue = subscription.getProperty(
+ subscription.findProperty(
+ _PROPERTY_REPEATNOTIFICATIONPOLICY)).getValue();
+ propValue.get(repeatNotificationPolicy);
//
// Send Modify request to each provider
//
- for (Uint32 i = 0; i < indicationProviders.size (); i++)
+ for (Uint32 i = 0; i < indicationProviders.size(); i++)
{
-// l10n
CIMModifySubscriptionRequestMessage * request =
- new CIMModifySubscriptionRequestMessage
- (XmlWriter::getNextMessageId (),
+ new CIMModifySubscriptionRequestMessage(
+ XmlWriter::getNextMessageId(),
nameSpace,
subscription,
- indicationProviders [i].classList,
+ indicationProviders[i].classList,
propertyList,
repeatNotificationPolicy,
query,
- QueueIdStack (_providerManager, getQueueId ()),
+ QueueIdStack(_providerManager, getQueueId()),
authType,
userName);
//
// Set operation context
//
- request->operationContext.insert(ProviderIdContainer
- (indicationProviders [i].providerModule
- ,indicationProviders [i].provider
+ request->operationContext.insert(ProviderIdContainer(
+ indicationProviders[i].providerModule
+ ,indicationProviders[i].provider
#ifdef PEGASUS_ENABLE_REMOTE_CMPI
- ,indicationProviders [i].isRemoteNameSpace
- ,indicationProviders [i].remoteInfo
+ ,indicationProviders[i].isRemoteNameSpace
+ ,indicationProviders[i].remoteInfo
#endif
));
- request->operationContext.insert(SubscriptionInstanceContainer
- (subscription));
- request->operationContext.insert(SubscriptionFilterConditionContainer
- (condition,queryLanguage));
- request->operationContext.insert(SubscriptionFilterQueryContainer
- (query,queryLanguage,nameSpace));
+ request->operationContext.insert(
+ SubscriptionInstanceContainer(subscription));
+ request->operationContext.insert(
+ SubscriptionFilterConditionContainer(condition,queryLanguage));
+ request->operationContext.insert(
+ SubscriptionFilterQueryContainer(query,queryLanguage,nameSpace));
request->operationContext.insert(IdentityContainer(userName));
- request->operationContext.set(ContentLanguageListContainer
- (contentLangs));
+ request->operationContext.set(
+ ContentLanguageListContainer(contentLangs));
request->operationContext.set(AcceptLanguageListContainer(acceptLangs));
AsyncLegacyOperationStart * asyncRequest =
request,
_queueId);
- AsyncReply * asyncReply = SendWait (asyncRequest);
+ AsyncReply * asyncReply = SendWait(asyncRequest);
CIMModifySubscriptionResponseMessage * response =
- reinterpret_cast <CIMModifySubscriptionResponseMessage *>
- ((static_cast <AsyncLegacyOperationResult *>
- (asyncReply))->get_result ());
+ reinterpret_cast<CIMModifySubscriptionResponseMessage *>(
+ (static_cast<AsyncLegacyOperationResult *>(
+ asyncReply))->get_result());
- if (!(response->cimException.getCode () == CIM_ERR_SUCCESS))
+ if (!(response->cimException.getCode() == CIM_ERR_SUCCESS))
{
//
// Provider rejected the subscription
//
- PEG_TRACE_STRING (TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL3,
+ PEG_TRACE_STRING(TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL3,
"Provider (" +
- indicationProviders [i].provider.getPath ().toString () +
+ indicationProviders[i].provider.getPath().toString() +
") rejected modify subscription: " +
- response->cimException.getMessage ());
+ response->cimException.getMessage());
}
delete response;
delete asyncReply;
} // for each indication provider
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-// l10n
-void IndicationService::_sendAsyncDeleteRequests
- (const Array <ProviderClassList> & indicationProviders,
- const CIMNamespaceName & nameSpace,
- const CIMInstance & subscription,
- const AcceptLanguageList & acceptLangs,
- const ContentLanguageList & contentLangs,
- const CIMRequestMessage * origRequest,
- const Array <CIMName> & indicationSubclasses,
- const String & userName,
- const String & authType)
+void IndicationService::_sendAsyncDeleteRequests(
+ const Array<ProviderClassList>& indicationProviders,
+ const CIMNamespaceName& nameSpace,
+ const CIMInstance& subscription,
+ const AcceptLanguageList& acceptLangs,
+ const ContentLanguageList& contentLangs,
+ const CIMRequestMessage * origRequest,
+ const Array<CIMName>& indicationSubclasses,
+ const String& userName,
+ const String& authType)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_sendAsyncDeleteRequests");
// If there are no providers to delete the subscription, just return
//
// Update subscription hash tables
//
- _subscriptionTable->removeSubscription
- (subscription,
+ _subscriptionTable->removeSubscription(
+ subscription,
indicationSubclasses,
nameSpace,
indicationProviders);
//
// Delete Instance or Modify Instance
//
- switch (origRequest->getType ())
+ switch (origRequest->getType())
{
case CIM_DELETE_INSTANCE_REQUEST_MESSAGE:
{
CIMDeleteInstanceRequestMessage * request =
(CIMDeleteInstanceRequestMessage *) origRequest;
CIMDeleteInstanceRequestMessage * requestCopy =
- new CIMDeleteInstanceRequestMessage (* request);
+ new CIMDeleteInstanceRequestMessage(*request);
aggRequest = requestCopy;
break;
}
CIMModifyInstanceRequestMessage * request =
(CIMModifyInstanceRequestMessage *) origRequest;
CIMModifyInstanceRequestMessage * requestCopy =
- new CIMModifyInstanceRequestMessage (* request);
+ new CIMModifyInstanceRequestMessage(*request);
aggRequest = requestCopy;
break;
}
default:
{
- PEG_TRACE_STRING (TRC_INDICATION_SERVICE_INTERNAL,
+ PEG_TRACE_STRING(TRC_INDICATION_SERVICE_INTERNAL,
Tracer::LEVEL2, "Unexpected origRequest type " +
- String (MessageTypeToString (origRequest->getType ())) +
+ String(MessageTypeToString(origRequest->getType())) +
" in _sendAsyncDeleteRequests");
- PEGASUS_ASSERT (false);
+ PEGASUS_ASSERT(false);
break;
}
}
// Create an aggregate object for the delete subscription requests
//
IndicationOperationAggregate * operationAggregate =
- new IndicationOperationAggregate (aggRequest, indicationSubclasses);
- operationAggregate->setNumberIssued (indicationProviders.size ());
+ new IndicationOperationAggregate(aggRequest, indicationSubclasses);
+ operationAggregate->setNumberIssued(indicationProviders.size());
//
// Send Delete request to each provider
//
- for (Uint32 i = 0; i < indicationProviders.size (); i++)
+ for (Uint32 i = 0; i < indicationProviders.size(); i++)
{
-// l10n
CIMDeleteSubscriptionRequestMessage * request =
- new CIMDeleteSubscriptionRequestMessage
- (XmlWriter::getNextMessageId (),
+ new CIMDeleteSubscriptionRequestMessage(
+ XmlWriter::getNextMessageId(),
nameSpace,
subscription,
- indicationProviders [i].classList,
- QueueIdStack (_providerManager, getQueueId ()),
+ indicationProviders[i].classList,
+ QueueIdStack(_providerManager, getQueueId()),
authType,
userName);
// Store a copy of the request in the operation aggregate instance
//
CIMDeleteSubscriptionRequestMessage * requestCopy =
- new CIMDeleteSubscriptionRequestMessage (* request);
- requestCopy->operationContext.insert(ProviderIdContainer
- (indicationProviders [i].providerModule
- ,indicationProviders [i].provider
+ new CIMDeleteSubscriptionRequestMessage(*request);
+ requestCopy->operationContext.insert(ProviderIdContainer(
+ indicationProviders[i].providerModule
+ ,indicationProviders[i].provider
#ifdef PEGASUS_ENABLE_REMOTE_CMPI
- ,indicationProviders [i].isRemoteNameSpace
- ,indicationProviders [i].remoteInfo
+ ,indicationProviders[i].isRemoteNameSpace
+ ,indicationProviders[i].remoteInfo
#endif
));
- operationAggregate->appendRequest (requestCopy);
- request->operationContext.insert(ProviderIdContainer
- (indicationProviders [i].providerModule
- ,indicationProviders [i].provider
+ operationAggregate->appendRequest(requestCopy);
+ request->operationContext.insert(ProviderIdContainer(
+ indicationProviders[i].providerModule
+ ,indicationProviders[i].provider
#ifdef PEGASUS_ENABLE_REMOTE_CMPI
- ,indicationProviders [i].isRemoteNameSpace
- ,indicationProviders [i].remoteInfo
+ ,indicationProviders[i].isRemoteNameSpace
+ ,indicationProviders[i].remoteInfo
#endif
));
- request->operationContext.insert(SubscriptionInstanceContainer
- (subscription));
+ request->operationContext.insert(
+ SubscriptionInstanceContainer(subscription));
request->operationContext.insert(IdentityContainer(userName));
- request->operationContext.set(ContentLanguageListContainer
- (contentLangs));
+ request->operationContext.set(
+ ContentLanguageListContainer(contentLangs));
request->operationContext.set(AcceptLanguageListContainer(acceptLangs));
- AsyncOpNode * op = this->get_op ();
+ AsyncOpNode * op = this->get_op();
AsyncLegacyOperationStart * async_req =
new AsyncLegacyOperationStart(
request,
_queueId);
- SendAsync
- (op,
+ SendAsync(
+ op,
_providerManager,
IndicationService::_aggregationCallBack,
this,
operationAggregate);
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-void IndicationService::_sendWaitDeleteRequests
- (const Array <ProviderClassList> & indicationProviders,
- const CIMNamespaceName & nameSpace,
- const CIMInstance & subscription,
- const AcceptLanguageList & acceptLangs,
- const ContentLanguageList & contentLangs,
- const String & userName,
- const String & authType)
+void IndicationService::_sendWaitDeleteRequests(
+ const Array<ProviderClassList>& indicationProviders,
+ const CIMNamespaceName& nameSpace,
+ const CIMInstance& subscription,
+ const AcceptLanguageList& acceptLangs,
+ const ContentLanguageList& contentLangs,
+ const String& userName,
+ const String& authType)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_sendWaitDeleteRequests");
// If there are no providers to delete the subscription, just return
//
// Send Delete request to each provider
//
- for (Uint32 i = 0; i < indicationProviders.size (); i++)
+ for (Uint32 i = 0; i < indicationProviders.size(); i++)
{
CIMDeleteSubscriptionRequestMessage * request =
- new CIMDeleteSubscriptionRequestMessage
- (XmlWriter::getNextMessageId (),
+ new CIMDeleteSubscriptionRequestMessage(
+ XmlWriter::getNextMessageId(),
nameSpace,
subscription,
- indicationProviders [i].classList,
- QueueIdStack (_providerManager, getQueueId ()),
+ indicationProviders[i].classList,
+ QueueIdStack(_providerManager, getQueueId()),
authType,
userName);
//
// Set operation context
//
- request->operationContext.insert(ProviderIdContainer
- (indicationProviders [i].providerModule
- ,indicationProviders [i].provider
+ request->operationContext.insert(ProviderIdContainer(
+ indicationProviders[i].providerModule
+ ,indicationProviders[i].provider
#ifdef PEGASUS_ENABLE_REMOTE_CMPI
- ,indicationProviders [i].isRemoteNameSpace
- ,indicationProviders [i].remoteInfo
+ ,indicationProviders[i].isRemoteNameSpace
+ ,indicationProviders[i].remoteInfo
#endif
));
- request->operationContext.insert(SubscriptionInstanceContainer
- (subscription));
+ request->operationContext.insert(
+ SubscriptionInstanceContainer(subscription));
request->operationContext.insert(IdentityContainer(userName));
- request->operationContext.set(ContentLanguageListContainer
- (contentLangs));
+ request->operationContext.set(
+ ContentLanguageListContainer(contentLangs));
request->operationContext.set(AcceptLanguageListContainer(acceptLangs));
AsyncLegacyOperationStart * asyncRequest =
request,
_queueId);
- AsyncReply * asyncReply = SendWait (asyncRequest);
+ AsyncReply * asyncReply = SendWait(asyncRequest);
CIMDeleteSubscriptionResponseMessage * response =
- reinterpret_cast <CIMDeleteSubscriptionResponseMessage *>
- ((static_cast <AsyncLegacyOperationResult *>
- (asyncReply))->get_result ());
+ reinterpret_cast<CIMDeleteSubscriptionResponseMessage *>(
+ (static_cast<AsyncLegacyOperationResult *>(
+ asyncReply))->get_result());
- if (!(response->cimException.getCode () == CIM_ERR_SUCCESS))
+ if (!(response->cimException.getCode() == CIM_ERR_SUCCESS))
{
//
// Provider rejected the subscription
//
- PEG_TRACE_STRING (TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL3,
+ PEG_TRACE_STRING(TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL3,
"Provider (" +
- indicationProviders [i].provider.getPath ().toString () +
+ indicationProviders[i].provider.getPath().toString() +
") rejected delete subscription: " +
- response->cimException.getMessage ());
+ response->cimException.getMessage());
}
delete response;
delete asyncReply;
} // for each indication provider
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-void IndicationService::_aggregationCallBack (
+void IndicationService::_aggregationCallBack(
AsyncOpNode * op,
MessageQueue * q,
void * userParameter)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_aggregationCallBack");
- IndicationService * service = static_cast <IndicationService *> (q);
+ IndicationService * service = static_cast<IndicationService *>(q);
AsyncRequest * asyncRequest =
static_cast<AsyncRequest *>(op->removeRequest());
AsyncReply * asyncReply = static_cast<AsyncReply *>(op->removeResponse());
IndicationOperationAggregate * operationAggregate =
- reinterpret_cast <IndicationOperationAggregate *> (userParameter);
- PEGASUS_ASSERT (operationAggregate != 0);
+ reinterpret_cast<IndicationOperationAggregate *>(userParameter);
+ PEGASUS_ASSERT(operationAggregate != 0);
CIMResponseMessage * response = 0;
- Uint32 msgType = asyncReply->getType ();
- PEGASUS_ASSERT ((msgType == async_messages::ASYNC_LEGACY_OP_RESULT) ||
- (msgType == async_messages::ASYNC_MODULE_OP_RESULT));
+ Uint32 msgType = asyncReply->getType();
+ PEGASUS_ASSERT((msgType == async_messages::ASYNC_LEGACY_OP_RESULT) ||
+ (msgType == async_messages::ASYNC_MODULE_OP_RESULT));
if (msgType == async_messages::ASYNC_LEGACY_OP_RESULT)
{
- response = reinterpret_cast <CIMResponseMessage *>
- ((static_cast <AsyncLegacyOperationResult *>
- (asyncReply))->get_result ());
+ response = reinterpret_cast<CIMResponseMessage *>(
+ (static_cast<AsyncLegacyOperationResult *>(
+ asyncReply))->get_result());
}
else if (msgType == async_messages::ASYNC_MODULE_OP_RESULT)
{
- response = reinterpret_cast <CIMResponseMessage *>
- ((static_cast <AsyncModuleOperationResult *>
- (asyncReply))->get_result ());
+ response = reinterpret_cast<CIMResponseMessage *>(
+ (static_cast<AsyncModuleOperationResult *>(
+ asyncReply))->get_result());
}
- PEGASUS_ASSERT (response != 0);
+ PEGASUS_ASSERT(response != 0);
delete asyncRequest;
delete asyncReply;
- op->release ();
- service->return_op (op);
+ op->release();
+ service->return_op(op);
- Boolean isDoneAggregation = operationAggregate->appendResponse (response);
+ Boolean isDoneAggregation = operationAggregate->appendResponse(response);
if (isDoneAggregation)
{
- service->_handleOperationResponseAggregation (operationAggregate);
+ service->_handleOperationResponseAggregation(operationAggregate);
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-void IndicationService::_handleOperationResponseAggregation (
+void IndicationService::_handleOperationResponseAggregation(
IndicationOperationAggregate * operationAggregate)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_handleOperationResponseAggregation");
- switch (operationAggregate->getRequest (0)->getType ())
+ switch (operationAggregate->getRequest(0)->getType())
{
case CIM_CREATE_SUBSCRIPTION_REQUEST_MESSAGE:
{
- _handleCreateResponseAggregation (operationAggregate);
+ _handleCreateResponseAggregation(operationAggregate);
break;
}
case CIM_DELETE_SUBSCRIPTION_REQUEST_MESSAGE:
{
- _handleDeleteResponseAggregation (operationAggregate);
+ _handleDeleteResponseAggregation(operationAggregate);
break;
}
default:
{
- PEG_TRACE_STRING (TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL2,
- "Unexpected request type " + String (MessageTypeToString
- (operationAggregate->getRequest (0)->getType ())) +
+ PEG_TRACE_STRING(TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL2,
+ "Unexpected request type " + String(MessageTypeToString(
+ operationAggregate->getRequest(0)->getType())) +
" in _handleOperationResponseAggregation");
- PEGASUS_ASSERT (false);
+ PEGASUS_ASSERT(false);
break;
}
}
//
delete operationAggregate;
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-void IndicationService::_handleCreateResponseAggregation (
+void IndicationService::_handleCreateResponseAggregation(
IndicationOperationAggregate * operationAggregate)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_handleCreateResponseAggregation");
- Array <ProviderClassList> acceptedProviders;
+ Array<ProviderClassList> acceptedProviders;
CIMObjectPath instanceRef;
CIMException cimException;
//
// Examine provider responses
//
- acceptedProviders.clear ();
- for (Uint32 i = 0; i < operationAggregate->getNumberResponses (); i++)
+ acceptedProviders.clear();
+ for (Uint32 i = 0; i < operationAggregate->getNumberResponses(); i++)
{
//
// Find provider from which response was sent
//
- CIMResponseMessage * response = operationAggregate->getResponse (i);
- ProviderClassList provider = operationAggregate->findProvider
- (response->messageId);
- if (response->cimException.getCode () == CIM_ERR_SUCCESS)
+ CIMResponseMessage * response = operationAggregate->getResponse(i);
+ ProviderClassList provider = operationAggregate->findProvider(
+ response->messageId);
+ if (response->cimException.getCode() == CIM_ERR_SUCCESS)
{
//
// If response is SUCCESS, provider accepted the subscription
// Add provider to list of providers that accepted subscription
//
- acceptedProviders.append (provider);
+ acceptedProviders.append(provider);
}
else
{
- PEG_TRACE_STRING (TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL3,
+ PEG_TRACE_STRING(TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL3,
"Provider (" + provider.provider.getPath().toString() +
") rejected create subscription: " +
- response->cimException.getMessage ());
+ response->cimException.getMessage());
}
}
CIMCreateSubscriptionRequestMessage * request =
(CIMCreateSubscriptionRequestMessage *)
- operationAggregate->getRequest (0);
- if (acceptedProviders.size () == 0)
+ operationAggregate->getRequest(0);
+ if (acceptedProviders.size() == 0)
{
//
// No providers accepted this subscription
//
- if (operationAggregate->requiresResponse ())
+ if (operationAggregate->requiresResponse())
{
//
// For Create Instance or Modify Instance request, set CIM
// exception for response
//
// l10n
- cimException = PEGASUS_CIM_EXCEPTION_L (CIM_ERR_NOT_SUPPORTED,
- MessageLoaderParms (_MSG_NOT_ACCEPTED_KEY, _MSG_NOT_ACCEPTED));
+ cimException = PEGASUS_CIM_EXCEPTION_L(CIM_ERR_NOT_SUPPORTED,
+ MessageLoaderParms(_MSG_NOT_ACCEPTED_KEY, _MSG_NOT_ACCEPTED));
}
}
//
// At least one provider accepted the subscription
//
- if (operationAggregate->getOrigType () ==
+ if (operationAggregate->getOrigType() ==
CIM_CREATE_INSTANCE_REQUEST_MESSAGE)
{
//
//
CIMCreateInstanceRequestMessage * origRequest =
(CIMCreateInstanceRequestMessage *)
- operationAggregate->getOrigRequest ();
+ operationAggregate->getOrigRequest();
CIMInstance instance = request->subscriptionInstance;
try
{
- instanceRef = _subscriptionRepository->createInstance
- (request->subscriptionInstance, origRequest->nameSpace,
+ instanceRef = _subscriptionRepository->createInstance(
+ request->subscriptionInstance, origRequest->nameSpace,
((IdentityContainer)origRequest->operationContext.get
(IdentityContainer::NAME)).getUserName(),
((AcceptLanguageListContainer)request->operationContext.get
((ContentLanguageListContainer)request->operationContext.get
(ContentLanguageListContainer::NAME)).getLanguages(),
true);
- instanceRef.setNameSpace
- (request->subscriptionInstance.getPath().getNameSpace());
- instance.setPath (instanceRef);
+ instanceRef.setNameSpace(
+ request->subscriptionInstance.getPath().getNameSpace());
+ instance.setPath(instanceRef);
}
- catch (CIMException & exception)
+ catch (CIMException& exception)
{
cimException = exception;
}
- catch (Exception & exception)
+ catch (Exception& exception)
{
- cimException = PEGASUS_CIM_EXCEPTION
- (CIM_ERR_FAILED, exception.getMessage ());
+ cimException = PEGASUS_CIM_EXCEPTION(
+ CIM_ERR_FAILED, exception.getMessage());
}
- if (cimException.getCode () == CIM_ERR_SUCCESS)
+ if (cimException.getCode() == CIM_ERR_SUCCESS)
{
//
// Insert entries into the subscription hash tables
//
- _subscriptionTable->insertSubscription
- (instance,
+ _subscriptionTable->insertSubscription(
+ instance,
acceptedProviders,
- operationAggregate->getIndicationSubclasses (),
+ operationAggregate->getIndicationSubclasses(),
request->nameSpace);
}
}
else // CIM_MODIFY_INSTANCE_REQUEST_MESSAGE
{
- PEGASUS_ASSERT (operationAggregate->getOrigType () ==
+ PEGASUS_ASSERT(operationAggregate->getOrigType() ==
CIM_MODIFY_INSTANCE_REQUEST_MESSAGE);
//
// Insert entries into the subscription hash tables
//
- _subscriptionTable->insertSubscription
- (request->subscriptionInstance,
+ _subscriptionTable->insertSubscription(
+ request->subscriptionInstance,
acceptedProviders,
- operationAggregate->getIndicationSubclasses (),
+ operationAggregate->getIndicationSubclasses(),
request->nameSpace);
}
}
//
// For Create Instance or Modify Instance request, send response
//
- if (operationAggregate->requiresResponse ())
+ if (operationAggregate->requiresResponse())
{
- if (operationAggregate->getOrigType () ==
+ if (operationAggregate->getOrigType() ==
CIM_CREATE_INSTANCE_REQUEST_MESSAGE)
{
// Note: don't need to set Content-language in the response
PEGASUS_ASSERT(response != 0);
response->cimException = cimException;
response->instanceName = instanceRef;
- _enqueueResponse (operationAggregate->getOrigRequest (), response);
+ _enqueueResponse(operationAggregate->getOrigRequest(), response);
}
else // CIM_MODIFY_INSTANCE_REQUEST_MESSAGE
{
- PEGASUS_ASSERT (operationAggregate->getOrigType () ==
- CIM_MODIFY_INSTANCE_REQUEST_MESSAGE);
+ PEGASUS_ASSERT(operationAggregate->getOrigType () ==
+ CIM_MODIFY_INSTANCE_REQUEST_MESSAGE);
// l10n
// Note: don't need to set Content-language in the response
//
CIMResponseMessage * response =
- operationAggregate->getOrigRequest ()->buildResponse ();
+ operationAggregate->getOrigRequest()->buildResponse();
response->cimException = cimException;
- _enqueueResponse (operationAggregate->getOrigRequest (), response);
+ _enqueueResponse(operationAggregate->getOrigRequest(), response);
}
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-void IndicationService::_handleDeleteResponseAggregation (
+void IndicationService::_handleDeleteResponseAggregation(
IndicationOperationAggregate * operationAggregate)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_handleDeleteResponseAggregation");
CIMException cimException;
- Array <ProviderClassList> checkProviders;
+ Array<ProviderClassList> checkProviders;
//
// Examine provider responses
//
- for (Uint32 i = 0; i < operationAggregate->getNumberResponses (); i++)
+ for (Uint32 i = 0; i < operationAggregate->getNumberResponses(); i++)
{
//
// Find provider from which response was sent and add to list
//
- CIMResponseMessage * response = operationAggregate->getResponse (i);
- ProviderClassList provider = operationAggregate->findProvider
- (response->messageId);
- checkProviders.append (provider);
+ CIMResponseMessage * response = operationAggregate->getResponse(i);
+ ProviderClassList provider = operationAggregate->findProvider(
+ response->messageId);
+ checkProviders.append(provider);
//
// If response is not SUCCESS, provider rejected the delete
//
- if (response->cimException.getCode () != CIM_ERR_SUCCESS)
+ if (response->cimException.getCode() != CIM_ERR_SUCCESS)
{
//
// Log a trace message
//
- PEG_TRACE_STRING (TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL3,
- "Provider (" + provider.provider.getPath ().toString() +
+ PEG_TRACE_STRING(TRC_INDICATION_SERVICE_INTERNAL, Tracer::LEVEL3,
+ "Provider (" + provider.provider.getPath().toString() +
") rejected delete subscription: " +
- response->cimException.getMessage ());
+ response->cimException.getMessage());
}
}
//
// For Delete Instance or Modify Instance request, send response
//
- if (operationAggregate->requiresResponse ())
+ if (operationAggregate->requiresResponse())
{
CIMResponseMessage * response;
- if (operationAggregate->getOrigType () ==
+ if (operationAggregate->getOrigType() ==
CIM_DELETE_INSTANCE_REQUEST_MESSAGE)
{
// l10n
// Note: don't need to set Content-language in the response
- response = operationAggregate->getOrigRequest ()->buildResponse ();
+ response = operationAggregate->getOrigRequest()->buildResponse();
response->cimException = cimException;
}
else // CIM_MODIFY_INSTANCE_REQUEST_MESSAGE
{
- PEGASUS_ASSERT (operationAggregate->getOrigType () ==
- CIM_MODIFY_INSTANCE_REQUEST_MESSAGE);
+ PEGASUS_ASSERT(operationAggregate->getOrigType() ==
+ CIM_MODIFY_INSTANCE_REQUEST_MESSAGE);
// l10n
// Note: don't need to set Content-language in the response
- response = operationAggregate->getOrigRequest ()->buildResponse ();
+ response = operationAggregate->getOrigRequest()->buildResponse();
response->cimException = cimException;
}
- _enqueueResponse (operationAggregate->getOrigRequest (), response);
+ _enqueueResponse(operationAggregate->getOrigRequest(), response);
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-CIMInstance IndicationService::_createAlertInstance (
- const CIMName & alertClassName,
- const Array <CIMInstance> & subscriptions)
+CIMInstance IndicationService::_createAlertInstance(
+ const CIMName& alertClassName,
+ const Array<CIMInstance>& subscriptions)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_createAlertInstance");
- CIMInstance indicationInstance (alertClassName);
+ CIMInstance indicationInstance(alertClassName);
//
// Add property values for all required properties of CIM_AlertIndication
//
- indicationInstance.addProperty
- (CIMProperty (_PROPERTY_ALERTTYPE, CIMValue ((Uint16) _TYPE_OTHER)));
+ indicationInstance.addProperty(
+ CIMProperty(_PROPERTY_ALERTTYPE, CIMValue((Uint16) _TYPE_OTHER)));
//
// ATTN: what should Other Alert Type value be??
// Currently using Alert class name
//
- indicationInstance.addProperty
- (CIMProperty (_PROPERTY_OTHERALERTTYPE, alertClassName.getString()));
+ indicationInstance.addProperty(
+ CIMProperty(_PROPERTY_OTHERALERTTYPE, alertClassName.getString()));
- indicationInstance.addProperty
- (CIMProperty (_PROPERTY_PERCEIVEDSEVERITY,
- CIMValue ((Uint16) _SEVERITY_WARNING)));
+ indicationInstance.addProperty(
+ CIMProperty(_PROPERTY_PERCEIVEDSEVERITY,
+ CIMValue((Uint16) _SEVERITY_WARNING)));
//
// ATTN: what should Probable Cause value be??
// Currently using Unknown
//
- indicationInstance.addProperty
- (CIMProperty (_PROPERTY_PROBABLECAUSE,
- CIMValue ((Uint16) _CAUSE_UNKNOWN)));
+ indicationInstance.addProperty(
+ CIMProperty(_PROPERTY_PROBABLECAUSE,
+ CIMValue((Uint16) _CAUSE_UNKNOWN)));
//
// Add properties specific to each alert class
// one of the properties will be a list of affected subscriptions
// It is for that reason that subscriptions is passed in as a parameter
//
- if (alertClassName.equal (_CLASS_CIMOM_SHUTDOWN_ALERT))
+ if (alertClassName.equal(_CLASS_CIMOM_SHUTDOWN_ALERT))
{
}
- else if (alertClassName.equal (_CLASS_NO_PROVIDER_ALERT))
+ else if (alertClassName.equal(_CLASS_NO_PROVIDER_ALERT))
{
}
- else if (alertClassName.equal (_CLASS_PROVIDER_TERMINATED_ALERT))
+ else if (alertClassName.equal(_CLASS_PROVIDER_TERMINATED_ALERT))
{
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
return indicationInstance;
}
MessageQueue *q,
void *parm)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_sendAlertsCallBack");
IndicationService *service =
AsyncRequest *asyncRequest = static_cast<AsyncRequest *>(op->get_request());
AsyncReply *asyncReply = static_cast<AsyncReply *>(op->get_response());
- CIMRequestMessage *request = reinterpret_cast<CIMRequestMessage *>
- ((static_cast<AsyncLegacyOperationStart *>(asyncRequest))->get_action());
+ CIMRequestMessage *request = reinterpret_cast<CIMRequestMessage *>(
+ (static_cast<AsyncLegacyOperationStart *>(asyncRequest))->get_action());
CIMHandleIndicationResponseMessage* response =
- reinterpret_cast<CIMHandleIndicationResponseMessage *>
- ((static_cast<AsyncLegacyOperationResult *>
- (asyncReply))->get_result());
+ reinterpret_cast<CIMHandleIndicationResponseMessage *>(
+ (static_cast<AsyncLegacyOperationResult *>(
+ asyncReply))->get_result());
PEGASUS_ASSERT(response != 0);
if (response->cimException.getCode() == CIM_ERR_SUCCESS)
// again
//
-// << Mon Jul 15 09:59:16 2002 mdd >> handler is allocated as an element in an array,
-// don't delete here.
+// << Mon Jul 15 09:59:16 2002 mdd >> handler is allocated as an element in
+// an array, don't delete here.
// delete _handler;
delete request;
delete response;
op->release();
service->return_op(op);
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-void IndicationService::_sendAlerts (
- const Array <CIMInstance> & subscriptions,
- /* const */ CIMInstance & alertInstance)
+void IndicationService::_sendAlerts(
+ const Array<CIMInstance>& subscriptions,
+ /* const */ CIMInstance& alertInstance)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, "IndicationService::_sendAlerts");
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE, "IndicationService::_sendAlerts");
CIMInstance current;
- PEG_TRACE_STRING (TRC_INDICATION_SERVICE, Tracer::LEVEL4,
+ PEG_TRACE_STRING(TRC_INDICATION_SERVICE, Tracer::LEVEL4,
"Sending alert: " + alertInstance.getClassName().getString());
//
// Get list of unique handler instances for all subscriptions in list
//
- for (Uint32 i = 0; i < subscriptions.size (); i++)
+ for (Uint32 i = 0; i < subscriptions.size(); i++)
{
- PEG_TRACE_STRING (TRC_INDICATION_SERVICE, Tracer::LEVEL4,
- "Alert subscription: " + subscriptions [i].getPath().toString());
+ PEG_TRACE_STRING(TRC_INDICATION_SERVICE, Tracer::LEVEL4,
+ "Alert subscription: " + subscriptions[i].getPath().toString());
//
// Get handler instance
//
- current = _subscriptionRepository->getHandler (subscriptions [i]);
+ current = _subscriptionRepository->getHandler(subscriptions[i]);
// ATTN: For the handlers which do not need subscription instance
// need to check duplicate alter
// Send handle indication request to the handler
//
CIMHandleIndicationRequestMessage * handler_request =
- new CIMHandleIndicationRequestMessage (
- XmlWriter::getNextMessageId (),
- current.getPath ().getNameSpace (),
+ new CIMHandleIndicationRequestMessage(
+ XmlWriter::getNextMessageId(),
+ current.getPath().getNameSpace(),
current,
- subscriptions [i],
+ subscriptions[i],
alertInstance,
- QueueIdStack (_handlerService, getQueueId ()));
+ QueueIdStack(_handlerService, getQueueId()));
AsyncOpNode* op = this->get_op();
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
#endif
-void IndicationService::_sendSubscriptionInitComplete ()
+void IndicationService::_sendSubscriptionInitComplete()
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_sendSubscriptionInitComplete");
//
// Create the Subscription Init Complete request
//
CIMSubscriptionInitCompleteRequestMessage * request =
- new CIMSubscriptionInitCompleteRequestMessage
- (XmlWriter::getNextMessageId (),
- QueueIdStack (_providerManager, getQueueId ()));
+ new CIMSubscriptionInitCompleteRequestMessage(
+ XmlWriter::getNextMessageId(),
+ QueueIdStack(_providerManager, getQueueId()));
//
// Send Subscription Initialization Complete request to provider manager
request,
_queueId);
- AutoPtr<AsyncReply> asyncReply (SendWait (asyncRequest));
+ AutoPtr<AsyncReply> asyncReply(SendWait(asyncRequest));
//
// Note: the response does not contain interesting data
//
delete asyncRequest;
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-Boolean IndicationService::_getCreator (
- const CIMInstance & instance,
- String & creator) const
+Boolean IndicationService::_getCreator(
+ const CIMInstance& instance,
+ String& creator) const
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, "IndicationService::_getCreator");
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE, "IndicationService::_getCreator");
- Uint32 creatorIndex = instance.findProperty
- (PEGASUS_PROPERTYNAME_INDSUB_CREATOR);
+ Uint32 creatorIndex = instance.findProperty(
+ PEGASUS_PROPERTYNAME_INDSUB_CREATOR);
if (creatorIndex != PEG_NOT_FOUND)
{
- CIMValue creatorValue = instance.getProperty
- (creatorIndex).getValue ();
- if (creatorValue.isNull ())
+ CIMValue creatorValue = instance.getProperty(creatorIndex).getValue();
+ if (creatorValue.isNull())
{
- PEG_TRACE_CSTRING (TRC_INDICATION_SERVICE_INTERNAL,
+ PEG_TRACE_CSTRING(TRC_INDICATION_SERVICE_INTERNAL,
Tracer::LEVEL2,
"Null Subscription Creator property value");
PEG_METHOD_EXIT();
return false;
}
- else if ((creatorValue.getType () != CIMTYPE_STRING) ||
- (creatorValue.isArray ()))
+ else if ((creatorValue.getType() != CIMTYPE_STRING) ||
+ (creatorValue.isArray()))
{
String traceString;
- if (creatorValue.isArray ())
+ if (creatorValue.isArray())
{
- traceString.append ("array of ");
+ traceString.append("array of ");
}
- traceString.append (cimTypeToString (creatorValue.getType ()));
- PEG_TRACE_STRING (TRC_INDICATION_SERVICE_INTERNAL,
+ traceString.append(cimTypeToString(creatorValue.getType()));
+ PEG_TRACE_STRING(TRC_INDICATION_SERVICE_INTERNAL,
Tracer::LEVEL2,
"Subscription Creator property value of incorrect type: "
+ traceString);
}
else
{
- creatorValue.get (creator);
+ creatorValue.get(creator);
}
}
else
{
- PEG_TRACE_CSTRING (TRC_INDICATION_SERVICE_INTERNAL,
+ PEG_TRACE_CSTRING(TRC_INDICATION_SERVICE_INTERNAL,
Tracer::LEVEL2,
"Missing Subscription Creator property");
return false;
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
return true;
}
-Boolean IndicationService::_validateState (
+Boolean IndicationService::_validateState(
const Uint16 state) const
{
//
// Validate the value
//
- if (!Contains (_validStates, state))
+ if (!Contains(_validStates, state))
{
//
// This is a corrupted/invalid instance
return true;
}
-void IndicationService::_updatePropertyList
- (CIMName & className,
- CIMPropertyList & propertyList,
- Boolean & setTimeRemaining,
- Boolean & startTimeAdded,
- Boolean & durationAdded)
+void IndicationService::_updatePropertyList(
+ CIMName& className,
+ CIMPropertyList& propertyList,
+ Boolean& setTimeRemaining,
+ Boolean& startTimeAdded,
+ Boolean& durationAdded)
{
- PEG_METHOD_ENTER ( TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER( TRC_INDICATION_SERVICE,
"IndicationService::_updatePropertyList");
//
// A null propertyList means all properties
// If the class is Subscription, that includes the Time Remaining property
//
- if (className.equal (PEGASUS_CLASSNAME_INDSUBSCRIPTION) ||
- className.equal (PEGASUS_CLASSNAME_FORMATTEDINDSUBSCRIPTION))
+ if (className.equal(PEGASUS_CLASSNAME_INDSUBSCRIPTION) ||
+ className.equal(PEGASUS_CLASSNAME_FORMATTEDINDSUBSCRIPTION))
{
setTimeRemaining = true;
}
}
startTimeAdded = false;
durationAdded = false;
- if (!propertyList.isNull ())
+ if (!propertyList.isNull())
{
setTimeRemaining = false;
- Array <CIMName> properties = propertyList.getPropertyNameArray ();
+ Array<CIMName> properties = propertyList.getPropertyNameArray();
//
// Add Creator to property list
//
- if (!ContainsCIMName (properties,
+ if (!ContainsCIMName(properties,
PEGASUS_PROPERTYNAME_INDSUB_CREATOR))
{
- properties.append (PEGASUS_PROPERTYNAME_INDSUB_CREATOR);
+ properties.append(PEGASUS_PROPERTYNAME_INDSUB_CREATOR);
}
//
// If a Subscription and Time Remaining is requested,
// Ensure Subscription Duration and Start Time are in property list
//
- if (className.equal (PEGASUS_CLASSNAME_INDSUBSCRIPTION) ||
- className.equal (PEGASUS_CLASSNAME_FORMATTEDINDSUBSCRIPTION))
+ if (className.equal(PEGASUS_CLASSNAME_INDSUBSCRIPTION) ||
+ className.equal(PEGASUS_CLASSNAME_FORMATTEDINDSUBSCRIPTION))
{
- if (ContainsCIMName (properties, _PROPERTY_TIMEREMAINING))
+ if (ContainsCIMName(properties, _PROPERTY_TIMEREMAINING))
{
setTimeRemaining = true;
- if (!ContainsCIMName (properties, _PROPERTY_STARTTIME))
+ if (!ContainsCIMName(properties, _PROPERTY_STARTTIME))
{
- properties.append (_PROPERTY_STARTTIME);
+ properties.append(_PROPERTY_STARTTIME);
startTimeAdded = true;
}
- if (!ContainsCIMName (properties, _PROPERTY_DURATION))
+ if (!ContainsCIMName(properties, _PROPERTY_DURATION))
{
- properties.append (_PROPERTY_DURATION);
+ properties.append(_PROPERTY_DURATION);
durationAdded = true;
}
}
}
- propertyList.clear ();
- propertyList.set (properties);
+ propertyList.clear();
+ propertyList.set(properties);
}
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
}
-String IndicationService::_getSubscriptionLogString
- (CIMInstance & subscription)
+String IndicationService::_getSubscriptionLogString(CIMInstance& subscription)
{
//
// Get Subscription Filter namespace and Name, and Handler namespace and
CIMValue filterValue;
CIMObjectPath filterPath;
CIMNamespaceName filterNS;
- Array <CIMKeyBinding> filterKeyBindings;
+ Array<CIMKeyBinding> filterKeyBindings;
CIMValue handlerValue;
CIMObjectPath handlerPath;
CIMNamespaceName handlerNS;
- Array <CIMKeyBinding> handlerKeyBindings;
- filterValue = subscription.getProperty (subscription.findProperty
- (PEGASUS_PROPERTYNAME_FILTER)).getValue ();
- filterValue.get (filterPath);
+ Array<CIMKeyBinding> handlerKeyBindings;
+ filterValue = subscription.getProperty(subscription.findProperty(
+ PEGASUS_PROPERTYNAME_FILTER)).getValue();
+ filterValue.get(filterPath);
//
// Get Filter namespace - if not set in Filter reference property
// value, namespace is the namespace of the subscription
//
- filterNS = filterPath.getNameSpace ();
- if (filterNS.isNull ())
+ filterNS = filterPath.getNameSpace();
+ if (filterNS.isNull())
{
- filterNS = subscription.getPath ().getNameSpace ();
+ filterNS = subscription.getPath().getNameSpace();
}
- logString.append (filterNS.getString ());
- logString.append (" ");
- filterKeyBindings = filterPath.getKeyBindings ();
- for (Uint32 i = 0; i < filterKeyBindings.size (); i++)
+ logString.append(filterNS.getString());
+ logString.append(" ");
+ filterKeyBindings = filterPath.getKeyBindings();
+ for (Uint32 i = 0; i < filterKeyBindings.size(); i++)
{
- if (filterKeyBindings [i].getName ().equal (PEGASUS_PROPERTYNAME_NAME))
+ if (filterKeyBindings[i].getName().equal(PEGASUS_PROPERTYNAME_NAME))
{
- logString.append (filterKeyBindings [i].getValue ());
- logString.append (", ");
+ logString.append(filterKeyBindings[i].getValue());
+ logString.append(", ");
break;
}
}
- handlerValue = subscription.getProperty
- (subscription.findProperty
- (PEGASUS_PROPERTYNAME_HANDLER)).getValue ();
- handlerValue.get (handlerPath);
+ handlerValue = subscription.getProperty(
+ subscription.findProperty(PEGASUS_PROPERTYNAME_HANDLER)).getValue();
+ handlerValue.get(handlerPath);
//
// Get Handler namespace - if not set in Handler reference property
// value, namespace is the namespace of the subscription
//
- handlerNS = handlerPath.getNameSpace ();
- if (handlerNS.isNull ())
+ handlerNS = handlerPath.getNameSpace();
+ if (handlerNS.isNull())
{
- handlerNS = subscription.getPath ().getNameSpace ();
+ handlerNS = subscription.getPath().getNameSpace();
}
- logString.append (handlerNS.getString ());
- logString.append (" ");
- handlerKeyBindings = handlerPath.getKeyBindings ();
- for (Uint32 j = 0; j < handlerKeyBindings.size (); j++)
+ logString.append(handlerNS.getString());
+ logString.append(" ");
+ handlerKeyBindings = handlerPath.getKeyBindings();
+ for (Uint32 j = 0; j < handlerKeyBindings.size(); j++)
{
- if (handlerKeyBindings [j].getName ().equal (PEGASUS_PROPERTYNAME_NAME))
+ if (handlerKeyBindings[j].getName().equal(PEGASUS_PROPERTYNAME_NAME))
{
- logString.append (handlerKeyBindings [j].getValue ());
+ logString.append(handlerKeyBindings[j].getValue());
break;
}
}
return logString;
}
-String IndicationService::getProviderLogString
- (CIMInstance & provider)
+String IndicationService::getProviderLogString(CIMInstance& provider)
{
String logString;
- logString = provider.getProperty (provider.findProperty
- (PEGASUS_PROPERTYNAME_NAME)).getValue ().toString ();
+ logString = provider.getProperty(
+ provider.findProperty(PEGASUS_PROPERTYNAME_NAME)).getValue().toString();
return logString;
}
-CIMClass IndicationService::_getIndicationClass (
- const CIMInstance & subscriptionInstance)
+CIMClass IndicationService::_getIndicationClass(
+ const CIMInstance& subscriptionInstance)
{
- PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
+ PEG_METHOD_ENTER(TRC_INDICATION_SERVICE,
"IndicationService::_getIndicationClass");
CIMNamespaceName sourceNameSpace;
String filterName;
// Get filter properties
- _subscriptionRepository->getFilterProperties (subscriptionInstance, query,
+ _subscriptionRepository->getFilterProperties(subscriptionInstance, query,
sourceNameSpace, queryLanguage, filterName);
// Build the query expression from the filter query
// Specify localOnly=false because superclass properties are needed
// Specify includeQualifiers=false because qualifiers are not needed
//
- indicationClass = _subscriptionRepository->getClass
- (sourceNameSpace, indicationClassName, false, false, false,
- CIMPropertyList ());
+ indicationClass = _subscriptionRepository->getClass(
+ sourceNameSpace, indicationClassName, false, false, false,
+ CIMPropertyList());
PEG_METHOD_EXIT();
return indicationClass;