本文整理汇总了Java中org.snmp4j.smi.OID.leftMostCompare方法的典型用法代码示例。如果您正苦于以下问题:Java OID.leftMostCompare方法的具体用法?Java OID.leftMostCompare怎么用?Java OID.leftMostCompare使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类org.snmp4j.smi.OID
的用法示例。
在下文中一共展示了OID.leftMostCompare方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Java代码示例。
示例1: checkWalkFinished
import org.snmp4j.smi.OID; //导入方法依赖的package包/类
private static boolean checkWalkFinished(OID targetOID, PDU pdu, VariableBinding vb) {
boolean finished = false;
if (pdu.getErrorStatus() != 0) {
finished = true;
} else if (vb.getOid() == null) {
finished = true;
} else if (vb.getOid().size() < targetOID.size()) {
finished = true;
} else if (targetOID.leftMostCompare(targetOID.size(), vb.getOid()) != 0) {
finished = true;
} else if (Null.isExceptionSyntax(vb.getVariable().getSyntax())) {
finished = true;
} else if (vb.getOid().compareTo(targetOID) <= 0) {
finished = true;
}
return finished;
}
示例2: checkWalkFinished
import org.snmp4j.smi.OID; //导入方法依赖的package包/类
private static boolean checkWalkFinished(OID targetOID, PDU pdu,
VariableBinding vb) {
boolean finished = false;
if (pdu.getErrorStatus() != 0) {
System.out.println("[true] responsePDU.getErrorStatus() != 0 ");
System.out.println(pdu.getErrorStatusText());
finished = true;
} else if (vb.getOid() == null) {
System.out.println("[true] vb.getOid() == null");
finished = true;
} else if (vb.getOid().size() < targetOID.size()) {
System.out.println("[true] vb.getOid().size() < targetOID.size()");
finished = true;
} else if (targetOID.leftMostCompare(targetOID.size(), vb.getOid()) != 0) {
System.out.println("[true] targetOID.leftMostCompare() != 0");
finished = true;
} else if (Null.isExceptionSyntax(vb.getVariable().getSyntax())) {
System.out
.println("[true] Null.isExceptionSyntax(vb.getVariable().getSyntax())");
finished = true;
} else if (vb.getOid().compareTo(targetOID) <= 0) {
System.out.println("[true] Variable received is not "
+ "lexicographic successor of requested " + "one:");
System.out.println(vb.toString() + " <= " + targetOID);
finished = true;
}
return finished;
}
示例3: checkWalkFinished
import org.snmp4j.smi.OID; //导入方法依赖的package包/类
private static boolean checkWalkFinished(OID walkOID, PDU pdu,
VariableBinding vb) {
boolean finished = false;
if (pdu.getErrorStatus() != 0) {
System.out.println("[true] pdu.getErrorStatus() != 0 ");
System.out.println(pdu.getErrorStatusText());
finished = true;
} else if (vb.getOid() == null) {
System.out.println("[true] vb.getOid() == null");
finished = true;
} else if (vb.getOid().size() < walkOID.size()) {
System.out.println("[true] vb.getOid().size() < targetOID.size()");
finished = true;
} else if (walkOID.leftMostCompare(walkOID.size(), vb.getOid()) != 0) {
System.out.println("[true] targetOID.leftMostCompare() != 0");
finished = true;
} else if (Null.isExceptionSyntax(vb.getVariable().getSyntax())) {
System.out
.println("[true] Null.isExceptionSyntax(vb.getVariable().getSyntax())");
finished = true;
} else if (vb.getOid().compareTo(walkOID) <= 0) {
System.out.println("[true] vb.getOid().compareTo(walkOID) <= 0 ");
finished = true;
}
return finished;
}
示例4: checkWalkFinished
import org.snmp4j.smi.OID; //导入方法依赖的package包/类
/**
* 1)responsePDU == null<br>
* 2)responsePDU.getErrorStatus() != 0<br>
* 3)responsePDU.get(0).getOid() == null<br>
* 4)responsePDU.get(0).getOid().size() < targetOID.size()<br>
* 5)targetOID.leftMostCompare(targetOID.size(),responsePDU.get(0).getOid())
* !=0<br>
* 6)Null.isExceptionSyntax(responsePDU.get(0).getVariable().getSyntax())<br>
* 7)responsePDU.get(0).getOid().compareTo(targetOID) <= 0<br>
*
* @param targetOID
* @param pdu
* @param vb
* @return
*/
private static boolean checkWalkFinished(OID targetOID, PDU pdu,
VariableBinding vb) {
boolean finished = false;
if (pdu.getErrorStatus() != 0) {
System.out.println("[true] responsePDU.getErrorStatus() != 0 ");
System.out.println(pdu.getErrorStatusText());
finished = true;
} else if (vb.getOid() == null) {
System.out.println("[true] vb.getOid() == null");
finished = true;
} else if (vb.getOid().size() < targetOID.size()) {
System.out.println("[true] vb.getOid().size() < targetOID.size()");
finished = true;
} else if (targetOID.leftMostCompare(targetOID.size(), vb.getOid()) != 0) {
System.out.println("[true] targetOID.leftMostCompare() != 0");
finished = true;
} else if (Null.isExceptionSyntax(vb.getVariable().getSyntax())) {
System.out
.println("[true] Null.isExceptionSyntax(vb.getVariable().getSyntax())");
finished = true;
} else if (vb.getOid().compareTo(targetOID) <= 0) {
System.out.println("[true] Variable received is not "
+ "lexicographic successor of requested " + "one:");
System.out.println(vb.toString() + " <= " + targetOID);
finished = true;
}
return finished;
}
示例5: walk
import org.snmp4j.smi.OID; //导入方法依赖的package包/类
public static List<VariableBinding> walk(Target target, OID oid) {
List<VariableBinding> ret = new ArrayList<VariableBinding>();
PDU requestPDU = new PDU();
requestPDU.add(new VariableBinding(oid));
requestPDU.setType(PDU.GETNEXT);
boolean finished = false;
try{
while (!finished) {
VariableBinding vb = null;
ResponseEvent respEvt = snmp.send(requestPDU, target);
PDU responsePDU = respEvt.getResponse();
if (responsePDU != null) {
vb = responsePDU.get(0);
}
if (responsePDU == null) {
finished = true;
} else if (responsePDU.getErrorStatus() != 0) {
finished = true;
} else if (vb.getOid() == null) {
finished = true;
} else if (vb.getOid().size() < oid.size()) {
finished = true;
} else if (oid.leftMostCompare(oid.size(), vb.getOid()) != 0) {
finished = true;
} else if (Null.isExceptionSyntax(vb.getVariable().getSyntax())) {
finished = true;
} else if (vb.getOid().compareTo(oid) <= 0) {
finished = true;
} else {
ret.add(vb);
// Set up the variable binding for the next entry.
requestPDU.setRequestID(new Integer32(0));
requestPDU.set(0, vb);
}
}
} catch (IOException e) {
e.printStackTrace();
}
return ret;
}