protected void processSetRequest(SnmpVarBind varb, AgentNode node, VarBindRequestEvent pe) throws AgentSnmpException { try { // This means that the node is outside the perview of the // mibs loaded if (node == null) { AgentUtil.throwNoCreation(pe.getVersion()); } int[] oid = (int[]) varb.getObjectID().toValue(); if (oid.length != REDEOidRep.length + 2) { AgentUtil.throwNoCreation(pe.getVersion()); } int[] inst = (int[]) AgentUtil.getInstance(oid, REDEOidRep.length); if (inst[1] != 0) { AgentUtil.throwNoCreation(pe.getVersion()); } // For adding trap varbinds ... Vector varbindVector = new Vector(); SnmpVar var = varb.getVariable(); switch (node.getSubId()) { case REDE_BUSCAIP: // Check for the proper instance if (!(var instanceof SnmpIpAddress)) { AgentUtil.throwWrongType(pe.getVersion()); } String REDE_BuscaIPStr = (String) var.getVarObject(); instrument.setREDE_BuscaIP(REDE_BuscaIPStr); break; case REDE_HOSTNAME: // Check for the proper instance if (!(var instanceof SnmpString)) { AgentUtil.throwWrongType(pe.getVersion()); } String REDE_HOSTNAMEStr = (String) var.getVarObject(); byte[] REDE_HOSTNAMEArr = AgentUtil.getOctetBytes(REDE_HOSTNAMEStr); instrument.setREDE_HOSTNAME(REDE_HOSTNAMEArr); break; default: AgentUtil.throwNoSuchInstance(pe.getVersion()); } } catch (Exception exp) { if (exp instanceof AgentException) { AgentException ae = (AgentException) exp; AgentSnmpException ase = AgentUtil.convertToAgentSnmpException(pe.getVersion(), ae); utils.handleError(ase); throw ase; } else if (exp instanceof AgentSnmpException) { utils.handleError((AgentSnmpException) exp); throw ((AgentSnmpException) exp); } utils.handleError(exp); } }