org.snmp4j.PDU.setNonRepeaters()方法的使用及代码示例

x33g5p2x  于2022-01-26 转载在 其他  
字(5.6k)|赞(0)|评价(0)|浏览(183)

本文整理了Java中org.snmp4j.PDU.setNonRepeaters()方法的一些代码示例,展示了PDU.setNonRepeaters()的具体用法。这些代码示例主要来源于Github/Stackoverflow/Maven等平台,是从一些精选项目中提取出来的代码,具有较强的参考意义,能在一定程度帮忙到你。PDU.setNonRepeaters()方法的具体详情如下:
包路径:org.snmp4j.PDU
类名称:PDU
方法名:setNonRepeaters

PDU.setNonRepeaters介绍

[英]Sets the number of non repeater variable bindings in a GETBULK PDU.
[中]设置GETBULK PDU中非repeater变量绑定的数量。

代码示例

代码示例来源:origin: OpenNMS/opennms

@Override
public void setNonRepeaters(int numNonRepeaters) {
  m_bulkPdu.setNonRepeaters(numNonRepeaters);
}

代码示例来源:origin: org.opennms.core.snmp/org.opennms.core.snmp.implementations.snmp4j

@Override
public void setNonRepeaters(int numNonRepeaters) {
  m_bulkPdu.setNonRepeaters(numNonRepeaters);
}

代码示例来源:origin: org.opennms.lib.snmp/org.opennms.lib.snmp.snmp4j

public void setNonRepeaters(int numNonRepeaters) {
  m_bulkPdu.setNonRepeaters(numNonRepeaters);
}

代码示例来源:origin: org.kaazing/snmp4j

private PDU walk(Snmp snmp, PDU request, Target target, final List snapshot)
  throws IOException
 request.setNonRepeaters(0);
 OID rootOID = request.get(0).getOid();
 PDU response = null;

代码示例来源: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.snmp4j/snmp4j

/**
 * Create a <code>PDU</code> instance for the supplied target.
 *
 * @param target the <code>Target</code> where the PDU to be created will be
 *    sent.
 * @param pduType
 *    a PDU type as specified by {@link PDU}.
 * @param maxRepetitions
 *    the maximum number of repetitions for GETBULK PDUs created
 *    by this factory.
 * @param nonRepeaters
 *    the number of non-repeater variable bindings
 *    (processed like GETNEXT) for GETBULK PDUs created
 *    by this factory.
 * @return PDU
 *    a PDU instance that is compatible with the supplied target.
 * @since 2.2
 */
public static PDU createPDU(Target target, int pduType, int maxRepetitions, int nonRepeaters) {
 PDU request = createPDU(target.getVersion());
 request.setType(pduType);
 if (pduType == PDU.GETBULK) {
  request.setMaxRepetitions(maxRepetitions);
  request.setNonRepeaters(nonRepeaters);
 }
 return request;
}

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

/**
 * Create a <code>PDU</code> instance for the supplied target.
 *
 * @param target the <code>Target</code> where the PDU to be created will be
 *    sent.
 * @param pduType
 *    a PDU type as specified by {@link PDU}.
 * @param maxRepetitions
 *    the maximum number of repetitions for GETBULK PDUs created
 *    by this factory.
 * @param nonRepeaters
 *    the number of non-repeater variable bindings
 *    (processed like GETNEXT) for GETBULK PDUs created
 *    by this factory.
 * @return PDU
 *    a PDU instance that is compatible with the supplied target.
 * @since 2.2
 */
public static PDU createPDU(Target target, int pduType, int maxRepetitions, int nonRepeaters) {
 PDU request = createPDU(target.getVersion());
 request.setType(pduType);
 if (pduType == PDU.GETBULK) {
  request.setMaxRepetitions(maxRepetitions);
  request.setNonRepeaters(nonRepeaters);
 }
 return request;
}

代码示例来源: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.kaazing/snmp4j

if (maxNumOfRowsPerPDU > 0) {
 pdu.setMaxRepetitions(maxNumOfRowsPerPDU);
 pdu.setNonRepeaters(0);
 pdu.setNonRepeaters(sz);
 pdu.setMaxRepetitions(0);

代码示例来源:origin: org.mobicents.tools.snmp.adaptor/core

pdu.add(new VariableBinding(new OID("1.3.1.1")));
pdu.setMaxRepetitions(7);
pdu.setNonRepeaters(1);
CommunityTarget target = new CommunityTarget();
OctetString community = new OctetString("public");

代码示例来源:origin: org.jboss.jbossas/jboss-snmp

pdu.add(new VariableBinding(new OID("1.3.1.1")));
pdu.setMaxRepetitions(7);
pdu.setNonRepeaters(1);
CommunityTarget target = new CommunityTarget();
OctetString community = new OctetString("public");

代码示例来源:origin: org.kaazing/snmp4j

if (request.getType() == PDU.GETBULK) {
 request.setMaxRepetitions(maxRepetitions);
 request.setNonRepeaters(nonRepeaters);

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

if (!(pdu instanceof PDUv1)) {
 pdu.setMaxRepetitions(0);
 pdu.setNonRepeaters(0);

代码示例来源:origin: org.jboss.jbossas/jboss-snmp

pdu.add(new VariableBinding(new OID("1.3.1.1")));
pdu.setMaxRepetitions(7);
pdu.setNonRepeaters(1);
CommunityTarget target = new CommunityTarget();
OctetString community = new OctetString("public");

代码示例来源:origin: org.snmp4j/snmp4j

if (!(pdu instanceof PDUv1)) {
  pdu.setMaxRepetitions(0);
  pdu.setNonRepeaters(0);

代码示例来源:origin: org.mobicents.tools.snmp.adaptor/core

pdu.add(new VariableBinding(new OID("1.3.1.1")));
pdu.setMaxRepetitions(7);
pdu.setNonRepeaters(1);
CommunityTarget target = new CommunityTarget();
OctetString community = new OctetString("public");

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

if (request.getType() == PDU.GETBULK) {
 request.setMaxRepetitions(maxRepetitions);
 request.setNonRepeaters(nonRepeaters);

代码示例来源:origin: org.openscada.atlantis/org.openscada.da.server.snmp

request.setNonRepeaters ( 0 );
request.setMaxRepetitions ( 10 );

代码示例来源:origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

pdu.setNonRepeaters(nonRepeaters);

代码示例来源:origin: org.snmp4j/snmp4j

pdu.setNonRepeaters(nonRepeaters);

相关文章