本文整理汇总了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();
}