From c51d7e1fd1c4500cae7a692ff68b37001db78fdd Mon Sep 17 00:00:00 2001 From: Kanagaraj Manickam k00365106 Date: Sat, 30 Sep 2017 06:02:50 +0530 Subject: Normalize the error code in exceptions CLI-2 Change-Id: I9d205993c9ca8fbf58459352fa023a2bf80ca376 Signed-off-by: Kanagaraj Manickam k00365106 --- .../fw/error/OnapCommandClientInitialzationFailed.java | 4 ++-- .../org/onap/cli/fw/error/OnapCommandDiscoveryFailed.java | 2 +- .../java/org/onap/cli/fw/error/OnapCommandException.java | 15 ++++++++++++++- .../org/onap/cli/fw/error/OnapCommandExecutionFailed.java | 2 +- .../onap/cli/fw/error/OnapCommandExecutorInfoMissing.java | 2 +- .../java/org/onap/cli/fw/error/OnapCommandHelpFailed.java | 2 +- .../org/onap/cli/fw/error/OnapCommandHttpFailure.java | 2 +- .../onap/cli/fw/error/OnapCommandHttpHeaderNotFound.java | 2 +- .../cli/fw/error/OnapCommandHttpInvalidResponseBody.java | 2 +- .../cli/fw/error/OnapCommandHttpInvalidResultMap.java | 2 +- .../cli/fw/error/OnapCommandInvalidDefaultParameter.java | 2 +- .../cli/fw/error/OnapCommandInvalidParameterType.java | 2 +- .../cli/fw/error/OnapCommandInvalidParameterValue.java | 2 +- .../cli/fw/error/OnapCommandInvalidPrintDirection.java | 2 +- .../onap/cli/fw/error/OnapCommandInvalidRegistration.java | 2 +- .../fw/error/OnapCommandInvalidResultAttributeScope.java | 2 +- .../org/onap/cli/fw/error/OnapCommandInvalidSchema.java | 2 +- .../cli/fw/error/OnapCommandInvalidSchemaVersion.java | 2 +- .../onap/cli/fw/error/OnapCommandLoadProfileFailed.java | 2 +- .../org/onap/cli/fw/error/OnapCommandLoginFailed.java | 2 +- .../org/onap/cli/fw/error/OnapCommandLogoutFailed.java | 2 +- .../java/org/onap/cli/fw/error/OnapCommandNotFound.java | 2 +- .../org/onap/cli/fw/error/OnapCommandNotInitialized.java | 2 +- .../cli/fw/error/OnapCommandOutputFormatNotsupported.java | 2 +- .../cli/fw/error/OnapCommandOutputPrintingFailed.java | 2 +- .../onap/cli/fw/error/OnapCommandParameterMissing.java | 2 +- .../cli/fw/error/OnapCommandParameterNameConflict.java | 2 +- .../onap/cli/fw/error/OnapCommandParameterNotFound.java | 2 +- .../cli/fw/error/OnapCommandParameterOptionConflict.java | 2 +- .../cli/fw/error/OnapCommandPersistProfileFailed.java | 2 +- .../cli/fw/error/OnapCommandProductVersionInvalid.java | 4 ++-- .../onap/cli/fw/error/OnapCommandRegistrationFailed.java | 2 +- .../fw/error/OnapCommandRegistrationVersionMissing.java | 2 +- .../org/onap/cli/fw/error/OnapCommandResultEmpty.java | 2 +- .../fw/error/OnapCommandResultInitialzationFailed.java | 2 +- .../fw/error/OnapCommandResultMapProcessingFailed.java | 2 +- .../org/onap/cli/fw/error/OnapCommandSchemaNotFound.java | 2 +- .../org/onap/cli/fw/error/OnapCommandServiceNotFound.java | 2 +- 38 files changed, 53 insertions(+), 40 deletions(-) (limited to 'framework/src/main/java') diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandClientInitialzationFailed.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandClientInitialzationFailed.java index d4fff5b7..5769aa02 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandClientInitialzationFailed.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandClientInitialzationFailed.java @@ -17,13 +17,13 @@ package org.onap.cli.fw.error; /** - * Command not registered in MSB. + * Command not registered in catalog. * */ public class OnapCommandClientInitialzationFailed extends OnapCommandException { private static final long serialVersionUID = 8580121615330415000L; - private static final String ERROR_CODE = "0x0021"; + private static final String ERROR_CODE = "0x5001"; private static final String ERROR_MESSAGE1 = "API client for the command "; private static final String ERROR_MESSAGE2 = " is failed"; diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandDiscoveryFailed.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandDiscoveryFailed.java index 87d1f4d6..7a9c27bd 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandDiscoveryFailed.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandDiscoveryFailed.java @@ -20,7 +20,7 @@ public class OnapCommandDiscoveryFailed extends OnapCommandException { private static final long serialVersionUID = 424464582747161435L; - private static final String ERROR_CODE = "0x0010"; + private static final String ERROR_CODE = "0x1001"; private static final String ERROR_MESSAGE1 = "Failed auto discover schema files from "; private static final String ERROR_MESSAGE2 = " under class path, "; private static final String ERROR_MESSAGE3 = "' under class path directory '"; diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandException.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandException.java index 905b17bc..8e99b9a1 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandException.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandException.java @@ -21,7 +21,20 @@ import org.slf4j.LoggerFactory; /** * Base command exception. - * +discovery 0x100 +registration 0x200 +http 0x300 +login/logout 0x400 +swagger 0x500 +execution 0x600 +input 0x700 +output 0x800 +help 0x900 +default parameter 0xa00 +schema 0xb00 +profile 0xc00 +product/service 0xd00 +catalog 0xe00 */ public class OnapCommandException extends Exception { diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandExecutionFailed.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandExecutionFailed.java index 2117cec7..1ab326a1 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandExecutionFailed.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandExecutionFailed.java @@ -23,7 +23,7 @@ package org.onap.cli.fw.error; public class OnapCommandExecutionFailed extends OnapCommandException { private static final long serialVersionUID = 488775545436993019L; - private static final String ERROR_CODE = "0x0001"; + private static final String ERROR_CODE = "0x6001"; private static final String ERROR_MESSAGE1 = "Command "; private static final String ERROR_MESSAGE2 = " failed to execute"; private static final String ERROR_MESSAGE3 = "Failed to retrive service url"; diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandExecutorInfoMissing.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandExecutorInfoMissing.java index b4945dda..3de7438e 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandExecutorInfoMissing.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandExecutorInfoMissing.java @@ -25,6 +25,6 @@ public class OnapCommandExecutorInfoMissing extends OnapCommandException { private static final long serialVersionUID = 8580121615330415456L; public OnapCommandExecutorInfoMissing(String cmd) { - super("0x0023", "Command " + cmd + " excutor info is missing from schema"); + super("0x6002", "Command " + cmd + " excutor info is missing from schema"); } } diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandHelpFailed.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandHelpFailed.java index a2efcca5..8cc24bd7 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandHelpFailed.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandHelpFailed.java @@ -23,7 +23,7 @@ package org.onap.cli.fw.error; public class OnapCommandHelpFailed extends OnapCommandException { private static final long serialVersionUID = -1833571383961748518L; - private static final String ERROR_CODE = "0x0002"; + private static final String ERROR_CODE = "0x9001"; private static final String ERROR_MSG = "Command failed to print help message"; /** diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandHttpFailure.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandHttpFailure.java index 954e6e11..bec8dd0b 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandHttpFailure.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandHttpFailure.java @@ -23,7 +23,7 @@ package org.onap.cli.fw.error; public class OnapCommandHttpFailure extends OnapCommandException { private static final long serialVersionUID = 488775545436993345L; - private static final String ERROR_CODE = "0x0025"; + private static final String ERROR_CODE = "0x3001"; public OnapCommandHttpFailure(String error, long httpStatus) { super(ERROR_CODE, error, httpStatus); diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandHttpHeaderNotFound.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandHttpHeaderNotFound.java index ba0006ec..58fcdfd9 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandHttpHeaderNotFound.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandHttpHeaderNotFound.java @@ -25,6 +25,6 @@ public class OnapCommandHttpHeaderNotFound extends OnapCommandException { private static final long serialVersionUID = 6676137916079057963L; public OnapCommandHttpHeaderNotFound(String name) { - super("0x0027", "Http header " + name + " is not returned from the service"); + super("0x3003", "Http header " + name + " is not returned from the service"); } } diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandHttpInvalidResponseBody.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandHttpInvalidResponseBody.java index 0cf2ac01..3e98d07d 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandHttpInvalidResponseBody.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandHttpInvalidResponseBody.java @@ -24,7 +24,7 @@ public class OnapCommandHttpInvalidResponseBody extends OnapCommandException { private static final long serialVersionUID = 6676137916079057963L; - private static final String ERROR_CODE = "0x0028"; + private static final String ERROR_CODE = "0x3004"; private static final String ERR_MSG = "Http response body does not have json entry "; public OnapCommandHttpInvalidResponseBody(String name, String error) { diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandHttpInvalidResultMap.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandHttpInvalidResultMap.java index 491f18cb..9303c6b2 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandHttpInvalidResultMap.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandHttpInvalidResultMap.java @@ -27,6 +27,6 @@ public class OnapCommandHttpInvalidResultMap extends OnapCommandException { private static final long serialVersionUID = 6676137916023457963L; public OnapCommandHttpInvalidResultMap(List invalidParams) { - super("0x0028", "Invalide result map parameters : " + invalidParams.toString()); + super("0x3005", "Invalide result map parameters : " + invalidParams.toString()); } } diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidDefaultParameter.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidDefaultParameter.java index 7dc4374e..dcbb5064 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidDefaultParameter.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidDefaultParameter.java @@ -30,6 +30,6 @@ public class OnapCommandInvalidDefaultParameter extends OnapCommandException { * @param invalidParamsList message */ public OnapCommandInvalidDefaultParameter(List invalidParamsList) { - super("0x0024", "Invalid default_parameter: " + invalidParamsList.toString()); + super("0xa001", "Invalid default_parameter: " + invalidParamsList.toString()); } } diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidParameterType.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidParameterType.java index 066e2699..e2ea3e40 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidParameterType.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidParameterType.java @@ -25,7 +25,7 @@ public class OnapCommandInvalidParameterType extends OnapCommandException { private static final long serialVersionUID = 2821256032317061066L; public OnapCommandInvalidParameterType(String paramName) { - super("0x0003", "Parameter type " + paramName + " is invalid"); + super("0x7001", "Parameter type " + paramName + " is invalid"); } diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidParameterValue.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidParameterValue.java index 49d41ffc..e21d3842 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidParameterValue.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidParameterValue.java @@ -29,7 +29,7 @@ public class OnapCommandInvalidParameterValue extends OnapCommandException { } public OnapCommandInvalidParameterValue(String paramName, Throwable throwable) { - super("0x0028", "Parameter " + paramName + " value is invalid", throwable); + super("0x7002", "Parameter " + paramName + " value is invalid", throwable); } } diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidPrintDirection.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidPrintDirection.java index 960bfa40..cf14e9fc 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidPrintDirection.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidPrintDirection.java @@ -25,7 +25,7 @@ public class OnapCommandInvalidPrintDirection extends OnapCommandException { private static final long serialVersionUID = -6008135162231523072L; public OnapCommandInvalidPrintDirection(String direction) { - super("0x0004", "Print direction " + direction + " is invalid"); + super("0x8003", "Print direction " + direction + " is invalid"); } } diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidRegistration.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidRegistration.java index c403a4ad..db4c8e6a 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidRegistration.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidRegistration.java @@ -27,7 +27,7 @@ public class OnapCommandInvalidRegistration extends OnapCommandException { private static final long serialVersionUID = 7722163282274482532L; public OnapCommandInvalidRegistration(Class cls) { - super("0x0005", "Invalid commad class " + cls.getCanonicalName() + " registration, it should be derived from " + super("0x2001", "Invalid commad class " + cls.getCanonicalName() + " registration, it should be derived from " + OnapCommand.class.getCanonicalName()); } } diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidResultAttributeScope.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidResultAttributeScope.java index d4a3a5ee..8a484557 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidResultAttributeScope.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidResultAttributeScope.java @@ -25,7 +25,7 @@ public class OnapCommandInvalidResultAttributeScope extends OnapCommandException private static final long serialVersionUID = 117926166492101573L; public OnapCommandInvalidResultAttributeScope(String attr) { - super("0x0006", "Result atrribute " + attr + " is invalid"); + super("0x8002", "Result atrribute " + attr + " is invalid"); } } diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidSchema.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidSchema.java index ae705577..de73ef2e 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidSchema.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidSchema.java @@ -24,7 +24,7 @@ public class OnapCommandInvalidSchema extends OnapCommandException { private static final long serialVersionUID = -3387652326582792833L; - private static final String ERROR_CODE = "0x0007"; + private static final String ERROR_CODE = "0xb001"; private static final String ERROR_MSG = "Invalid command schema "; diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidSchemaVersion.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidSchemaVersion.java index e330283f..d5996108 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidSchemaVersion.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidSchemaVersion.java @@ -25,7 +25,7 @@ public class OnapCommandInvalidSchemaVersion extends OnapCommandException { private static final long serialVersionUID = 4459731110721370387L; public OnapCommandInvalidSchemaVersion(String schemaVersion) { - super("0x0008", "Command schema open_cli_schema_version " + schemaVersion + " is invalid or missing"); + super("0xb003", "Command schema open_cli_schema_version " + schemaVersion + " is invalid or missing"); } } diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandLoadProfileFailed.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandLoadProfileFailed.java index 5398cdd5..029da5b4 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandLoadProfileFailed.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandLoadProfileFailed.java @@ -24,7 +24,7 @@ public class OnapCommandLoadProfileFailed extends OnapCommandException { private static final long serialVersionUID = 8580121615330415123L; - private static final String ERROR_CODE = "0x1301"; + private static final String ERROR_CODE = "0xc001"; private static final String ERROR_MSG = "Failed to load profile details"; /** diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandLoginFailed.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandLoginFailed.java index 01c5a600..e9c82259 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandLoginFailed.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandLoginFailed.java @@ -24,7 +24,7 @@ public class OnapCommandLoginFailed extends OnapCommandException { private static final long serialVersionUID = 5518154493762956959L; - private static final String ERROR_CODE = "0x0009"; + private static final String ERROR_CODE = "0x4001"; private static final String ERROR_MESSAGE1 = "Login failed"; public OnapCommandLoginFailed(String error) { diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandLogoutFailed.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandLogoutFailed.java index 430b65c4..df879021 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandLogoutFailed.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandLogoutFailed.java @@ -23,7 +23,7 @@ package org.onap.cli.fw.error; public class OnapCommandLogoutFailed extends OnapCommandException { private static final long serialVersionUID = 1150649507734289032L; - private static final String ERROR_CODE = "0x0010"; + private static final String ERROR_CODE = "0x4002"; private static final String ERROR_MESSAGE1 = "Logout failed"; public OnapCommandLogoutFailed(String error) { diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandNotFound.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandNotFound.java index 4a070fb3..a01e47f3 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandNotFound.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandNotFound.java @@ -25,7 +25,7 @@ public class OnapCommandNotFound extends OnapCommandException { private static final long serialVersionUID = 6676137916079057963L; public OnapCommandNotFound(String cmdName, String version) { - super("0x0011", "Command " + cmdName + " is not available for product version " + version + + super("0x6003", "Command " + cmdName + " is not available for product version " + version + ". so please check command name or product version set in env variable CLI_PRODUCT_VERSION or cli.product.version in onap.properties"); } } diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandNotInitialized.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandNotInitialized.java index 8c3f6c22..23a1fb4d 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandNotInitialized.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandNotInitialized.java @@ -25,6 +25,6 @@ public class OnapCommandNotInitialized extends OnapCommandException { private static final long serialVersionUID = -2828462844645573902L; public OnapCommandNotInitialized(String cmdName) { - super("0x0012", "Command " + cmdName + " is not initialized"); + super("0x6004", "Command " + cmdName + " is not initialized"); } } diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandOutputFormatNotsupported.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandOutputFormatNotsupported.java index e54171ef..99a764b3 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandOutputFormatNotsupported.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandOutputFormatNotsupported.java @@ -25,6 +25,6 @@ public class OnapCommandOutputFormatNotsupported extends OnapCommandException { private static final long serialVersionUID = 2429471829315901896L; public OnapCommandOutputFormatNotsupported(String format) { - super("0x0013", "Command does not support the output format " + format); + super("0x8005", "Command does not support the output format " + format); } } diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandOutputPrintingFailed.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandOutputPrintingFailed.java index b875e00f..03e128de 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandOutputPrintingFailed.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandOutputPrintingFailed.java @@ -24,7 +24,7 @@ public class OnapCommandOutputPrintingFailed extends OnapCommandException { private static final long serialVersionUID = -1957064141442406239L; - private static final String ERROR_CODE = "0x0014"; + private static final String ERROR_CODE = "0x8006"; private static final String ERROR_MSG = "Command is failed to print the result"; diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandParameterMissing.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandParameterMissing.java index 54e0a0de..ed2dae5b 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandParameterMissing.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandParameterMissing.java @@ -25,7 +25,7 @@ public class OnapCommandParameterMissing extends OnapCommandException { private static final long serialVersionUID = 2821256032317061066L; public OnapCommandParameterMissing(String paramName) { - super("0x0015", "Parameter " + paramName + " is mandatory"); + super("0x7003", "Parameter " + paramName + " is mandatory"); } diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandParameterNameConflict.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandParameterNameConflict.java index d5dc185c..1f036355 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandParameterNameConflict.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandParameterNameConflict.java @@ -25,7 +25,7 @@ public class OnapCommandParameterNameConflict extends OnapCommandException { private static final long serialVersionUID = -993203017969910920L; public OnapCommandParameterNameConflict(String name) { - super("0x0016", "Parameter name " + name + " is in conflict"); + super("0x7004", "Parameter name " + name + " is in conflict"); } } diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandParameterNotFound.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandParameterNotFound.java index ea3eb3a8..40f67f9a 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandParameterNotFound.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandParameterNotFound.java @@ -25,6 +25,6 @@ public class OnapCommandParameterNotFound extends OnapCommandException { private static final long serialVersionUID = 6676137916079057963L; public OnapCommandParameterNotFound(String paramName) { - super("0x0026", "Command input parameter " + paramName + " is not valid"); + super("0x7005", "Command input parameter " + paramName + " is not valid"); } } diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandParameterOptionConflict.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandParameterOptionConflict.java index 91decf99..1ee0a8c3 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandParameterOptionConflict.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandParameterOptionConflict.java @@ -25,7 +25,7 @@ public class OnapCommandParameterOptionConflict extends OnapCommandException { private static final long serialVersionUID = -3107017890769007297L; public OnapCommandParameterOptionConflict(String name) { - super("0x0017", "Parameter option " + name + " is in conflict, only one option is allowed with given name"); + super("0x7006", "Parameter option " + name + " is in conflict, only one option is allowed with given name"); } } diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandPersistProfileFailed.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandPersistProfileFailed.java index ce8ea62f..f58c8901 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandPersistProfileFailed.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandPersistProfileFailed.java @@ -24,7 +24,7 @@ public class OnapCommandPersistProfileFailed extends OnapCommandException { private static final long serialVersionUID = 8580121615330415123L; - private static final String ERROR_CODE = "0x1302"; + private static final String ERROR_CODE = "0xc002"; private static final String ERROR_MSG = "Failed to persist profile details"; diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandProductVersionInvalid.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandProductVersionInvalid.java index 7ec69e6b..2f970b5f 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandProductVersionInvalid.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandProductVersionInvalid.java @@ -18,7 +18,7 @@ package org.onap.cli.fw.error; import java.util.Set; -/** +/* * ONAP command product version is invalid * */ @@ -27,6 +27,6 @@ public class OnapCommandProductVersionInvalid extends OnapCommandException { private static final long serialVersionUID = 5513297861129088463L; public OnapCommandProductVersionInvalid(String invalidVersion, Set validVersions) { - super("0x0031", "Given product version " + invalidVersion + " is invalid. Please use one of " + validVersions); + super("0xd002", "Given product version " + invalidVersion + " is invalid. Please use one of " + validVersions); } } diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandRegistrationFailed.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandRegistrationFailed.java index 1a13a293..a353c4c6 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandRegistrationFailed.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandRegistrationFailed.java @@ -24,7 +24,7 @@ public class OnapCommandRegistrationFailed extends OnapCommandException { private static final long serialVersionUID = 5513297861129088460L; - private static final String ERROR_CODE = "0x0018"; + private static final String ERROR_CODE = "0x2002"; private static final String ERROR_MSG = "Failed to register the command "; diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandRegistrationVersionMissing.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandRegistrationVersionMissing.java index 2bad5a4c..6155d274 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandRegistrationVersionMissing.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandRegistrationVersionMissing.java @@ -25,6 +25,6 @@ public class OnapCommandRegistrationVersionMissing extends OnapCommandException private static final long serialVersionUID = 5513297861129088463L; public OnapCommandRegistrationVersionMissing(String cmdName) { - super("0x0031", "Command " + cmdName + " version is missing"); + super("0x2003", "Command " + cmdName + " version is missing"); } } diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandResultEmpty.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandResultEmpty.java index 5d7e4fd3..53394759 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandResultEmpty.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandResultEmpty.java @@ -28,6 +28,6 @@ public class OnapCommandResultEmpty extends OnapCommandWarning { * Command result empty. */ public OnapCommandResultEmpty() { - super("0x1001", "Command result is empty"); + super("0x8003", "Command result is empty"); } } diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandResultInitialzationFailed.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandResultInitialzationFailed.java index c32bda88..73131e29 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandResultInitialzationFailed.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandResultInitialzationFailed.java @@ -24,7 +24,7 @@ public class OnapCommandResultInitialzationFailed extends OnapCommandException { private static final long serialVersionUID = 8580121615330415123L; - private static final String ERROR_CODE = "0x0022"; + private static final String ERROR_CODE = "0x8004"; private static final String ERROR_MSG = "Failed to parse the result format of command "; diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandResultMapProcessingFailed.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandResultMapProcessingFailed.java index 238e9092..45f44dce 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandResultMapProcessingFailed.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandResultMapProcessingFailed.java @@ -23,7 +23,7 @@ package org.onap.cli.fw.error; public class OnapCommandResultMapProcessingFailed extends OnapCommandException { private static final long serialVersionUID = 488775545436113019L; - private static final String ERROR_CODE = "0x0028"; + private static final String ERROR_CODE = "0x3002"; private static final String ERROR_MSG = "Failed to parse the result format of command "; diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandSchemaNotFound.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandSchemaNotFound.java index 42514366..8a0ab5a9 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandSchemaNotFound.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandSchemaNotFound.java @@ -24,7 +24,7 @@ public class OnapCommandSchemaNotFound extends OnapCommandException { private static final long serialVersionUID = -3919580583845280200L; - private static final String ERROR_CODE = "0x0019"; + private static final String ERROR_CODE = "0xb002"; private static final String ERROR_MSG = "Command schema is missing for command "; diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandServiceNotFound.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandServiceNotFound.java index fbbaafbd..9cc0e45f 100644 --- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandServiceNotFound.java +++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandServiceNotFound.java @@ -25,6 +25,6 @@ public class OnapCommandServiceNotFound extends OnapCommandException { private static final long serialVersionUID = 8580121615330415065L; public OnapCommandServiceNotFound(String service) { - super("0x0020", "Service " + service + " is not found in MSB"); + super("0xd001", "Service " + service + " is not found in MSB"); } } -- cgit 1.2.3-korg