Example #1
0
 private static String getTrapOid(MibValueSymbol trapValueSymbol) {
   if (trapValueSymbol.getType() instanceof SnmpNotificationType) {
     return "." + trapValueSymbol.getValue().toString();
   } else if (trapValueSymbol.getType() instanceof SnmpTrapType) {
     SnmpTrapType v1trap = (SnmpTrapType) trapValueSymbol.getType();
     return "." + v1trap.getEnterprise().toString() + "." + trapValueSymbol.getValue().toString();
   } else {
     throw new IllegalStateException(
         "Trying to get trap information from an object that's not a trap and not a notification");
   }
 }
Example #2
0
 @SuppressWarnings("unchecked")
 private static List<MibValue> getV1TrapVariables(SnmpTrapType v1trap) {
   return v1trap.getVariables();
 }