version 1.14, 2003/07/25 17:54:37
|
version 1.18, 2003/08/22 14:49:49
|
|
|
#include "snmpDeliverTrap_stub.h" | #include "snmpDeliverTrap_stub.h" |
#endif | #endif |
| |
|
// l10n |
|
#include <Pegasus/Common/MessageLoader.h> |
|
|
PEGASUS_NAMESPACE_BEGIN | PEGASUS_NAMESPACE_BEGIN |
| |
PEGASUS_USING_STD; | PEGASUS_USING_STD; |
|
|
} | } |
| |
// 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(); |
|
|
|
trapOid = trapOid.subString(11, PEG_NOT_FOUND); |
| |
if (index != 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 |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Invalid MappingStrings Value"); |
// l10n |
|
// throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Invalid MappingStrings Value"); |
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
|
MessageLoaderParms("Handler.snmpIndicationHandler.snmpIndicationHandler.INVALID_MS_VALUE", |
|
"Invalid MappingStrings Value")); |
|
} |
|
} |
|
else |
|
{ |
|
//L10N_ TODO DONE |
|
//throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Qualifier MappingStrings can not be found"); |
|
MessageLoaderParms parms("Handler.snmpIndicationHandler.snmpIndicationHandler.QUALIFIER_MAPPINGS_NOT_FOUND", |
|
"Qualifier MappingStrings can not be found"); |
|
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms); |
|
} |
} | } |
| |
handler.getProperty(targetHostPos).getValue().get(targetHost); | handler.getProperty(targetHostPos).getValue().get(targetHost); |
|
|
} | } |
else | else |
{ | { |
throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
// l10n |
"Invalid IndicationHandlerSNMPMapper instance"); |
|
|
// throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
|
// "Invalid IndicationHandlerSNMPMapper instance"); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
|
MessageLoaderParms("Handler.snmpIndicationHandler.snmpIndicationHandler.INVALID_SNMP_INSTANCE", |
|
"Invalid IndicationHandlerSNMPMapper instance")); |
} | } |
} | } |
| |