diff options
Diffstat (limited to 'profiles/snmp/src/main')
-rw-r--r-- | profiles/snmp/src/main/java/org/onap/cli/fw/snmp/cmd/OnapSnmpCommand.java | 8 | ||||
-rw-r--r-- | profiles/snmp/src/main/java/org/onap/cli/fw/snmp/schema/OnapCommandSchemaSnmpLoader.java | 6 |
2 files changed, 5 insertions, 9 deletions
diff --git a/profiles/snmp/src/main/java/org/onap/cli/fw/snmp/cmd/OnapSnmpCommand.java b/profiles/snmp/src/main/java/org/onap/cli/fw/snmp/cmd/OnapSnmpCommand.java index 3e841e76..4fc47538 100644 --- a/profiles/snmp/src/main/java/org/onap/cli/fw/snmp/cmd/OnapSnmpCommand.java +++ b/profiles/snmp/src/main/java/org/onap/cli/fw/snmp/cmd/OnapSnmpCommand.java @@ -116,9 +116,7 @@ public class OnapSnmpCommand extends OnapCommand { String[] oidStrArr = oids.toArray(new String[oids.size()]); - switch (this.command) { - - case OnapCommandSnmpConstants.SNMP_CMD_GET: + if (OnapCommandSnmpConstants.SNMP_CMD_GET.equals(this.command)) { ResponseEvent responseEvent = snmp.send(getPDU(PDU.GET, oidStrArr), getTarget(), null); if ( responseEvent != null) { if (responseEvent.getResponse().getErrorStatus() == PDU.noError) { @@ -138,10 +136,6 @@ public class OnapSnmpCommand extends OnapCommand { } else { throw new OnapSnmpErrorResponse("Failed to send SNMP GET command"); } - break; - - default: - break; } snmp.close(); } catch (IOException ex) { diff --git a/profiles/snmp/src/main/java/org/onap/cli/fw/snmp/schema/OnapCommandSchemaSnmpLoader.java b/profiles/snmp/src/main/java/org/onap/cli/fw/snmp/schema/OnapCommandSchemaSnmpLoader.java index ca3f44e0..0d708202 100644 --- a/profiles/snmp/src/main/java/org/onap/cli/fw/snmp/schema/OnapCommandSchemaSnmpLoader.java +++ b/profiles/snmp/src/main/java/org/onap/cli/fw/snmp/schema/OnapCommandSchemaSnmpLoader.java @@ -27,7 +27,9 @@ import org.onap.cli.fw.snmp.conf.OnapCommandSnmpConstants; import org.onap.cli.fw.utils.OnapCommandUtils; public class OnapCommandSchemaSnmpLoader { - + private OnapCommandSchemaSnmpLoader() { + throw new IllegalStateException("Utility class"); + } private static List<String> validateSnmpSchemaSection(Map<String, Object> values) { ArrayList<String> errorList = new ArrayList<>(); @@ -61,7 +63,7 @@ public class OnapCommandSchemaSnmpLoader { case OnapCommandSnmpConstants.SNMP_COMMAND: cmd.setCommand((String) entry.getValue()); - + break; default: break; } |