Package org.snmp4j

Examples of org.snmp4j.PDU


  public ResponseEvent setSync(final A address, final VariableBinding... bindings) throws IOException {

    checkNoNulls(address, bindings);

    final Target target = this.createTarget(address);
    final PDU requestPdu = this.createRequestPdu(PDU.SET, target, bindings);
    return this.snmp.send(requestPdu, target);
  }
View Full Code Here


   */
  protected PDU createRequestPdu(final int type, final Target target, final VariableBinding... bindings) {

    /* Build the request PDU */
    final PDUFactory pduFactory = new DefaultPDUFactory(type);
    final PDU requestPdu = pduFactory.createPDU(target);

    /* Load up the OIDs or VariableBindings */
    if ((type == PDU.GET) || (type == PDU.GETBULK) || (type == PDU.GETNEXT)) {
      requestPdu.addAllOIDs(bindings);
    } else {
      requestPdu.addAll(bindings);
    }

    requestPdu.setRequestID(new Integer32(Math.abs(this.random.nextInt())));
    return requestPdu;
  }
View Full Code Here

      final ResponseListener listener, final Object handle, final OID... oids) throws IOException {

    checkNoNulls(address, listener, oids);

    final Target target = this.createTarget(address);
    final PDU requestPdu = this.createRequestPdu(PDU.GETBULK, target, VariableBindings.wrapOids(oids));
    requestPdu.setMaxRepetitions(maxRepetitions);
    requestPdu.setNonRepeaters(nonRepeaters);
    this.getSnmp().send(requestPdu, target, handle, listener);
  }
View Full Code Here

      final OID... oids) throws IOException {

    checkNoNulls(address, oids);

    final Target target = this.createTarget(address);
    final PDU requestPdu = this.createRequestPdu(PDU.GETBULK, target, VariableBindings.wrapOids(oids));
    requestPdu.setMaxRepetitions(maxRepetitions);
    requestPdu.setNonRepeaters(nonRepeaters);
    return this.getSnmp().send(requestPdu, target);
  }
View Full Code Here

      final VariableBinding... bindings) throws IOException {

    checkNoNulls(address, listener, bindings);

    final Target target = this.createTarget(address);
    final PDU requestPdu = this.createRequestPdu(PDU.INFORM, target, bindings);
    this.getSnmp().send(requestPdu, target, handle, listener);
  }
View Full Code Here

  public ResponseEvent informSync(final A address, final VariableBinding... bindings) throws IOException {

    checkNoNulls(address, bindings);

    final Target target = this.createTarget(address);
    final PDU requestPdu = this.createRequestPdu(PDU.INFORM, target, bindings);
    return this.getSnmp().send(requestPdu, target);
  }
View Full Code Here

  public void notify(final A address, final VariableBinding... bindings) throws IOException {

    checkNoNulls(address, bindings);

    final Target target = this.createTarget(address);
    final PDU requestPdu = this.createRequestPdu(PDU.NOTIFICATION, target, bindings);
    this.getSnmp().send(requestPdu, target);
  }
View Full Code Here

      final ResponseListener listener, final Object handle, final OID... oids) throws IOException {

    checkNoNulls(address, listener, oids);

    final Target target = this.createTarget(address);
    final PDU requestPdu = this.createRequestPdu(PDU.GETBULK, target, VariableBindings.wrapOids(oids));
    requestPdu.setMaxRepetitions(maxRepetitions);
    requestPdu.setNonRepeaters(nonRepeaters);
    this.getSnmp().send(requestPdu, target, handle, listener);
  }
View Full Code Here

      final OID... oids) throws IOException {

    checkNoNulls(address, oids);

    final Target target = this.createTarget(address);
    final PDU requestPdu = this.createRequestPdu(PDU.GETBULK, target, VariableBindings.wrapOids(oids));
    requestPdu.setMaxRepetitions(maxRepetitions);
    requestPdu.setNonRepeaters(nonRepeaters);
    return this.getSnmp().send(requestPdu, target);
  }
View Full Code Here

      final VariableBinding... bindings) throws IOException {

    checkNoNulls(address, listener, bindings);

    final Target target = this.createTarget(address);
    final PDU requestPdu = this.createRequestPdu(PDU.INFORM, target, bindings);
    this.getSnmp().send(requestPdu, target, handle, listener);
  }
View Full Code Here

TOP

Related Classes of org.snmp4j.PDU

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.