version 1.15, 2003/08/12 21:35:23
|
version 1.16, 2003/08/14 15:23:47
|
|
|
} | } |
| |
// l10n - note: ignoring indication language | // l10n - note: ignoring indication language |
void snmpIndicationHandler::handleIndication(CIMInstance& handler, |
void snmpIndicationHandler::handleIndication( |
|
const OperationContext& context, |
|
CIMInstance& handler, |
CIMInstance& indication, String nameSpace, | CIMInstance& indication, String nameSpace, |
ContentLanguages & contentLanguages) | ContentLanguages & contentLanguages) |
{ | { |
|
|
Uint16 targetHostFormat, snmpVersion; | Uint16 targetHostFormat, snmpVersion; |
Uint32 portNumber; | Uint32 portNumber; |
| |
// trapOid from indication Class |
String trapOid; |
|
// |
|
// Get snmpTrapOid from context |
|
// |
|
try |
|
{ |
|
SnmpTrapOidContainer trapContainer = context.get |
|
(SnmpTrapOidContainer::NAME); |
| |
String trapOid = indicationClass.getQualifier( |
trapOid = trapContainer.getSnmpTrapOid(); |
indicationClass.findQualifier |
} |
(CIMName ("MappingStrings"))).getValue().toString(); |
catch (Exception& e) |
|
{ |
|
// get trapOid from indication Class |
| |
Uint32 index = trapOid.find("SNMP."); |
Uint32 pos = indicationClass.findQualifier(CIMName ("MappingStrings")); |
|
if (pos != PEG_NOT_FOUND) |
|
{ |
|
trapOid = indicationClass.getQualifier(pos).getValue().toString(); |
| |
if (index != PEG_NOT_FOUND) |
trapOid = trapOid.subString(11, PEG_NOT_FOUND); |
|
|
|
if ((String::compare(trapOid, "SNMP.", 5)) == 0) |
{ | { |
trapOid = trapOid.subString(index+5); |
trapOid = trapOid.subString(5, (trapOid.size()-6)); |
trapOid = trapOid.subString(0, (trapOid.size()-1)); |
|
} | } |
else | else |
{ | { |
// l10n | // l10n |
|
|
// throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Invalid MappingStrings Value"); | // throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Invalid MappingStrings Value"); |
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, | throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
MessageLoaderParms("Handler.snmpIndicationHandler.snmpIndicationHandler.INVALID_VALUE", | MessageLoaderParms("Handler.snmpIndicationHandler.snmpIndicationHandler.INVALID_VALUE", |
"Invalid $0 Value", "MappingStrings")); | "Invalid $0 Value", "MappingStrings")); |
} | } |
|
} |
|
else |
|
{ |
|
//L10N_TODO |
|
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Qualifier MappingStrings can not be found"); |
|
} |
|
} |
| |
handler.getProperty(targetHostPos).getValue().get(targetHost); | handler.getProperty(targetHostPos).getValue().get(targetHost); |
handler.getProperty(targetHostFormatPos).getValue().get(targetHostFormat); | handler.getProperty(targetHostFormatPos).getValue().get(targetHostFormat); |
|
|
} | } |
else | else |
{ | { |
|
|
// l10n | // l10n |
| |
// throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, | // throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |