version 1.82, 2003/08/19 18:11:18
|
version 1.83, 2003/09/02 18:11:48
|
|
|
CIMPropertyList propertyList; | CIMPropertyList propertyList; |
Array <ProviderClassList> indicationProviders; | Array <ProviderClassList> indicationProviders; |
| |
for (Uint8 i = 0; i < activeSubscriptions.size (); i++) |
for (Uint32 i = 0; i < activeSubscriptions.size (); i++) |
{ | { |
// | // |
// Check for expired subscription | // Check for expired subscription |
|
|
// | // |
// Merge provider list into list of unique providers to enable | // Merge provider list into list of unique providers to enable |
// | // |
for (Uint8 j = 0; j < indicationProviders.size (); j++) |
for (Uint32 j = 0; j < indicationProviders.size (); j++) |
{ | { |
duplicate = false; | duplicate = false; |
for (Uint8 k = 0; k < enableProviders.size () && !duplicate; k++) |
for (Uint32 k = 0; k < enableProviders.size () && !duplicate; k++) |
{ | { |
if ((indicationProviders [j].provider.identical | if ((indicationProviders [j].provider.identical |
(enableProviders [k].provider))) | (enableProviders [k].provider))) |
|
|
// | // |
// Send Enable message to each provider | // Send Enable message to each provider |
// | // |
for (Uint8 m = 0; m < enableProviders.size (); m++) |
for (Uint32 m = 0; m < enableProviders.size (); m++) |
{ | { |
// | // |
// Send Enable message | // Send Enable message |
|
|
// | // |
// Send Enable message to each provider | // Send Enable message to each provider |
// | // |
for (Uint8 i = 0; i < indicationProviders.size (); i++) |
for (Uint32 i = 0; i < indicationProviders.size (); i++) |
{ | { |
// | // |
// Send Enable message | // Send Enable message |
|
|
// | // |
// Remove Creator and language properties from instances before returning | // Remove Creator and language properties from instances before returning |
// | // |
for (Uint8 i = 0; i < enumInstances.size (); i++) |
for (Uint32 i = 0; i < enumInstances.size (); i++) |
{ | { |
String creator; | String creator; |
if (!_getCreator (enumInstances [i], creator)) | if (!_getCreator (enumInstances [i], creator)) |
|
|
// | // |
// Send Enable message to each provider | // Send Enable message to each provider |
// | // |
for (Uint8 i = 0; i < indicationProviders.size (); i++) |
for (Uint32 i = 0; i < indicationProviders.size (); i++) |
{ | { |
// | // |
// Send Enable message | // Send Enable message |
|
|
// | // |
Array <CIMName> propertyNames; | Array <CIMName> propertyNames; |
CIMPropertyList propertyList; | CIMPropertyList propertyList; |
for (Uint8 i = 0; i < indication.getPropertyCount(); i++) |
for (Uint32 i = 0; i < indication.getPropertyCount(); i++) |
propertyNames.append(indication.getProperty(i).getName()); | propertyNames.append(indication.getProperty(i).getName()); |
propertyList = _checkPropertyList (propertyNames, | propertyList = _checkPropertyList (propertyNames, |
request->nameSpace, indication.getClassName ()); | request->nameSpace, indication.getClassName ()); |
|
|
stopWatch.reset (); | stopWatch.reset (); |
#endif | #endif |
| |
for (Uint8 i = 0; i < request->subscriptionInstanceNames.size(); |
for (Uint32 i = 0; i < request->subscriptionInstanceNames.size(); |
i++) | i++) |
{ | { |
// | // |
|
|
#endif | #endif |
} | } |
| |
for (Uint8 i = 0; i < matchedSubscriptions.size(); i++) |
for (Uint32 i = 0; i < matchedSubscriptions.size(); i++) |
{ | { |
match = true; | match = true; |
| |
|
|
// Send Create or Modify request for each subscription that can newly | // Send Create or Modify request for each subscription that can newly |
// be supported | // be supported |
// | // |
for (Uint8 i = 0; i < newSubscriptions.size (); i++) |
for (Uint32 i = 0; i < newSubscriptions.size (); i++) |
{ | { |
CIMNamespaceName sourceNameSpace; | CIMNamespaceName sourceNameSpace; |
Array <CIMName> indicationSubclasses; | Array <CIMName> indicationSubclasses; |
|
|
// | // |
// Send Enable message to each provider | // Send Enable message to each provider |
// | // |
for (Uint8 j = 0; j < indicationProviders.size (); j++) |
for (Uint32 j = 0; j < indicationProviders.size (); j++) |
{ | { |
// | // |
// Send Enable message | // Send Enable message |
|
|
// Send Delete or Modify request for each subscription that can no | // Send Delete or Modify request for each subscription that can no |
// longer be supported | // longer be supported |
// | // |
for (Uint8 i = 0; i < formerSubscriptions.size (); i++) |
for (Uint32 i = 0; i < formerSubscriptions.size (); i++) |
{ | { |
// | // |
// NOTE: These Delete or Modify requests are not associated with a | // NOTE: These Delete or Modify requests are not associated with a |
|
|
// | // |
// Look for the provider in the list | // Look for the provider in the list |
// | // |
for (Uint8 i = 0; i < tableValue.providers.size (); i++) |
for (Uint32 i = 0; i < tableValue.providers.size (); i++) |
{ | { |
if (tableValue.providers [i].provider.identical (provider)) | if (tableValue.providers [i].provider.identical (provider)) |
{ | { |
|
|
// | // |
// Look for the class in the list | // Look for the class in the list |
// | // |
for (Uint8 i = 0; i < providerClasses.classList.size (); i++) |
for (Uint32 i = 0; i < providerClasses.classList.size (); i++) |
{ | { |
if (providerClasses.classList [i].equal (className)) | if (providerClasses.classList [i].equal (className)) |
{ | { |
|
|
| |
Array <CIMInstance> providers = request->providers; | Array <CIMInstance> providers = request->providers; |
| |
for (Uint8 i = 0; i < providers.size (); i++) |
for (Uint32 i = 0; i < providers.size (); i++) |
{ | { |
// | // |
// Get list of affected subscriptions | // Get list of affected subscriptions |
|
|
// Check each subscription for a reference to the instance to be | // Check each subscription for a reference to the instance to be |
// deleted | // deleted |
// | // |
for (Uint8 i = 0; i < subscriptions.size(); i++) |
for (Uint32 i = 0; i < subscriptions.size(); i++) |
{ | { |
// | // |
// Get the subscription Filter or Handler property value | // Get the subscription Filter or Handler property value |
|
|
// | // |
// Get existing subscriptions from each namespace in the repository | // Get existing subscriptions from each namespace in the repository |
// | // |
for (Uint8 i = 0; i < nameSpaceNames.size (); i++) |
for (Uint32 i = 0; i < nameSpaceNames.size (); i++) |
{ | { |
| |
// | // |
|
|
// | // |
// Process each subscription | // Process each subscription |
// | // |
for (Uint8 j = 0; j < subscriptions.size (); j++) |
for (Uint32 j = 0; j < subscriptions.size (); j++) |
{ | { |
// | // |
// Get subscription state | // Get subscription state |
|
|
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, | PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, |
"IndicationService::_getMatchingSubscriptions"); | "IndicationService::_getMatchingSubscriptions"); |
| |
for (Uint8 i = 0; i < nameSpaces.size (); i++) |
for (Uint32 i = 0; i < nameSpaces.size (); i++) |
{ | { |
// | // |
// Look up the indicationClass-sourceNamespace pair in the | // Look up the indicationClass-sourceNamespace pair in the |
|
|
tableValue)) | tableValue)) |
{ | { |
subscriptions = tableValue.subscriptions; | subscriptions = tableValue.subscriptions; |
for (Uint8 j = 0; j < subscriptions.size (); j++) |
for (Uint32 j = 0; j < subscriptions.size (); j++) |
{ | { |
Boolean match = true; | Boolean match = true; |
| |
|
|
// Compare subscription property list | // Compare subscription property list |
// with supported property list | // with supported property list |
// | // |
for (Uint8 k = 0; |
for (Uint32 k = 0; |
k < propertyList.size () && match; | k < propertyList.size () && match; |
k++) | k++) |
{ | { |
|
|
// For each newly supported namespace, lookup to retrieve list of | // For each newly supported namespace, lookup to retrieve list of |
// subscriptions for the indication class-source namespace pair | // subscriptions for the indication class-source namespace pair |
// | // |
for (Uint8 i = 0; i < newNameSpaces.size (); i++) |
for (Uint32 i = 0; i < newNameSpaces.size (); i++) |
{ | { |
// | // |
// Look up the indicationClass-sourceNamespace pair in the | // Look up the indicationClass-sourceNamespace pair in the |
|
|
if (_subscriptionClassesTable.lookup (subscriptionClassesKey, | if (_subscriptionClassesTable.lookup (subscriptionClassesKey, |
tableValue)) | tableValue)) |
{ | { |
for (Uint8 j = 0; j < tableValue.subscriptions.size (); j++) |
for (Uint32 j = 0; j < tableValue.subscriptions.size (); j++) |
newList.append (tableValue.subscriptions [j]); | newList.append (tableValue.subscriptions [j]); |
} | } |
} | } |
|
|
// For each formerly supported namespace, lookup to retrieve list of | // For each formerly supported namespace, lookup to retrieve list of |
// subscriptions for the indication class-source namespace pair | // subscriptions for the indication class-source namespace pair |
// | // |
for (Uint8 k = 0; k < oldNameSpaces.size (); k++) |
for (Uint32 k = 0; k < oldNameSpaces.size (); k++) |
{ | { |
// | // |
// Look up the indicationClass-sourceNamespace pair in the | // Look up the indicationClass-sourceNamespace pair in the |
|
|
if (_subscriptionClassesTable.lookup (subscriptionClassesKey, | if (_subscriptionClassesTable.lookup (subscriptionClassesKey, |
tableValue)) | tableValue)) |
{ | { |
for (Uint8 m = 0; m < tableValue.subscriptions.size (); m++) |
for (Uint32 m = 0; m < tableValue.subscriptions.size (); m++) |
formerList.append (tableValue.subscriptions [m]); | formerList.append (tableValue.subscriptions [m]); |
} | } |
} | } |
|
|
// list | // list |
// | // |
Sint8 found; | Sint8 found; |
for (Uint8 p = 0; p < newList.size (); p++) |
for (Uint32 p = 0; p < newList.size (); p++) |
{ | { |
found = -1; | found = -1; |
for (Uint8 q = 0; q < formerList.size (); q++) |
for (Uint32 q = 0; q < formerList.size (); q++) |
{ | { |
if (newList [p].identical (formerList [q])) | if (newList [p].identical (formerList [q])) |
{ | { |
|
|
// previously was not, add to list of newly supported subscriptions if | // previously was not, add to list of newly supported subscriptions if |
// required properties are now supported | // required properties are now supported |
// | // |
for (Uint8 n = 0; n < newList.size (); n++) |
for (Uint32 n = 0; n < newList.size (); n++) |
{ | { |
String filterQuery; | String filterQuery; |
WQLSelectStatement selectStatement; | WQLSelectStatement selectStatement; |
|
|
// supported, but now is not, add to list of formerly supported | // supported, but now is not, add to list of formerly supported |
// subscriptions | // subscriptions |
// | // |
for (Uint8 f = 0; f < formerList.size (); f++) |
for (Uint32 f = 0; f < formerList.size (); f++) |
{ | { |
formerSubscriptions.append (formerList [f]); | formerSubscriptions.append (formerList [f]); |
} | } |
|
|
// and was also previously supported, add to appropriate list, based on | // and was also previously supported, add to appropriate list, based on |
// required properties | // required properties |
// | // |
for (Uint8 b = 0; b < bothList.size (); b++) |
for (Uint32 b = 0; b < bothList.size (); b++) |
{ | { |
String filterQuery; | String filterQuery; |
WQLSelectStatement selectStatement; | WQLSelectStatement selectStatement; |
|
|
// Compare required property list | // Compare required property list |
// with property list | // with property list |
// | // |
for (Uint8 i = 0; i < requiredProperties.size (); i++) |
for (Uint32 i = 0; i < requiredProperties.size (); i++) |
{ | { |
if (!ContainsCIMName (supportedProperties.getPropertyNameArray (), | if (!ContainsCIMName (supportedProperties.getPropertyNameArray (), |
requiredProperties[i])) | requiredProperties[i])) |
|
|
// | // |
// If provider matches, append subscription to the list | // If provider matches, append subscription to the list |
// | // |
for (Uint8 j = 0; j < i.value ().providers.size (); j++) |
for (Uint32 j = 0; j < i.value ().providers.size (); j++) |
{ | { |
ActiveSubscriptionsTableEntry tableValue = i.value (); | ActiveSubscriptionsTableEntry tableValue = i.value (); |
if (tableValue.providers [j].provider.identical (provider)) | if (tableValue.providers [j].provider.identical (provider)) |
|
|
// | // |
// For each indication subclass, get providers | // For each indication subclass, get providers |
// | // |
for (Uint8 i = 0; i < indicationSubclasses.size (); i++) |
for (Uint32 i = 0; i < indicationSubclasses.size (); i++) |
{ | { |
// | // |
// Get providers that can serve the subscription | // Get providers that can serve the subscription |
|
|
// | // |
// Merge into list of ProviderClassList structs | // Merge into list of ProviderClassList structs |
// | // |
for (Uint8 j = 0; j < providerInstances.size () && !duplicate; j++) |
for (Uint32 j = 0; j < providerInstances.size () && !duplicate; j++) |
{ | { |
provider.classList.clear (); | provider.classList.clear (); |
duplicate = false; | duplicate = false; |
|
|
// | // |
// See if indication provider is already in list | // See if indication provider is already in list |
// | // |
for (Uint8 k = 0; |
for (Uint32 k = 0; |
k < indicationProviders.size () && !duplicate; k++) | k < indicationProviders.size () && !duplicate; k++) |
{ | { |
if ((providerInstances [j].identical | if ((providerInstances [j].identical |
|
|
// | // |
// Check each subscription for a reference to the specified instance | // Check each subscription for a reference to the specified instance |
// | // |
for (Uint8 i = 0; i < subscriptions.size (); i++) |
for (Uint32 i = 0; i < subscriptions.size (); i++) |
{ | { |
// | // |
// Get the reference property value from the subscription instance | // Get the reference property value from the subscription instance |
|
|
// Send Create request to each provider | // Send Create request to each provider |
// | // |
| |
for (Uint8 i = 0; i < indicationProviders.size (); i++) |
for (Uint32 i = 0; i < indicationProviders.size (); i++) |
{ | { |
| |
struct enableProviderList *epl = | struct enableProviderList *epl = |
|
|
// | // |
// Send Modify request to each provider | // Send Modify request to each provider |
// | // |
for (Uint8 i = 0; i < indicationProviders.size (); i++) |
for (Uint32 i = 0; i < indicationProviders.size (); i++) |
{ | { |
| |
struct enableProviderList *epl = | struct enableProviderList *epl = |
|
|
// | // |
// Send Delete request to each provider | // Send Delete request to each provider |
// | // |
for (Uint8 i = 0; i < indicationProviders.size (); i++) |
for (Uint32 i = 0; i < indicationProviders.size (); i++) |
{ | { |
| |
struct enableProviderList *epl = | struct enableProviderList *epl = |
|
|
Array<CIMKeyBinding> subscriptionKB = subscriptionRef.getKeyBindings (); | Array<CIMKeyBinding> subscriptionKB = subscriptionRef.getKeyBindings (); |
Array<CIMKeyBinding> filterKB; | Array<CIMKeyBinding> filterKB; |
Array<CIMKeyBinding> handlerKB; | Array<CIMKeyBinding> handlerKB; |
for (Uint8 i = 0; i < subscriptionKB.size (); i++) |
for (Uint32 i = 0; i < subscriptionKB.size (); i++) |
{ | { |
if ((subscriptionKB [i].getName () == _PROPERTY_FILTER) && | if ((subscriptionKB [i].getName () == _PROPERTY_FILTER) && |
(subscriptionKB [i].getType () == CIMKeyBinding::REFERENCE)) | (subscriptionKB [i].getType () == CIMKeyBinding::REFERENCE)) |
|
|
// | // |
// Append subscription filter key values to key | // Append subscription filter key values to key |
// | // |
for (Uint8 j = 0; j < filterKB.size (); j++) |
for (Uint32 j = 0; j < filterKB.size (); j++) |
{ | { |
activeSubscriptionsKey.append (filterKB [j].getValue ()); | activeSubscriptionsKey.append (filterKB [j].getValue ()); |
} | } |
|
|
// | // |
// Append subscription handler key values to key | // Append subscription handler key values to key |
// | // |
for (Uint8 k = 0; k < handlerKB.size (); k++) |
for (Uint32 k = 0; k < handlerKB.size (); k++) |
{ | { |
activeSubscriptionsKey.append (handlerKB [k].getValue ()); | activeSubscriptionsKey.append (handlerKB [k].getValue ()); |
} | } |
|
|
String traceString; | String traceString; |
traceString.append (activeSubscriptionsKey); | traceString.append (activeSubscriptionsKey); |
traceString.append (" Providers: "); | traceString.append (" Providers: "); |
for (Uint8 i = 0; i < providers.size (); i++) |
for (Uint32 i = 0; i < providers.size (); i++) |
{ | { |
String providerName = providers [i].provider.getProperty | String providerName = providers [i].provider.getProperty |
(providers [i].provider.findProperty | (providers [i].provider.findProperty |
(_PROPERTY_NAME)).getValue ().toString (); | (_PROPERTY_NAME)).getValue ().toString (); |
traceString.append (providerName); | traceString.append (providerName); |
traceString.append (" Classes: "); | traceString.append (" Classes: "); |
for (Uint8 j = 0; j < providers[i].classList.size (); j++) |
for (Uint32 j = 0; j < providers[i].classList.size (); j++) |
{ | { |
traceString.append (providers[i].classList[j].getString()); | traceString.append (providers[i].classList[j].getString()); |
traceString.append (" "); | traceString.append (" "); |
|
|
String traceString; | String traceString; |
traceString.append (subscriptionClassesKey); | traceString.append (subscriptionClassesKey); |
traceString.append (" Subscriptions: "); | traceString.append (" Subscriptions: "); |
for (Uint8 i = 0; i < subscriptions.size (); i++) |
for (Uint32 i = 0; i < subscriptions.size (); i++) |
{ | { |
traceString.append (subscriptions [i].getPath ().toString()); | traceString.append (subscriptions [i].getPath ().toString()); |
traceString.append (" "); | traceString.append (" "); |
|
|
// | // |
// Insert or update entries in subscription classes table | // Insert or update entries in subscription classes table |
// | // |
for (Uint8 i = 0; i < indicationSubclassNames.size (); i++) |
for (Uint32 i = 0; i < indicationSubclassNames.size (); i++) |
{ | { |
String subscriptionClassesKey = _generateSubscriptionClassesKey | String subscriptionClassesKey = _generateSubscriptionClassesKey |
(indicationSubclassNames [i], sourceNamespaceName); | (indicationSubclassNames [i], sourceNamespaceName); |
|
|
// | // |
// Remove or update entries in subscription classes table | // Remove or update entries in subscription classes table |
// | // |
for (Uint8 i = 0; i < indicationSubclassNames.size (); i++) |
for (Uint32 i = 0; i < indicationSubclassNames.size (); i++) |
{ | { |
String subscriptionClassesKey = _generateSubscriptionClassesKey | String subscriptionClassesKey = _generateSubscriptionClassesKey |
(indicationSubclassNames [i], sourceNamespaceName); | (indicationSubclassNames [i], sourceNamespaceName); |
|
|
// pair, remove subscription from the list | // pair, remove subscription from the list |
// | // |
Array <CIMInstance> subscriptions = tableValue.subscriptions; | Array <CIMInstance> subscriptions = tableValue.subscriptions; |
for (Uint8 j = 0; j < subscriptions.size (); j++) |
for (Uint32 j = 0; j < subscriptions.size (); j++) |
{ | { |
if (subscriptions [j].getPath().identical | if (subscriptions [j].getPath().identical |
(subscription.getPath())) | (subscription.getPath())) |
|
|
// | // |
// Get list of unique handler instances for all subscriptions in list | // Get list of unique handler instances for all subscriptions in list |
// | // |
for (Uint8 i = 0; i < subscriptions.size (); i++) |
for (Uint32 i = 0; i < subscriptions.size (); i++) |
{ | { |
PEG_TRACE_STRING (TRC_INDICATION_SERVICE, Tracer::LEVEL4, | PEG_TRACE_STRING (TRC_INDICATION_SERVICE, Tracer::LEVEL4, |
"Alert subscription: " + subscriptions [i].getPath().toString()); | "Alert subscription: " + subscriptions [i].getPath().toString()); |
|
|
// Merge into list of unique handler instances | // Merge into list of unique handler instances |
// | // |
duplicate = false; | duplicate = false; |
for (Uint8 j = 0; j < handlers.size () && !duplicate; j++) |
for (Uint32 j = 0; j < handlers.size () && !duplicate; j++) |
{ | { |
if ((current.identical (handlers [j])) && | if ((current.identical (handlers [j])) && |
(current.getPath () == handlers [j].getPath ())) | (current.getPath () == handlers [j].getPath ())) |
|
|
// | // |
// Send handle indication request to each handler | // Send handle indication request to each handler |
// | // |
for (Uint8 k = 0; k < handlers.size (); k++) |
for (Uint32 k = 0; k < handlers.size (); k++) |
{ | { |
CIMHandleIndicationRequestMessage * handler_request = | CIMHandleIndicationRequestMessage * handler_request = |
new CIMHandleIndicationRequestMessage ( | new CIMHandleIndicationRequestMessage ( |
|
|
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, | PEG_METHOD_ENTER (TRC_INDICATION_SERVICE, |
"IndicationService::_getPropertySourceFromInstance"); | "IndicationService::_getPropertySourceFromInstance"); |
| |
for (Uint8 i=0; i < indicationInstance.getPropertyCount(); i++) |
for (Uint32 i=0; i < indicationInstance.getPropertyCount(); i++) |
{ | { |
CIMProperty property = indicationInstance.getProperty(i); | CIMProperty property = indicationInstance.getProperty(i); |
CIMValue propertyValue = property.getValue(); | CIMValue propertyValue = property.getValue(); |