Package com.caucho.server.snmp.types

Examples of com.caucho.server.snmp.types.IntegerValue


    out.flush();
  }
 
  final protected SnmpMessageValue composeResponse(SnmpMessageValue req)
  {
    IntegerValue error = IntegerValue.ZERO;
    IntegerValue errorIndex = IntegerValue.ZERO;
    VarBindListValue varBindList = new VarBindListValue();
   
    int i = -1;
    try {
      switch (req.getPdu().getType()) {
        case SnmpValue.GET_REQUEST_PDU:
        {
          ObjectIdentifierValue []oids = req.getVarBindList().getNames();
         
          for (i = 0; i < oids.length; i++) {
            SnmpValue attr = getMBean(oids[i]);

            VarBindValue varBind;
           
            if (attr != null)
              varBind = new VarBindValue(oids[i], attr);
            else {
              varBind = new VarBindValue(oids[i], NullValue.NULL);
             
              if (error.getLong() == 0) {
                error = new IntegerValue(NO_SUCH_NAME);
                errorIndex = new IntegerValue(i + 1);
              }
            }
           
            varBindList.add(varBind);
          }

          break;
        }
        case SnmpValue.GET_NEXT_REQUEST_PDU:
        {
          break;
        }
        case SnmpValue.SET_REQUEST_PDU:
        {
          break;
        }
        default:
          log.fine(L.l("invalid pdu type {0}", req.getType()));
         
          throw new SnmpRuntimeException(L.l("invalid pdu type {0}",
                                             req.getType()));
      }
    }
    catch (Exception e) {
      if (error.getLong() == 0) {
        error = new IntegerValue(GENERAL_ERROR);
        errorIndex = new IntegerValue(i + 1);
      }
     
      if (req.getVarBindList().size() > i) {
        VarBindValue varBind
          = new VarBindValue(req.getVarBindList().get(i).getName(),
View Full Code Here


  /*
   * Sets the SNMP version.
   */
  public void setVersion(int version)
  {
    _version = new IntegerValue(version);
  }
View Full Code Here

    out.flush();
  }
 
  final protected SnmpMessageValue composeResponse(SnmpMessageValue req)
  {
    IntegerValue error = IntegerValue.ZERO;
    IntegerValue errorIndex = IntegerValue.ZERO;
    VarBindListValue varBindList = new VarBindListValue();
   
    int i = -1;
    try {
      switch (req.getPdu().getType()) {
        case SnmpValue.GET_REQUEST_PDU:
        {
          ObjectIdentifierValue []oids = req.getVarBindList().getNames();
         
          for (i = 0; i < oids.length; i++) {
            SnmpValue attr = getMBean(oids[i]);

            VarBindValue varBind;
           
            if (attr != null)
              varBind = new VarBindValue(oids[i], attr);
            else {
              varBind = new VarBindValue(oids[i], NullValue.NULL);
             
              if (error.getLong() == 0) {
                error = new IntegerValue(NO_SUCH_NAME);
                errorIndex = new IntegerValue(i + 1);
              }
            }
           
            varBindList.add(varBind);
          }

          break;
        }
        case SnmpValue.GET_NEXT_REQUEST_PDU:
        {
          break;
        }
        case SnmpValue.SET_REQUEST_PDU:
        {
          break;
        }
        default:
          log.fine(L.l("invalid pdu type {0}", req.getType()));
         
          throw new SnmpRuntimeException(L.l("invalid pdu type {0}",
                                             req.getType()));
      }
    }
    catch (Exception e) {
      if (error.getLong() == 0) {
        error = new IntegerValue(GENERAL_ERROR);
        errorIndex = new IntegerValue(i + 1);
      }
     
      if (req.getVarBindList().size() > i) {
        VarBindValue varBind
          = new VarBindValue(req.getVarBindList().get(i).getName(),
View Full Code Here

  /*
   * Sets the SNMP version.
   */
  public void setVersion(int version)
  {
    _version = new IntegerValue(version);
  }
View Full Code Here

TOP

Related Classes of com.caucho.server.snmp.types.IntegerValue

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.