PDU response = getResponsePDU(pdu); oldVar = getValueFor(oid); modified.add(new VariableBinding(oid, oldVar)); // keep a record of the old variable binding. if (checkObject(oid)){ var = setValueFor(oid,newVal); undoSets(modified); makeErrorPdu(response, pdu, errorIndex, PDU.noAccess); return response; undoSets(modified); makeErrorPdu(response, pdu, errorIndex, PDU.noCreation); return response; undoSets(modified); makeErrorPdu(response, pdu, errorIndex, PDU.wrongType); return response; undoSets(modified); makeErrorPdu(response, pdu, errorIndex, PDU.notWritable); return response; undoSets(modified); makeErrorPdu(response, pdu, errorIndex, PDU.genErr); return response;
/** * Reconfigures the RequestHandler */ public void reconfigure(String resName) throws Exception { if (resName == null || resName.equals("")) throw new IllegalArgumentException("Null or empty resName, cannot reconfigure"); if (initialized == false) throw new IllegalStateException("Cannot reconfigure, not initialized yet"); this.resourceName = resName; // Wipe out old entries bindings.clear(); // Fetch them again initializeBindings(); }
response = getResponsePDU(pdu); noid = getNextOid(oid); newVB = new VariableBinding(noid); try { var = getValueFor(noid); } catch (NoSuchInstanceException e) { log.debug("snmpReceivedGet: GETNEXT operation returned null. No such OID."); } catch (VariableTypeException e) { log.debug("snmpReceivedGet: GETNEXT operation could not convert the returned value for " + noid + " into an appropriate type."); makeErrorPdu(response, pdu, errorIndex, PDU.genErr); return response; if (checkObject(oid)){ try { var = getValueFor(oid); } catch (NoSuchInstanceException e) { log.debug("snmpReceivedGet: GET operation returned null. No such Instance."); } catch (VariableTypeException e) { log.debug("snmpReceivedGet: GET operation could not convert the returned value for " + oid + " into an appropriate type."); makeErrorPdu(response, pdu, errorIndex, PDU.genErr); return response;
BindEntry be = findBindEntryForOid(oid); Variable ssy = null; if (be != null) { tableIndexOID = be.getTableIndexOID(); ssy = prepForPdu(val, tableIndexOID); } catch (VariableTypeException e){ log.debug("getValueFor: didn't find a suitable data type for the requested data");
final boolean trace = log.isTraceEnabled(); BindEntry be = findBindEntryForOid(oid); Variable ssy = null; Object val = convertVariableToValue(newVal, other);
} else { oid = oid + ".0"; addBindEntry(oid, mmb.getName(), ma.getName(), ma.isReadWrite());
response = getResponsePDU(pdu); noid = getNextOid(oid); newVB = new VariableBinding(noid); try { var = getValueFor(noid); } catch (NoSuchInstanceException e) { log.debug("snmpReceivedGet: GETNEXT operation returned null. No such OID."); } catch (VariableTypeException e) { log.debug("snmpReceivedGet: GETNEXT operation could not convert the returned value for " + noid + " into an appropriate type."); makeErrorPdu(response, pdu, errorIndex, PDU.genErr); return response; if (checkObject(oid)){ try { var = getValueFor(oid); } catch (NoSuchInstanceException e) { log.debug("snmpReceivedGet: GET operation returned null. No such Instance."); } catch (VariableTypeException e) { log.debug("snmpReceivedGet: GET operation could not convert the returned value for " + oid + " into an appropriate type."); makeErrorPdu(response, pdu, errorIndex, PDU.genErr); return response;
BindEntry be = findBindEntryForOid(oid); Variable ssy = null; if (be != null) { tableIndexOID = be.getTableIndexOID(); ssy = prepForPdu(val, tableIndexOID); } catch (VariableTypeException e){ log.debug("getValueFor: didn't find a suitable data type for the requested data");
final boolean trace = log.isTraceEnabled(); BindEntry be = findBindEntryForOid(oid); Variable ssy = null; Object val = convertVariableToValue(newVal, other);
} else { oid = oid + ".0"; addBindEntry(oid, mmb.getName(), ma.getName(), ma.isReadWrite());
PDU response = getResponsePDU(pdu); if(response == null) { return response; makeErrorPdu(response, pdu, errorIndex, PDU.genErr); return response; noid = getNextOid(oid); var = getValueFor(noid); makeErrorPdu(response, pdu, errorIndex, PDU.genErr); return response; OID noid = null; try { noid = getNextOid(oid); var = getValueFor(noid); makeErrorPdu(response, pdu, errorIndex, PDU.genErr); var = Null.instance; noid = getNextOid(noid);
PDU response = getResponsePDU(pdu); oldVar = getValueFor(oid); modified.add(new VariableBinding(oid, oldVar)); // keep a record of the old variable binding. if (checkObject(oid)){ var = setValueFor(oid,newVal); undoSets(modified); makeErrorPdu(response, pdu, errorIndex, PDU.noAccess); return response; undoSets(modified); makeErrorPdu(response, pdu, errorIndex, PDU.noCreation); return response; undoSets(modified); makeErrorPdu(response, pdu, errorIndex, PDU.wrongType); return response; undoSets(modified); makeErrorPdu(response, pdu, errorIndex, PDU.notWritable); return response; undoSets(modified); makeErrorPdu(response, pdu, errorIndex, PDU.genErr); return response;
/** * Reconfigures the RequestHandler */ public void reconfigure(String resName) throws Exception { if (resName == null || resName.equals("")) throw new IllegalArgumentException("Null or empty resName, cannot reconfigure"); if (initialized == false) throw new IllegalStateException("Cannot reconfigure, not initialized yet"); this.resourceName = resName; // Wipe out old entries bindings.clear(); // Fetch them again initializeBindings(); }
PDU response = getResponsePDU(pdu); if(response == null) { return response; makeErrorPdu(response, pdu, errorIndex, PDU.genErr); return response; noid = getNextOid(oid); var = getValueFor(noid); makeErrorPdu(response, pdu, errorIndex, PDU.genErr); return response; OID noid = null; try { noid = getNextOid(oid); var = getValueFor(noid); makeErrorPdu(response, pdu, errorIndex, PDU.genErr); var = Null.instance; noid = getNextOid(noid);
/** * Initialize * * @param resourceName A file containing get/set mappings * @param server Our MBean-Server * @param log The logger we use * @param uptime The uptime of the snmp-agent subsystem. */ public void initialize(String resourceName, MBeanServer server, Logger log, Clock uptime) throws Exception { log.debug("initialize() with res=" + resourceName); super.initialize(resourceName, server, log, uptime); tableMapper = new TableMapper(server, log); attributeTableMapper = new AttributeTableMapper(server, log); if (resourceName != null) initializeBindings(); else log.warn("No RequestHandlerResName configured, disabling snmp-get"); initialized = true; }
/** * Initialize * * @param resourceName A file containing get/set mappings * @param server Our MBean-Server * @param log The logger we use * @param uptime The uptime of the snmp-agent subsystem. */ public void initialize(String resourceName, MBeanServer server, Logger log, Clock uptime) throws Exception { log.debug("initialize() with res=" + resourceName); super.initialize(resourceName, server, log, uptime); tableMapper = new TableMapper(server, log); attributeTableMapper = new AttributeTableMapper(server, log); if (resourceName != null) initializeBindings(); else log.warn("No RequestHandlerResName configured, disabling snmp-get"); initialized = true; }