version 1.77, 2003/08/06 14:19:09
|
version 1.78, 2003/08/12 21:24:47
|
|
|
| |
#include "IndicationService.h" | #include "IndicationService.h" |
| |
|
// l10n |
|
#include <Pegasus/Common/MessageLoader.h> |
|
#include <Pegasus/Common/String.h> |
|
|
PEGASUS_USING_STD; | PEGASUS_USING_STD; |
| |
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
|
|
// subscription | // subscription |
// | // |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED, |
|
_MSG_NO_PROVIDERS); |
// l10n |
|
|
|
// throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED, |
|
// _MSG_NO_PROVIDERS); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_NOT_SUPPORTED, |
|
MessageLoaderParms(_MSG_NO_PROVIDERS_KEY, _MSG_NO_PROVIDERS)); |
|
|
} | } |
} | } |
| |
|
|
request->userName, request->authType)) | request->userName, request->authType)) |
{ | { |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED, |
|
_MSG_NOT_ACCEPTED); |
// l10n |
|
|
|
// throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED, |
|
// _MSG_NOT_ACCEPTED); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_NOT_SUPPORTED, |
|
MessageLoaderParms(_MSG_NOT_ACCEPTED_KEY, _MSG_NOT_ACCEPTED)); |
|
|
} | } |
| |
// | // |
|
|
instanceReference.setNameSpace (request->nameSpace); | instanceReference.setNameSpace (request->nameSpace); |
_deleteExpiredSubscription (instanceReference); | _deleteExpiredSubscription (instanceReference); |
| |
String exceptionStr = _MSG_EXPIRED; |
|
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
throw PEGASUS_CIM_EXCEPTION (CIM_ERR_FAILED, exceptionStr); |
|
|
// l10n |
|
|
|
// String exceptionStr = _MSG_EXPIRED; |
|
// throw PEGASUS_CIM_EXCEPTION (CIM_ERR_FAILED, exceptionStr); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
|
MessageLoaderParms(_MSG_EXPIRED_KEY, _MSG_EXPIRED)); |
|
|
} | } |
| |
// | // |
|
|
instance.setPath (instanceReference); | instance.setPath (instanceReference); |
_handleError (instance); | _handleError (instance); |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED, |
|
_MSG_NO_PROVIDERS); |
// l10n |
|
|
|
// throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED, |
|
// _MSG_NO_PROVIDERS); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_NOT_SUPPORTED, |
|
MessageLoaderParms(_MSG_NO_PROVIDERS_KEY, _MSG_NO_PROVIDERS)); |
} | } |
} | } |
| |
|
|
request->userName, request->authType)) | request->userName, request->authType)) |
{ | { |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED, |
|
_MSG_NOT_ACCEPTED); |
// l10n |
|
|
|
// throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED, |
|
// _MSG_NOT_ACCEPTED); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_NOT_SUPPORTED, |
|
MessageLoaderParms(_MSG_NOT_ACCEPTED_KEY, _MSG_NOT_ACCEPTED)); |
|
|
} | } |
| |
// | // |
|
|
creator)) | creator)) |
{ | { |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED, |
|
_MSG_NOT_ACCEPTED); |
// l10n |
|
|
|
// throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED, |
|
// _MSG_NOT_ACCEPTED); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_NOT_SUPPORTED, |
|
MessageLoaderParms(_MSG_NOT_ACCEPTED_KEY, _MSG_NOT_ACCEPTED)); |
|
|
} | } |
| |
// | // |
|
|
// A class not currently served by the Indication Service | // A class not currently served by the Indication Service |
// | // |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED, |
|
_MSG_CLASS_NOT_SERVED); |
// l10n |
|
|
|
// throw PEGASUS_CIM_EXCEPTION (CIM_ERR_NOT_SUPPORTED, |
|
// _MSG_CLASS_NOT_SERVED); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_NOT_SUPPORTED, |
|
MessageLoaderParms(_MSG_CLASS_NOT_SERVED_KEY, _MSG_CLASS_NOT_SERVED)); |
} | } |
} | } |
| |
|
|
| |
if (missingProperty) | if (missingProperty) |
{ | { |
|
|
|
// l10n |
|
|
String exceptionStr = _MSG_MISSING_REQUIRED; | String exceptionStr = _MSG_MISSING_REQUIRED; |
exceptionStr.append (propertyName.getString()); |
// exceptionStr.append (propertyName.getString()); |
|
exceptionStr.append ("$0"); |
exceptionStr.append (message); | exceptionStr.append (message); |
|
|
|
String message_key; |
|
if (strcmp(message.getCString(), _MSG_KEY_PROPERTY) == 0) { |
|
message_key = _MSG_KEY_PROPERTY_KEY; |
|
} else if (strcmp(message.getCString(), _MSG_PROPERTY) == 0) { |
|
message_key = _MSG_PROPERTY_KEY; |
|
} else { |
|
message_key = String(""); |
|
} |
|
|
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER, |
|
exceptionStr); |
// l10n |
|
|
|
// throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER, |
|
// exceptionStr); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_INVALID_PARAMETER, |
|
MessageLoaderParms(message_key, |
|
exceptionStr, propertyName.getString())); |
|
|
} | } |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
} | } |
|
|
// | // |
if (!Contains (validValues, result)) | if (!Contains (validValues, result)) |
{ | { |
|
// l10n |
|
|
String exceptionStr = _MSG_INVALID_VALUE; | String exceptionStr = _MSG_INVALID_VALUE; |
exceptionStr.append (theValue.toString ()); |
// exceptionStr.append (theValue.toString ()); |
|
exceptionStr.append ("$0"); |
exceptionStr.append (_MSG_FOR_PROPERTY); | exceptionStr.append (_MSG_FOR_PROPERTY); |
exceptionStr.append (propertyName.getString()); |
// exceptionStr.append (propertyName.getString()); |
|
exceptionStr.append ("$1"); |
|
|
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER, |
|
exceptionStr); |
// 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, |
|
theValue.toString(), propertyName.getString())); |
} | } |
} | } |
| |
|
|
{ | { |
if (instance.findProperty (otherPropertyName) == PEG_NOT_FOUND) | if (instance.findProperty (otherPropertyName) == PEG_NOT_FOUND) |
{ | { |
|
// l10n |
|
|
String exceptionStr = _MSG_MISSING_REQUIRED; | String exceptionStr = _MSG_MISSING_REQUIRED; |
exceptionStr.append (otherPropertyName.getString()); |
// exceptionStr.append (otherPropertyName.getString()); |
|
exceptionStr.append ("$0"); |
exceptionStr.append (_MSG_PROPERTY); | exceptionStr.append (_MSG_PROPERTY); |
|
|
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER, |
|
exceptionStr); |
// l10n |
|
|
|
// throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER, |
|
// exceptionStr); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_INVALID_PARAMETER, |
|
MessageLoaderParms(_MSG_PROPERTY_KEY, |
|
exceptionStr, |
|
otherPropertyName.getString())); |
|
|
} | } |
else | else |
{ | { |
|
|
CIMValue theOtherValue = otherProperty.getValue (); | CIMValue theOtherValue = otherProperty.getValue (); |
if (theOtherValue.isNull ()) | if (theOtherValue.isNull ()) |
{ | { |
|
// l10n |
|
|
String exceptionStr = _MSG_MISSING_REQUIRED; | String exceptionStr = _MSG_MISSING_REQUIRED; |
exceptionStr.append (otherPropertyName.getString()); |
// exceptionStr.append (otherPropertyName.getString()); |
|
exceptionStr.append ("$0"); |
exceptionStr.append (_MSG_PROPERTY); | exceptionStr.append (_MSG_PROPERTY); |
|
|
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER, |
|
exceptionStr); |
// l10n |
|
// throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER, |
|
// exceptionStr); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_INVALID_PARAMETER, |
|
MessageLoaderParms(_MSG_PROPERTY_KEY, |
|
exceptionStr, |
|
otherPropertyName.getString())); |
} | } |
} | } |
} | } |
|
|
CIMValue theOtherValue = otherProperty.getValue (); | CIMValue theOtherValue = otherProperty.getValue (); |
if (!theOtherValue.isNull ()) | if (!theOtherValue.isNull ()) |
{ | { |
String exceptionStr = otherPropertyName.getString(); |
// l10n |
|
|
|
// String exceptionStr = otherPropertyName.getString(); |
|
String exceptionStr ("$0"); |
exceptionStr.append (_MSG_PROPERTY_PRESENT); | exceptionStr.append (_MSG_PROPERTY_PRESENT); |
exceptionStr.append (propertyName.getString()); |
// exceptionStr.append (propertyName.getString()); |
|
exceptionStr.append ("$1"); |
exceptionStr.append (_MSG_VALUE_NOT); | exceptionStr.append (_MSG_VALUE_NOT); |
exceptionStr.append (CIMValue (otherValue).toString ()); |
// exceptionStr.append (CIMValue (otherValue).toString ()); |
|
exceptionStr.append ("$2"); |
|
|
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER, |
|
exceptionStr); |
// l10n |
|
|
|
// throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER, |
|
// exceptionStr); |
|
|
|
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 ())); |
} | } |
} | } |
} | } |
|
|
// | // |
if (instanceReference == ref) | if (instanceReference == ref) |
{ | { |
String exceptionStr = _MSG_REFERENCED; |
|
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
throw PEGASUS_CIM_EXCEPTION (CIM_ERR_FAILED, exceptionStr); |
|
|
// l10n |
|
|
|
// String exceptionStr = _MSG_REFERENCED; |
|
// throw PEGASUS_CIM_EXCEPTION (CIM_ERR_FAILED, exceptionStr); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
|
MessageLoaderParms(_MSG_REFERENCED_KEY, _MSG_REFERENCED)); |
} | } |
} | } |
} | } |
|
|
| |
if (!validClass) | if (!validClass) |
{ | { |
String exceptionStr = _MSG_INVALID_CLASSNAME; |
// l10n |
exceptionStr.append (indicationClassName.getString()); |
|
exceptionStr.append (_MSG_IN_FROM); |
// String exceptionStr = _MSG_INVALID_CLASSNAME; |
exceptionStr.append (PEGASUS_CLASSNAME_INDFILTER.getString()); |
String exceptionStr = String("Invalid $0 class name "); |
|
// exceptionStr.append (indicationClassName.getString()); |
|
exceptionStr.append ("$1"); |
|
// exceptionStr.append (_MSG_IN_FROM); |
|
exceptionStr.append (" in $2 clause of "); |
|
// exceptionStr.append (PEGASUS_CLASSNAME_INDFILTER.getString()); |
|
exceptionStr.append ("$3"); |
exceptionStr.append (" "); | exceptionStr.append (" "); |
exceptionStr.append (_PROPERTY_QUERY.getString()); |
// exceptionStr.append (_PROPERTY_QUERY.getString()); |
|
exceptionStr.append ("$4"); |
exceptionStr.append (_MSG_PROPERTY); | exceptionStr.append (_MSG_PROPERTY); |
|
|
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER, |
|
exceptionStr); |
// l10n |
|
|
|
// throw PEGASUS_CIM_EXCEPTION (CIM_ERR_INVALID_PARAMETER, |
|
// exceptionStr); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_INVALID_PARAMETER, |
|
MessageLoaderParms ( |
|
_MSG_INVALID_CLASSNAME_IN_FROM_PROPERTY_KEY, |
|
exceptionStr, |
|
"indication", |
|
indicationClassName.getString(), |
|
"FROM", |
|
PEGASUS_CLASSNAME_INDFILTER.getString(), |
|
_PROPERTY_QUERY.getString())); |
} | } |
| |
PEG_METHOD_EXIT (); | PEG_METHOD_EXIT (); |
|
|
// Message substrings used in exception messages | // Message substrings used in exception messages |
// | // |
| |
|
// l10n |
|
|
|
// some have been commented out and put directly in the code for localization |
|
|
|
// this one is tricky because it is used in _checkRequiredProperty with the two below |
const char IndicationService::_MSG_MISSING_REQUIRED [] = "Missing required "; | const char IndicationService::_MSG_MISSING_REQUIRED [] = "Missing required "; |
| |
const char IndicationService::_MSG_KEY_PROPERTY [] = " key property"; | const char IndicationService::_MSG_KEY_PROPERTY [] = " key property"; |
|
const char IndicationService::_MSG_KEY_PROPERTY_KEY [] = |
|
"IndicationService.IndicationService._MSG_KEY_PROPERTY"; |
| |
const char IndicationService::_MSG_PROPERTY [] = " property"; | const char IndicationService::_MSG_PROPERTY [] = " property"; |
|
const char IndicationService::_MSG_PROPERTY_KEY [] = |
|
"IndicationService.IndicationService._MSG_PROPERTY"; |
| |
const char IndicationService::_MSG_PROPERTY_PRESENT [] = | const char IndicationService::_MSG_PROPERTY_PRESENT [] = |
" property present, but "; | " property present, but "; |
| |
const char IndicationService::_MSG_VALUE_NOT [] = " value not "; | const char IndicationService::_MSG_VALUE_NOT [] = " value not "; |
| |
|
const char IndicationService::_MSG_PROPERTY_PRESENT_BUT_VALUE_NOT_KEY [] = |
|
"IndicationService.IndicationService._MSG_PROPERTY_PRESENT_BUT_VALUE_NOT"; |
|
|
|
|
const char IndicationService::_MSG_NO_PROVIDERS [] = | const char IndicationService::_MSG_NO_PROVIDERS [] = |
"There are no providers capable of serving the subscription"; | "There are no providers capable of serving the subscription"; |
|
const char IndicationService::_MSG_NO_PROVIDERS_KEY [] = |
|
"IndicationService.IndicationService._MSG_NO_PROVIDERS"; |
| |
const char IndicationService::_MSG_NOT_ACCEPTED [] = | const char IndicationService::_MSG_NOT_ACCEPTED [] = |
"No providers accepted the subscription"; | "No providers accepted the subscription"; |
|
const char IndicationService::_MSG_NOT_ACCEPTED_KEY [] = |
|
"IndicationService.IndicationService._MSG_NOT_ACCEPTED"; |
| |
const char IndicationService::_MSG_INVALID_CLASSNAME [] = | const char IndicationService::_MSG_INVALID_CLASSNAME [] = |
"Invalid indication class name "; | "Invalid indication class name "; |
| |
const char IndicationService::_MSG_IN_FROM [] = " in FROM clause of "; | const char IndicationService::_MSG_IN_FROM [] = " in FROM clause of "; |
| |
|
const char IndicationService::_MSG_INVALID_CLASSNAME_IN_FROM_PROPERTY_KEY [] = |
|
"IndicationService.IndicationService._MSG_INVALID_CLASSNAME_IN_FROM_PROPERTY"; |
|
|
const char IndicationService::_MSG_EXPIRED [] = | const char IndicationService::_MSG_EXPIRED [] = |
"Expired subscription may not be modified; has been deleted"; | "Expired subscription may not be modified; has been deleted"; |
|
const char IndicationService::_MSG_EXPIRED_KEY [] = |
|
"IndicationService.IndicationService._MSG_EXPIRED"; |
| |
const char IndicationService::_MSG_REFERENCED [] = | const char IndicationService::_MSG_REFERENCED [] = |
"A Filter or Handler referenced by a subscription may not be deleted"; | "A Filter or Handler referenced by a subscription may not be deleted"; |
|
const char IndicationService::_MSG_REFERENCED_KEY [] = |
|
"IndicationService.IndicationService._MSG_REFERENCED"; |
|
|
| |
const char IndicationService::_MSG_INVALID_VALUE [] = | const char IndicationService::_MSG_INVALID_VALUE [] = |
"Invalid value "; | "Invalid value "; |
|
|
const char IndicationService::_MSG_FOR_PROPERTY [] = | const char IndicationService::_MSG_FOR_PROPERTY [] = |
" for property "; | " for property "; |
| |
|
const char IndicationService::_MSG_INVALID_VALUE_FOR_PROPERTY_KEY [] = |
|
"IndicationService.IndicationService._MSG_INVALID_VALUE_FOR_PROPERTY"; |
|
|
const char IndicationService::_MSG_CLASS_NOT_SERVED [] = | const char IndicationService::_MSG_CLASS_NOT_SERVED [] = |
"The specified class is not served by the Indication Service"; | "The specified class is not served by the Indication Service"; |
|
const char IndicationService::_MSG_CLASS_NOT_SERVED_KEY [] = |
|
"IndicationService.IndicationService._MSG_CLASS_NOT_SERVED"; |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |