/** * Sets the value of the variable binding. * * @param variable * a <code>Variable</code> (must not be <code>null</code>) that is cloned * when added to this binding. */ public void setVariable(Variable variable) { if (variable == null) { throw new IllegalArgumentException( "Variable of a VariableBinding must not be null"); } this.variable = (Variable) variable.clone(); }
/** * Sets the value of the variable binding. * * @param variable * a <code>Variable</code> (must not be <code>null</code>) that is cloned * when added to this binding. */ public void setVariable(Variable variable) { if (variable == null) { throw new IllegalArgumentException( "Variable of a VariableBinding must not be null"); } this.variable = (Variable) variable.clone(); }
/** * Sets the value of the variable binding. * * @param variable * a <code>Variable</code> (must not be <code>null</code>) that is cloned * when added to this binding. */ public void setVariable(Variable variable) { if (variable == null) { throw new IllegalArgumentException( "Variable of a VariableBinding must not be null"); } this.variable = (Variable) variable.clone(); }
public Object clone() { updateVariable(); return new VariantVariable((Variable)variable.clone()); }
public Object clone() { updateVariable(); return new VariantVariable((Variable)variable.clone()); }
public Object clone() { updateVariable(); return new VariantVariable((Variable)variable.clone()); }
public synchronized void incrementCounter(CounterEvent event) { OID id = event.getOid(); VariableBinding counter = (VariableBinding) counters.get(id); if (counter == null) { counter = new VariableBinding(id, new Counter32(1)); counters.put(id, counter); } else { ((Counter32)counter.getVariable()).increment(); } // write back current value event.setCurrentValue((Variable) ((VariableBinding)counter).getVariable().clone()); } }
public void commit(SubRequest subRequest, MOTableRow changeSet, int column) { subRequest.setUndoValue(values[column]); setValue(column, (Variable) subRequest.getVariableBinding().getVariable().clone()); subRequest.completed(); }
public void commit(SubRequest subRequest, MOTableRow changeSet, int column) { subRequest.setUndoValue(values[column]); setValue(column, (Variable) subRequest.getVariableBinding().getVariable().clone()); subRequest.completed(); }
public Variable getValue() { if (snmpCommunityMIB != null) { if (snmpCommunityMIB.isSourceAddressFiltering()) { setValue(new Integer32(Snmp4jCfgSecSrcAddrValidationEnum.enabled)); } else { setValue(new Integer32(Snmp4jCfgSecSrcAddrValidationEnum.disabled)); } } else { setValue(new Integer32(Snmp4jCfgSecSrcAddrValidationEnum.notAvailable)); } return (Variable) super.getValue().clone(); }
public void get(SubRequest request) { RequestStatus status = request.getStatus(); if (checkRequestScope(request)) { if (access.isAccessibleForRead()) { VariableBinding vb = request.getVariableBinding(); vb.setOid(getOid()); vb.setVariable((Variable) getValue().clone()); request.completed(); } else { status.setErrorStatus(SnmpConstants.SNMP_ERROR_NO_ACCESS); } } }
public void commit(SubRequest subRequest, MOTableRow row, MOTableRow changeSet, int column) { if (row instanceof MOMutableRow2PC) { ((MOMutableRow2PC) row).commit(subRequest, changeSet, column); } else if (row instanceof MOMutableTableRow) { if (subRequest.getUndoValue() == null) { subRequest.setUndoValue(row.getValue(column)); } ((MOMutableTableRow) row).setValue(column, (Variable) subRequest.getVariableBinding().getVariable().clone()); subRequest.completed(); } else { // should never be reached! subRequest.getStatus().setErrorStatus(PDU.commitFailed); } }
public void get(SubRequest subRequest, MOTableRow row, int column) { if (getAccess().isAccessibleForRead()) { Variable value = getValue(row, column); if (value != null) { subRequest.getVariableBinding().setVariable((Variable) value.clone()); } else { subRequest.getVariableBinding().setVariable(Null.noSuchInstance); } subRequest.completed(); } else { subRequest.getStatus().setErrorStatus(SnmpConstants.SNMP_ERROR_NO_ACCESS); } }
public void commit(SubRequest subRequest, MOTableRow row, MOTableRow changeSet, int column) { if (row instanceof MOMutableRow2PC) { ((MOMutableRow2PC)row).commit(subRequest, changeSet, column); } else if (row instanceof MOMutableTableRow) { if (subRequest.getUndoValue() == null) { subRequest.setUndoValue(row.getValue(column)); } ((MOMutableTableRow)row).setValue(column, (Variable)subRequest.getVariableBinding().getVariable().clone()); subRequest.completed(); } else { // should never be reached! subRequest.getStatus().setErrorStatus(PDU.commitFailed); } }
public void get(SubRequest request) { RequestStatus status = request.getStatus(); if (checkRequestScope(request)) { if (access.isAccessibleForRead()) { VariableBinding vb = request.getVariableBinding(); vb.setOid(getOid()); Variable variable = getValue(); if (variable == null) { vb.setVariable(Null.noSuchObject); } else { vb.setVariable((Variable) variable.clone()); } request.completed(); } else { status.setErrorStatus(SnmpConstants.SNMP_ERROR_NO_ACCESS); } } }
/** * Process a get sub-request for the specified table row and column. * @param subRequest * the GET sub-request to execute. * @param row * the row that contains the value to return in the GET response PDU. * @param column * the column index of the value to return in <code>subRequest</code> */ @SuppressWarnings("unchecked") public void get(SubRequest subRequest, MOTableRow row, int column) { if (getAccess().isAccessibleForRead()) { V value = getValue(row, column, subRequest); if (value != null) { subRequest.getVariableBinding().setVariable((V) value.clone()); } else { subRequest.getVariableBinding().setVariable(Null.noSuchInstance); } subRequest.completed(); } else { subRequest.getStatus().setErrorStatus(SnmpConstants.SNMP_ERROR_NO_ACCESS); } }
public boolean next(SubRequest request) { if (access.isAccessibleForRead() && (request.getScope().isCovered(getSingleInstanceScope()))) { VariableBinding vb = request.getVariableBinding(); vb.setOid(getOid()); vb.setVariable((Variable)getValue().clone()); request.completed(); if (logger.isDebugEnabled()) { logger.debug("Processed GETNEXT/BULK request '"+request+"' by '"+ getOid()); } return true; } if (logger.isDebugEnabled()) { logger.debug("Skipped '"+ getOid()+"' for GETNEXT/BULK request '"+request+"'"); } return false; }
public boolean next(SubRequest request) { if (access.isAccessibleForRead() && (request.getScope().isCovered(getSingleInstanceScope()))) { VariableBinding vb = request.getVariableBinding(); vb.setOid(getOid()); Variable variable = getValue(); if (variable == null) { // skip this scalar for NEXT requests if (logger.isDebugEnabled()) { logger.debug("Skipped '" + getOid() + "' for GETNEXT/BULK request '" + request + "' because variable is NULL"); } return false; } else { vb.setVariable((Variable) variable.clone()); } request.completed(); if (logger.isDebugEnabled()) { logger.debug("Processed GETNEXT/BULK request '" + request + "' by '" + getOid()); } return true; } if (logger.isDebugEnabled()) { logger.debug("Skipped '" + getOid() + "' for GETNEXT/BULK request '" + request + "'"); } return false; }