aboutsummaryrefslogtreecommitdiffstats
path: root/framework/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'framework/src/main')
-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