version 1.5, 2003/07/15 16:53:03
|
version 1.9, 2004/08/24 23:10:21
|
|
|
//%///////////////////////////////////////////////////////////////////////////// |
//%2003//////////////////////////////////////////////////////////////////////// |
// | // |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Company, IBM, |
// Copyright (c) 2000, 2001, 2002 BMC Software, Hewlett-Packard Development |
// The Open Group, Tivoli Systems |
// Company, L. P., IBM Corp., The Open Group, Tivoli Systems. |
|
// Copyright (c) 2003 BMC Software; Hewlett-Packard Development Company, L. P.; |
|
// IBM Corp.; EMC Corporation, The Open Group. |
// | // |
// Permission is hereby granted, free of charge, to any person obtaining a copy | // Permission is hereby granted, free of charge, to any person obtaining a copy |
// of this software and associated documentation files (the "Software"), to | // of this software and associated documentation files (the "Software"), to |
|
|
| |
"CIM_ERR_METHOD_NOT_AVAILABLE: The extrinsic method could not be executed", | "CIM_ERR_METHOD_NOT_AVAILABLE: The extrinsic method could not be executed", |
| |
"CIM_ERR_METHOD_NOT_FOUND: The specified extrinsic method does not exist" |
"CIM_ERR_METHOD_NOT_FOUND: The specified extrinsic method does not exist", |
|
|
|
// NOTE - the message below must always be last |
|
"The CIM status code associated with this error is not recognized" |
|
}; |
|
|
|
// l10n - keys for cimstatus messages |
|
static const char* _cimMessageKeys[] = |
|
{ |
|
"Common.CIMStatusCode.CIM_ERR_SUCCESS", |
|
|
|
"Common.CIMStatusCode.CIM_ERR_FAILED", |
|
|
|
"Common.CIMStatusCode.CIM_ERR_ACCESS_DENIED", |
|
|
|
"Common.CIMStatusCode.CIM_ERR_INVALID_NAMESPACE", |
|
|
|
"Common.CIMStatusCode.CIM_ERR_INVALID_PARAMETER", |
|
|
|
"Common.CIMStatusCode.CIM_ERR_INVALID_CLASS", |
|
|
|
"Common.CIMStatusCode.CIM_ERR_NOT_FOUND", |
|
|
|
"Common.CIMStatusCode.CIM_ERR_NOT_SUPPORTED", |
|
|
|
"Common.CIMStatusCode.CIM_ERR_CLASS_HAS_CHILDREN", |
|
|
|
"Common.CIMStatusCode.CIM_ERR_CLASS_HAS_INSTANCES", |
|
|
|
"Common.CIMStatusCode.CIM_ERR_INVALID_SUPERCLASS", |
|
|
|
"Common.CIMStatusCode.CIM_ERR_ALREADY_EXISTS", |
|
|
|
"Common.CIMStatusCode.CIM_ERR_NO_SUCH_PROPERTY", |
|
|
|
"Common.CIMStatusCode.CIM_ERR_TYPE_MISMATCH", |
|
|
|
"Common.CIMStatusCode.CIM_ERR_QUERY_LANGUAGE_NOT_SUPPORTED", |
|
|
|
"Common.CIMStatusCode.CIM_ERR_INVALID_QUERY", |
|
|
|
"Common.CIMStatusCode.CIM_ERR_METHOD_NOT_AVAILABLE", |
|
|
|
"Common.CIMStatusCode.CIM_ERR_METHOD_NOT_FOUND", |
|
|
|
// NOTE: the message key below must always be last |
|
"Common.CIMStatusCode.UNRECOGNIZED_STATUS_CODE", |
}; | }; |
| |
// l10n TOD0 - the first func should go away when all Pegasus is globalized | // l10n TOD0 - the first func should go away when all Pegasus is globalized |
| |
const char* cimStatusCodeToString(CIMStatusCode code) | const char* cimStatusCodeToString(CIMStatusCode code) |
{ | { |
if (Uint32(code) < CIM_ERR_METHOD_NOT_FOUND) |
if (Uint32(code) <= CIM_ERR_METHOD_NOT_FOUND) |
return _cimMessages[Uint32(code)]; | return _cimMessages[Uint32(code)]; |
| |
return "Unrecognized CIM status code"; | return "Unrecognized CIM status code"; |
|
|
String cimStatusCodeToString(CIMStatusCode code, | String cimStatusCodeToString(CIMStatusCode code, |
const ContentLanguages& contentLanguages) | const ContentLanguages& contentLanguages) |
{ | { |
// l10n TODO - finish and uncomment this |
|
/* |
|
AcceptLanguages acceptLanguages; | AcceptLanguages acceptLanguages; |
if (contentLanguages.size() == 0) |
|
|
Uint32 tempCode; |
|
|
|
if (Uint32(code) <= CIM_ERR_METHOD_NOT_FOUND) |
{ | { |
return MessageLoader::getMessage(....use AcceptLanguages::EMPTY) |
tempCode = (Uint32)code; |
} | } |
else | else |
{ | { |
build AcceptLanguages from contentLanguages, use in getMessage |
tempCode = CIM_ERR_METHOD_NOT_FOUND + 1; |
} | } |
*/ |
|
| |
return String("Unrecognized CIM status code"); |
MessageLoaderParms parms(_cimMessageKeys[tempCode], _cimMessages[tempCode]); |
|
if (contentLanguages.size() == 0) //use AcceptLanguages::EMPTY |
|
{ |
|
return MessageLoader::getMessage(parms); |
|
} |
|
else |
|
{ |
|
//build AcceptLanguages from contentLanguages, use in getMessage |
|
parms.acceptlanguages = AcceptLanguages(contentLanguages.getLanguageElement(0).getTag()); |
|
return MessageLoader::getMessage(parms); |
|
} |
} | } |
| |
// l10n | // l10n |
ContentLanguages cimStatusCodeToString_Thread(String & message, CIMStatusCode code) | ContentLanguages cimStatusCodeToString_Thread(String & message, CIMStatusCode code) |
{ | { |
// l10n TODO - finish when we have msg ids |
Uint32 tempCode; |
/* |
|
String msgId = "abc"; |
if (Uint32(code) <= CIM_ERR_METHOD_NOT_FOUND) |
String dftMsg = message; |
{ |
*/ |
tempCode = (Uint32)code; |
|
} |
/* |
else |
MessageLoaderParms parms(msgId, dftMsg); |
{ |
parms.useThreadLocale = true; |
tempCode = CIM_ERR_METHOD_NOT_FOUND + 1; |
|
} |
|
|
|
MessageLoaderParms parms(_cimMessageKeys[tempCode], _cimMessages[tempCode]); |
|
//parms.useThreadLocale = true; |
message = MessageLoader::getMessage(parms); | message = MessageLoader::getMessage(parms); |
return parms.contentlanguages; | return parms.contentlanguages; |
*/ |
|
return ContentLanguages::EMPTY; |
|
} | } |
| |
PEGASUS_NAMESPACE_END | PEGASUS_NAMESPACE_END |