Package org.snmp4j.util

Examples of org.snmp4j.util.DefaultPDUFactory


  }
  private Exception walkHard(Snmp snmp, Target target, String context_engine, String context_name,
                             String oid_string, ResmonResult rr) {
    try {
      OID walk_oid = new OID(oid_string);
      TreeUtils treeUtils = new TreeUtils(snmp, new DefaultPDUFactory());     
      List<TreeEvent> events = treeUtils.getSubtree(target, walk_oid);
      if(events == null || events.size() == 0) return null;
      for (TreeEvent event : events) {
        if(event != null){
          if (event.isError()) continue;
View Full Code Here


    @NotNull
    public List<SNMPValue> getColumn(String mibName) throws SNMPException {
        List<SNMPValue> values = new ArrayList<SNMPValue>();
        OID oid = SNMPClient.getMibOID(mibName);
        TreeUtils treeUtils = new TreeUtils(session, new DefaultPDUFactory());
        treeUtils.setMaxRepetitions(GETBULK_MAX_REPETITIONS);
        List<TreeEvent> events = treeUtils.getSubtree(this.target, oid);
        for (TreeEvent event : events) {
            if (event.isError()) {
                throw new SNMPException("Error occurred while retrieving column " + mibName + "(" + oid + "): "
View Full Code Here

    public String toString() {
        return target.getAddress() + "/" + this.target.getCommunity();
    }

    protected PDU createPDU(String mibName, int type) throws MIBLookupException {
        PDU pdu = new DefaultPDUFactory().createPDU(this.target);
        pdu.setType(type);
        OID oid = SNMPClient.getMibOID(mibName);
        pdu.add(new VariableBinding(oid));
        return pdu;
    }
View Full Code Here

      final VariableBinding... bindings) {

    checkNoNulls(address, rowStatusColumnOid, rowIndex, bindings);

    final Target target = this.createTarget(address);
    final TableUtils tableUtils = new TableUtils(this.snmp, new DefaultPDUFactory());
    return tableUtils.createRow(target, rowStatusColumnOid, rowIndex, bindings);
  }
View Full Code Here

  public ResponseEvent destroyRowSync(final A address, final OID rowStatusColumnOid, final OID rowIndex) {

    checkNoNulls(address, rowStatusColumnOid, rowIndex);

    final Target target = this.createTarget(address);
    final TableUtils tableUtils = new TableUtils(this.snmp, new DefaultPDUFactory());
    return tableUtils.destroyRow(target, rowStatusColumnOid, rowIndex);
  }
View Full Code Here

      final OID lowerBoundIndex, final OID upperBoundIndex, final OID... columnOids) {

    checkNoNulls(address, listener, handle, lowerBoundIndex, upperBoundIndex, columnOids);

    final Target target = this.createTarget(address);
    final TableUtils tableUtils = new TableUtils(this.snmp, new DefaultPDUFactory());
    tableUtils.getDenseTable(target, columnOids, listener, handle, lowerBoundIndex, upperBoundIndex);
  }
View Full Code Here

      final OID lowerBoundIndex, final OID upperBoundIndex, final OID... columnOids) {

    checkNoNulls(address, listener, handle, lowerBoundIndex, upperBoundIndex, columnOids);

    final Target target = this.createTarget(address);
    final TableUtils tableUtils = new TableUtils(this.snmp, new DefaultPDUFactory());
    tableUtils.getTable(target, columnOids, listener, handle, lowerBoundIndex, upperBoundIndex);
  }
View Full Code Here

      final OID... columnOids) {

    checkNoNulls(address, lowerBoundIndex, upperBoundIndex, columnOids);

    final Target target = this.createTarget(address);
    final TableUtils tableUtils = new TableUtils(this.snmp, new DefaultPDUFactory());
    return tableUtils.getTable(target, columnOids, lowerBoundIndex, upperBoundIndex);
  }
View Full Code Here

   *      org.snmp4j.smi.OID)
   */
  @Override
  public void walkAsync(final A address, final TreeListener listener, final Object handle, final OID oid) {
    final Target target = this.createTarget(address);
    final TreeUtils treeUtils = new TreeUtils(this.snmp, new DefaultPDUFactory());
    treeUtils.setIgnoreLexicographicOrder(true);
    treeUtils.getSubtree(target, oid, handle, listener);
  }
View Full Code Here

   * @see org.chiefly.sunlamp.SNMP#walkSync(org.snmp4j.smi.Address, org.snmp4j.smi.OID)
   */
  @Override
  public List<TreeEvent> walkSync(final A address, final OID oid) {
    final Target target = this.createTarget(address);
    final TreeUtils treeUtils = new TreeUtils(this.snmp, new DefaultPDUFactory());
    treeUtils.setIgnoreLexicographicOrder(true);
    return treeUtils.getSubtree(target, oid);
  }
View Full Code Here

TOP

Related Classes of org.snmp4j.util.DefaultPDUFactory

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.