/** * Gets the error status of the PDU. * @return * a SNMP error status. * @see SnmpConstants */ public int getErrorStatus() { return errorStatus.getValue(); }
/** * Gets the number of non repeater variable bindings in a GETBULK PDU. * @return * an integer value >= 0 and <= {@link #size()} */ public int getNonRepeaters() { return errorStatus.getValue(); }
/** * Gets the error index. * * @return an integer value >= 0 where 1 denotes the first variable binding. */ public int getErrorIndex() { return errorIndex.getValue(); }
/** * Gets the maximum repetitions of repeatable variable bindings in GETBULK * requests. * * @return an integer value >= 0. */ public int getMaxRepetitions() { return errorIndex.getValue(); }
/** * Gets the maximum repetitions of repeatable variable bindings in GETBULK * requests. * @return * an integer value >= 0. */ public int getMaxRepetitions() { return errorIndex.getValue(); }
public void validate(MOValueValidationEvent validationEvent) { Variable newValue = validationEvent.getNewValue(); long v = ((Integer32)newValue).getValue(); if (!(((v >= 0L) && (v <= 0L)) || ((v >= 484L)))) { validationEvent.setValidationStatus(SnmpConstants.SNMP_ERROR_WRONG_VALUE); return; } //--AgentGen BEGIN=snmpTargetAddrMMS::validate //--AgentGen END } }
public void validate(MOValueValidationEvent validationEvent) { Variable newValue = validationEvent.getNewValue(); //--AgentGen BEGIN=snmp4jLogRootLevel::validate int v = ((Integer32)newValue ).getValue(); if ((v < 1) || (v > 8)) { validationEvent.setValidationStatus(SnmpConstants.SNMP_ERROR_WRONG_VALUE); } //--AgentGen END } }
public int setValue(Integer32 newValue) { //--AgentGen BEGIN=agentppSimMode::setValue SimMOFactory.setSimulationModeEnabled(newValue.getValue() == AgentppSimModeEnum.config); //--AgentGen END return super.setValue(newValue); }
public int isValueOK(SubRequest request) { Integer32 value = (Integer32) request.getVariableBinding().getVariable(); if (value.getValue() < 0) { return SnmpConstants.SNMP_ERROR_WRONG_VALUE; } return SnmpConstants.SNMP_ERROR_SUCCESS; }
public void validate(MOValueValidationEvent validationEvent) { Variable newValue = validationEvent.getNewValue(); long v = ((Integer32) newValue).getValue(); if (!(((v >= 0L) && (v <= 255L)))) { validationEvent.setValidationStatus(SnmpConstants. SNMP_ERROR_WRONG_VALUE); return; } //--AgentGen BEGIN=snmpTargetAddrRetryCount::validate //--AgentGen END } }
public int setValue(Variable newValue) { //--AgentGen BEGIN=agentppSimMode::setValue SimMOFactory.setSimulationModeEnabled(((Integer32)newValue).getValue() == AgentppSimModeEnum.config); //--AgentGen END return super.setValue(newValue); }
public void validate(MOValueValidationEvent validationEvent) { Variable newValue = validationEvent.getNewValue(); int v = ((Integer32) newValue).getValue(); if (messageDispatcher.getMessageProcessingModel(v) == null) { validationEvent.setValidationStatus(SnmpConstants. SNMP_ERROR_WRONG_VALUE); return; } //--AgentGen BEGIN=snmpTargetParamsMPModel::validate //--AgentGen END } }
public boolean passesFilter(DefaultMOMutableRow2PC row) { Integer32 rs = (Integer32) row.getValue(idxSnmpNotifyFilterProfileRowStatus); if (rs == null) { return false; } return ((rs.getValue() == RowStatus.active) && filterName.equals(row.getValue(idxSnmpNotifyFilterProfileName))); } };
public boolean passesFilter(DefaultMOMutableRow2PC row) { Integer32 rs = (Integer32) row.getValue(idxSnmpNotifyFilterProfileRowStatus); if (rs == null) { return false; } return ((rs.getValue() == RowStatus.active) && filterName.equals(row.getValue(idxSnmpNotifyFilterProfileName))); } };
public void validate(MOValueValidationEvent validationEvent) { Variable newValue = validationEvent.getNewValue(); int v = ((Integer32) newValue).getValue(); if (messageDispatcher.getMessageProcessingModel(v) == null) { validationEvent.setValidationStatus(SnmpConstants. SNMP_ERROR_WRONG_VALUE); return; } //--AgentGen BEGIN=snmpTargetParamsMPModel::validate //--AgentGen END } }
private int getStorageType(LogAdapter logger) { Snmp4jLogLoggerRow row = (Snmp4jLogLoggerRow) snmp4jLogLoggerEntryModel.getRow(getLoggerIndex(logger)); if (row != null) { return row.getSnmp4jLogLoggerStorageType().getValue(); } return StorageType.volatile_; }
public void validate(MOValueValidationEvent event) { if (!(event.getNewValue() instanceof Integer32)) { event.setValidationStatus(PDU.wrongType); } int v = ((Integer32)event.getNewValue()).getValue(); if ((v < 1) || (v > 6) || (v == 3)) { event.setValidationStatus(PDU.wrongValue); } } }
public void get(SubRequest subRequest, MOTableRow row, int column) { Integer32 rowStatus = (Integer32) getValue(row, column); if ((rowStatus != null) && (rowStatus.getValue() == notReady)) { if (isReady(row, column)) { rowStatus.setValue(notInService); } } super.get(subRequest, row, column); }
public void commit(SubRequest request) { //--AgentGen BEGIN=snmp4jLogRootLevel::commit Variable vb = request.getVariableBinding().getVariable(); int v = ((Integer32)vb).getValue(); LogAdapter logAdapter = LogFactory.getLogFactory().getRootLogger(); logAdapter.setLogLevel(new LogLevel(v)); //--AgentGen END super.commit(request); }
public void load(MOInput input) throws IOException { super.load(input); int v = ((Integer32)getValue()).getValue(); if (LogFactory.getLogFactory() != null) { LogAdapter logAdapter = LogFactory.getLogFactory().getRootLogger(); if (v != LogLevel.LEVEL_NONE) { logAdapter.setLogLevel(new LogLevel(v)); } } }