version 1.5, 2008/12/02 09:01:39
|
version 1.6, 2012/03/08 08:45:35
|
|
|
| |
Boolean NormalizedSubscriptionTable:: remove(const CIMObjectPath &subPath) | Boolean NormalizedSubscriptionTable:: remove(const CIMObjectPath &subPath) |
{ | { |
return _subscriptionTable.remove(normalize(subPath)); |
return _subscriptionTable.remove(SubscriptionKey(subPath)); |
} | } |
| |
Boolean NormalizedSubscriptionTable::add(const CIMObjectPath &subPath, | Boolean NormalizedSubscriptionTable::add(const CIMObjectPath &subPath, |
const Boolean &value) | const Boolean &value) |
{ | { |
return _subscriptionTable.insert(normalize(subPath), value); |
return _subscriptionTable.insert(SubscriptionKey(subPath), value); |
} | } |
| |
Boolean NormalizedSubscriptionTable::exists(const CIMObjectPath &subPath, | Boolean NormalizedSubscriptionTable::exists(const CIMObjectPath &subPath, |
Boolean &value) | Boolean &value) |
{ | { |
return _subscriptionTable.lookup(normalize(subPath), value); |
return _subscriptionTable.lookup(SubscriptionKey(subPath), value); |
} |
|
|
|
CIMObjectPath NormalizedSubscriptionTable::normalize( |
|
const CIMObjectPath &subPath) |
|
{ |
|
PEG_METHOD_ENTER(TRC_INDICATION_SERVICE, |
|
"SubscriptionRepository::normalizeSubscriptionPath"); |
|
|
|
// Normalize the subscription object path. |
|
Array<CIMKeyBinding> subscriptionKB = subPath.getKeyBindings(); |
|
CIMObjectPath filterPath; |
|
CIMObjectPath handlerPath; |
|
|
|
for (Uint32 i = 0; i < subscriptionKB.size(); i++) |
|
{ |
|
if ((subscriptionKB [i].getName() == PEGASUS_PROPERTYNAME_FILTER) && |
|
(subscriptionKB [i].getType() == CIMKeyBinding::REFERENCE)) |
|
{ |
|
filterPath = subscriptionKB[i].getValue(); |
|
} |
|
if ((subscriptionKB [i].getName() == PEGASUS_PROPERTYNAME_HANDLER) && |
|
(subscriptionKB [i].getType() == CIMKeyBinding::REFERENCE)) |
|
{ |
|
handlerPath = subscriptionKB[i].getValue(); |
|
} |
|
} |
|
// Remove Host Tag |
|
filterPath.setHost(String::EMPTY); |
|
handlerPath.setHost(String::EMPTY); |
|
|
|
// Remove Namespaces if Subscription namespace, Filter and Handler |
|
// namespaces are same. |
|
CIMNamespaceName subNamespace = subPath.getNameSpace(); |
|
if (filterPath.getNameSpace() == subNamespace) |
|
{ |
|
filterPath.setNameSpace (CIMNamespaceName()); |
|
} |
|
if (handlerPath.getNameSpace() == subNamespace) |
|
{ |
|
handlerPath.setNameSpace (CIMNamespaceName()); |
|
} |
|
|
|
Array<CIMKeyBinding> kb; |
|
kb.append(CIMKeyBinding( |
|
PEGASUS_PROPERTYNAME_FILTER, CIMValue(filterPath))); |
|
kb.append(CIMKeyBinding( |
|
PEGASUS_PROPERTYNAME_HANDLER, CIMValue(handlerPath))); |
|
|
|
PEG_METHOD_EXIT(); |
|
return CIMObjectPath("", subNamespace, subPath.getClassName(), kb); |
|
} | } |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |