Package org.snmp4j.smi

Examples of org.snmp4j.smi.Variable


      value = data.get(attribute.getName());
    }
    else {
      value = mBeanNotifyUserObject;
    }
    Variable smiValue = (Variable) valueType.clone();
    SMIVariant smiVariant = new SMIVariant(smiValue);
    value = attribute.transformFromNative(value, null);
    smiVariant.setValue(value);
    OID oid = new OID(classID);
    if (index != null) {
View Full Code Here


  }

  public int isValueOK(SubRequest request) {
    int status = super.isValueOK(request);
    if (status == SnmpConstants.SNMP_ERROR_SUCCESS) {
      Variable newValue = request.getVariableBinding().getVariable();
      status = valueProxy.checkScalarValue(getOid(), newValue);
    }
    return status;
  }
View Full Code Here

    }
    return status;
  }

  public void commit(SubRequest request) {
    Variable newValue = request.getVariableBinding().getVariable();
    int status = valueProxy.setScalarValue(getOid(), newValue);
    if (status != PDU.noError) {
      request.getStatus().setErrorStatus(status);
    }
    else {
View Full Code Here

    }
    super.get(request);
  }

  public void undo(SubRequest request) {
    Variable newValue = (Variable) request.getUndoValue();
    int status = valueProxy.setScalarValue(getOid(), newValue);
    request.getStatus().setErrorStatus(status);
  }
View Full Code Here

            return;
        }

        VariableBinding vb = new VariableBinding(new OID(oid));
        if (value != null) {
            Variable variable;
            switch (type) {
            case 'i': {
                variable = new Integer32(Integer.parseInt(value));
                break;
            }
View Full Code Here

            EventSeverity severity = EventSeverity.INFO;

            Vector<VariableBinding> vbs = pdu.getVariableBindings();
            for (VariableBinding vb : vbs) {
                OID oid = vb.getOid();
                Variable var = vb.getVariable();
                int syntax = vb.getSyntax();

                // Try to translate the oid string (1.2.3....) into a readable name
                String oids = oid.toString();
                if (translation.getProperty(oids) != null) {
                    oids = translation.getProperty(oids);
                }

                payload.append(oids);
                payload.append(": ");
                payload.append(var.toString()); // TODO change depending on syntax !
                payload.append("\n");

                /*
                 * This corresponds with the values from AlertPriority
                 */
                if (severityOid != null && oid.compareTo(severityOid) == 0) {
                    String sev = var.toString();
                    if (sev.toLowerCase().contains("high"))
                        severity = EventSeverity.ERROR;
                    else if (sev.toLowerCase().contains("medium"))
                        severity = EventSeverity.WARN;
                    else
View Full Code Here

    }

    @Override
    public boolean equals(Object obj) {
        if (obj instanceof SNMPValue) {
            Variable var = ((SNMPValue) obj).var;
            return (var != null) && var.equals(this.var);
        }

        return false;
    }
View Full Code Here

      ((ConstraintsImpl)
       getValueConstraint()).add(new Constraint(minSize, maxSize));
    }

    public void validate(MOValueValidationEvent validationEvent) {
      Variable newValue = validationEvent.getNewValue();
      int status =
          DisplayString.validateDisplayString(newValue, getValueConstraint());
      validationEvent.setValidationStatus(status);
    }
View Full Code Here

      public int isValueOK(SubRequest sreq) {
        return validateDateAndTime(sreq.getVariableBinding().getVariable());
      }

      public Variable getValue() {
        Variable value = super.getValue();
        if (localtime) {
          value = makeDateAndTime(new GregorianCalendar());
        }
        return value;
      }
View Full Code Here

  public int isValueOK(SubRequest sreq) {
    return DateAndTime.validateDateAndTime(sreq.getVariableBinding().getVariable());
  }

  public Variable getValue() {
    Variable value = super.getValue();
    if (localtime) {
      value = DateAndTime.makeDateAndTime(new GregorianCalendar());
    }
    return value;
  }
View Full Code Here

TOP

Related Classes of org.snmp4j.smi.Variable

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.