diff options
Diffstat (limited to 'vid-app-common/src/main/java/org/onap/vid/properties')
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/properties/Features.java | 23 | ||||
-rw-r--r-- | vid-app-common/src/main/java/org/onap/vid/properties/VidProperties.java | 93 |
2 files changed, 64 insertions, 52 deletions
diff --git a/vid-app-common/src/main/java/org/onap/vid/properties/Features.java b/vid-app-common/src/main/java/org/onap/vid/properties/Features.java index ea047d698..c96efe6f5 100644 --- a/vid-app-common/src/main/java/org/onap/vid/properties/Features.java +++ b/vid-app-common/src/main/java/org/onap/vid/properties/Features.java @@ -29,22 +29,17 @@ public enum Features implements Feature { * Use /docs/feature-flags.md for details */ - FLAG_ASYNC_JOBS, CREATE_INSTANCE_TEST, EMPTY_DRAWING_BOARD_TEST, FLAG_ADD_MSO_TESTAPI_FIELD, - FLAG_ASYNC_INSTANTIATION, FLAG_SERVICE_MODEL_CACHE, - FLAG_UNASSIGN_SERVICE, FLAG_NETWORK_TO_ASYNC_INSTANTIATION, - FLAG_COLLECTION_RESOURCE_SUPPORT, FLAG_SHOW_ASSIGNMENTS, + FLAG_UNASSIGN_SERVICE, FLAG_FABRIC_CONFIGURATION_ASSIGNMENTS, FLAG_SHOW_VERIFY_SERVICE, // AKA POMBA - FLAG_DUPLICATE_VNF, FLAG_DEFAULT_VNF, FLAG_SETTING_DEFAULTS_IN_DRAWING_BOARD, - FLAG_PNP_INSTANTIATION, FLAG_RESTRICTED_SELECT, FLAG_5G_IN_NEW_INSTANTIATION_UI, FLAG_ASYNC_ALACARTE_VNF, @@ -52,7 +47,6 @@ public enum Features implements Feature { FLAG_PRESENT_PROVIDER_NETWORKS_ASSOCIATIONS, FLAG_ASYNC_ALACARTE_VFMODULE, FLAG_SUPPLEMENTARY_FILE, - FLAG_SHIFT_VFMODULE_PARAMS_TO_VNF, FLAG_EXP_ANY_ALACARTE_NEW_INSTANTIATION_UI, FLAG_1810_CR_LET_SELECTING_COLLECTOR_TYPE_UNCONDITIONALLY, FLAG_1810_CR_ADD_CLOUD_OWNER_TO_MSO_REQUEST, @@ -62,10 +56,25 @@ public enum Features implements Feature { FLAG_1902_NEW_VIEW_EDIT, FLAG_EXP_USE_DEFAULT_HOST_NAME_VERIFIER, FLAG_1902_VNF_GROUPING, + FLAG_1902_RETRY_JOB, + FLAG_VF_MODULE_RESUME_STATUS_CREATE, + FLAG_EXP_CREATE_RESOURCES_IN_PARALLEL, + FLAG_1906_COMPONENT_INFO, + FLAG_1906_INSTANTIATION_API_USER_VALIDATION, + FLAG_1906_AAI_SUB_DETAILS_REDUCE_DEPTH, + FLAG_1908_TRANSPORT_SERVICE_NEW_INSTANTIATION_UI, + FLAG_1908_COLLECTION_RESOURCE_NEW_INSTANTIATION_UI, + FLAG_1908_INFRASTRUCTURE_VPN, + FLAG_1908_RESUME_MACRO_SERVICE, + FLAG_1908_RELEASE_TENANT_ISOLATION, + FLAG_1908_A_LA_CARTE_VNF_NEW_INSTANTIATION_UI, + FLAG_FLASH_REPLACE_VF_MODULE, + FLAG_PNP_INSTANTIATION, FLAG_HANDLE_SO_WORKFLOWS, FLAG_CREATE_ERROR_REPORTS ; + public boolean isActive() { return FeatureContext.getFeatureManager().isActive(this); } diff --git a/vid-app-common/src/main/java/org/onap/vid/properties/VidProperties.java b/vid-app-common/src/main/java/org/onap/vid/properties/VidProperties.java index 24b72fdff..8331886c0 100644 --- a/vid-app-common/src/main/java/org/onap/vid/properties/VidProperties.java +++ b/vid-app-common/src/main/java/org/onap/vid/properties/VidProperties.java @@ -7,9 +7,9 @@ * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at - * + * * http://www.apache.org/licenses/LICENSE-2.0 - * + * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. @@ -21,9 +21,9 @@ package org.onap.vid.properties; import org.apache.commons.lang3.StringUtils; +import org.onap.vid.model.ModelConstants; import org.onap.portalsdk.core.logging.logic.EELFLoggerDelegate; import org.onap.portalsdk.core.util.SystemProperties; -import org.onap.vid.model.ModelConstants; /** * The Class VidProperties. */ @@ -38,59 +38,62 @@ public class VidProperties extends SystemProperties { /** The Constant VID_TRUSTSTORE_FILENAME. */ public static final String VID_TRUSTSTORE_FILENAME = "vid.truststore.filename"; - + /** The Constant VID_TRUSTSTORE_PASSWD_X. */ public static final String VID_TRUSTSTORE_PASSWD_X = "vid.truststore.passwd.x"; - + /** The Constant FILESEPARATOR. */ public static final String FILESEPARATOR = (System.getProperty("file.separator") == null) ? "/" : System.getProperty("file.separator"); - + /** The Constant LOG. */ private static final EELFLoggerDelegate LOG = EELFLoggerDelegate.getLogger(VidProperties.class); - public static final String VID_JOB_MAX_HOURS_IN_PROGRESS = "vid.asyncJob.maxHoursInProgress"; + public static final String VID_JOB_MAX_HOURS_IN_PROGRESS = "vid.asyncJob.maxHoursInProgress"; + + public static final String VID_THREAD_COUNT = "vid.thread.count"; + public static final String VID_THREAD_TIMEOUT = "vid.thread.timeout"; /** * Gets the asdc model namespace prefix property - * + * * @return the property value or a default value */ public static String getAsdcModelNamespace() { String methodName = "getAsdcModelNamespace "; String asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE; - try { - asdcModelNamespace = SystemProperties.getProperty(ModelConstants.ASDC_MODEL_NAMESPACE); - if ( asdcModelNamespace == null || asdcModelNamespace.isEmpty()) { - asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE; - } - } - catch ( Exception e ) { - LOG.error (EELFLoggerDelegate.errorLogger, methodName + "unable to find the value, using the default " - + ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE); - asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE; - } - return (asdcModelNamespace); + try { + asdcModelNamespace = SystemProperties.getProperty(ModelConstants.ASDC_MODEL_NAMESPACE); + if ( asdcModelNamespace == null || asdcModelNamespace.isEmpty()) { + asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE; + } + } + catch ( Exception e ) { + LOG.error (EELFLoggerDelegate.errorLogger, methodName + "unable to find the value, using the default " + + ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE); + asdcModelNamespace = ModelConstants.DEFAULT_ASDC_MODEL_NAMESPACE; + } + return (asdcModelNamespace); } /** * Gets the specified property value. If the property is not defined, returns a default value. - * + * * @return the property value or a default value */ public static String getPropertyWithDefault ( String propName, String defaultValue ) { String methodName = "getPropertyWithDefault "; String propValue = defaultValue; - try { - propValue = SystemProperties.getProperty(propName); - if ( propValue == null || propValue.isEmpty()) { - propValue = defaultValue; - } - } - catch ( Exception e ) { - LOG.error (EELFLoggerDelegate.errorLogger, methodName + "unable to find the value, using the default " - + defaultValue); - propValue = defaultValue; - } - return (propValue); + try { + propValue = SystemProperties.getProperty(propName); + if ( propValue == null || propValue.isEmpty()) { + propValue = defaultValue; + } + } + catch ( Exception e ) { + LOG.error (EELFLoggerDelegate.errorLogger, methodName + "unable to find the value, using the default " + + defaultValue); + propValue = defaultValue; + } + return (propValue); } public static long getLongProperty(String key) { @@ -98,16 +101,16 @@ public class VidProperties extends SystemProperties { } public static long getLongProperty(String key, long defaultValue) { - if (!containsProperty(key)) { - LOG.debug(EELFLoggerDelegate.debugLogger, "No such property: {}. {} value is used", key, defaultValue); - return defaultValue; - } - String configValue = getProperty(key); - if (StringUtils.isNumeric(configValue)) { - return Long.parseLong(configValue); - } else { - LOG.debug(EELFLoggerDelegate.debugLogger, "{} property value is not valid: {}. {} value is used", key, configValue, defaultValue); - return defaultValue; - } - } + if (!containsProperty(key)) { + LOG.debug(EELFLoggerDelegate.debugLogger, "No such property: {}. {} value is used", key, defaultValue); + return defaultValue; + } + String configValue = getProperty(key); + if (StringUtils.isNumeric(configValue)) { + return Long.parseLong(configValue); + } else { + LOG.debug(EELFLoggerDelegate.debugLogger, "{} property value is not valid: {}. {} value is used", key, configValue, defaultValue); + return defaultValue; + } + } } |