예제 #1
0
  /**
   * Processes a <CODE>get</CODE> operation. It will throw an exception for V1 requests or it will
   * set exceptions within the list for V2 requests.
   *
   * @param inRequest The SnmpMibRequest object holding the list of variable to be retrieved.
   * @exception SnmpStatusException An error occurred during the operation.
   */
  @Override
  public void get(SnmpMibRequest inRequest) throws SnmpStatusException {

    SNMP_ADAPTOR_LOGGER.logp(
        Level.FINEST, SnmpErrorHandlerAgent.class.getName(), "get", "Get in Exception");

    if (inRequest.getVersion() == SnmpDefinitions.snmpVersionOne)
      throw new SnmpStatusException(SnmpStatusException.noSuchName);

    Enumeration<SnmpVarBind> l = inRequest.getElements();
    while (l.hasMoreElements()) {
      SnmpVarBind varbind = l.nextElement();
      varbind.setNoSuchObject();
    }
  }
예제 #2
0
  /**
   * Processes a <CODE>getBulk</CODE> operation. It will throw an exception if the request is a V1
   * one or it will set exceptions within the list for V2 ones.
   *
   * @param inRequest The SnmpMibRequest object holding the list of variable to be retrieved.
   * @exception SnmpStatusException An error occurred during the operation.
   */
  @Override
  public void getBulk(SnmpMibRequest inRequest, int nonRepeat, int maxRepeat)
      throws SnmpStatusException {

    SNMP_ADAPTOR_LOGGER.logp(
        Level.FINEST, SnmpErrorHandlerAgent.class.getName(), "getBulk", "GetBulk in Exception");

    if (inRequest.getVersion() == SnmpDefinitions.snmpVersionOne)
      throw new SnmpStatusException(SnmpDefinitions.snmpRspGenErr, 0);

    Enumeration<SnmpVarBind> l = inRequest.getElements();
    while (l.hasMoreElements()) {
      SnmpVarBind varbind = l.nextElement();
      varbind.setEndOfMibView();
    }
  }