org.snmp4j.util
Class TreeUtils

java.lang.Object
  extended by org.snmp4j.util.AbstractSnmpUtility
      extended by org.snmp4j.util.TreeUtils

public class TreeUtils
extends AbstractSnmpUtility


Field Summary
 
Fields inherited from class org.snmp4j.util.AbstractSnmpUtility
pduFactory, session
 
Constructor Summary
TreeUtils(Session snmpSession, PDUFactory pduFactory)
          Creates a TreeUtils instance.
 
Method Summary
 int getMaxRepetitions()
          Gets the maximum number of the variable bindings per TreeEvent returned by this instance.
 java.util.List getSubtree(Target target, OID rootOID)
          Gets a subtree with GETNEXT (SNMPv1) or GETBULK (SNMP2c, SNMPv3) operations from the specified target synchronously.
 void getSubtree(Target target, OID rootOID, java.lang.Object userObject, TreeListener listener)
          Gets a subtree with GETNEXT (SNMPv1) or GETBULK (SNMP2c, SNMPv3) operations from the specified target asynchronously.
 boolean isIgnoreLexicographicOrder()
          Return the ignore lexicographic order errors flage value.
 void setIgnoreLexicographicOrder(boolean ignoreLexicographicOrder)
          Set the ignore lexicographic order errors flage value.
 void setMaxRepetitions(int maxRepetitions)
          Sets the maximum number of the variable bindings per TreeEvent returned by this instance.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

TreeUtils

public TreeUtils(Session snmpSession,
                 PDUFactory pduFactory)
Creates a TreeUtils instance. The created instance is thread safe as long as the supplied Session and PDUFactory are thread safe.

Parameters:
snmpSession - a SNMP Session instance.
pduFactory - a PDUFactory instance that creates the PDU that are used by this instance to retrieve MIB tree data using GETBULK/GETNEXT operations.
Method Detail

getSubtree

public java.util.List getSubtree(Target target,
                                 OID rootOID)
Gets a subtree with GETNEXT (SNMPv1) or GETBULK (SNMP2c, SNMPv3) operations from the specified target synchronously.

Parameters:
target - a Target that specifies the target command responder including its network transport address.
rootOID - the OID that specifies the root of the sub-tree to retrieve (not included).
Returns:
a possibly empty List of TreeEvent instances where each instance carries zero or more values (or an error condition) in depth-first-order.

getSubtree

public void getSubtree(Target target,
                       OID rootOID,
                       java.lang.Object userObject,
                       TreeListener listener)
Gets a subtree with GETNEXT (SNMPv1) or GETBULK (SNMP2c, SNMPv3) operations from the specified target asynchronously.

Parameters:
target - a Target that specifies the target command responder including its network transport address.
rootOID - the OID that specifies the root of the sub-tree to retrieve (not included).
userObject - an optional user object that will be transparently handed over to the supplied TreeListener.
listener - the TreeListener that processes the TreeEvents generated by this method. Each event object may carry zero or more object instances from the sub-tree in depth-first-order.

setMaxRepetitions

public void setMaxRepetitions(int maxRepetitions)
Sets the maximum number of the variable bindings per TreeEvent returned by this instance.

Parameters:
maxRepetitions - the maximum repetitions used for GETBULK requests. For SNMPv1 this values has no effect (it is then implicitly one).

setIgnoreLexicographicOrder

public void setIgnoreLexicographicOrder(boolean ignoreLexicographicOrder)
Set the ignore lexicographic order errors flage value.

Parameters:
ignoreLexicographicOrder - true to ignore lexicographic order errors, false otherwise (default).
Since:
1.10.1

getMaxRepetitions

public int getMaxRepetitions()
Gets the maximum number of the variable bindings per TreeEvent returned by this instance.

Returns:
the maximum repetitions used for GETBULK requests. For SNMPv1 this values has no effect (it is then implicitly one).

isIgnoreLexicographicOrder

public boolean isIgnoreLexicographicOrder()
Return the ignore lexicographic order errors flage value.

Returns:
true if lexicographic order errors are ignored, false otherwise (default).
Since:
1.10.1

Copyright 2005-2010 Frank Fock (SNMP4J.org)

Copyright © 2011 SNMP4J.org. All Rights Reserved.