本文整理匯總了Java中net.percederberg.mibble.snmp.SnmpTrapType類的典型用法代碼示例。如果您正苦於以下問題:Java SnmpTrapType類的具體用法?Java SnmpTrapType怎麽用?Java SnmpTrapType使用的例子?那麽, 這裏精選的類代碼示例或許可以為您提供幫助。
SnmpTrapType類屬於net.percederberg.mibble.snmp包,在下文中一共展示了SnmpTrapType類的5個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Java代碼示例。
示例1: convertMibToEvents
import net.percederberg.mibble.snmp.SnmpTrapType; //導入依賴的package包/類
public Events convertMibToEvents(Mib mib, String ueibase) {
Events events = new Events();
for (MibSymbol sym : getAllSymbolsFromMib(mib)) {
if (!(sym instanceof MibValueSymbol)) {
continue;
}
MibValueSymbol vsym = (MibValueSymbol) sym;
if ((!(vsym.getType() instanceof SnmpNotificationType)) && (!(vsym.getType() instanceof SnmpTrapType))) {
continue;
}
events.addEvent(getTrapEvent(vsym, ueibase));
}
return events;
}
示例2: convertMibToEvents
import net.percederberg.mibble.snmp.SnmpTrapType; //導入依賴的package包/類
private Events convertMibToEvents(Mib mib, String ueibase) {
Events events = new Events();
for (MibSymbol sym : getAllSymbolsFromMib(mib)) {
if (!(sym instanceof MibValueSymbol)) {
continue;
}
MibValueSymbol vsym = (MibValueSymbol) sym;
if ((!(vsym.getType() instanceof SnmpNotificationType)) && (!(vsym.getType() instanceof SnmpTrapType))) {
continue;
}
events.addEvent(getTrapEvent(vsym, ueibase));
}
return events;
}
示例3: getTrapOid
import net.percederberg.mibble.snmp.SnmpTrapType; //導入依賴的package包/類
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");
}
}
示例4: getTrapVars
import net.percederberg.mibble.snmp.SnmpTrapType; //導入依賴的package包/類
public static List<MibValue> getTrapVars(MibValueSymbol trapValueSymbol) {
if (trapValueSymbol.getType() instanceof SnmpNotificationType) {
SnmpNotificationType v2notif = (SnmpNotificationType) trapValueSymbol.getType();
return getV2NotificationObjects(v2notif);
} else if (trapValueSymbol.getType() instanceof SnmpTrapType) {
SnmpTrapType v1trap = (SnmpTrapType) trapValueSymbol.getType();
return getV1TrapVariables(v1trap);
} else {
throw new IllegalStateException("trap type is not an SNMP v1 Trap or v2 Notification");
}
}
示例5: getV1TrapVariables
import net.percederberg.mibble.snmp.SnmpTrapType; //導入依賴的package包/類
@SuppressWarnings("unchecked")
private static List<MibValue> getV1TrapVariables(SnmpTrapType v1trap) {
return v1trap.getVariables();
}