version 1.33, 2006/08/15 17:24:21
|
version 1.34, 2006/11/14 18:34:53
|
|
|
#include "snmpDeliverTrap_stub.h" | #include "snmpDeliverTrap_stub.h" |
#endif | #endif |
| |
// l10n |
|
#include <Pegasus/Common/MessageLoader.h> | #include <Pegasus/Common/MessageLoader.h> |
| |
PEGASUS_USING_STD; | PEGASUS_USING_STD; |
|
|
{ | { |
CIMProperty trapProp = indicationClass.getProperty(propPos); | CIMProperty trapProp = indicationClass.getProperty(propPos); |
| |
qualifierPos = trapProp.findQualifier(CIMName ("MappingStrings")); |
qualifierPos = |
|
trapProp.findQualifier(CIMName("MappingStrings")); |
if (qualifierPos != PEG_NOT_FOUND) | if (qualifierPos != PEG_NOT_FOUND) |
{ | { |
trapQualifier = trapProp.getQualifier(qualifierPos); | trapQualifier = trapProp.getQualifier(qualifierPos); |
|
|
{ | { |
if (mapstr1.subString(0, 8) == "OID.IETF") | if (mapstr1.subString(0, 8) == "OID.IETF") |
{ | { |
mapstr1 = mapstr1.subString(mapstr1.find("SNMP.")+5); |
mapstr1 = mapstr1.subString( |
|
mapstr1.find("SNMP.") + 5); |
if (mapstr1.find("|") != PEG_NOT_FOUND) | if (mapstr1.find("|") != PEG_NOT_FOUND) |
{ | { |
mapstr2.clear(); | mapstr2.clear(); |
|
|
propValue = prop.getValue().toString(); | propValue = prop.getValue().toString(); |
propVALUEs.append(propValue); | propVALUEs.append(propValue); |
| |
mapstr2 = mapstr1.subString(mapstr1.find("|")+2); |
mapstr2 = mapstr1.subString( |
mapstr2 = mapstr2.subString(0, mapstr2.size()-1); |
mapstr1.find("|") + 2); |
|
mapstr2 = mapstr2.subString( |
|
0, mapstr2.size() - 1); |
propTYPEs.append(mapstr2); | propTYPEs.append(mapstr2); |
} | } |
} | } |
|
|
// and passing this instance as it is to deliverTrap() call | // and passing this instance as it is to deliverTrap() call |
| |
Uint32 targetHostPos = handler.findProperty(CIMName ("TargetHost")); | Uint32 targetHostPos = handler.findProperty(CIMName ("TargetHost")); |
Uint32 targetHostFormatPos = handler.findProperty(CIMName ("TargetHostFormat")); |
Uint32 targetHostFormatPos = |
Uint32 otherTargetHostFormatPos = handler.findProperty(CIMName ( |
handler.findProperty(CIMName("TargetHostFormat")); |
"OtherTargetHostFormat")); |
Uint32 otherTargetHostFormatPos = |
|
handler.findProperty(CIMName("OtherTargetHostFormat")); |
Uint32 portNumberPos = handler.findProperty(CIMName ("PortNumber")); | Uint32 portNumberPos = handler.findProperty(CIMName ("PortNumber")); |
Uint32 snmpVersionPos = handler.findProperty(CIMName ("SNMPVersion")); | Uint32 snmpVersionPos = handler.findProperty(CIMName ("SNMPVersion")); |
Uint32 securityNamePos = handler.findProperty(CIMName ("SNMPSecurityName")); |
Uint32 securityNamePos = |
|
handler.findProperty(CIMName("SNMPSecurityName")); |
Uint32 engineIDPos = handler.findProperty(CIMName ("SNMPEngineID")); | Uint32 engineIDPos = handler.findProperty(CIMName ("SNMPEngineID")); |
| |
if ((targetHostPos != PEG_NOT_FOUND) && | if ((targetHostPos != PEG_NOT_FOUND) && |
|
|
// | // |
if (context.contains(SnmpTrapOidContainer::NAME)) | if (context.contains(SnmpTrapOidContainer::NAME)) |
{ | { |
SnmpTrapOidContainer trapContainer = context.get |
SnmpTrapOidContainer trapContainer = |
(SnmpTrapOidContainer::NAME); |
context.get(SnmpTrapOidContainer::NAME); |
| |
trapOid = trapContainer.getSnmpTrapOid(); | trapOid = trapContainer.getSnmpTrapOid(); |
} | } |
|
|
{ | { |
// get trapOid from indication Class | // get trapOid from indication Class |
| |
Uint32 pos = indicationClass.findQualifier(CIMName ("MappingStrings")); |
Uint32 pos = |
|
indicationClass.findQualifier(CIMName("MappingStrings")); |
if (pos != PEG_NOT_FOUND) | if (pos != PEG_NOT_FOUND) |
{ | { |
trapOid = indicationClass.getQualifier(pos).getValue().toString(); |
trapOid = |
|
indicationClass.getQualifier(pos).getValue().toString(); |
| |
trapOid = trapOid.subString(11, PEG_NOT_FOUND); | trapOid = trapOid.subString(11, PEG_NOT_FOUND); |
| |
|
|
PEG_TRACE_STRING(TRC_IND_HANDLER, Tracer::LEVEL4, | PEG_TRACE_STRING(TRC_IND_HANDLER, Tracer::LEVEL4, |
"Invalid MappingStrings Value " + trapOid); | "Invalid MappingStrings Value " + trapOid); |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
// l10n |
|
// 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_MS_VALUE", |
MessageLoaderParms( |
|
"Handler.snmpIndicationHandler." |
|
"snmpIndicationHandler.INVALID_MS_VALUE", |
"Invalid MappingStrings Value")); | "Invalid MappingStrings Value")); |
} | } |
} | } |
|
|
PEG_TRACE_STRING(TRC_IND_HANDLER, Tracer::LEVEL4, | PEG_TRACE_STRING(TRC_IND_HANDLER, Tracer::LEVEL4, |
"Qualifier MappingStrings can not be found."); | "Qualifier MappingStrings can not be found."); |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
//L10N_ TODO DONE |
MessageLoaderParms parms( |
//throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, "Qualifier MappingStrings can not be found"); |
"Handler.snmpIndicationHandler.snmpIndicationHandler." |
MessageLoaderParms parms("Handler.snmpIndicationHandler.snmpIndicationHandler.QUALIFIER_MAPPINGS_NOT_FOUND", |
"QUALIFIER_MAPPINGS_NOT_FOUND", |
"Qualifier MappingStrings can not be found"); | "Qualifier MappingStrings can not be found"); |
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms); | throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, parms); |
} | } |
} | } |
| |
handler.getProperty(targetHostPos).getValue().get(targetHost); | handler.getProperty(targetHostPos).getValue().get(targetHost); |
handler.getProperty(targetHostFormatPos).getValue().get(targetHostFormat); |
handler.getProperty(targetHostFormatPos).getValue().get( |
|
targetHostFormat); |
if (otherTargetHostFormatPos != PEG_NOT_FOUND) | if (otherTargetHostFormatPos != PEG_NOT_FOUND) |
{ | { |
handler.getProperty(otherTargetHostFormatPos).getValue().get |
handler.getProperty(otherTargetHostFormatPos).getValue().get( |
(otherTargetHostFormat); |
otherTargetHostFormat); |
} | } |
if (portNumberPos != PEG_NOT_FOUND) | if (portNumberPos != PEG_NOT_FOUND) |
{ | { |
|
|
handler.getProperty(snmpVersionPos).getValue().get(snmpVersion); | handler.getProperty(snmpVersionPos).getValue().get(snmpVersion); |
if (securityNamePos != PEG_NOT_FOUND) | if (securityNamePos != PEG_NOT_FOUND) |
{ | { |
handler.getProperty(securityNamePos).getValue().get(securityName); |
handler.getProperty(securityNamePos).getValue().get( |
|
securityName); |
} | } |
if (engineIDPos != PEG_NOT_FOUND) | if (engineIDPos != PEG_NOT_FOUND) |
{ | { |
|
|
PEG_TRACE_STRING(TRC_IND_HANDLER, Tracer::LEVEL4, | PEG_TRACE_STRING(TRC_IND_HANDLER, Tracer::LEVEL4, |
"Invalid IndicationHandlerSNMPMapper instance."); | "Invalid IndicationHandlerSNMPMapper instance."); |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
// l10n |
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms( |
|
"Handler.snmpIndicationHandler.snmpIndicationHandler." |
// throw PEGASUS_CIM_EXCEPTION(CIM_ERR_FAILED, |
"INVALID_SNMP_INSTANCE", |
// "Invalid IndicationHandlerSNMPMapper instance"); |
|
|
|
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
|
MessageLoaderParms("Handler.snmpIndicationHandler.snmpIndicationHandler.INVALID_SNMP_INSTANCE", |
|
"Invalid IndicationHandlerSNMPMapper instance")); | "Invalid IndicationHandlerSNMPMapper instance")); |
} | } |
} | } |
|
|
{ | { |
PEG_TRACE_STRING(TRC_IND_HANDLER, Tracer::LEVEL4, c.getMessage()); | PEG_TRACE_STRING(TRC_IND_HANDLER, Tracer::LEVEL4, c.getMessage()); |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
|
|
throw PEGASUS_CIM_EXCEPTION (CIM_ERR_FAILED, c.getMessage()); | throw PEGASUS_CIM_EXCEPTION (CIM_ERR_FAILED, c.getMessage()); |
} | } |
catch (Exception& e) | catch (Exception& e) |
|
|
"Failed to deliver trap."); | "Failed to deliver trap."); |
PEG_METHOD_EXIT(); | PEG_METHOD_EXIT(); |
| |
throw PEGASUS_CIM_EXCEPTION_L (CIM_ERR_FAILED, |
throw PEGASUS_CIM_EXCEPTION_L(CIM_ERR_FAILED, MessageLoaderParms( |
MessageLoaderParms("Handler.snmpIndicationHandler.snmpIndicationHandler.FAILED_TO_DELIVER_TRAP", |
"Handler.snmpIndicationHandler.snmpIndicationHandler." |
|
"FAILED_TO_DELIVER_TRAP", |
"Failed to deliver trap.")); | "Failed to deliver trap.")); |
} | } |
| |