/** * Method to add {@link FlowFile} attributes from a {@link VariableBinding} * @param variableBinding {@link VariableBinding} * @param attributes {@link FlowFile} attributes to update */ private static void addAttributeFromVariable(VariableBinding variableBinding, Map<String, String> attributes) { attributes.put(SNMP_PROP_PREFIX + variableBinding.getOid() + SNMP_PROP_DELIMITER + variableBinding.getVariable().getSyntax(), variableBinding.getVariable().toString()); }
private boolean isNumber(Object o) { if (o instanceof VariableBinding) { Variable v = ((VariableBinding) o).getVariable(); if ((v instanceof AssignableFromLong) || (v instanceof AssignableFromInteger)) { return true; } } return false; }
protected Variable findVariableByOid(OID oid, Vector<?> variableBindings) { for (Iterator<?> it = variableBindings.iterator(); it.hasNext();) { VariableBinding vb = (VariableBinding) it.next(); if (vb.getOid().startsWith(oid)) { return vb.getVariable(); } } return null; }
public int isValueOK(SubRequest request) { Variable newValue = request.getVariableBinding().getVariable(); int valueOK = super.isValueOK(request); if (valueOK != SnmpConstants.SNMP_ERROR_SUCCESS) { return valueOK; } //--AgentGen BEGIN=nlmConfigGlobalEntryLimit::isValueOK //--AgentGen END return valueOK; }
public int isValueOK(SubRequest request) { Variable newValue = request.getVariableBinding().getVariable(); int valueOK = super.isValueOK(request); if (valueOK != SnmpConstants.SNMP_ERROR_SUCCESS) { return valueOK; } //--AgentGen BEGIN=nlmConfigGlobalEntryLimit::isValueOK //--AgentGen END return valueOK; }
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 int isValueOK(SubRequest request) { Variable newValue = request.getVariableBinding().getVariable(); int valueOK = super.isValueOK(request); if (valueOK != SnmpConstants.SNMP_ERROR_SUCCESS) { return valueOK; } //--AgentGen BEGIN=snmp4jDemoSparseTableType::isValueOK //--AgentGen END return valueOK; }
/** {@inheritDoc} */ @Override public void commit(final SubRequest request) { final VariableBinding vb = request.getVariableBinding(); final Variable v = vb.getVariable(); m_vars.put(vb.getOid(), v); final RequestStatus status = request.getStatus(); status.setPhaseComplete(true); }
public boolean equals(Object o) { if (o instanceof VariableBinding) { VariableBinding other = (VariableBinding)o; return oid.equals(other.getOid()) && variable.equals(other.getVariable()); } return false; }
public boolean equals(Object o) { if (o instanceof VariableBinding) { VariableBinding other = (VariableBinding)o; return oid.equals(other.getOid()) && variable.equals(other.getVariable()); } return false; } }
public boolean equals(Object o) { if (o instanceof VariableBinding) { VariableBinding other = (VariableBinding)o; return oid.equals(other.getOid()) && variable.equals(other.getVariable()); } return false; }
private static SnmpValue[] convertResponseToValues(ResponseEvent responseEvent) { SnmpValue[] retvalues = new Snmp4JValue[responseEvent.getResponse().getVariableBindings().size()]; for (int i = 0; i < retvalues.length; i++) { retvalues[i] = new Snmp4JValue(responseEvent.getResponse().get(i).getVariable()); } return retvalues; }
@SuppressWarnings("unchecked") public boolean setValue(VariableBinding newValueAndInstancceOID) { if (getOid().equals(newValueAndInstancceOID.getOid())) { return (setValue((V) newValueAndInstancceOID.getVariable()) == SnmpConstants.SNMP_ERROR_SUCCESS); } return false; }
public boolean setValue(VariableBinding newValueAndInstancceOID) { if (getOid().equals(newValueAndInstancceOID.getOid())) { return (setValue(newValueAndInstancceOID.getVariable()) == SnmpConstants.SNMP_ERROR_SUCCESS); } return false; } }
public void commit(SubRequest subRequest, MOTableRow changeSet, int column) { subRequest.setUndoValue(values[column]); setValue(column, (Variable) subRequest.getVariableBinding().getVariable().clone()); subRequest.completed(); }
@Override public TrapIdentity getTrapIdentity() { OID snmpTrapOid = (OID) getVarBindAt(SNMP_TRAP_OID_INDEX).getVariable(); OID lastVarBindOid = getVarBindAt(getPduLength() - 1).getOid(); Variable lastVarBindValue = getVarBindAt(getPduLength() - 1).getVariable(); return new TrapIdentity(SnmpObjId.get(snmpTrapOid.getValue()), SnmpObjId.get(lastVarBindOid.getValue()), new Snmp4JValue(lastVarBindValue)); }
protected TrapIdentity getTrapIdentity() { OID snmpTrapOid = (OID) getVarBindAt(SNMP_TRAP_OID_INDEX).getVariable(); OID lastVarBindOid = getVarBindAt(getPduLength() - 1).getOid(); Variable lastVarBindValue = getVarBindAt(getPduLength() - 1).getVariable(); return new TrapIdentity(SnmpObjId.get(snmpTrapOid.getValue()), SnmpObjId.get(lastVarBindOid.getValue()), new Snmp4JValue(lastVarBindValue)); }
@Override public TrapIdentity getTrapIdentity() { OID snmpTrapOid = (OID) getVarBindAt(SNMP_TRAP_OID_INDEX).getVariable(); OID lastVarBindOid = getVarBindAt(getPduLength() - 1).getOid(); Variable lastVarBindValue = getVarBindAt(getPduLength() - 1).getVariable(); return new TrapIdentity(SnmpObjId.get(snmpTrapOid.getValue()), SnmpObjId.get(lastVarBindOid.getValue()), new Snmp4JValue(lastVarBindValue)); }
@Override public SnmpVarBindDTO getSnmpVarBindDTO(int i) { SnmpObjId name = SnmpObjId.get(getVarBindAt(i).getOid().getValue()); SnmpValue value = new Snmp4JValue(getVarBindAt(i).getVariable()); return new SnmpVarBindDTO(name, value); }
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); }