From 034d62f1c76aafa32bb434962ea29485e6313442 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Wed, 2 May 2018 14:34:17 +0530 Subject: Add hashCode() for SchemaInfo Issue-ID: CLI-106 Change-Id: If8e3bc25821bbdd3c56f7f6309c43456424a173b Signed-off-by: Kanagaraj Manickam k00365106 --- .../src/main/java/org/onap/cli/fw/schema/OnapCommandSchemaInfo.java | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/framework/src/main/java/org/onap/cli/fw/schema/OnapCommandSchemaInfo.java b/framework/src/main/java/org/onap/cli/fw/schema/OnapCommandSchemaInfo.java index d4776e16..a4703256 100644 --- a/framework/src/main/java/org/onap/cli/fw/schema/OnapCommandSchemaInfo.java +++ b/framework/src/main/java/org/onap/cli/fw/schema/OnapCommandSchemaInfo.java @@ -18,6 +18,7 @@ package org.onap.cli.fw.schema; import java.util.ArrayList; import java.util.List; +import java.util.Objects; import org.onap.cli.fw.cmd.OnapCommandType; import org.onap.cli.fw.conf.OnapCommandConstants; @@ -154,4 +155,9 @@ public class OnapCommandSchemaInfo implements Comparable return this.compareTo((OnapCommandSchemaInfo) obj) == 0; } + + @Override + public int hashCode() { + return Objects.hashCode(this.cmdName); + } } -- cgit 1.2.3-korg From 21c36da10bc2032da3587d6bbc4a94af07fc8244 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Wed, 2 May 2018 14:41:44 +0530 Subject: Del invalid excep throws in OnapCommand getSchema Issue-ID: CLI-106 Change-Id: I2b40fb38a77feeea0ec0a743987d7211ad45dd7e Signed-off-by: Kanagaraj Manickam k00365106 --- framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java b/framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java index aa04d556..d3264508 100644 --- a/framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java +++ b/framework/src/main/java/org/onap/cli/fw/cmd/OnapCommand.java @@ -67,7 +67,7 @@ public abstract class OnapCommand { this.addDefaultSchemas(OnapCommandConstants.DEFAULT_PARAMETER_FILE_NAME); } - public List getSchemas() throws OnapCommandException { + public List getSchemas() { List schemas = new ArrayList<>(); schemas.addAll(this.defaultSchemas); schemas.add(this.getSchemaName()); -- cgit 1.2.3-korg From 3dd9d9c91361bfc3f52cb2abe9197f1ea9c54b80 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Wed, 2 May 2018 14:44:55 +0530 Subject: Remove unused imports from Auth Client Issue-ID: CLI-106 Change-Id: I76d37a7cd2e4b597749663fba134cb14d9da6a1c Signed-off-by: Kanagaraj Manickam k00365106 --- .../main/java/org/onap/cli/fw/http/auth/OnapCommandHttpAuthClient.java | 1 - 1 file changed, 1 deletion(-) diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/auth/OnapCommandHttpAuthClient.java b/profiles/http/src/main/java/org/onap/cli/fw/http/auth/OnapCommandHttpAuthClient.java index fa4b9c2f..9b7b4039 100644 --- a/profiles/http/src/main/java/org/onap/cli/fw/http/auth/OnapCommandHttpAuthClient.java +++ b/profiles/http/src/main/java/org/onap/cli/fw/http/auth/OnapCommandHttpAuthClient.java @@ -22,7 +22,6 @@ import java.util.Map; import org.onap.cli.fw.cmd.OnapCommand; import org.onap.cli.fw.conf.OnapCommandConfig; import org.onap.cli.fw.error.OnapCommandException; -import org.onap.cli.fw.error.OnapCommandInvalidParameterValue; import org.onap.cli.fw.http.cmd.OnapHttpCommand; import org.onap.cli.fw.http.conf.OnapCommandHttpConstants; import org.onap.cli.fw.http.connect.HttpInput; -- cgit 1.2.3-korg From f69d32298d042f20f1640e30f2e19bf6623385e5 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Wed, 2 May 2018 14:47:59 +0530 Subject: Reuse constant names across Issue-ID: CLI-106 Change-Id: I7e3abdf3b7c8b8619ff61943f9f69c97cd1b4113 Signed-off-by: Kanagaraj Manickam k00365106 --- .../main/java/org/onap/cli/fw/http/conf/OnapCommandHttpConstants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/conf/OnapCommandHttpConstants.java b/profiles/http/src/main/java/org/onap/cli/fw/http/conf/OnapCommandHttpConstants.java index a4346a60..47edc0f4 100644 --- a/profiles/http/src/main/java/org/onap/cli/fw/http/conf/OnapCommandHttpConstants.java +++ b/profiles/http/src/main/java/org/onap/cli/fw/http/conf/OnapCommandHttpConstants.java @@ -53,7 +53,7 @@ public class OnapCommandHttpConstants { public static final String REQUEST = "request"; public static final String URI = "uri"; public static final String BODY = "body"; - public static final String METHOD_TYPE = "method"; + public static final String METHOD_TYPE = METHOD; public static final String POST = "post"; public static final String GET = "get"; public static final String DELETE = "delete"; -- cgit 1.2.3-korg From d7aa562decb865691eda0e5b90d113ce6d1aa812 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Wed, 2 May 2018 14:48:31 +0530 Subject: Fix the HEAD name in http profile Issue-ID: CLI-106 Change-Id: Ie18578b1b284283c889a7584e6dd6795be55489a Signed-off-by: Kanagaraj Manickam k00365106 --- .../main/java/org/onap/cli/fw/http/conf/OnapCommandHttpConstants.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/conf/OnapCommandHttpConstants.java b/profiles/http/src/main/java/org/onap/cli/fw/http/conf/OnapCommandHttpConstants.java index 47edc0f4..e6d5e031 100644 --- a/profiles/http/src/main/java/org/onap/cli/fw/http/conf/OnapCommandHttpConstants.java +++ b/profiles/http/src/main/java/org/onap/cli/fw/http/conf/OnapCommandHttpConstants.java @@ -58,7 +58,7 @@ public class OnapCommandHttpConstants { public static final String GET = "get"; public static final String DELETE = "delete"; public static final String PUT = "put"; - public static final String HEAD = "delete"; + public static final String HEAD = "head"; public static final String HEADERS = "headers"; public static final String QUERIES = "queries"; public static final String COOKIES = "cookies"; -- cgit 1.2.3-korg From 7ba103e37b6489172bd432c08adcdd7e39b72dbc Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Wed, 2 May 2018 14:50:10 +0530 Subject: Remove unused class from the imports Issue-ID: CLI-106 Change-Id: I2b558d6d4fb8926fd7c2130e0cf9b9e840b42528 Signed-off-by: Kanagaraj Manickam k00365106 --- .../src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java | 1 - 1 file changed, 1 deletion(-) diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java b/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java index 31786245..06097b4e 100644 --- a/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java +++ b/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java @@ -64,7 +64,6 @@ import org.apache.http.impl.cookie.BasicClientCookie; import org.apache.http.protocol.BasicHttpContext; import org.apache.http.protocol.HttpContext; import org.apache.http.util.EntityUtils; -import org.onap.cli.fw.conf.OnapCommandConstants; import org.onap.cli.fw.http.conf.OnapCommandHttpConstants; import org.onap.cli.fw.http.error.OnapCommandHttpFailure; import org.slf4j.Logger; -- cgit 1.2.3-korg From 6adc4f7a9901ef53d89ec4d6eb24e11d5461a21c Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Wed, 2 May 2018 14:50:53 +0530 Subject: HttpConnection does not thru exception Issue-ID: CLI-106 Change-Id: Ic2f8f8618505498a9345e17671691bbd73714c9f Signed-off-by: Kanagaraj Manickam k00365106 --- .../src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java b/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java index 06097b4e..52a1b729 100644 --- a/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java +++ b/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java @@ -110,7 +110,7 @@ public class OnapHttpConnection { * @throws OnapCommandHttpFailure * exception */ - public OnapHttpConnection(boolean debug) throws OnapCommandHttpFailure { + public OnapHttpConnection(boolean debug) { this.debug = debug; } -- cgit 1.2.3-korg From 8336a0adb17a98a2c14bfefeb06de12f16a7e405 Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Wed, 2 May 2018 14:51:57 +0530 Subject: Comply the constructor declaration to std. Issue-ID: CLI-106 Change-Id: I5d215880beb99cb598d302a2710f7ac08b79a67a Signed-off-by: Kanagaraj Manickam k00365106 --- .../main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java b/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java index 52a1b729..aee37236 100644 --- a/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java +++ b/profiles/http/src/main/java/org/onap/cli/fw/http/connect/OnapHttpConnection.java @@ -370,12 +370,13 @@ public class OnapHttpConnection { @NotThreadSafe static class HttpDeleteWithBody extends HttpEntityEnclosingRequestBase { + public HttpDeleteWithBody() { + super(); + } + public String getMethod() { return OnapCommandHttpConstants.DELETE; } - public HttpDeleteWithBody() { - super(); - } } } -- cgit 1.2.3-korg