{
CQL_DEBUG_TRACE("LEX: [STRING]-> BAD UTF\n");
throw CQLSyntaxErrorException(
- MessageLoaderParms(String("CQL.CQL_y.BAD_UTF8"),
- String("Bad UTF8 encountered parsing rule $0 in position $1."),
- String("literal_string"),
+ MessageLoaderParms("CQL.CQL_y.BAD_UTF8",
+ "Bad UTF8 encountered parsing rule $0 in position $1.",
+ "literal_string",
CQL_globalParserState->currentTokenPos));
}
{
//error
MessageLoaderParms parms(
- String("CQL.CQLIdentifier.HASH_ARRAY_SYMBOL_MISMATCH"),
- String("The identifier contains a mismatched symbolic"
- " constant symbol and an array symbol: $0"),
+ "CQL.CQLIdentifier.HASH_ARRAY_SYMBOL_MISMATCH",
+ "The identifier contains a mismatched symbolic"
+ " constant symbol and an array symbol: $0",
identifier);
throw CQLIdentifierParseException(parms);
}
{
// Basic query error
MessageLoaderParms parms(
- String("CQL.CQLIdentifier.TOO_MANY_ARRAY_INDICES"),
- String("The identifier contains one or more commas which"
- " is not allowed in CQL Basic query: $0"),
+ "CQL.CQLIdentifier.TOO_MANY_ARRAY_INDICES",
+ "The identifier contains one or more commas which"
+ " is not allowed in CQL Basic query: $0",
identifier);
throw CQLIdentifierParseException(parms);
//
{
// error
MessageLoaderParms parms(
- String("CQL.CQLIdentifier.ARRAY_SYMBOL_MISMATCH"),
- String("The identifier contains a mismatched array symbol: $0"),
+ "CQL.CQLIdentifier.ARRAY_SYMBOL_MISMATCH",
+ "The identifier contains a mismatched array symbol: $0",
identifier);
throw CQLIdentifierParseException(parms);
}
catch (Exception&)
{
MessageLoaderParms parms(
- String("CQL.CQLIdentifier.INVALID_CIMNAME"),
- String("The identifier contains an invalid CIMName: $0."),
+ "CQL.CQLIdentifier.INVALID_CIMNAME",
+ "The identifier contains an invalid CIMName: $0.",
identifier);
throw CQLIdentifierParseException(parms);
}
/* A lexical scanner generated by flex*/
/* Scanner skeleton version:
- * $Header: /cvs/MSB/pegasus/src/Pegasus/CQL/CQLLEX.cpp,v 1.21 2008/02/26 19:03:13 kumpf Exp $
+ * $Header: /cvs/MSB/pegasus/src/Pegasus/CQL/CQLLEX.cpp,v 1.22 2008/08/12 17:35:06 kumpf Exp $
*/
#define FLEX_SCANNER
{
CQL_DEBUG_TRACE("LEX: [STRING]-> BAD UTF\n");
throw CQLSyntaxErrorException(
- MessageLoaderParms(String("CQL.CQL_y.BAD_UTF8"),
- String("Bad UTF8 encountered parsing rule $0 in position $1."),
- String("literal_string"),
+ MessageLoaderParms("CQL.CQL_y.BAD_UTF8",
+ "Bad UTF8 encountered parsing rule $0 in position $1.",
+ "literal_string",
CQL_globalParserState->currentTokenPos));
}
default:
MessageLoaderParms mload(
- String("CQL.CQLTermRep.OPERATION_NOT_SUPPORTED"),
- String("Operation is not supported."));
+ "CQL.CQLTermRep.OPERATION_NOT_SUPPORTED",
+ "Operation is not supported.");
throw CQLRuntimeException(mload);
}
}
}
break;
default:
- MessageLoaderParms mload(String("CQL.CQLValueRep.CONSTRUCTOR_FAILURE"),
- String("Undefined case:$0 in constructor."),
- inValueType);
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.CONSTRUCTOR_FAILURE",
+ "Undefined case:$0 in constructor.",
+ inValueType);
throw CQLRuntimeException(mload);
break;
break;
default:
- MessageLoaderParms mload(String("CQL.CQLValueRep.CONSTRUCTOR_FAILURE"),
- String("Undefined case:$0 in constructor."),
- _valueType);
- throw CQLRuntimeException(mload);
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.CONSTRUCTOR_FAILURE",
+ "Undefined case:$0 in constructor.",
+ _valueType);
+ throw CQLRuntimeException(mload);
break;
}
return false;
break;
default:
- MessageLoaderParms mload(String("CQL.CQLValueRep.CONSTRUCTOR_FAILURE"),
- String("Undefined case:$0 in constructor."));
- throw CQLRuntimeException(mload);
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.CONSTRUCTOR_FAILURE",
+ "Undefined case: $0 in constructor.");
+ throw CQLRuntimeException(mload);
break;
}
PEG_METHOD_EXIT();
break;
default:
- MessageLoaderParms mload(String("CQL.CQLValueRep.CONSTRUCTOR_FAILURE"),
- String("Undefined case:$0 in constructor."),
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.CONSTRUCTOR_FAILURE",
+ "Undefined case:$0 in constructor.",
_valueType);
throw CQLRuntimeException(mload);
break;
if(!_isResolved ||
(_valueType != CQLValue::CIMObject_type))
{
- MessageLoaderParms mload(String("CQL.CQLValueRep.ISA_TYPE_MISMATCH"),
- String("The type: $0 is not an object, or the object is not resolved"),
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.ISA_TYPE_MISMATCH",
+ "The type: $0 is not an object, or the object is not resolved",
_valueType);
throw CQLRuntimeException(mload);
}
if( _valueType != CQLValue::String_type ||
inVal._valueType != CQLValue::String_type)
{
- MessageLoaderParms mload(String("CQL.CQLValueRep.LIKE_TYPE_MISMATCH"),
- String("The following types may not be strings:$0,$1."),
- _valueType,inVal._valueType);
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.LIKE_TYPE_MISMATCH",
+ "The following types may not be strings: $0, $1.",
+ _valueType, inVal._valueType);
throw CQLRuntimeException(mload);
}
if(_theValue.isArray())
str = "array";
else str = valueTypeToString(_valueType);
- MessageLoaderParms mload(String("CQL.CQLValueRep.TYPE_MISMATCH"),
- String("The type: $0 is not correct for $1 operation."),
- str,
- String("getUint"));
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.TYPE_MISMATCH",
+ "The type: $0 is not correct for $1 operation.",
+ str,
+ "getUint");
throw CQLRuntimeException(mload);
}
Uint64 tmp;
if(_theValue.isArray())
str = "array";
else str = valueTypeToString(_valueType);
- MessageLoaderParms mload(String("CQL.CQLValueRep.TYPE_MISMATCH"),
- String("The type: $0 is not correct for $1 operation."),
- str,
- String("getBool"));
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.TYPE_MISMATCH",
+ "The type: $0 is not correct for $1 operation.",
+ str,
+ "getBool");
throw CQLRuntimeException(mload);
}
Boolean tmp;
if(_theValue.isArray())
str = "array";
else str = valueTypeToString(_valueType);
- MessageLoaderParms mload(String("CQL.CQLValueRep.TYPE_MISMATCH"),
- String("The type: $0 is not correct for $1 operation."),
- str,
- String("getSint"));
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.TYPE_MISMATCH",
+ "The type: $0 is not correct for $1 operation.",
+ str,
+ "getSint");
throw CQLRuntimeException(mload);
}
Sint64 tmp;
if(_theValue.isArray())
str = "array";
else str = valueTypeToString(_valueType);
- MessageLoaderParms mload(String("CQL.CQLValueRep.TYPE_MISMATCH"),
- String("The type: $0 is not correct for $1 operation."),
- str,
- String("getReal"));
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.TYPE_MISMATCH",
+ "The type: $0 is not correct for $1 operation.",
+ str,
+ "getReal");
throw CQLRuntimeException(mload);
}
Real64 tmp;
if(_theValue.isArray())
str = "array";
else str = valueTypeToString(_valueType);
- MessageLoaderParms mload(String("CQL.CQLValueRep.TYPE_MISMATCH"),
- String("The type: $0 is not correct for $1 operation."),
- str,
- String("getString"));
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.TYPE_MISMATCH",
+ "The type: $0 is not correct for $1 operation.",
+ str,
+ "getString");
throw CQLRuntimeException(mload);
}
String tmp;
if(_theValue.isArray())
str = "array";
else str = valueTypeToString(_valueType);
- MessageLoaderParms mload(String("CQL.CQLValueRep.TYPE_MISMATCH"),
- String("The type: $0 is not correct for $1 operation."),
- str,
- String("getDateTime"));
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.TYPE_MISMATCH",
+ "The type: $0 is not correct for $1 operation.",
+ str,
+ "getDateTime");
throw CQLRuntimeException(mload);
}
CIMDateTime tmp;
if(_theValue.isArray())
str = "array";
else str = valueTypeToString(_valueType);
- MessageLoaderParms mload(String("CQL.CQLValueRep.TYPE_MISMATCH"),
- String("The type: $0 is not correct for $1 operation."),
- str,
- String("getReference"));
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.TYPE_MISMATCH",
+ "The type: $0 is not correct for $1 operation.",
+ str,
+ "getReference");
throw CQLRuntimeException(mload);
}
CIMObjectPath tmp;
if(_theValue.isArray())
str = "array";
else str = valueTypeToString(_valueType);
- MessageLoaderParms mload(String("CQL.CQLValueRep.TYPE_MISMATCH"),
- String("The type: $0 is not correct for $1 operation."),
- str,
- String("getObject"));
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.TYPE_MISMATCH",
+ "The type: $0 is not correct for $1 operation.",
+ str,
+ "getObject");
throw CQLRuntimeException(mload);
}
CIMObject tmp;
// Do not allow an array value be compared to a non array value.
if(x._theValue.isArray() != _theValue.isArray())
{
- MessageLoaderParms mload(String("CQL.CQLValueRep.OP_TYPE_MISMATCH"),
- String("Validation type mismatch error for type: $0"),
- String("ARRAY"));
- throw CQLRuntimeException(mload);
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.OP_TYPE_MISMATCH",
+ "Validation type mismatch error for type: $0",
+ "ARRAY");
+ throw CQLRuntimeException(mload);
}
switch(_valueType)
case CQLValue::Boolean_type:
if(x._valueType != CQLValue::Boolean_type)
{
- MessageLoaderParms mload(String("CQL.CQLValueRep.OP_TYPE_MISMATCH"),
- String("Validation type mismatch error for type: $0"),
- String("BOOLEAN"));
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.OP_TYPE_MISMATCH",
+ "Validation type mismatch error for type: $0",
+ "BOOLEAN");
throw CQLRuntimeException(mload);
}
break;
x._valueType != CQLValue::Uint64_type &&
x._valueType != CQLValue::Real_type)
{
- MessageLoaderParms mload(String("CQL.CQLValueRep.OP_TYPE_MISMATCH"),
- String("Validation type mismatch error for type: $0"),
- String("SINT64, UINT64, REAL64"));
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.OP_TYPE_MISMATCH",
+ "Validation type mismatch error for type: $0",
+ "SINT64, UINT64, REAL64");
throw CQLRuntimeException(mload);
}
break;
case CQLValue::String_type:
if(x._valueType != CQLValue::String_type)
{
- MessageLoaderParms mload(String("CQL.CQLValueRep.OP_TYPE_MISMATCH"),
- String("Validation type mismatch error for type: $0"),
- String("STIRNG"));
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.OP_TYPE_MISMATCH",
+ "Validation type mismatch error for type: $0",
+ "STRING");
throw CQLRuntimeException(mload);
}
break;
case CQLValue::CIMDateTime_type:
if(x._valueType != CQLValue::CIMDateTime_type)
{
- MessageLoaderParms mload(String("CQL.CQLValueRep.OP_TYPE_MISMATCH"),
- String("Validation type mismatch error for type: $0"),
- String("CIMDATETIME"));
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.OP_TYPE_MISMATCH",
+ "Validation type mismatch error for type: $0",
+ "CIMDATETIME");
throw CQLRuntimeException(mload);
}
break;
case CQLValue::CIMReference_type:
if(x._valueType != CQLValue::CIMReference_type)
{
- MessageLoaderParms mload(String("CQL.CQLValueRep.OP_TYPE_MISMATCH"),
- String("Validation type mismatch error for type: $0"),
- String("CIMREFERENCE"));
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.OP_TYPE_MISMATCH",
+ "Validation type mismatch error for type: $0",
+ "CIMREFERENCE");
throw CQLRuntimeException(mload);
}
break;
case CQLValue::CIMObject_type:
if(x._valueType != CQLValue::CIMObject_type)
{
- MessageLoaderParms mload(String("CQL.CQLValueRep.OP_TYPE_MISMATCH"),
- String("Validation type mismatch error for type: $0"),
- String("CIMOBJECT"));
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.OP_TYPE_MISMATCH",
+ "Validation type mismatch error for type: $0",
+ "CIMOBJECT");
throw CQLRuntimeException(mload);
}
break;
case CQLValue::CQLIdentifier_type:
if(x._valueType != CQLValue::CQLIdentifier_type)
{
- MessageLoaderParms mload(String("CQL.CQLValueRep.OP_TYPE_MISMATCH"),
- String("Validation type mismatch error for type: $0"),
- String("CQLIDENTIFIER"));
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.OP_TYPE_MISMATCH",
+ "Validation type mismatch error for type: $0",
+ "CQLIDENTIFIER");
throw CQLRuntimeException(mload);
}
break;
default:
- MessageLoaderParms mload(String("CQL.CQLValueRep.OP_TYPE_MISMATCH"),
- String("Validation type mismatch error for type: $0"),
- String("UNKNOWN"));
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.OP_TYPE_MISMATCH",
+ "Validation type mismatch error for type: $0",
+ "UNKNOWN");
throw CQLRuntimeException(mload);
break;
}
}
#endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT
default:
- MessageLoaderParms mload(String("CQL.CQLValueRep.SET_VALUE"),
- String("Unable to set internal object type: $0."),
- cv.getType());
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.SET_VALUE",
+ "Unable to set internal object type: $0.",
+ cv.getType());
throw CQLRuntimeException(mload);
} // switch statement
}
}
#endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT
default:
- MessageLoaderParms mload(String("CQL.CQLValueRep.SET_VALUE"),
- String("Unable to set internal object type: $0."),
- cv.getType());
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.SET_VALUE",
+ "Unable to set internal object type: $0.",
+ cv.getType());
throw CQLRuntimeException(mload);
}
if(propertyIndex == PEG_NOT_FOUND)
{
- MessageLoaderParms mload(String("CQL.CQLValueRep.PROP_NOT_FOUND"),
- String("Property $0 not found on class $1."),
- lid.getName().getString(),
- className.getString());
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.PROP_NOT_FOUND",
+ "Property $0 not found on class $1.",
+ lid.getName().getString(),
+ className.getString());
throw CQLRuntimeException(mload);
}
if(qualIndex == PEG_NOT_FOUND)
{
// This property can not be processed with a symbolic constant.
- MessageLoaderParms mload(String("CQL.CQLValueRep.QUALIFIER_NOT_FOUND"),
- String("Qualifier $0 not found on Property $1 in class $2."),
- String("Values"),
- lid.getName().getString(),
- className.getString());
+ MessageLoaderParms mload(
+ "CQL.CQLValueRep.QUALIFIER_NOT_FOUND",
+ "Qualifier $0 not found on Property $1 in class $2.",
+ "Values",
+ lid.getName().getString(),
+ className.getString());
throw CQLRuntimeException(mload);
}
// The symbolic constant provided is not valid
// for this property.
MessageLoaderParms mload(
- String("CQL.CQLValueRep.INVALID_SYMBOLIC_CONSTANT"),
- String("Provided symbolic constant $0 is not valid for"
- " property $1 in class $2."),
+ "CQL.CQLValueRep.INVALID_SYMBOLIC_CONSTANT",
+ "Provided symbolic constant $0 is not valid for"
+ " property $1 in class $2.",
lid.getSymbolicConstantName(),
lid.getName().getString(),
className.getString());
// The symbolic constant provided is not valid
// for this property.
MessageLoaderParms mload(
- String("CQL.CQLValueRep.INVALID_SYMBOLIC_CONSTANT"),
- String("Provided symbolic constant $0 is not valid for property"
- " $1 in class $2."),
+ "CQL.CQLValueRep.INVALID_SYMBOLIC_CONSTANT",
+ "Provided symbolic constant $0 is not valid for property"
+ " $1 in class $2.",
lid.getSymbolicConstantName(),
lid.getName().getString(),
className.getString());
// The symbolic constant provided is not valid
// for this property.
MessageLoaderParms mload(
- String("CQL.CQLValueRep.INVALID_SYMBOLIC_CONSTANT"),
- String("Provided symbolic constant $0 is not valid for property"
- " $1 in class $2."),
+ "CQL.CQLValueRep.INVALID_SYMBOLIC_CONSTANT",
+ "Provided symbolic constant $0 is not valid for property"
+ " $1 in class $2.",
lid.getSymbolicConstantName(),
lid.getName().getString(),
className.getString());
#endif // PEGASUS_EMBEDDED_INSTANCE_SUPPORT
default:
MessageLoaderParms mload(
- String("CQL.CQLValueRep.INVALID_ARRAY_COMPARISON"),
- String("Invalid array comparison type: $0."),
- _in1.getType());
+ "CQL.CQLValueRep.INVALID_ARRAY_COMPARISON",
+ "Invalid array comparison type: $0.",
+ _in1.getType());
throw CQLRuntimeException(mload);
} // switch statement
}
default:
MessageLoaderParms mload(
- String("CQL.CQLValueRep.INVALID_ARRAY_COMPARISON"),
- String("Invalid array comparison type: $0."),
- _in2.getType());
+ "CQL.CQLValueRep.INVALID_ARRAY_COMPARISON",
+ "Invalid array comparison type: $0.",
+ _in2.getType());
throw CQLRuntimeException(mload);
} // switch statement
const Uint32 logComponent, // FUTURE: Support logComponent mask
Uint32 logLevel,
const String& formatString,
- const String& messageId,
+ const char* messageId,
const Formatter::Arg& arg0,
const Formatter::Arg& arg1,
const Formatter::Arg& arg2,
// If the caller specified a messageId, then load the localized
// message in the locale of the server process.
- if (messageId != String::EMPTY)
+ if (messageId)
{
// A message ID was specified. Use the MessageLoader.
MessageLoaderParms msgParms(messageId, formatString);
if (wouldLog(logLevel))
{
Logger::_putInternal(logFileType, systemId, 0, logLevel,
- formatString, String::EMPTY, arg0, arg1, arg2, arg3,
+ formatString, 0, arg0, arg1, arg2, arg3,
arg4, arg5, arg6, arg7, arg8, arg9);
}
}
if (wouldLog(logLevel))
{
Logger::_putInternal(logFileType, systemId, 0, logLevel,
- formatString, String::EMPTY);
+ formatString, 0);
}
}
if (wouldLog(logLevel))
{
Logger::_putInternal(logFileType, systemId, 0, logLevel,
- formatString, String::EMPTY, arg0);
+ formatString, 0, arg0);
}
}
if (wouldLog(logLevel))
{
Logger::_putInternal(logFileType, systemId, 0, logLevel,
- formatString, String::EMPTY, arg0, arg1);
+ formatString, 0, arg0, arg1);
}
}
if (wouldLog(logLevel))
{
Logger::_putInternal(logFileType, systemId, 0, logLevel,
- formatString, String::EMPTY, arg0, arg1, arg2);
+ formatString, 0, arg0, arg1, arg2);
}
}
LogFileType logFileType,
const String& systemId,
Uint32 logLevel,
- const String& messageId,
- const String& formatString,
+ const char* messageId,
+ const char* formatString,
const Formatter::Arg& arg0,
const Formatter::Arg& arg1,
const Formatter::Arg& arg2,
LogFileType logFileType,
const String& systemId,
Uint32 logLevel,
- const String& messageId,
- const String& formatString)
+ const char* messageId,
+ const char* formatString)
{
if (wouldLog(logLevel))
{
LogFileType logFileType,
const String& systemId,
Uint32 logLevel,
- const String& messageId,
- const String& formatString,
+ const char* messageId,
+ const char* formatString,
const Formatter::Arg& arg0)
{
if (wouldLog(logLevel))
LogFileType logFileType,
const String& systemId,
Uint32 logLevel,
- const String& messageId,
- const String& formatString,
+ const char* messageId,
+ const char* formatString,
const Formatter::Arg& arg0,
const Formatter::Arg& arg1)
{
LogFileType logFileType,
const String& systemId,
Uint32 logLevel,
- const String& messageId,
- const String& formatString,
+ const char* messageId,
+ const char* formatString,
const Formatter::Arg& arg0,
const Formatter::Arg& arg1,
const Formatter::Arg& arg2)
if (wouldLog(Logger::TRACE))
{
Logger::_putInternal(logFileType, systemId, logComponent, Logger::TRACE,
- formatString, String::EMPTY, arg0, arg1, arg2, arg3, arg4, arg5,
+ formatString, 0, arg0, arg1, arg2, arg3, arg4, arg5,
arg6, arg7, arg8, arg9);
}
}
if (wouldLog(Logger::TRACE))
{
Logger::_putInternal(logFileType, systemId, logComponent, Logger::TRACE,
- formatString, String::EMPTY);
+ formatString, 0);
}
}
if (wouldLog(Logger::TRACE))
{
Logger::_putInternal(logFileType, systemId, logComponent, Logger::TRACE,
- formatString, String::EMPTY, arg0);
+ formatString, 0, arg0);
}
}
if (wouldLog(Logger::TRACE))
{
Logger::_putInternal(logFileType, systemId, logComponent, Logger::TRACE,
- formatString, String::EMPTY, arg0, arg1);
+ formatString, 0, arg0, arg1);
}
}
if (wouldLog(Logger::TRACE))
{
Logger::_putInternal(logFileType, systemId, logComponent, Logger::TRACE,
- formatString, String::EMPTY, arg0, arg1, arg2);
+ formatString, 0, arg0, arg1, arg2);
}
}
LogFileType logFileType,
const String& systemId,
const Uint32 logComponent,
- const String& messageId,
+ const char* messageId,
const String& formatString,
const Formatter::Arg& arg0,
const Formatter::Arg& arg1,
LogFileType logFileType,
const String& systemId,
const Uint32 logComponent,
- const String& messageId,
+ const char* messageId,
const String& formatString)
{
if (wouldLog(Logger::TRACE))
LogFileType logFileType,
const String& systemId,
const Uint32 logComponent,
- const String& messageId,
+ const char* messageId,
const String& formatString,
const Formatter::Arg& arg0)
{
LogFileType logFileType,
const String& systemId,
const Uint32 logComponent,
- const String& messageId,
+ const char* messageId,
const String& formatString,
const Formatter::Arg& arg0,
const Formatter::Arg& arg1)
LogFileType logFileType,
const String& systemId,
const Uint32 logComponent,
- const String& messageId,
+ const char* messageId,
const String& formatString,
const Formatter::Arg& arg0,
const Formatter::Arg& arg1,
LogFileType logFileType,
const String& systemId,
Uint32 logLevel,
- const String& messageId,
- const String& formatString,
+ const char* messageId,
+ const char* formatString,
const Formatter::Arg& arg0,
const Formatter::Arg& arg1,
const Formatter::Arg& arg2,
LogFileType logFileType,
const String& systemId,
Uint32 logLevel,
- const String& messageId,
- const String& formatString);
+ const char* messageId,
+ const char* formatString);
/** Optimized one-argument form of put_l().
*/
LogFileType logFileType,
const String& systemId,
Uint32 logLevel,
- const String& messageId,
- const String& formatString,
+ const char* messageId,
+ const char* formatString,
const Formatter::Arg& arg0);
/** Optimized two-argument form of put_l().
LogFileType logFileType,
const String& systemId,
Uint32 logLevel,
- const String& messageId,
- const String& formatString,
+ const char* messageId,
+ const char* formatString,
const Formatter::Arg& arg0,
const Formatter::Arg& arg1);
LogFileType logFileType,
const String& systemId,
Uint32 logLevel,
- const String& messageId,
- const String& formatString,
+ const char* messageId,
+ const char* formatString,
const Formatter::Arg& arg0,
const Formatter::Arg& arg1,
const Formatter::Arg& arg2);
LogFileType logFileType,
const String& systemId,
const Uint32 logComponent,
- const String& messageId,
+ const char* messageId,
const String& formatString,
const Formatter::Arg& arg0,
const Formatter::Arg& arg1,
LogFileType logFileType,
const String& systemId,
const Uint32 logComponent,
- const String& messageId,
+ const char* messageId,
const String& formatString);
/** Optimized one-argument form of trace_l().
LogFileType logFileType,
const String& systemId,
const Uint32 logComponent,
- const String& messageId,
+ const char* messageId,
const String& formatString,
const Formatter::Arg& arg0);
LogFileType logFileType,
const String& systemId,
const Uint32 logComponent,
- const String& messageId,
+ const char* messageId,
const String& formatString,
const Formatter::Arg& arg0,
const Formatter::Arg& arg1);
LogFileType logFileType,
const String& systemId,
const Uint32 logComponent,
- const String& messageId,
+ const char* messageId,
const String& formatString,
const Formatter::Arg& arg0,
const Formatter::Arg& arg1,
const Uint32 logComponent,
Uint32 logLevel,
const String& formatString,
- const String& messageId,
+ const char* messageId,
const Formatter::Arg& arg0 = Formatter::DEFAULT_ARG,
const Formatter::Arg& arg1 = Formatter::DEFAULT_ARG,
const Formatter::Arg& arg2 = Formatter::DEFAULT_ARG,
int32_t msgLen = 0;
const UChar* msg = ures_getStringByKey(
- resbundl, (const char*)parms.msg_id.getCString(), &msgLen, &status);
+ resbundl, parms.msg_id, &msgLen, &status);
if (U_FAILURE(status))
{
String MessageLoader::getMessage(MessageLoaderParms& parms)
{
PEG_METHOD_ENTER(TRC_L10N, "MessageLoader::getMessage");
- PEG_TRACE_STRING(TRC_L10N, Tracer::LEVEL4, "Message ID = " + parms.msg_id);
+ PEG_TRACE((TRC_L10N, Tracer::LEVEL4, "Message ID = %s", parms.msg_id));
String msg;
}
MessageLoaderParms::MessageLoaderParms(
- const String& id,
- const String& msg,
+ const char* id,
+ const char* msg,
const Formatter::Arg& arg0_,
const Formatter::Arg& arg1_,
const Formatter::Arg& arg2_,
}
MessageLoaderParms::MessageLoaderParms(
- const String& id,
+ const char* id,
+ const char* msg)
+{
+ msg_id = id;
+ default_msg = msg;
+ _init();
+}
+
+MessageLoaderParms::MessageLoaderParms(
+ const char* id,
const String& msg)
{
msg_id = id;
}
MessageLoaderParms::MessageLoaderParms(
- const String& id,
- const String& msg,
+ const char* id,
+ const char* msg,
const Formatter::Arg& arg0_)
{
msg_id = id;
}
MessageLoaderParms::MessageLoaderParms(
- const String& id,
- const String& msg,
+ const char* id,
+ const char* msg,
const Formatter::Arg& arg0_,
const Formatter::Arg& arg1_)
{
}
MessageLoaderParms::MessageLoaderParms(
- const String& id,
- const String& msg,
+ const char* id,
+ const char* msg,
const Formatter::Arg& arg0_,
const Formatter::Arg& arg1_,
const Formatter::Arg& arg2_)
}
MessageLoaderParms::MessageLoaderParms(
- const String& id,
- const String& msg,
+ const char* id,
+ const char* msg,
const Formatter::Arg& arg0_,
const Formatter::Arg& arg1_,
const Formatter::Arg& arg2_,
arg3 = arg3_;
}
-MessageLoaderParms::MessageLoaderParms(
- const char* id,
- const char* msg)
-{
- msg_id = id;
- default_msg = msg;
- _init();
-}
-
-MessageLoaderParms::MessageLoaderParms(
- const char* id,
- const char* msg,
- const String& arg0_)
-{
- msg_id = id;
- default_msg = msg;
- _init();
- arg0 = arg0_;
-}
-
-MessageLoaderParms::MessageLoaderParms(
- const char* id,
- const char* msg,
- const String& arg0_,
- const String& arg1_)
-{
- msg_id = id;
- default_msg = msg;
- _init();
- arg0 = arg0_;
- arg1 = arg1_;
-}
-
void MessageLoaderParms::_init()
{
useProcessLocale = false;
processLoc = (useProcessLocale) ? "true" : "false";
threadLoc = (useThreadLocale) ? "true" : "false";
- s.append("msg_id = " + msg_id + "\n");
+ s.append("msg_id = ");
+ s.append(msg_id);
+ s.append("\n");
s.append("default_msg = " + default_msg + "\n");
s.append("msg_src_path = " + msg_src_path + "\n");
s.append("acceptlanguages = " +
public:
/**
- String msg_id: unique message identifier for a particular
+ Unique message identifier for a particular
message in a message resource
*/
- String msg_id;
+ const char* msg_id;
/**
String default_msg: the default message to use if a message
/** Constructor */
MessageLoaderParms(
- const String& id,
- const String& msg,
+ const char* id,
+ const char* msg,
const Formatter::Arg& arg0,
const Formatter::Arg& arg1,
const Formatter::Arg& arg2,
/** Constructor */
MessageLoaderParms(
- const String& id,
+ const char* id,
+ const char* msg);
+
+ /**
+ Constructor with a String default message argument and no
+ substitutions. This form is handy for cases like command usage
+ strings where the message is built up dynamically from component parts.
+ */
+ MessageLoaderParms(
+ const char* id,
const String& msg);
/** Constructor */
MessageLoaderParms(
- const String& id,
- const String& msg,
+ const char* id,
+ const char* msg,
const Formatter::Arg& arg0);
/** Constructor */
MessageLoaderParms(
- const String& id,
- const String& msg,
+ const char* id,
+ const char* msg,
const Formatter::Arg& arg0,
const Formatter::Arg& arg1);
/** Constructor */
MessageLoaderParms(
- const String& id,
- const String& msg,
+ const char* id,
+ const char* msg,
const Formatter::Arg& arg0,
const Formatter::Arg& arg1,
const Formatter::Arg& arg2);
/** Constructor */
MessageLoaderParms(
- const String& id,
- const String& msg,
+ const char* id,
+ const char* msg,
const Formatter::Arg& arg0,
const Formatter::Arg& arg1,
const Formatter::Arg& arg2,
const Formatter::Arg& arg3);
- MessageLoaderParms(
- const char* id,
- const char* msg);
-
- MessageLoaderParms(
- const char* id,
- const char* msg,
- const String& arg0);
-
- MessageLoaderParms(
- const char* id,
- const char* msg,
- const String& arg0,
- const String& arg1);
-
/** Converts to string. */
String toString();
const String& message)
{
String dftMsg = _xmlMessages[Uint32(code) - 1];
- String key = _xmlKeys[Uint32(code) - 1];
+ const char* key = _xmlKeys[Uint32(code) - 1];
String msg = message;
dftMsg.append(": on line $0");
dftMsg.append("$1");
}
- return MessageLoaderParms(key, dftMsg, line ,msg);
+ return MessageLoaderParms(key, dftMsg.getCString(), line ,msg);
}
static MessageLoaderParms _formPartialMessage(Uint32 code, Uint32 line)
{
String dftMsg = _xmlMessages[Uint32(code) - 1];
- String key = _xmlKeys[Uint32(code) - 1];
+ const char* key = _xmlKeys[Uint32(code) - 1];
dftMsg.append(": on line $0");
- return MessageLoaderParms(key, dftMsg, line);
+ return MessageLoaderParms(key, dftMsg.getCString(), line);
}
const cimmofMessages::arglist cimmofMessages::EMPTYLIST;
-static String _cimmofMessages[] =
+static const char* _cimmofMessages[] =
{
"OK", //CIM_ERR_SUCCESS
"$0:$1: $2 before '$3'", //PARSER_SYNTAX_ERROR
"Invalid $0 value: $1", // INVALID_LITERAL_VALUE
""
};
-static String _cimmofMessagesKeys [] =
+
+static const char* _cimmofMessagesKeys [] =
{
"Compiler.cimmofMessages.CIM_ERR_SUCCESS",
"Compiler.cimmofMessages.PARSER_SYNTAX_ERROR",
};
-const String & cimmofMessages::msgCodeToString(MsgCode code)
+const char* cimmofMessages::msgCodeToString(MsgCode code)
{
return _cimmofMessages[(unsigned int)code];
}
};
typedef Array<String> arglist;
static const arglist EMPTYLIST;
- static const String &msgCodeToString(MsgCode code);
+ static const char* msgCodeToString(MsgCode code);
static void getMessage(String &out, MsgCode code,
const arglist &al =
cimmofMessages::EMPTYLIST);
path = temp.subString(0,pos);
if (!FileSystem::isDirectory(path))
{
- Logger::put_l(Logger::ERROR_LOG,System::CIMSERVER,
- Logger::SEVERE,
- "$0 is not a directory!",
- path);
+ Logger::put(
+ Logger::ERROR_LOG,System::CIMSERVER, Logger::SEVERE,
+ "$0 is not a directory!",
+ path);
return false;
}
if (!FileSystem::canRead(path))
{
- Logger::put_l(Logger::ERROR_LOG,System::CIMSERVER,
- Logger::SEVERE,
- "Cannot $0 is not readable!",
- path);
+ Logger::put(
+ Logger::ERROR_LOG,System::CIMSERVER, Logger::SEVERE,
+ "Cannot $0 is not readable!",
+ path);
return false;
}
#ifndef PEGASUS_OS_ZOS
if (FileSystem::canWrite(path))
{
- Logger::put_l(Logger::ERROR_LOG,System::CIMSERVER,
- Logger::WARNING,
- "$0 is writeable! Possible security risk.",
- path);
+ Logger::put(
+ Logger::ERROR_LOG,System::CIMSERVER, Logger::WARNING,
+ "$0 is writeable! Possible security risk.",
+ path);
}
#endif
temp.remove(0,pos+token);
// Check for proper execute permissions for sendmail
if (access(SENDMAIL_CMD, X_OK) < 0)
{
- MessageLoaderParms parms(
+ Logger::put_l(Logger::STANDARD_LOG, System::CIMSERVER, Logger::WARNING,
"Handler.EmailListenerDestination.EmailListenerDestination."
"_MSG_EXECUTE_ACCESS_FAILED",
"Cannot execute $0: $1",
SENDMAIL_CMD,
strerror(errno));
- Logger::put_l(Logger::STANDARD_LOG, System::CIMSERVER, Logger::WARNING,
- "Handler.EmailListenerDestination.EmailListenerDestination."
- "_MSG_EXECUTE_ACCESS_FAILED",
- MessageLoader::getMessage(parms));
-
PEG_METHOD_EXIT();
-
return;
}
#endif
// 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
-static const char _MSG_MISSING_REQUIRED [] = "Missing required ";
-
-static const char _MSG_KEY_PROPERTY [] = " key property";
+static const char _MSG_KEY_PROPERTY [] = "The key property $0 is missing.";
static const char _MSG_KEY_PROPERTY_KEY [] =
"IndicationService.IndicationService._MSG_KEY_PROPERTY";
-static const char _MSG_PROPERTY [] = " property";
+static const char _MSG_PROPERTY [] = "The required property $0 is missing.";
static const char _MSG_PROPERTY_KEY [] =
"IndicationService.IndicationService._MSG_PROPERTY";
-static const char _MSG_PROPERTY_PRESENT [] = " property present, but ";
-
-static const char _MSG_VALUE_NOT [] = " value not ";
+static const char _MSG_PROPERTY_PRESENT_BUT_VALUE_NOT[] =
+ "The $0 property is present, but the $1 value is not $2.";
static const char _MSG_PROPERTY_PRESENT_BUT_VALUE_NOT_KEY [] =
"IndicationService.IndicationService._MSG_PROPERTY_PRESENT_BUT_VALUE_NOT";
static const char _MSG_NOT_ACCEPTED_KEY [] =
"IndicationService.IndicationService._MSG_NOT_ACCEPTED";
-static const char _MSG_INVALID_CLASSNAME [] = "Invalid indication class name ";
-
-static const char _MSG_IN_FROM [] = " in FROM clause of ";
+static const char _MSG_INVALID_CLASSNAME_IN_FROM_PROPERTY[] =
+ "The Indication class name $0 is not valid in the FROM clause of $1 $2 "
+ "property.";
static const char _MSG_INVALID_CLASSNAME_IN_FROM_PROPERTY_KEY [] =
"IndicationService.IndicationService."
static const char _MSG_REFERENCED_KEY [] =
"IndicationService.IndicationService._MSG_REFERENCED";
-static const char _MSG_INVALID_VALUE [] = "Invalid value ";
-
-static const char _MSG_INVALID_TYPE [] = "Invalid type ";
-
-static const char _MSG_UNSUPPORTED_VALUE [] = "Unsupported value ";
-
-static const char _MSG_FOR_PROPERTY [] = " for property ";
-
-static const char _MSG_ARRAY_OF [] = "array of ";
+static const char _MSG_INVALID_TYPE_FOR_PROPERTY[] =
+ "The value of type $0 is not valid for property $1.";
static const char _MSG_INVALID_TYPE_FOR_PROPERTY_KEY [] =
"IndicationService.IndicationService._MSG_INVALID_TYPE_FOR_PROPERTY";
+static const char _MSG_INVALID_TYPE_ARRAY_OF_FOR_PROPERTY[] =
+ "The value of an array of type $0 is not valid for property $1.";
+
static const char _MSG_INVALID_TYPE_ARRAY_OF_FOR_PROPERTY_KEY [] =
"IndicationService.IndicationService."
"_MSG_INVALID_TYPE_ARRAY_OF_FOR_PROPERTY";
+static const char _MSG_INVALID_VALUE_FOR_PROPERTY[] =
+ "The value $0 is not valid for property $1.";
+
static const char _MSG_INVALID_VALUE_FOR_PROPERTY_KEY [] =
"IndicationService.IndicationService._MSG_INVALID_VALUE_FOR_PROPERTY";
+static const char _MSG_UNSUPPORTED_VALUE_FOR_PROPERTY[] =
+ "The value $0 is not supported for property $1.";
+
static const char _MSG_UNSUPPORTED_VALUE_FOR_PROPERTY_KEY [] =
"IndicationService.IndicationService._MSG_UNSUPPORTED_VALUE_FOR_PROPERTY";
instance,
PEGASUS_PROPERTYNAME_FILTER,
CIMTYPE_REFERENCE,
- _MSG_KEY_PROPERTY);
+ true);
_checkRequiredProperty(
instance,
PEGASUS_PROPERTYNAME_HANDLER,
CIMTYPE_REFERENCE,
- _MSG_KEY_PROPERTY);
+ true);
//
// Get filter and handler property values
//
// Reject subscription creation
//
- String exceptionStr = _MSG_INVALID_VALUE;
- exceptionStr.append ("$0");
- exceptionStr.append (_MSG_FOR_PROPERTY);
- exceptionStr.append ("$1");
-
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
throw PEGASUS_CIM_EXCEPTION_L(
CIM_ERR_INVALID_PARAMETER,
MessageLoaderParms(
_MSG_INVALID_VALUE_FOR_PROPERTY_KEY,
- exceptionStr,
+ _MSG_INVALID_VALUE_FOR_PROPERTY,
origFilterPath.toString(),
PEGASUS_PROPERTYNAME_FILTER.getString()));
}
//
// Reject subscription creation
//
- String exceptionStr = _MSG_INVALID_VALUE;
- exceptionStr.append ("$0");
- exceptionStr.append (_MSG_FOR_PROPERTY);
- exceptionStr.append ("$1");
-
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
throw PEGASUS_CIM_EXCEPTION_L(
CIM_ERR_INVALID_PARAMETER,
MessageLoaderParms(
_MSG_INVALID_VALUE_FOR_PROPERTY_KEY,
- exceptionStr,
+ _MSG_INVALID_VALUE_FOR_PROPERTY,
origHandlerPath.toString(),
PEGASUS_PROPERTYNAME_HANDLER.getString()));
}
instance,
PEGASUS_PROPERTYNAME_NAME,
CIMTYPE_STRING,
- _MSG_KEY_PROPERTY);
+ true);
_initOrValidateStringProperty(
instance,
instance,
PEGASUS_PROPERTYNAME_QUERY,
CIMTYPE_STRING,
- _MSG_PROPERTY);
+ false);
_checkRequiredProperty(
instance,
PEGASUS_PROPERTYNAME_QUERYLANGUAGE,
CIMTYPE_STRING,
- _MSG_PROPERTY);
+ false);
//
// Validate the query language is supported
instance,
PEGASUS_PROPERTYNAME_LSTNRDST_DESTINATION,
CIMTYPE_STRING,
- _MSG_PROPERTY);
+ false);
}
if (instance.getClassName().equal
instance,
PEGASUS_PROPERTYNAME_LSTNRDST_TARGETHOST,
CIMTYPE_STRING,
- _MSG_PROPERTY);
+ false);
//
// TargetHostFormat property is required for SNMP
instance,
_PROPERTY_TARGETHOSTFORMAT,
CIMTYPE_UINT16,
- _MSG_PROPERTY);
+ false);
//
// SNMPVersion property is required for SNMP Handler
instance,
PEGASUS_PROPERTYNAME_SNMPVERSION,
CIMTYPE_UINT16,
- _MSG_PROPERTY);
+ false);
// Currently, only SNMPv1 trap and SNMPv2C trap are supported,
// verify if the value of SNMPVersion is one of them
instance,
PEGASUS_PROPERTYNAME_LSTNRDST_MAILTO,
CIMTYPE_STRING,
- _MSG_PROPERTY,
+ false,
true);
// get MailTo from handler instance
instance,
PEGASUS_PROPERTYNAME_LSTNRDST_MAILSUBJECT,
CIMTYPE_STRING,
- _MSG_PROPERTY);
+ false);
//
// For MailCc property, verify that if the property
CIMInstance& instance,
const CIMName& propertyName,
const CIMType expectedType,
- const String& message,
- const Boolean isArray)
+ Boolean isKeyProperty,
+ Boolean isArray)
{
PEG_METHOD_ENTER (TRC_INDICATION_SERVICE,
"IndicationService::_checkRequiredProperty");
{
if (theValue.isArray ())
{
- String exceptionStr = _MSG_INVALID_TYPE;
- exceptionStr.append (_MSG_ARRAY_OF);
- 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_ARRAY_OF_FOR_PROPERTY_KEY,
- exceptionStr,
- cimTypeToString (theValue.getType ()),
- propertyName.getString ()));
+ PEG_METHOD_EXIT();
+ throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_INVALID_PARAMETER,
+ MessageLoaderParms(
+ _MSG_INVALID_TYPE_ARRAY_OF_FOR_PROPERTY_KEY,
+ _MSG_INVALID_TYPE_ARRAY_OF_FOR_PROPERTY,
+ cimTypeToString(theValue.getType()),
+ propertyName.getString()));
}
else
{
- String exceptionStr = _MSG_INVALID_TYPE;
- 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,
- exceptionStr,
- cimTypeToString (theValue.getType ()),
- propertyName.getString ()));
+ PEG_METHOD_EXIT();
+ throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_INVALID_PARAMETER,
+ MessageLoaderParms(
+ _MSG_INVALID_TYPE_FOR_PROPERTY_KEY,
+ _MSG_INVALID_TYPE_FOR_PROPERTY,
+ cimTypeToString(theValue.getType()),
+ propertyName.getString()));
}
}
}
if (missingProperty)
{
-
- // l10n
-
- String exceptionStr = _MSG_MISSING_REQUIRED;
- // exceptionStr.append (propertyName.getString());
- exceptionStr.append ("$0");
- 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)
+ if (isKeyProperty)
{
- message_key = _MSG_PROPERTY_KEY;
+ PEG_METHOD_EXIT();
+ throw PEGASUS_CIM_EXCEPTION_L(
+ CIM_ERR_INVALID_PARAMETER,
+ MessageLoaderParms(
+ _MSG_KEY_PROPERTY_KEY,
+ _MSG_KEY_PROPERTY,
+ propertyName.getString()));
}
else
{
- message_key = String("");
+ PEG_METHOD_EXIT();
+ throw PEGASUS_CIM_EXCEPTION_L(
+ CIM_ERR_INVALID_PARAMETER,
+ MessageLoaderParms(
+ _MSG_PROPERTY_KEY,
+ _MSG_PROPERTY,
+ propertyName.getString()));
}
-
- PEG_METHOD_EXIT ();
-
- // 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 ();
}
//
if (!Contains (validValues, result))
{
- String exceptionStr = _MSG_INVALID_VALUE;
- 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_VALUE_FOR_PROPERTY_KEY,
- exceptionStr,
- theValue.toString(), propertyName.getString()));
+ PEG_METHOD_EXIT();
+ throw PEGASUS_CIM_EXCEPTION_L(
+ CIM_ERR_INVALID_PARAMETER,
+ MessageLoaderParms(
+ _MSG_INVALID_VALUE_FOR_PROPERTY_KEY,
+ _MSG_INVALID_VALUE_FOR_PROPERTY,
+ theValue.toString(),
+ propertyName.getString()));
}
//
//
if (!Contains(supportedValues, result))
{
- String exceptionStr = _MSG_UNSUPPORTED_VALUE;
- exceptionStr.append("$0");
- exceptionStr.append(_MSG_FOR_PROPERTY);
- exceptionStr.append("$1");
-
PEG_METHOD_EXIT();
-
throw PEGASUS_CIM_EXCEPTION_L(
CIM_ERR_NOT_SUPPORTED,
MessageLoaderParms(
_MSG_UNSUPPORTED_VALUE_FOR_PROPERTY_KEY,
- exceptionStr,
+ _MSG_UNSUPPORTED_VALUE_FOR_PROPERTY,
theValue.toString(),
propertyName.getString()));
}
{
if (instance.findProperty(otherPropertyName) == PEG_NOT_FOUND)
{
- String exceptionStr = _MSG_MISSING_REQUIRED;
- exceptionStr.append("$0");
- exceptionStr.append(_MSG_PROPERTY);
-
PEG_METHOD_EXIT();
-
throw PEGASUS_CIM_EXCEPTION_L(
CIM_ERR_INVALID_PARAMETER,
MessageLoaderParms(
_MSG_PROPERTY_KEY,
- exceptionStr,
+ _MSG_PROPERTY,
otherPropertyName.getString()));
}
else
CIMValue theOtherValue = otherProperty.getValue();
if (theOtherValue.isNull())
{
- String exceptionStr = _MSG_MISSING_REQUIRED;
- exceptionStr.append("$0");
- exceptionStr.append(_MSG_PROPERTY);
-
PEG_METHOD_EXIT();
-
throw PEGASUS_CIM_EXCEPTION_L(
CIM_ERR_INVALID_PARAMETER,
MessageLoaderParms(
_MSG_PROPERTY_KEY,
- exceptionStr,
+ _MSG_PROPERTY,
otherPropertyName.getString()));
}
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");
-
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
throw PEGASUS_CIM_EXCEPTION_L(
CIM_ERR_INVALID_PARAMETER,
MessageLoaderParms(
_MSG_INVALID_TYPE_FOR_PROPERTY_KEY,
- exceptionStr,
+ _MSG_INVALID_TYPE_FOR_PROPERTY,
cimTypeToString(theOtherValue.getType()),
otherPropertyName.getString()));
}
CIMValue theOtherValue = otherProperty.getValue();
if (!theOtherValue.isNull())
{
- String exceptionStr("$0");
- exceptionStr.append(_MSG_PROPERTY_PRESENT);
- exceptionStr.append("$1");
- exceptionStr.append(_MSG_VALUE_NOT);
- exceptionStr.append("$2");
-
PEG_METHOD_EXIT();
-
throw PEGASUS_CIM_EXCEPTION_L(
CIM_ERR_INVALID_PARAMETER,
MessageLoaderParms(
_MSG_PROPERTY_PRESENT_BUT_VALUE_NOT_KEY,
- exceptionStr,
+ _MSG_PROPERTY_PRESENT_BUT_VALUE_NOT,
otherPropertyName.getString(),
propertyName.getString(),
CIMValue(otherValue).toString()));
//
if (theValue.isArray ())
{
- String exceptionStr = _MSG_INVALID_TYPE;
- exceptionStr.append (_MSG_ARRAY_OF);
- 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_ARRAY_OF_FOR_PROPERTY_KEY,
- exceptionStr,
- cimTypeToString (theValue.getType ()),
- propertyName.getString ()));
+ PEG_METHOD_EXIT();
+ throw PEGASUS_CIM_EXCEPTION_L(
+ CIM_ERR_INVALID_PARAMETER,
+ MessageLoaderParms(
+ _MSG_INVALID_TYPE_ARRAY_OF_FOR_PROPERTY_KEY,
+ _MSG_INVALID_TYPE_ARRAY_OF_FOR_PROPERTY,
+ cimTypeToString(theValue.getType()),
+ propertyName.getString()));
}
else
{
- String exceptionStr = _MSG_INVALID_TYPE;
- 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,
- exceptionStr,
- cimTypeToString (theValue.getType ()),
- propertyName.getString ()));
+ PEG_METHOD_EXIT();
+ throw PEGASUS_CIM_EXCEPTION_L(
+ CIM_ERR_INVALID_PARAMETER,
+ MessageLoaderParms(
+ _MSG_INVALID_TYPE_FOR_PROPERTY_KEY,
+ _MSG_INVALID_TYPE_FOR_PROPERTY,
+ cimTypeToString(theValue.getType()),
+ propertyName.getString()));
}
}
else
//
// Property value specified is invalid
//
- String exceptionStr = _MSG_INVALID_VALUE;
- 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_VALUE_FOR_PROPERTY_KEY,
- exceptionStr,
- propertyValue, propertyName.getString ()));
+ PEG_METHOD_EXIT();
+ throw PEGASUS_CIM_EXCEPTION_L(
+ CIM_ERR_INVALID_PARAMETER,
+ MessageLoaderParms(
+ _MSG_INVALID_VALUE_FOR_PROPERTY_KEY,
+ _MSG_INVALID_VALUE_FOR_PROPERTY,
+ propertyValue,
+ propertyName.getString()));
}
PEG_METHOD_EXIT ();
//
if (theValue.isArray ())
{
- String exceptionStr = _MSG_INVALID_TYPE;
- exceptionStr.append (_MSG_ARRAY_OF);
- 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_ARRAY_OF_FOR_PROPERTY_KEY,
- exceptionStr,
- cimTypeToString (theValue.getType ()),
- propertyName.getString ()));
+ PEG_METHOD_EXIT();
+ throw PEGASUS_CIM_EXCEPTION_L(
+ CIM_ERR_INVALID_PARAMETER,
+ MessageLoaderParms(
+ _MSG_INVALID_TYPE_ARRAY_OF_FOR_PROPERTY_KEY,
+ _MSG_INVALID_TYPE_ARRAY_OF_FOR_PROPERTY,
+ cimTypeToString(theValue.getType()),
+ propertyName.getString()));
}
else
{
- String exceptionStr = _MSG_INVALID_TYPE;
- 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,
- exceptionStr,
- cimTypeToString (theValue.getType ()),
- propertyName.getString ()));
+ PEG_METHOD_EXIT();
+ throw PEGASUS_CIM_EXCEPTION_L(
+ CIM_ERR_INVALID_PARAMETER,
+ MessageLoaderParms(
+ _MSG_INVALID_TYPE_FOR_PROPERTY_KEY,
+ _MSG_INVALID_TYPE_FOR_PROPERTY,
+ cimTypeToString(theValue.getType()),
+ propertyName.getString()));
}
}
}
// Note: Valid values are defined by the PG Events MOF
if (!Contains(validValues, theValue))
{
- String exceptionStr = _MSG_INVALID_VALUE;
- exceptionStr.append ("$0");
- exceptionStr.append (_MSG_FOR_PROPERTY);
- exceptionStr.append ("$1");
-
- PEG_METHOD_EXIT ();
+ PEG_METHOD_EXIT();
- throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_INVALID_PARAMETER,
- MessageLoaderParms (_MSG_INVALID_VALUE_FOR_PROPERTY_KEY,
- exceptionStr,
- theValue,
- propertyName.getString()));
+ throw PEGASUS_CIM_EXCEPTION_L(
+ CIM_ERR_INVALID_PARAMETER,
+ MessageLoaderParms(
+ _MSG_INVALID_VALUE_FOR_PROPERTY_KEY,
+ _MSG_INVALID_VALUE_FOR_PROPERTY,
+ theValue,
+ propertyName.getString()));
}
// supported
if (!Contains(supportedValues, theValue))
{
- String exceptionStr = _MSG_UNSUPPORTED_VALUE;
- exceptionStr.append ("$0");
- exceptionStr.append (_MSG_FOR_PROPERTY);
- exceptionStr.append ("$1");
-
- PEG_METHOD_EXIT ();
-
- throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_NOT_SUPPORTED,
- MessageLoaderParms (_MSG_UNSUPPORTED_VALUE_FOR_PROPERTY_KEY,
- exceptionStr,
- theValue,
- propertyName.getString()));
+ PEG_METHOD_EXIT();
+ throw PEGASUS_CIM_EXCEPTION_L(
+ CIM_ERR_NOT_SUPPORTED,
+ MessageLoaderParms(
+ _MSG_UNSUPPORTED_VALUE_FOR_PROPERTY_KEY,
+ _MSG_UNSUPPORTED_VALUE_FOR_PROPERTY,
+ theValue,
+ propertyName.getString()));
}
}
}
if (!validClass)
{
- // l10n
- // String exceptionStr = _MSG_INVALID_CLASSNAME;
- String exceptionStr = String ("Invalid indication class name ");
- // exceptionStr.append (indicationClassName.getString());
- exceptionStr.append ("$0");
- // exceptionStr.append (_MSG_IN_FROM);
- exceptionStr.append (" in FROM clause of ");
- // exceptionStr.append (PEGASUS_CLASSNAME_INDFILTER.getString());
- exceptionStr.append ("$1");
- exceptionStr.append (" ");
- // exceptionStr.append (PEGASUS_PROPERTYNAME_QUERY.getString());
- exceptionStr.append ("$2");
- exceptionStr.append (_MSG_PROPERTY);
-
- PEG_METHOD_EXIT ();
-
- // 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,
- indicationClassName.getString (),
- PEGASUS_CLASSNAME_INDFILTER.getString (),
- PEGASUS_PROPERTYNAME_QUERY.getString ()));
+ PEG_METHOD_EXIT();
+ throw PEGASUS_CIM_EXCEPTION_L(
+ CIM_ERR_INVALID_PARAMETER,
+ MessageLoaderParms(
+ _MSG_INVALID_CLASSNAME_IN_FROM_PROPERTY_KEY,
+ _MSG_INVALID_CLASSNAME_IN_FROM_PROPERTY,
+ indicationClassName.getString(),
+ PEGASUS_CLASSNAME_INDFILTER.getString(),
+ PEGASUS_PROPERTYNAME_QUERY.getString()));
}
PEG_METHOD_EXIT ();
@param instance instance to be validated
@param propertyName name of property to be validated
@param expectedType expected CIMType of property value
- @param message message to be used in exception
+ @param isKeyProperty indicates whether the property is a key
+ property (used for selection of error
+ message)
@param isArray indicates whether the validated
property is array
CIMInstance& instance,
const CIMName& propertyName,
const CIMType expectedType,
- const String& message,
- const Boolean isArray = false);
+ Boolean isKeyProperty,
+ Boolean isArray = false);
/**
Validates the specified Uint16 (non-array) property and its
if (msgId != NULL)
{
- parms->msg_id.assign(msgId);
+ parms->msg_id = msgId;
}
if ( defMsg != NULL )
PEGASUS_NAMESPACE_BEGIN
-const String CIMOperationResponseEncoder::OUT_OF_MEMORY_MESSAGE =
- "A System error has occurred. Please retry the CIM Operation at a "
- "later time.";
-
CIMOperationResponseEncoder::CIMOperationResponseEncoder()
: Base(PEGASUS_QUEUENAME_OPRESPENCODER)
{
Boolean isImplicit,
Buffer* bodygiven)
{
- static String funcname = "CIMOperationResponseEncoder::sendResponse: ";
- static String funcnameClassS = String(funcname + "for class " + name);
- static CString funcnameClass = funcnameClassS.getCString();
- PEG_METHOD_ENTER(TRC_DISPATCHER, funcnameClass);
+ PEG_METHOD_ENTER(TRC_DISPATCHER,
+ "CIMOperationResponseEncoder::sendResponse");
+ PEG_TRACE((TRC_HTTP, Tracer::LEVEL4,
+ "name = %s",
+ (const char*)name.getCString()));
if (! response)
{
isFirst,
isLast);
}
-#if defined(PEGASUS_OS_TYPE_WINDOWS)
- catch (std::bad_alloc&)
-#else
- catch (bad_alloc&)
-#endif
+ catch (PEGASUS_STD(bad_alloc)&)
{
+ MessageLoaderParms parms(
+ "Server.CIMOperationResponseEncoder.OUT_OF_MEMORY",
+ "A System error has occurred. Please retry the CIM Operation "
+ "at a later time.");
+
Logger::put(
- Logger::ERROR_LOG,
- System::CIMSERVER,
- Logger::WARNING,
- funcname + OUT_OF_MEMORY_MESSAGE);
-
- cimException = PEGASUS_CIM_EXCEPTION_L(
- CIM_ERR_FAILED, MessageLoaderParms(
- "Server.CIMOperationResponseEncoder.OUT_OF_MEMORY",
- OUT_OF_MEMORY_MESSAGE));
+ Logger::ERROR_LOG, System::CIMSERVER, Logger::WARNING,
+ MessageLoader::getMessage(parms));
+
+ cimException = PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms);
// try again with new error and no body
body.clear();