summaryrefslogtreecommitdiffstats
path: root/framework/src
diff options
context:
space:
mode:
authorKanagaraj Manickam <mkr1481@gmail.com>2019-08-29 15:41:53 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2019-08-29 15:41:53 +0530
commit70dac125e796d52b874f4e7f3839f9cf042e0f98 (patch)
tree9382129179acf1a0b0e82c5051a0f287f000c0e1 /framework/src
parent02b61c5a78448d2c01ce15adecb6df99f1b6b8c8 (diff)
Minor issues fix
Issue-ID: CLI-166 Change-Id: I97bd303b4e636bfc53e24732c7c6e4062037909b Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'framework/src')
-rw-r--r--framework/src/main/java/org/onap/cli/fw/conf/OnapCommandConstants.java1
-rw-r--r--framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidSample.java2
-rw-r--r--framework/src/main/java/org/onap/cli/fw/error/OnapCommandWarning.java4
-rw-r--r--framework/src/main/java/org/onap/cli/fw/store/OnapCommandExecutionStore.java20
-rw-r--r--framework/src/main/resources/open-cli.properties2
5 files changed, 26 insertions, 3 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/conf/OnapCommandConstants.java b/framework/src/main/java/org/onap/cli/fw/conf/OnapCommandConstants.java
index 53018025..51a18627 100644
--- a/framework/src/main/java/org/onap/cli/fw/conf/OnapCommandConstants.java
+++ b/framework/src/main/java/org/onap/cli/fw/conf/OnapCommandConstants.java
@@ -43,6 +43,7 @@ public class OnapCommandConstants {
public static final String OPEN_CLI_DATA_DIR = "cli.data.dir";
public static final String OPEN_CLI_ARTIFACT_DIR = "cli.artifact.dir";
public static final String OPEN_CLI_GRPC_CLIENT_TIMEOUT = "cli.grpc.client.timeout";
+ public static final String OPEN_CLI_EXECUTION_SEARCH_MODE = "cli.execution.search.mode";
//schema
public static final String OPEN_CLI_SCHEMA_VERSION = "open_cli_schema_version";
public static final String OPEN_CLI_SCHEMA_VERSION_VALUE_1_0 = "1.0";
diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidSample.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidSample.java
index 32e5cf65..9f702209 100644
--- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidSample.java
+++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandInvalidSample.java
@@ -20,7 +20,7 @@ package org.onap.cli.fw.error;
* Command sample is invalid.
*
*/
-public class OnapCommandInvalidSample extends OnapCommandException {
+public class OnapCommandInvalidSample extends OnapCommandWarning {
private static final long serialVersionUID = -3387652326582792835L;
diff --git a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandWarning.java b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandWarning.java
index 3b49f464..ccd2cee5 100644
--- a/framework/src/main/java/org/onap/cli/fw/error/OnapCommandWarning.java
+++ b/framework/src/main/java/org/onap/cli/fw/error/OnapCommandWarning.java
@@ -31,4 +31,8 @@ public abstract class OnapCommandWarning extends OnapCommandException {
public OnapCommandWarning(String errorCode, String errorMessage) {
super(errorCode, errorMessage);
}
+
+ public OnapCommandWarning(String errorCode, String errorMessage, Throwable err) {
+ super(errorCode, errorMessage, err);
+ }
}
diff --git a/framework/src/main/java/org/onap/cli/fw/store/OnapCommandExecutionStore.java b/framework/src/main/java/org/onap/cli/fw/store/OnapCommandExecutionStore.java
index d09e4304..d032a99c 100644
--- a/framework/src/main/java/org/onap/cli/fw/store/OnapCommandExecutionStore.java
+++ b/framework/src/main/java/org/onap/cli/fw/store/OnapCommandExecutionStore.java
@@ -48,12 +48,21 @@ public class OnapCommandExecutionStore {
private enum SearchMode {
find,
file //for developer mode
+
+
}
+
private static SearchMode SEARCH_MODE = SearchMode.file;
+ static {
+ String mode = OnapCommandConfig.getPropertyValue(OnapCommandConstants.OPEN_CLI_EXECUTION_SEARCH_MODE);
+ if (mode.equalsIgnoreCase(SearchMode.find.name()))
+ SEARCH_MODE = SearchMode.find;
+ }
public static class ExecutionStoreContext {
private String requestId;
private String executionId;
+ private String profile;
private String storePath;
public String getExecutionId() {
return executionId;
@@ -76,6 +85,12 @@ public class OnapCommandExecutionStore {
this.requestId = requestId;
return this;
}
+ public String getProfile() {
+ return profile;
+ }
+ public void setProfile(String profile) {
+ this.profile = profile;
+ }
}
public static class Execution {
@@ -219,8 +234,10 @@ public class OnapCommandExecutionStore {
if (input != null)
FileUtils.writeStringToFile(new File(context.getStorePath() + File.separator + "input"), input);
- if (profile != null)
+ if (profile != null) {
+ context.setProfile(profile);
FileUtils.writeStringToFile(new File(context.getStorePath() + File.separator + "profile"), profile);
+ }
FileUtils.touch(new File(context.getStorePath() + File.separator + "stdout"));
FileUtils.touch(new File(context.getStorePath() + File.separator + "stderr"));
@@ -371,6 +388,7 @@ public class OnapCommandExecutionStore {
if (new File(executionStorePath + File.separator + "executionId").exists())
exectuion.setId(FileUtils.readFileToString(new File(executionStorePath + File.separator + "executionId")));
exectuion.setProduct(FileUtils.readFileToString(new File(executionStorePath + File.separator + "product")));
+ exectuion.setProfile(FileUtils.readFileToString(new File(executionStorePath + File.separator + "profile")));
exectuion.setService(FileUtils.readFileToString(new File(executionStorePath + File.separator + "service")));
exectuion.setCommand(FileUtils.readFileToString(new File(executionStorePath + File.separator + "command")));
if (new File(executionStorePath + File.separator + "profile").exists())
diff --git a/framework/src/main/resources/open-cli.properties b/framework/src/main/resources/open-cli.properties
index 259fd227..bd8a6acf 100644
--- a/framework/src/main/resources/open-cli.properties
+++ b/framework/src/main/resources/open-cli.properties
@@ -20,7 +20,7 @@ cli.artifact.dir=./data/artifacts
cli.tmp.dir=./data/tmp
#timeout in seconds
cli.grpc.client.timeout=60
-
+cli.execution.search.mode=file
#schema validation
cli.schema.base.sections=open_cli_schema_version,name,description,parameters,results,info
cli.schema.base.sections.mandatory=open_cli_schema_version