Tabnine Logo
TableUtils.getTable
Code IndexAdd Tabnine to your IDE (free)

How to use
getTable
method
in
org.snmp4j.util.TableUtils

Best Java code snippets using org.snmp4j.util.TableUtils.getTable (Showing top 14 results out of 315)

origin: org.snmp4j/snmp4j

         OID lowerBoundIndex,
         OID upperBoundIndex) {
getTable(target, columnOIDs, listener, userObject, lowerBoundIndex, upperBoundIndex,
    SparseTableMode.sparseTable);
origin: fbacchella/jrds

public TabularIterator(SnmpConnection starter, Collection<OID> oids) {
  if(starter != null && starter.isStarted()) {
    Target snmpTarget = starter.getConnection();
    if(snmpTarget != null) {
      DefaultPDUFactory localfactory = new DefaultPDUFactory();
      TableUtils tableRet = new TableUtils(starter.getSnmp(), localfactory);
      tableRet.setMaxNumColumnsPerPDU(30);
      OID[] oidTab = new OID[oids.size()];
      oids.toArray(oidTab);
      tabIterator = tableRet.getTable(snmpTarget, oidTab, null, null).iterator();
    }
  }
}
origin: jrask/snmp-blog

/**
 * Normally this would return domain objects or something else than this...
 */
public List<List<String>> getTableAsStrings(OID[] oids) {
  TableUtils tUtils = new TableUtils(snmp, new DefaultPDUFactory());
  
  @SuppressWarnings("unchecked") 
    List<TableEvent> events = tUtils.getTable(getTarget(), oids, null, null);
  
  List<List<String>> list = new ArrayList<List<String>>();
  for (TableEvent event : events) {
    if(event.isError()) {
      throw new RuntimeException(event.getErrorMessage());
    }
    List<String> strList = new ArrayList<String>();
    list.add(strList);
    for(VariableBinding vb: event.getColumns()) {
      strList.add(vb.getVariable().toString());
    }
  }
  return list;
}

origin: org.kaazing/snmp4j

tableUtils.getTable(target, columns, listener, counter,
          lowerBoundIndex, upperBoundIndex);
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

tableUtils.getTable(target, columns, listener, counter,
          lowerBoundIndex, upperBoundIndex);
origin: org.kaazing/snmp4j

private synchronized void listLoggers(Snmp snmp, Target target, PDUFactory pduFactory) {
 TableUtils tableUtils = new TableUtils(snmp, pduFactory);
 OID lowerBound = null;
 OID upperBound = null;
 String filter = (String) ArgumentParser.getValue(parameters, "filter", 0);
 if (filter != null) {
  OctetString filterString = new OctetString(filter);
  lowerBound = filterString.toSubIndex(true);
  upperBound = lowerBound.nextPeer();
 }
 LoggerListListener lll = new LoggerListListener();
 tableUtils.getTable(target, SNMP4J_LOGGER_OIDS, lll, this,
           lowerBound, upperBound);
 while (!lll.isFinished()) {
  try {
   wait();
  }
  catch (InterruptedException ex) {
  }
 }
}
origin: org.snmp4j/snmp4j

private synchronized void listLoggers(Snmp snmp, Target target, PDUFactory pduFactory) {
 TableUtils tableUtils = new TableUtils(snmp, pduFactory);
 OID lowerBound = null;
 OID upperBound = null;
 String filter = (String) ArgumentParser.getValue(parameters, "filter", 0);
 if (filter != null) {
  OctetString filterString = new OctetString(filter);
  lowerBound = filterString.toSubIndex(true);
  upperBound = lowerBound.nextPeer();
 }
 LoggerListListener lll = new LoggerListListener();
 tableUtils.getTable(target, SNMP4J_LOGGER_OIDS, lll, this,
           lowerBound, upperBound);
 while (!lll.isFinished()) {
  try {
   wait();
  }
  catch (InterruptedException ex) {
   // ignore
  }
 }
}
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

private synchronized void listLoggers(Snmp snmp, Target target, PDUFactory pduFactory) {
 TableUtils tableUtils = new TableUtils(snmp, pduFactory);
 OID lowerBound = null;
 OID upperBound = null;
 String filter = (String) ArgumentParser.getValue(parameters, "filter", 0);
 if (filter != null) {
  OctetString filterString = new OctetString(filter);
  lowerBound = filterString.toSubIndex(true);
  upperBound = lowerBound.nextPeer();
 }
 LoggerListListener lll = new LoggerListListener();
 tableUtils.getTable(target, SNMP4J_LOGGER_OIDS, lll, this,
           lowerBound, upperBound);
 while (!lll.isFinished()) {
  try {
   wait();
  }
  catch (InterruptedException ex) {
   // ignore
  }
 }
}
origin: org.snmp4j/snmp4j

      lowerBoundIndex, upperBoundIndex);
} else {
  tableUtils.getTable(target, columns, listener, counter,
      lowerBoundIndex, upperBoundIndex);
origin: fbacchella/jrds

  @Override
  public Map<OID, Object> doSnmpGet(SnmpConnection cnx, Collection<OID> oids) {
    Target snmpTarget = cnx.getConnection();
    Snmp snmp = cnx.getSnmp();
    if(cnx.isStarted() && snmpTarget != null && snmp != null) {
      TableUtils tableRet = new TableUtils(snmp, cnx.getPdufactory());
      tableRet.setMaxNumColumnsPerPDU(30);
      OID[] oidTab = new OID[oids.size()];
      oids.toArray(oidTab);
      SnmpVars retValue = new SnmpVars();
      for(TableEvent te: tableRet.getTable(snmpTarget, oidTab, null, null)) {
        if(!cnx.isStarted()) {
          retValue = new SnmpVars();
          break;
        }
        if(!te.isError()) {
          retValue.join(te.getColumns());
        }
      }
      return retValue;
    }
    return Collections.emptyMap();
  }
},
origin: org.snmp4j/snmp4j

OID[] columns =
    new OID[] { oidUsmDHKickstartMyPublic, oidUsmDHKickstartMgrPublic, oidUsmDHKickstartSecurityName };
List<TableEvent> rows = tableUtils.getTable(target, columns, null, null);
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

OID[] columns =
    new OID[] { oidUsmDHKickstartMyPublic, oidUsmDHKickstartMgrPublic, oidUsmDHKickstartSecurityName };
List<TableEvent> rows = tableUtils.getTable(target, columns, null, null);
origin: net.itransformers.snmp2xml4j/snmptoolkit

List table = tutils.getTable(getTarget(), oids, new OID("0"), null);
origin: OpenNMS/opennms

public void testWalkSystem() throws IOException {
  
  Snmp snmp = new Snmp(new DefaultUdpTransportMapping());
  TableUtils walker = new TableUtils(snmp, new DefaultPDUFactory());
  snmp.listen();
  
  Address addr = new UdpAddress(InetAddress.getLocalHost(), 9161);
  //Address addr = new UdpAddress(InetAddressUtils.addr("192.168.0.100"), 161);
  Target target = new CommunityTarget(addr, new OctetString("public"));
  target.setVersion(SnmpConstants.version1);
  target.setTimeout(3000);
  target.setRetries(3);
  
  // Implements snmp4j API
  @SuppressWarnings("rawtypes")
  List results = walker.getTable(target, new OID[] {new OID("1.3.6.1.2.1.1")}, null, null);
  
  assertNotNull(results);
  assertFalse(results.isEmpty());
  
  assertTrue(results.get(results.size()-1) instanceof TableEvent);
  
  TableEvent lastEvent = (TableEvent)results.get(results.size()-1);
  MockUtil.println("Status of lastEvent is "+lastEvent.getStatus());
  assertEquals(TableEvent.STATUS_OK, lastEvent.getStatus());
  
  
  
}

org.snmp4j.utilTableUtilsgetTable

Javadoc

Gets synchronously SNMP tabular data from one or more tables. The data is returned row-by-row as a list of TableEvent instances. Each instance represents a row (or an error condition). Besides the target agent, the OIDs of the columnar objects have to be specified for which instances should be retrieved. With a lower bound index and an upper bound index, the result set can be narrowed to improve performance. This method can be executed concurrently by multiple threads.

Popular methods of TableUtils

  • <init>
    Creates a TableUtils instance. The created instance is thread safe as long as the supplied Session a
  • createTableRequest
  • getDenseTable
    Gets SNMP tabular data from one or more tables. The data is returned asynchronously row-by-row throu
  • setMaxNumRowsPerPDU
    Sets the maximum number of rows that will be retrieved per SNMP GETBULK request. The default is 10.
  • isCheckLexicographicOrdering
    Indicates whether a single request on behalf of #getTable(Target,OID[],OID,OID) or #getTable(Target,
  • setMaxNumColumnsPerPDU
    Sets the maximum number of columns that will be retrieved per SNMP GETNEXT or GETBULK request. The d

Popular in Java

  • Parsing JSON documents to java classes using gson
  • getSystemService (Context)
  • findViewById (Activity)
  • getResourceAsStream (ClassLoader)
  • Graphics2D (java.awt)
    This Graphics2D class extends the Graphics class to provide more sophisticated control overgraphics
  • FileReader (java.io)
    A specialized Reader that reads from a file in the file system. All read requests made by calling me
  • MessageDigest (java.security)
    Uses a one-way hash function to turn an arbitrary number of bytes into a fixed-length byte sequence.
  • SimpleDateFormat (java.text)
    Formats and parses dates in a locale-sensitive manner. Formatting turns a Date into a String, and pa
  • CountDownLatch (java.util.concurrent)
    A synchronization aid that allows one or more threads to wait until a set of operations being perfor
  • Annotation (javassist.bytecode.annotation)
    The annotation structure.An instance of this class is returned bygetAnnotations() in AnnotationsAttr
  • Top PhpStorm plugins
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

    FAQBlogTabnine AcademyTerms of usePrivacy policyJava Code IndexJavascript Code Index
Get Tabnine for your IDE now