version 1.63, 2002/09/13 21:40:42
|
version 1.64, 2002/09/16 17:11:58
|
|
|
CIMPropertyList requiredProperties; | CIMPropertyList requiredProperties; |
CIMNamespaceName sourceNameSpace; | CIMNamespaceName sourceNameSpace; |
Array <ProviderClassList> indicationProviders; | Array <ProviderClassList> indicationProviders; |
if (instance.getClassName () == PEGASUS_CLASSNAME_INDSUBSCRIPTION) |
if (instance.getClassName ().equal |
|
(PEGASUS_CLASSNAME_INDSUBSCRIPTION)) |
{ | { |
// | // |
// Get subscription state | // Get subscription state |
|
|
// and subscription state is enabled, send Create request to | // and subscription state is enabled, send Create request to |
// indication providers | // indication providers |
// | // |
if (instance.getClassName () == PEGASUS_CLASSNAME_INDSUBSCRIPTION) |
if (instance.getClassName ().equal |
|
(PEGASUS_CLASSNAME_INDSUBSCRIPTION)) |
{ | { |
if ((subscriptionState == _STATE_ENABLED) || | if ((subscriptionState == _STATE_ENABLED) || |
(subscriptionState == _STATE_ENABLEDDEGRADED)) | (subscriptionState == _STATE_ENABLEDDEGRADED)) |
|
|
// If a subscription with a duration, calculate subscription time | // If a subscription with a duration, calculate subscription time |
// remaining, and add property to the instance | // remaining, and add property to the instance |
// | // |
if (request->instanceName.getClassName () == |
if (request->instanceName.getClassName ().equal |
PEGASUS_CLASSNAME_INDSUBSCRIPTION) |
(PEGASUS_CLASSNAME_INDSUBSCRIPTION)) |
{ | { |
_setTimeRemaining (instance); | _setTimeRemaining (instance); |
} | } |
|
|
// If a subscription with a duration, calculate subscription time | // If a subscription with a duration, calculate subscription time |
// remaining, and add property to the instance | // remaining, and add property to the instance |
// | // |
if (request->className == PEGASUS_CLASSNAME_INDSUBSCRIPTION) |
if (request->className.equal (PEGASUS_CLASSNAME_INDSUBSCRIPTION)) |
{ | { |
_setTimeRemaining (enumInstances [i]); | _setTimeRemaining (enumInstances [i]); |
} | } |
|
|
if (_canDelete (request->instanceName, request->nameSpace, | if (_canDelete (request->instanceName, request->nameSpace, |
request->userName)) | request->userName)) |
{ | { |
if (request->instanceName.getClassName () == |
if (request->instanceName.getClassName ().equal |
PEGASUS_CLASSNAME_INDSUBSCRIPTION) |
(PEGASUS_CLASSNAME_INDSUBSCRIPTION)) |
{ | { |
CIMInstance subscriptionInstance; | CIMInstance subscriptionInstance; |
Array <ProviderClassList> indicationProviders; | Array <ProviderClassList> indicationProviders; |
|
|
// delete, send a Delete request | // delete, send a Delete request |
// | // |
if ((tableValue.classList.size () == 1) && | if ((tableValue.classList.size () == 1) && |
(tableValue.classList [0] == className)) |
(tableValue.classList [0].equal (className))) |
{ | { |
_sendDeleteRequests (indicationProviders, | _sendDeleteRequests (indicationProviders, |
formerSubscriptions [i].getPath ().getNameSpace (), | formerSubscriptions [i].getPath ().getNameSpace (), |
|
|
// null, add or set property with default value | // null, add or set property with default value |
// For a property that has a specified set of valid values, validate | // For a property that has a specified set of valid values, validate |
// | // |
if (instance.getClassName () == PEGASUS_CLASSNAME_INDSUBSCRIPTION) |
if (instance.getClassName ().equal (PEGASUS_CLASSNAME_INDSUBSCRIPTION)) |
{ | { |
// | // |
// Filter and Handler are key properties for Subscription | // Filter and Handler are key properties for Subscription |
|
|
_checkPropertyWithDefault (instance, _PROPERTY_SYSTEMCREATIONCLASSNAME, | _checkPropertyWithDefault (instance, _PROPERTY_SYSTEMCREATIONCLASSNAME, |
System::getSystemCreationClassName ()); | System::getSystemCreationClassName ()); |
| |
if (instance.getClassName () == PEGASUS_CLASSNAME_INDFILTER) |
if (instance.getClassName ().equal (PEGASUS_CLASSNAME_INDFILTER)) |
{ | { |
// | // |
// Query and QueryLanguage properties are required for Filter | // Query and QueryLanguage properties are required for Filter |
|
|
// class are supported -- further subclassing is not currently | // class are supported -- further subclassing is not currently |
// supported | // supported |
// | // |
else if ((instance.getClassName () == |
else if ((instance.getClassName ().equal |
PEGASUS_CLASSNAME_INDHANDLER_CIMXML) || |
(PEGASUS_CLASSNAME_INDHANDLER_CIMXML)) || |
(instance.getClassName () == |
(instance.getClassName ().equal |
PEGASUS_CLASSNAME_INDHANDLER_SNMP)) |
(PEGASUS_CLASSNAME_INDHANDLER_SNMP))) |
{ | { |
_checkPropertyWithOther (instance, _PROPERTY_PERSISTENCETYPE, | _checkPropertyWithOther (instance, _PROPERTY_PERSISTENCETYPE, |
_PROPERTY_OTHERPERSISTENCETYPE, (Uint16) _PERSISTENCE_PERMANENT, | _PROPERTY_OTHERPERSISTENCETYPE, (Uint16) _PERSISTENCE_PERMANENT, |
(Uint16) _PERSISTENCE_OTHER, _validPersistenceTypes); | (Uint16) _PERSISTENCE_OTHER, _validPersistenceTypes); |
| |
if (instance.getClassName () == PEGASUS_CLASSNAME_INDHANDLER_CIMXML) |
if (instance.getClassName ().equal |
|
(PEGASUS_CLASSNAME_INDHANDLER_CIMXML)) |
{ | { |
// | // |
// Destination property is required for CIMXML | // Destination property is required for CIMXML |
|
|
_MSG_PROPERTY); | _MSG_PROPERTY); |
} | } |
| |
if (instance.getClassName () == PEGASUS_CLASSNAME_INDHANDLER_SNMP) |
if (instance.getClassName ().equal |
|
(PEGASUS_CLASSNAME_INDHANDLER_SNMP)) |
{ | { |
// | // |
// Trap Destination property is required for SNMP | // Trap Destination property is required for SNMP |
|
|
// Currently, only modification allowed is of Subscription State | // Currently, only modification allowed is of Subscription State |
// property in Subscription class | // property in Subscription class |
// | // |
if (instanceReference.getClassName () != PEGASUS_CLASSNAME_INDSUBSCRIPTION) |
if (!instanceReference.getClassName ().equal |
|
(PEGASUS_CLASSNAME_INDSUBSCRIPTION)) |
{ | { |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); | throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
|
|
// If one property specified, it must be Subscription State property | // If one property specified, it must be Subscription State property |
// | // |
else if ((request->propertyList.size () == 1) && | else if ((request->propertyList.size () == 1) && |
(request->propertyList[0] != _PROPERTY_STATE)) |
(!request->propertyList[0].equal (_PROPERTY_STATE))) |
{ | { |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); | throw PEGASUS_CIM_EXCEPTION(CIM_ERR_NOT_SUPPORTED, String::EMPTY); |
|
|
// If the class or superclass is Filter or Handler, check for | // If the class or superclass is Filter or Handler, check for |
// subscription instances referring to the instance to be deleted | // subscription instances referring to the instance to be deleted |
// | // |
if ((superClass == PEGASUS_CLASSNAME_INDFILTER) || |
if ((superClass.equal (PEGASUS_CLASSNAME_INDFILTER)) || |
(superClass == PEGASUS_CLASSNAME_INDHANDLER) || |
(superClass.equal (PEGASUS_CLASSNAME_INDHANDLER)) || |
(instanceReference.getClassName() == PEGASUS_CLASSNAME_INDFILTER) || |
(instanceReference.getClassName().equal (PEGASUS_CLASSNAME_INDFILTER)) |
(instanceReference.getClassName() == PEGASUS_CLASSNAME_INDHANDLER)) |
|| (instanceReference.getClassName().equal (PEGASUS_CLASSNAME_INDHANDLER))) |
{ |
{ |
if ((superClass == PEGASUS_CLASSNAME_INDFILTER) || |
if ((superClass.equal (PEGASUS_CLASSNAME_INDFILTER)) || |
(instanceReference.getClassName() == PEGASUS_CLASSNAME_INDFILTER)) |
(instanceReference.getClassName().equal |
|
(PEGASUS_CLASSNAME_INDFILTER))) |
{ | { |
propName = _PROPERTY_FILTER; | propName = _PROPERTY_FILTER; |
} | } |
else if (superClass == PEGASUS_CLASSNAME_INDHANDLER) |
else if (superClass.equal (PEGASUS_CLASSNAME_INDHANDLER)) |
{ | { |
propName = _PROPERTY_HANDLER; | propName = _PROPERTY_HANDLER; |
| |
|
|
// one of the properties will be a list of affected subscriptions | // one of the properties will be a list of affected subscriptions |
// It is for that reason that subscriptions is passed in as a parameter | // It is for that reason that subscriptions is passed in as a parameter |
// | // |
if (alertClassName == _CLASS_CIMOM_SHUTDOWN_ALERT) |
if (alertClassName.equal (_CLASS_CIMOM_SHUTDOWN_ALERT)) |
{ | { |
} | } |
else if (alertClassName == _CLASS_NO_PROVIDER_ALERT) |
else if (alertClassName.equal (_CLASS_NO_PROVIDER_ALERT)) |
{ | { |
} | } |
else if (alertClassName == _CLASS_PROVIDER_TERMINATED_ALERT) |
else if (alertClassName.equal (_CLASS_PROVIDER_TERMINATED_ALERT)) |
{ | { |
} | } |
| |