from((CompositeData) notification.getUserData());
SnmpCounter64 count = new SnmpCounter64(minfo.getCount());
SnmpCounter64 used =
new SnmpCounter64(minfo.getUsage().getUsed());
SnmpString poolName = new SnmpString(minfo.getPoolName());
SnmpOid entryIndex =
getJvmMemPoolEntryIndex(minfo.getPoolName());
if (entryIndex == null) {
log.error("handleNotification",
"Error: Can't find entry index for Memory Pool: "
+ minfo.getPoolName() +": " +
"No trap emitted for " + type);
return;
}
SnmpOid trap = null;
final SnmpOidTable mibTable = getOidTable();
try {
SnmpOid usedOid = null;
SnmpOid countOid = null;
if (type.equals(MemoryNotificationInfo.
MEMORY_THRESHOLD_EXCEEDED)) {
trap = new SnmpOid(mibTable.
resolveVarName("jvmLowMemoryPoolUsageNotif").getOid());
usedOid =
new SnmpOid(mibTable.
resolveVarName("jvmMemPoolUsed").getOid() +
"." + entryIndex);
countOid =
new SnmpOid(mibTable.
resolveVarName("jvmMemPoolThreshdCount").getOid()
+ "." + entryIndex);
} else if (type.equals(MemoryNotificationInfo.
MEMORY_COLLECTION_THRESHOLD_EXCEEDED)) {
trap = new SnmpOid(mibTable.
resolveVarName("jvmLowMemoryPoolCollectNotif").
getOid());
usedOid =
new SnmpOid(mibTable.
resolveVarName("jvmMemPoolCollectUsed").getOid() +
"." + entryIndex);
countOid =
new SnmpOid(mibTable.
resolveVarName("jvmMemPoolCollectThreshdCount").
getOid() +
"." + entryIndex);
}
//Datas
SnmpVarBindList list = new SnmpVarBindList();
SnmpOid poolNameOid =
new SnmpOid(mibTable.
resolveVarName("jvmMemPoolName").getOid() +
"." + entryIndex);
SnmpVarBind varCount = new SnmpVarBind(countOid, count);
SnmpVarBind varUsed = new SnmpVarBind(usedOid, used);