本文整理了Java中org.snmp4j.PDU.getVariable()
方法的一些代码示例,展示了PDU.getVariable()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PDU.getVariable()
方法的具体详情如下:
包路径:org.snmp4j.PDU
类名称:PDU
方法名:getVariable
[英]Gets the first variable whose OID starts with the specified OID.
[中]获取其OID以指定OID开头的第一个变量。
代码示例来源:origin: org.snmp4j/snmp4j
protected void handleInternalResponse(PDU response, PDU pdu, Address target) {
Variable contextEngineID = response.getVariable(SnmpConstants.snmpEngineID);
if (contextEngineID instanceof OctetString) {
if (pdu instanceof ScopedPDU) {
((ScopedPDU) pdu).setContextEngineID((OctetString) contextEngineID);
if (logger.isInfoEnabled()) {
logger.info("Discovered contextEngineID '" + contextEngineID +
"' by RFC 5343 for " + target);
}
}
}
}
代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j
protected void handleInternalResponse(PDU response, PDU pdu, Address target) {
Variable contextEngineID = response.getVariable(SnmpConstants.snmpEngineID);
if (contextEngineID instanceof OctetString) {
if (pdu instanceof ScopedPDU) {
((ScopedPDU)pdu).setContextEngineID((OctetString) contextEngineID);
if (logger.isInfoEnabled()) {
logger.info("Discovered contextEngineID '"+contextEngineID+
"' by RFC 5343 for " + target);
}
}
}
}
代码示例来源:origin: org.openhab.binding/org.openhab.binding.snmp
Variable variable = pdu.getVariable(oid);
if (variable != null) {
Class<? extends Item> itemType = provider.getItemType(itemName);
代码示例来源:origin: org.snmp4j/snmp4j-agent
request.getVariableBinding().setVariable(resp.getResponse().getVariable(oid));
内容来源于网络,如有侵权,请联系作者删除!