本文整理了Java中org.snmp4j.PDU.getMaxRepetitions()
方法的一些代码示例,展示了PDU.getMaxRepetitions()
的具体用法。这些代码示例主要来源于Github
/Stackoverflow
/Maven
等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PDU.getMaxRepetitions()
方法的具体详情如下:
包路径:org.snmp4j.PDU
类名称:PDU
方法名:getMaxRepetitions
[英]Gets the maximum repetitions of repeatable variable bindings in GETBULK requests.
[中]获取GETBULK请求中可重复变量绑定的最大重复次数。
代码示例来源:origin: org.snmp4j/snmp4j-agent
public int getMaxRepetitions() {
return source.getPDU().getMaxRepetitions();
}
代码示例来源:origin: org.kaazing/snmp4j-agent
public int getMaxRepetitions() {
return requestEvent.getPDU().getMaxRepetitions();
}
代码示例来源:origin: org.snmp4j/snmp4j-agent
public SnmpRequest.SnmpSubRequest next() {
if (!hasNext()) {
throw new NoSuchElementException();
}
if ((source.getPDU().getType() == PDU.GETBULK) &&
(cursor >= subrequests.size()) && (source.getPDU().getMaxRepetitions() > 0)) {
while (cursor >= subrequests.size()) {
addRepeaterSubRequest();
}
}
SnmpRequest.SnmpSubRequest sreq = subrequests.get(cursor);
cursor += increment;
return sreq;
}
代码示例来源:origin: org.snmp4j/snmp4j-agent
protected synchronized void setupSubRequests() {
PDU pdu = source.getPDU();
int capacity = pdu.size();
int totalRepetitions = (pdu instanceof PDUv1) ? 0 :
repeaterRowSize*pdu.getMaxRepetitions();
subrequests = new ArrayList<SnmpSubRequest>(capacity + totalRepetitions);
if (response == null) {
response = createResponse();
}
int numSubReq = capacity;
if (pdu.getType() == PDU.GETBULK && pdu.getMaxRepetitions() < 1) {
numSubReq = Math.min(numSubReq, pdu.getNonRepeaters());
}
for (int i=0; i<numSubReq; i++) {
SnmpSubRequest subReq = new SnmpSubRequest(source.getPDU().get(i), i);
addSubRequest(subReq);
}
if (logger.isDebugEnabled()) {
logger.debug("SnmpSubRequests initialized: "+subrequests);
}
}
代码示例来源:origin: org.kaazing/snmp4j-agent
private void correctRequestValues() {
PDU request = requestEvent.getPDU();
if (!(request instanceof PDUv1)) {
if (request.getMaxRepetitions() < 0) {
request.setMaxRepetitions(0);
}
if (request.getNonRepeaters() < 0) {
request.setNonRepeaters(0);
}
repeaterStartIndex = request.getNonRepeaters();
repeaterRowSize =
Math.max(request.size() - repeaterStartIndex, 0);
}
else {
repeaterStartIndex = 0;
repeaterRowSize = request.size();
}
}
代码示例来源:origin: org.snmp4j/snmp4j-agent
reqPDU.getMaxRepetitions() * getRepeaterCount()) {
List<SnmpSubRequest> lastRow = lastRow(cursor);
if (lastRow != null) {
(reqPDU.getMaxRepetitions() == 0)) {
SnmpRequest.this.subrequests.clear();
if (response != null) {
代码示例来源:origin: org.kaazing/snmp4j-agent
reqPDU.getMaxRepetitions() * getRepeaterCount()) {
List lastRow = lastRow(cursor);
if (lastRow != null) {
(reqPDU.getMaxRepetitions() == 0)) {
SnmpRequest.this.subrequests.clear();
if (response != null) {
代码示例来源:origin: org.kaazing/snmp4j-agent
protected synchronized void setupSubRequests() {
int capacity = requestEvent.getPDU().size();
int totalRepetitions = (requestEvent.getPDU() instanceof PDUv1) ? 0 :
repeaterRowSize*requestEvent.getPDU().getMaxRepetitions();
subrequests = new ArrayList(capacity + totalRepetitions);
if (response == null) {
response = createResponse();
}
for (int i=0; i<requestEvent.getPDU().size(); i++) {
SnmpSubRequest subReq =
new SnmpSubRequest(requestEvent.getPDU().get(i), i);
addSubRequest(subReq);
}
if (logger.isDebugEnabled()) {
logger.debug("SnmpSubRequests initialized: "+subrequests);
}
}
代码示例来源:origin: org.mobicents.tools.snmp.adaptor/core
nonRepeaters=0;
int maxRepetitions = pdu.getMaxRepetitions();
if (maxRepetitions<0)
maxRepetitions=0;
代码示例来源:origin: org.snmp4j/snmp4j-agent
private void correctRequestValues() {
PDU request = source.getPDU();
if (!(request instanceof PDUv1)) {
if (request.getMaxRepetitions() < 0) {
request.setMaxRepetitions(0);
}
if (request.getNonRepeaters() < 0) {
request.setNonRepeaters(0);
}
if (request.getNonRepeaters() > request.size()) {
request.setNonRepeaters(request.size());
}
repeaterStartIndex = request.getNonRepeaters();
repeaterRowSize =
Math.max(request.size() - repeaterStartIndex, 0);
}
else {
repeaterStartIndex = 0;
repeaterRowSize = request.size();
}
}
代码示例来源:origin: org.jboss.jbossas/jboss-snmp
nonRepeaters=0;
int maxRepetitions = pdu.getMaxRepetitions();
if (maxRepetitions<0)
maxRepetitions=0;
代码示例来源:origin: org.kaazing/snmp4j-agent
target.setType(source.getType());
if (!(target instanceof PDUv1) && !(source instanceof PDUv1)) {
target.setMaxRepetitions(source.getMaxRepetitions());
target.setNonRepeaters(source.getNonRepeaters());
代码示例来源:origin: org.snmp4j/snmp4j-agent
target.setType(source.getType());
if (!(target instanceof PDUv1) && !(source instanceof PDUv1)) {
target.setMaxRepetitions(source.getMaxRepetitions());
target.setNonRepeaters(source.getNonRepeaters());
内容来源于网络,如有侵权,请联系作者删除!