Tabnine Logo
TableUtils.<init>
Code IndexAdd Tabnine to your IDE (free)

How to use
org.snmp4j.util.TableUtils
constructor

Best Java code snippets using org.snmp4j.util.TableUtils.<init> (Showing top 13 results out of 315)

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: net.itransformers.snmp2xml4j/snmptoolkit

  /**
   * <p>fillTreeFromSNMP.</p>
   *
   * @param root a {@link net.itransformers.snmp2xml4j.snmptoolkit.Node} object.
   * @throws java.io.IOException if any.
   */
  protected void fillTreeFromSNMP(Node root) throws IOException {
    CounterSupport.getInstance().addCounterListener(new DefaultCounterListener());
//         AbstractTransportMapping transport = new DefaultUdpTransportMapping(localAddress);

//
      TableUtils tutils = new TableUtils(snmp, pduFactory);
      fillTreeFromSNMP(root, tutils);

  }

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

snmp.listen();
TableUtils tableUtils = new TableUtils(snmp, this);
tableUtils.setMaxNumRowsPerPDU(maxRepetitions);
Counter32 counter = new Counter32();
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

snmp.listen();
TableUtils tableUtils = new TableUtils(snmp, this);
tableUtils.setMaxNumRowsPerPDU(maxRepetitions);
Counter32 counter = new Counter32();
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

public int table() throws IOException {
  TableUtils tableUtils = new TableUtils(snmp, pduFactory);
  Integer maxRep = ((InnerPDUFactory) pduFactory).getMaxRepetitions();
  if (maxRep != null) {
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

target.setSecurityName(dhKickstart);
TableUtils tableUtils = new TableUtils(session, pduFactory);
OID[] columns =
    new OID[] { oidUsmDHKickstartMyPublic, oidUsmDHKickstartMgrPublic, oidUsmDHKickstartSecurityName };
origin: org.apache.servicemix.bundles/org.apache.servicemix.bundles.snmp4j

target.setSecurityName(dhKickstart);
TableUtils tableUtils = new TableUtils(session, pduFactory);
OID[] columns =
    new OID[] { oidUsmDHKickstartMyPublic, oidUsmDHKickstartMgrPublic, oidUsmDHKickstartSecurityName };
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.utilTableUtils<init>

Javadoc

Creates a TableUtils instance. The created instance is thread safe as long as the supplied Session and PDUFactory are thread safe.

Popular methods of TableUtils

  • getTable
    Gets SNMP tabular data from one or more tables. The data is returned asynchronously row-by-row throu
  • 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

  • Creating JSON documents from java classes using gson
  • onRequestPermissionsResult (Fragment)
  • getExternalFilesDir (Context)
  • getSharedPreferences (Context)
  • FileOutputStream (java.io)
    An output stream that writes bytes to a file. If the output file exists, it can be replaced or appen
  • OutputStream (java.io)
    A writable sink for bytes.Most clients will use output streams that write data to the file system (
  • Socket (java.net)
    Provides a client-side TCP socket.
  • SecureRandom (java.security)
    This class generates cryptographically secure pseudo-random numbers. It is best to invoke SecureRand
  • Locale (java.util)
    Locale represents a language/country/variant combination. Locales are used to alter the presentatio
  • JComboBox (javax.swing)
  • Top plugins for WebStorm
Tabnine Logo
  • Products

    Search for Java codeSearch for JavaScript code
  • IDE Plugins

    IntelliJ IDEAWebStormVisual StudioAndroid StudioEclipseVisual Studio CodePyCharmSublime TextPhpStormVimAtomGoLandRubyMineEmacsJupyter NotebookJupyter LabRiderDataGripAppCode
  • Company

    About UsContact UsCareers
  • Resources

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