BUG#: 7784
authorkumpf <kumpf>
Tue, 12 Aug 2008 17:35:06 +0000 (17:35 +0000)
committerkumpf <kumpf>
Tue, 12 Aug 2008 17:35:06 +0000 (17:35 +0000)
TITLE: Use char* instead of String for message IDs
DESCRIPTION: Do not convert message IDs to Strings.

19 files changed:
src/Pegasus/CQL/CQL.l
src/Pegasus/CQL/CQLIdentifierRep.cpp
src/Pegasus/CQL/CQLLEX.cpp
src/Pegasus/CQL/CQLTermRep.cpp
src/Pegasus/CQL/CQLValueRep.cpp
src/Pegasus/Common/Logger.cpp
src/Pegasus/Common/Logger.h
src/Pegasus/Common/MessageLoader.cpp
src/Pegasus/Common/MessageLoader.h
src/Pegasus/Common/XmlParser.cpp
src/Pegasus/Compiler/cimmofMessages.cpp
src/Pegasus/Compiler/cimmofMessages.h
src/Pegasus/Config/ProviderDirPropertyOwner.cpp
src/Pegasus/Handler/EmailListenerDestination/EmailListenerDestination.cpp
src/Pegasus/IndicationService/IndicationMessageConstants.h
src/Pegasus/IndicationService/IndicationService.cpp
src/Pegasus/IndicationService/IndicationService.h
src/Pegasus/ProviderManager2/CMPI/CMPI_BrokerEnc.cpp
src/Pegasus/Server/CIMOperationResponseEncoder.cpp

index 3adbb0f8f9fdf43c05a2d2481a00751e830f5c02..76f7d69d58a69b10dd7522719c7b4d725d3af6fe 100644 (file)
@@ -474,9 +474,9 @@ Z [Zz]
     {   
         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));
     }
 
index a721ee778e1d1401e2a040839c7771a343cbc511..7fca5981cee63d313a3fe5efe200ea065c1b78e0 100644 (file)
@@ -116,9 +116,9 @@ void CQLIdentifierRep::parse(String identifier)
         {
             //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);
         }
@@ -144,9 +144,9 @@ void CQLIdentifierRep::parse(String identifier)
             {
                 // 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);
                 // 
@@ -167,8 +167,8 @@ void CQLIdentifierRep::parse(String identifier)
         {
           // 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);
         }
@@ -201,8 +201,8 @@ void CQLIdentifierRep::parse(String identifier)
         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);
         }
index 3555404d0b010ec6f414036eb2f480be767c632f..281637b2044e76d2f184fbdcb90b229ffac19368 100644 (file)
@@ -20,7 +20,7 @@
 /* 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
@@ -1316,9 +1316,9 @@ YY_RULE_SETUP
     {   
         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));
     }
 
index 9e4043c04d5090f8e771ad665d1b01e98d1ad731..482d1f6701f7e752fd4c544142e8c42b55011e2b 100755 (executable)
@@ -86,8 +86,8 @@ CQLValue CQLTermRep::resolveValue(const CIMInstance& CI,
             
              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);
         }
     }
index b31e0ffdb3edd9952c9ff5e97e504f43257da890..89b09d92aaea47ab4d6ac86fad1324e3a743f7e7 100755 (executable)
@@ -146,9 +146,10 @@ CQLValueRep::CQLValueRep(const String& inString,
      }
      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;
@@ -590,10 +591,11 @@ Boolean CQLValueRep::operator==(const CQLValueRep& x)
       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;
@@ -773,9 +775,10 @@ Boolean CQLValueRep::operator<(const CQLValueRep& x)
       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();
@@ -813,8 +816,9 @@ CQLValueRep CQLValueRep::operator+(const CQLValueRep x)
        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;
@@ -895,8 +899,9 @@ Boolean CQLValueRep::isa(const CQLChainedIdentifier& inID,
   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);
     }
@@ -939,9 +944,10 @@ Boolean CQLValueRep::like(const CQLValueRep& inVal)
    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);
    }
    
@@ -972,10 +978,11 @@ Uint64 CQLValueRep::getUint()const
          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;
@@ -994,10 +1001,11 @@ Boolean CQLValueRep::getBool()const
        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;
@@ -1017,10 +1025,11 @@ Sint64 CQLValueRep::getSint()const
        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;
@@ -1039,10 +1048,11 @@ Real64 CQLValueRep::getReal()const
        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;
@@ -1060,10 +1070,11 @@ String CQLValueRep::getString()const
        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;
@@ -1081,10 +1092,11 @@ CIMDateTime CQLValueRep::getDateTime()const
        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;
@@ -1103,10 +1115,11 @@ CIMObjectPath CQLValueRep::getReference()const
        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;
@@ -1125,10 +1138,11 @@ CIMObject CQLValueRep::getObject()const
        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;
@@ -1183,10 +1197,11 @@ void CQLValueRep::_validate(const CQLValueRep& x)
   // 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)
@@ -1194,9 +1209,10 @@ void CQLValueRep::_validate(const CQLValueRep& x)
     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;
@@ -1207,62 +1223,69 @@ void CQLValueRep::_validate(const CQLValueRep& x)
      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;
     }
@@ -1619,9 +1642,10 @@ void CQLValueRep::_setValue(CIMValue cv,Sint64 key)
       }
 #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 
     }
@@ -1762,9 +1786,10 @@ void CQLValueRep::_setValue(CIMValue cv,Sint64 key)
     } 
 #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);
     }
 
@@ -1850,10 +1875,11 @@ void CQLValueRep::_resolveSymbolicConstant(const QueryContext& inQueryCtx)
 
    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);
    }
 
@@ -1867,11 +1893,12 @@ void CQLValueRep::_resolveSymbolicConstant(const QueryContext& inQueryCtx)
    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);
    }
 
@@ -1903,9 +1930,9 @@ void CQLValueRep::_resolveSymbolicConstant(const QueryContext& inQueryCtx)
        // 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());
@@ -1947,9 +1974,9 @@ void CQLValueRep::_resolveSymbolicConstant(const QueryContext& inQueryCtx)
        // 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());
@@ -1963,9 +1990,9 @@ void CQLValueRep::_resolveSymbolicConstant(const QueryContext& inQueryCtx)
        // 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());
@@ -2191,9 +2218,9 @@ Boolean CQLValueRep::_compareArray(const CQLValueRep& _in)
 #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 
   
@@ -2284,9 +2311,9 @@ Boolean CQLValueRep::_compareArray(const CQLValueRep& _in)
       }   
     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 
 
index 164818a1388abd301b1c7e066f2486ad30f9e701..69f7357b64941fbd04128f254cdb11cab376e69f 100644 (file)
@@ -309,7 +309,7 @@ void Logger::_putInternal(
     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,
@@ -335,7 +335,7 @@ void Logger::_putInternal(
 
         // 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);
@@ -404,7 +404,7 @@ void Logger::put(
     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);
     }
 }
@@ -418,7 +418,7 @@ void Logger::put(
     if (wouldLog(logLevel))
     {
         Logger::_putInternal(logFileType, systemId, 0, logLevel,
-            formatString, String::EMPTY);
+            formatString, 0);
     }
 }
 
@@ -432,7 +432,7 @@ void Logger::put(
     if (wouldLog(logLevel))
     {
         Logger::_putInternal(logFileType, systemId, 0, logLevel,
-            formatString, String::EMPTY, arg0);
+            formatString, 0, arg0);
     }
 }
 
@@ -447,7 +447,7 @@ void Logger::put(
     if (wouldLog(logLevel))
     {
         Logger::_putInternal(logFileType, systemId, 0, logLevel,
-            formatString, String::EMPTY, arg0, arg1);
+            formatString, 0, arg0, arg1);
     }
 }
 
@@ -463,7 +463,7 @@ void Logger::put(
     if (wouldLog(logLevel))
     {
         Logger::_putInternal(logFileType, systemId, 0, logLevel,
-            formatString, String::EMPTY, arg0, arg1, arg2);
+            formatString, 0, arg0, arg1, arg2);
     }
 }
 
@@ -471,8 +471,8 @@ void Logger::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,
     const Formatter::Arg& arg2,
@@ -496,8 +496,8 @@ void Logger::put_l(
      LogFileType logFileType,
      const String& systemId,
      Uint32 logLevel,
-     const String& messageId,
-     const String& formatString)
+     const char* messageId,
+     const char* formatString)
 {
     if (wouldLog(logLevel))
     {
@@ -510,8 +510,8 @@ void Logger::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)
 {
     if (wouldLog(logLevel))
@@ -525,8 +525,8 @@ void Logger::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)
 {
@@ -541,8 +541,8 @@ void Logger::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,
      const Formatter::Arg& arg2)
@@ -573,7 +573,7 @@ void Logger::trace(
     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);
     }
 }
@@ -587,7 +587,7 @@ void Logger::trace(
     if (wouldLog(Logger::TRACE))
     {
         Logger::_putInternal(logFileType, systemId, logComponent, Logger::TRACE,
-            formatString, String::EMPTY);
+            formatString, 0);
     }
 }
 
@@ -601,7 +601,7 @@ void Logger::trace(
     if (wouldLog(Logger::TRACE))
     {
         Logger::_putInternal(logFileType, systemId, logComponent, Logger::TRACE,
-            formatString, String::EMPTY, arg0);
+            formatString, 0, arg0);
     }
 }
 
@@ -616,7 +616,7 @@ void Logger::trace(
     if (wouldLog(Logger::TRACE))
     {
         Logger::_putInternal(logFileType, systemId, logComponent, Logger::TRACE,
-            formatString, String::EMPTY, arg0, arg1);
+            formatString, 0, arg0, arg1);
     }
 }
 
@@ -632,7 +632,7 @@ void Logger::trace(
     if (wouldLog(Logger::TRACE))
     {
         Logger::_putInternal(logFileType, systemId, logComponent, Logger::TRACE,
-            formatString, String::EMPTY, arg0, arg1, arg2);
+            formatString, 0, arg0, arg1, arg2);
     }
 }
 
@@ -640,7 +640,7 @@ void Logger::trace_l(
     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,
@@ -665,7 +665,7 @@ void Logger::trace_l(
     LogFileType logFileType,
     const String& systemId,
     const Uint32 logComponent,
-    const String& messageId,
+    const char* messageId,
     const String& formatString)
 {
     if (wouldLog(Logger::TRACE))
@@ -679,7 +679,7 @@ void Logger::trace_l(
     LogFileType logFileType,
     const String& systemId,
     const Uint32 logComponent,
-    const String& messageId,
+    const char* messageId,
     const String& formatString,
     const Formatter::Arg& arg0)
 {
@@ -694,7 +694,7 @@ void Logger::trace_l(
     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)
@@ -710,7 +710,7 @@ void Logger::trace_l(
     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,
index 8867c81e60fab0d497a4694e1c1ce33de27131ed..5412ae09098987ad977c53f8b15ca8be25fcabfa 100644 (file)
@@ -167,8 +167,8 @@ public:
         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,
@@ -186,8 +186,8 @@ public:
         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().
     */
@@ -195,8 +195,8 @@ public:
         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().
@@ -205,8 +205,8 @@ public:
         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);
 
@@ -216,8 +216,8 @@ public:
         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);
@@ -286,7 +286,7 @@ public:
         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,
@@ -305,7 +305,7 @@ public:
         LogFileType logFileType,
         const String& systemId,
         const Uint32 logComponent,
-        const String& messageId,
+        const char* messageId,
         const String& formatString);
 
     /** Optimized one-argument form of trace_l().
@@ -314,7 +314,7 @@ public:
         LogFileType logFileType,
         const String& systemId,
         const Uint32 logComponent,
-        const String& messageId,
+        const char* messageId,
         const String& formatString,
         const Formatter::Arg& arg0);
 
@@ -324,7 +324,7 @@ public:
         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);
@@ -335,7 +335,7 @@ public:
         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,
@@ -388,7 +388,7 @@ private:
         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,
index 43194f1620f7a777b4eaebb9309fe8956b173174..cb86e648e011cd59bc408b93fb569934e9d92c0e 100755 (executable)
@@ -227,7 +227,7 @@ String MessageLoaderICU::extractICUMessage(
     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))
     {
@@ -415,7 +415,7 @@ AcceptLanguageList MessageLoader::_acceptlanguages;
 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;
 
@@ -761,8 +761,8 @@ MessageLoaderParms::MessageLoaderParms()
 }
 
 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_,
@@ -790,7 +790,16 @@ MessageLoaderParms::MessageLoaderParms(
 }
 
 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;
@@ -799,8 +808,8 @@ MessageLoaderParms::MessageLoaderParms(
 }
 
 MessageLoaderParms::MessageLoaderParms(
-    const String& id,
-    const String& msg,
+    const char* id,
+    const char* msg,
     const Formatter::Arg& arg0_)
 {
     msg_id = id;
@@ -810,8 +819,8 @@ MessageLoaderParms::MessageLoaderParms(
 }
 
 MessageLoaderParms::MessageLoaderParms(
-    const String& id,
-    const String& msg,
+    const char* id,
+    const char* msg,
     const Formatter::Arg& arg0_,
     const Formatter::Arg& arg1_)
 {
@@ -823,8 +832,8 @@ MessageLoaderParms::MessageLoaderParms(
 }
 
 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_)
@@ -838,8 +847,8 @@ MessageLoaderParms::MessageLoaderParms(
 }
 
 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_,
@@ -854,39 +863,6 @@ MessageLoaderParms::MessageLoaderParms(
     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;
@@ -916,7 +892,9 @@ String MessageLoaderParms::toString()
     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 = " +
index a18b3941ee87ed8c558410c0999acbb5a9736d6a..ca2fa26ab4f5e99dc2cec777eb3f8a1e21496260 100755 (executable)
@@ -56,10 +56,10 @@ class PEGASUS_COMMON_LINKAGE MessageLoaderParms
 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
@@ -138,8 +138,8 @@ public:
 
     /** 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,
@@ -153,54 +153,48 @@ public:
 
     /** 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();
 
index 1f3f709e3d059b8462cc2fb369cc5f78b6f8fa67..899173fba243d0e60ac4a97d089339e166f087d9 100644 (file)
@@ -210,7 +210,7 @@ static MessageLoaderParms _formMessage(
     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");
@@ -220,17 +220,17 @@ static MessageLoaderParms _formMessage(
         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);
 }
 
 
index fdb6d3a1b49b56a3c6bae0fca53e69be5a39d8b1..e63fb21d0e134c2b03bb5e7af8e2ae408663d6c5 100755 (executable)
@@ -44,7 +44,7 @@ PEGASUS_USING_STD;
 
 const cimmofMessages::arglist cimmofMessages::EMPTYLIST;
 
-static String _cimmofMessages[] =
+static const char* _cimmofMessages[] =
 {
     "OK", //CIM_ERR_SUCCESS
     "$0:$1: $2 before '$3'", //PARSER_SYNTAX_ERROR
@@ -121,7 +121,8 @@ static String _cimmofMessages[] =
     "Invalid $0 value: $1",    // INVALID_LITERAL_VALUE
     ""
 };
-static String _cimmofMessagesKeys [] =
+
+static const char* _cimmofMessagesKeys [] =
 {
     "Compiler.cimmofMessages.CIM_ERR_SUCCESS",
     "Compiler.cimmofMessages.PARSER_SYNTAX_ERROR",
@@ -176,7 +177,7 @@ static String _cimmofMessagesKeys [] =
 };
 
 
-const String & cimmofMessages::msgCodeToString(MsgCode code)
+const char* cimmofMessages::msgCodeToString(MsgCode code)
 {
     return _cimmofMessages[(unsigned int)code];
 }
index 0ad2657f6afff9773b2c8fa97d5edbac6e8a9f47..fddde059b969f9132ec09a9bb03993e16c6316b8 100755 (executable)
@@ -106,7 +106,7 @@ class cimmofMessages
         };
         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);
index dc398dc7fb96778410bb76fe3cf6f3865c743347..3acce8f327f2b27c692917c342b2d37996e04747 100644 (file)
@@ -110,27 +110,27 @@ Boolean isProviderDirValid(const String& dirName)
         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);
index f794e936eb6470ce35b502fa8711553f2d756cd9..645f16e2e1e57bbad225801d1ab0c0c40c2c036f 100644 (file)
@@ -180,20 +180,14 @@ void EmailListenerDestination::_sendViaEmail(
     // 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
index 7c32521eaa2060d31a90f76b4bcdbed4f2757578..9fce3dbb33a198c1452978be2dd6df6254611524 100644 (file)
@@ -51,27 +51,20 @@ PEGASUS_NAMESPACE_BEGIN
 //  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";
@@ -88,9 +81,9 @@ static const char _MSG_NOT_ACCEPTED [] =
 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."
@@ -108,26 +101,28 @@ static const char _MSG_REFERENCED [] =
 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";
 
index eb9b6bf0bc30d98c8d42c14bdd9ee6c3441ecd51..e6041fa17301c72caa80cde88948172c6999c7f4 100644 (file)
@@ -3160,12 +3160,12 @@ Boolean IndicationService::_canCreate (
             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
@@ -3203,17 +3203,12 @@ Boolean IndicationService::_canCreate (
                 //
                 //  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()));
             }
@@ -3227,17 +3222,12 @@ Boolean IndicationService::_canCreate (
                 //
                 //  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()));
             }
@@ -3428,7 +3418,7 @@ Boolean IndicationService::_canCreate (
             instance,
             PEGASUS_PROPERTYNAME_NAME,
             CIMTYPE_STRING,
-            _MSG_KEY_PROPERTY);
+            true);
 
         _initOrValidateStringProperty(
             instance,
@@ -3454,12 +3444,12 @@ Boolean IndicationService::_canCreate (
                 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
@@ -3624,7 +3614,7 @@ Boolean IndicationService::_canCreate (
                     instance,
                     PEGASUS_PROPERTYNAME_LSTNRDST_DESTINATION,
                     CIMTYPE_STRING,
-                    _MSG_PROPERTY);
+                    false);
             }
 
             if (instance.getClassName().equal
@@ -3638,7 +3628,7 @@ Boolean IndicationService::_canCreate (
                     instance,
                     PEGASUS_PROPERTYNAME_LSTNRDST_TARGETHOST,
                     CIMTYPE_STRING,
-                    _MSG_PROPERTY);
+                    false);
 
                 //
                 //  TargetHostFormat property is required for SNMP
@@ -3648,7 +3638,7 @@ Boolean IndicationService::_canCreate (
                     instance,
                     _PROPERTY_TARGETHOSTFORMAT,
                     CIMTYPE_UINT16,
-                    _MSG_PROPERTY);
+                    false);
 
                 //
                 //  SNMPVersion property is required for SNMP Handler
@@ -3657,7 +3647,7 @@ Boolean IndicationService::_canCreate (
                     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
@@ -3690,7 +3680,7 @@ Boolean IndicationService::_canCreate (
                     instance,
                     PEGASUS_PROPERTYNAME_LSTNRDST_MAILTO,
                     CIMTYPE_STRING,
-                    _MSG_PROPERTY,
+                    false,
                     true);
 
                 // get MailTo from handler instance
@@ -3736,7 +3726,7 @@ Boolean IndicationService::_canCreate (
                     instance,
                     PEGASUS_PROPERTYNAME_LSTNRDST_MAILSUBJECT,
                     CIMTYPE_STRING,
-                    _MSG_PROPERTY);
+                    false);
 
                 //
                 //  For MailCc property, verify that if the property
@@ -3773,8 +3763,8 @@ void IndicationService::_checkRequiredProperty(
     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");
@@ -3814,34 +3804,23 @@ void 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()));
                 }
             }
         }
@@ -3849,39 +3828,28 @@ void IndicationService::_checkRequiredProperty(
 
     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 ();
 }
 
@@ -3967,17 +3935,14 @@ void IndicationService::_checkPropertyWithOther (
             //
             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()));
             }
 
             //
@@ -3989,18 +3954,12 @@ void IndicationService::_checkPropertyWithOther (
             //
             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()));
             }
@@ -4014,17 +3973,12 @@ void IndicationService::_checkPropertyWithOther (
         {
             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
@@ -4034,17 +3988,12 @@ void IndicationService::_checkPropertyWithOther (
                 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)
@@ -4053,17 +4002,12 @@ void IndicationService::_checkPropertyWithOther (
                     //  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()));
                 }
@@ -4081,19 +4025,12 @@ void IndicationService::_checkPropertyWithOther (
             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()));
@@ -4147,34 +4084,25 @@ String IndicationService::_checkPropertyWithDefault(
             //
             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
@@ -4220,17 +4148,14 @@ String IndicationService::_initOrValidateStringProperty (
         //
         //  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 ();
@@ -4268,34 +4193,25 @@ void IndicationService::_checkProperty (
                 //
                 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()));
                 }
             }
         }
@@ -4403,18 +4319,15 @@ void IndicationService::_checkValue (
             // 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()));
 
             }
 
@@ -4424,18 +4337,14 @@ void IndicationService::_checkValue (
             // 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()));
             }
         }
     }
@@ -5175,33 +5084,15 @@ CIMName IndicationService::_getIndicationClassName (
 
     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 ();
index 3eb40fc6cb3fedefad6c490984b2453481cb1e4c..c018e41d76fc65f9d145609c4c932e265c15fd7c 100644 (file)
@@ -213,7 +213,9 @@ private:
         @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
 
@@ -224,8 +226,8 @@ private:
         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
index 7a167e1ce9b92a0cca0f54d607747b9a9f28f38b..22652caa205dadfb956cd242d21a7a754bd8d9b5 100644 (file)
@@ -1155,7 +1155,7 @@ extern "C"
 
         if (msgId != NULL)
         {
-            parms->msg_id.assign(msgId);
+            parms->msg_id = msgId;
         }
 
         if ( defMsg != NULL )
index e79827a91771b5055c462187a16076c746417f34..794bc560ce2bcae0c47d67e24a7b1ae4e4d3ee9a 100644 (file)
@@ -51,10 +51,6 @@ PEGASUS_USING_STD;
 
 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)
 {
@@ -70,10 +66,11 @@ void CIMOperationResponseEncoder::sendResponse(
     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)
     {
@@ -228,22 +225,18 @@ void CIMOperationResponseEncoder::sendResponse(
                 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();