summaryrefslogtreecommitdiffstats
path: root/framework/src/main/java/org
diff options
context:
space:
mode:
authorKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-09-26 10:04:10 +0530
committerKanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>2017-11-14 14:38:52 +0530
commit39f345954434553d10e0cea114e15e0521ec9471 (patch)
tree652c0dae69f8238c41f903d9697160e3b3ed2960 /framework/src/main/java/org
parent8e14f39a1c41a2b5bf793877926b312e4b6102d4 (diff)
Migrate onap-cli-schema into open-cli-schema
Issue-Id: CLI-66 Change-Id: I719719194bc5f21f4316380e606ce1a58f0f046c Signed-off-by: Kanagaraj Manickam k00365106 <kanagaraj.manickam@huawei.com>
Diffstat (limited to 'framework/src/main/java/org')
-rw-r--r--framework/src/main/java/org/onap/cli/fw/OnapCommand.java2
-rw-r--r--framework/src/main/java/org/onap/cli/fw/OnapCommandRegistrar.java2
-rw-r--r--framework/src/main/java/org/onap/cli/fw/conf/Constants.java20
-rw-r--r--framework/src/main/java/org/onap/cli/fw/conf/OnapCommandConfg.java20
4 files changed, 12 insertions, 32 deletions
diff --git a/framework/src/main/java/org/onap/cli/fw/OnapCommand.java b/framework/src/main/java/org/onap/cli/fw/OnapCommand.java
index bce27642..b100b155 100644
--- a/framework/src/main/java/org/onap/cli/fw/OnapCommand.java
+++ b/framework/src/main/java/org/onap/cli/fw/OnapCommand.java
@@ -282,7 +282,7 @@ public abstract class OnapCommand {
// For auth type commands, login and logout logic is not required
boolean isAuthRequired = !this.onapService.isNoAuth()
&& "false".equals(paramMap.get(Constants.DEFAULT_PARAMETER_OUTPUT_NO_AUTH).getValue())
- && !this.getType().equals(CommandType.AUTH);
+ && this.getType().equals(CommandType.CMD);
if (!isCommandInternal()) {
this.authClient = new OnapAuthClient(
diff --git a/framework/src/main/java/org/onap/cli/fw/OnapCommandRegistrar.java b/framework/src/main/java/org/onap/cli/fw/OnapCommandRegistrar.java
index 74793f47..37ed81a5 100644
--- a/framework/src/main/java/org/onap/cli/fw/OnapCommandRegistrar.java
+++ b/framework/src/main/java/org/onap/cli/fw/OnapCommandRegistrar.java
@@ -265,7 +265,7 @@ public class OnapCommandRegistrar {
String errorNote = "";
String usageNote = "\n\nTo enable a product version, use one of following methods:"
+ "\n 1. set env variable CLI_PRODUCT_VERSION"
- + "\n 2. set cli.product.version in onap.properties"
+ + "\n 2. set cli.product.version in open-cli.properties"
+ "\n 3. in interactive mode, use the directive 'use <product version>'\n";
if (!this.availableProductVersions.contains(configuredProductVersion)) {
diff --git a/framework/src/main/java/org/onap/cli/fw/conf/Constants.java b/framework/src/main/java/org/onap/cli/fw/conf/Constants.java
index f9e5ba99..5ae3c502 100644
--- a/framework/src/main/java/org/onap/cli/fw/conf/Constants.java
+++ b/framework/src/main/java/org/onap/cli/fw/conf/Constants.java
@@ -43,15 +43,7 @@ public class Constants {
public static final String SSLCONTEST_TLS = "TLSV1.2";
public static final String APPLICATION_JSON = "application/json";
- public static final String X_AUTH_TOKEN = "x-auth-token";
- public static final String AUTH_SERVICE = "cli.auth_service";
- public static final String AUTH_SERVICE_VERSION = "v1";
- public static final String TOKEN = "{\"userName\": \"%s\",\"password\": \"%s\"}";
- public static final String MSB_URI = "/api/microservices/v1";
- public static final String MSB_SERVICE_URI = MSB_URI + "/services/%s/version/%s";
-
- public static final String API_GATEWAY = "cli.api_gateway";
public static final String SERVICE_NAME = "cli.service_name";
//http
@@ -127,11 +119,11 @@ public class Constants {
public static final String DEFAULT_PARAMETER_OUTPUT_NO_AUTH = "no-auth";
// Configuration properties
- public static final String CONF = "onap.properties";
- public static final String ONAP_IGNORE_AUTH = "cli.ignore_auth";
- public static final String ONAP_CLI_VERSION = "cli.version";
- public static final String ONAP_CLI_PRODUCT_VERSION = "cli.product.version";
- public static final String ONAP_CLI_PRODUCT_VERSION_ENV_NAME = "CLI_PRODUCT_VERSION";
+ public static final String CONF = "open-cli.properties";
+ public static final String OPEN_IGNORE_AUTH = "cli.ignore_auth";
+ public static final String OPEN_CLI_VERSION = "cli.version";
+ public static final String OPEN_CLI_PRODUCT_VERSION = "cli.product.version";
+ public static final String OPEN_CLI_PRODUCT_VERSION_ENV_NAME = "CLI_PRODUCT_VERSION";
public static final String HTTP_API_KEY_USE_COOKIES = "cli.http.api_key_use_cookies";
public static final String EXCLUDE_PARAMS_INTERNAL_CMD = "cli.exclude_params_internal_cmd";
public static final String NO_AUTH_DISABLE_INCLUDE_PARAMS_EXTERNAL_CMD = "cli.no_auth_disable_include_params_external_cmd";
@@ -144,7 +136,7 @@ public class Constants {
public static final String PORTRAINT_COLUMN_NAME_PROPERTY = "property";
public static final String PORTRAINT_COLUMN_NAME_VALUE = "value";
- public static final String EXTERNAL_SCHEMA_DIRECTORY = "onap-cli-schema";
+ public static final String EXTERNAL_SCHEMA_DIRECTORY = "open-cli-schema";
public static final String EXTERNAL_YAML_PATTERN = "/**/*.yaml";
public static final String EXTERNAL_JSON_PATTERN = "/**/*.json";
public static final String EXTERNAL_SCHEMA_PATH_PATERN = EXTERNAL_SCHEMA_DIRECTORY + EXTERNAL_YAML_PATTERN;
diff --git a/framework/src/main/java/org/onap/cli/fw/conf/OnapCommandConfg.java b/framework/src/main/java/org/onap/cli/fw/conf/OnapCommandConfg.java
index bb0e2c06..447a7f4c 100644
--- a/framework/src/main/java/org/onap/cli/fw/conf/OnapCommandConfg.java
+++ b/framework/src/main/java/org/onap/cli/fw/conf/OnapCommandConfg.java
@@ -55,7 +55,7 @@ public final class OnapCommandConfg {
* @return boolean
*/
public static boolean isAuthIgnored() {
- if ("true".equals(prps.getProperty(Constants.ONAP_IGNORE_AUTH))) {
+ if ("true".equals(prps.getProperty(Constants.OPEN_IGNORE_AUTH))) {
return true;
}
@@ -76,13 +76,13 @@ public final class OnapCommandConfg {
}
public static String getVersion() {
- return prps.getProperty(Constants.ONAP_CLI_VERSION);
+ return prps.getProperty(Constants.OPEN_CLI_VERSION);
}
public static String getEnabledProductVersion() {
- String version = System.getenv(Constants.ONAP_CLI_PRODUCT_VERSION_ENV_NAME);
+ String version = System.getenv(Constants.OPEN_CLI_PRODUCT_VERSION_ENV_NAME);
if (version == null) {
- version = prps.getProperty(Constants.ONAP_CLI_PRODUCT_VERSION);
+ version = prps.getProperty(Constants.OPEN_CLI_PRODUCT_VERSION);
}
return version;
}
@@ -100,22 +100,10 @@ public final class OnapCommandConfg {
return false;
}
- public static String getXAuthTokenName() {
- return prps.getProperty(Constants.SERVICE_AUTH_BASIC_HTTP_HEADERS + "." + Constants.X_AUTH_TOKEN);
- }
-
public static String getInternalCmd() {
return prps.getProperty(Constants.SERVICE_NAME);
}
- public static String getApiGateway() {
- return prps.getProperty(Constants.API_GATEWAY);
- }
-
- public static String getAuthService() {
- return prps.getProperty(Constants.AUTH_SERVICE);
- }
-
public static String getAuthType() {
return prps.getProperty(Constants.SERVICE_AUTH, Constants.AUTH_BASIC);
}