summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJerry Flood <jflood@att.com>2019-04-23 16:16:34 -0400
committerJerry Flood <jflood@att.com>2019-04-24 06:37:15 -0400
commitcb8d238bf57c2723fac484a0f7c1dc77428a65c0 (patch)
tree42f9736406df7acbfde6449d3cc1960157cc05ee
parent990a5833020c8b01f059c7e5f6405c0076eeed05 (diff)
Remove dead code, add robot tests
Issue-ID: OPTFRA-474 Change-Id: I409f3c16d287419357d07487032ceee8eda8cf94 Signed-off-by: Jerry Flood <jflood@att.com>
-rw-r--r--cmso-optimizer/src/main/java/org/onap/optf/cmso/optimizer/CmsoEnvironmentPostProcessor.java56
-rw-r--r--cmso-optimizer/src/main/resources/META-INF/spring.factories1
-rw-r--r--cmso-robot/robot/assets/test_properties.py8
-rw-r--r--cmso-robot/robot/resources/optimizer_common.robot18
-rw-r--r--cmso-robot/robot/resources/scheduler_common.robot13
-rw-r--r--cmso-robot/robot/resources/ticketmgt_common.robot72
-rw-r--r--cmso-robot/robot/resources/topology_common.robot72
-rw-r--r--cmso-robot/robot/testsuites/MiscTests.robot51
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/CmsoEnvironmentPostProcessor.java47
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/JerseyConfiguration.java2
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoOptimizerRequest.java74
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoOptimizerResponse.java124
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoRequestInfo.java83
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoSchedule.java88
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoSchedulingInfo.java110
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoVnfDetails.java60
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoOptimizerCallback.java64
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoOptimizerCallbackImpl.java304
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoServiceImpl.java25
-rw-r--r--cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/SchedulerTestLoopbackServiceImpl.java43
-rw-r--r--cmso-service/src/main/resources/META-INF/spring.factories1
-rw-r--r--cmso-ticketmgt/src/main/java/org/onap/optf/cmso/CmsoEnvironmentPostProcessor.java61
-rw-r--r--cmso-ticketmgt/src/main/resources/META-INF/spring.factories1
-rw-r--r--cmso-topology/src/main/java/org/onap/optf/cmso/CmsoEnvironmentPostProcessor.java56
-rw-r--r--cmso-topology/src/main/resources/META-INF/spring.factories1
25 files changed, 289 insertions, 1146 deletions
diff --git a/cmso-optimizer/src/main/java/org/onap/optf/cmso/optimizer/CmsoEnvironmentPostProcessor.java b/cmso-optimizer/src/main/java/org/onap/optf/cmso/optimizer/CmsoEnvironmentPostProcessor.java
deleted file mode 100644
index bb47567..0000000
--- a/cmso-optimizer/src/main/java/org/onap/optf/cmso/optimizer/CmsoEnvironmentPostProcessor.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property. Modifications Copyright © 2018 IBM.
- *
- * 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. See the License for the specific language governing permissions and limitations under
- * the License.
- *
- *
- * Unless otherwise specified, all documentation contained herein is licensed under the Creative
- * Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation distributed under the
- * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onap.optf.cmso.optimizer;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.onap.optf.cmso.optimizer.common.PropertiesManagement;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.env.EnvironmentPostProcessor;
-import org.springframework.core.env.ConfigurableEnvironment;
-import org.springframework.core.env.MapPropertySource;
-import org.springframework.core.env.MutablePropertySources;
-
-public class CmsoEnvironmentPostProcessor implements EnvironmentPostProcessor {
- // TODO tested in ONAP springboot and this is called before all of the properties files have been
- // loaded...
- // perhaps there is a post post processor? Until this works. DB password will be in the clear in the
- // proeprties files.
- @Override
- public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
- String pwd = environment.getProperty("cmso.database.password");
- if (pwd != null) {
- pwd = PropertiesManagement.getDecryptedValue(pwd);
- Map<String, Object> map = new HashMap<String, Object>();
- map.put("spring.datasource.password", pwd);
- MapPropertySource propertySource = new MapPropertySource("abc", map);
- MutablePropertySources proeprtySources = environment.getPropertySources();
- proeprtySources.addLast(propertySource);
- }
- }
-
-}
diff --git a/cmso-optimizer/src/main/resources/META-INF/spring.factories b/cmso-optimizer/src/main/resources/META-INF/spring.factories
deleted file mode 100644
index a2c386a..0000000
--- a/cmso-optimizer/src/main/resources/META-INF/spring.factories
+++ /dev/null
@@ -1 +0,0 @@
-org.springframework.boot.env.EnvironmentPostProcessor=org.onap.optf.cmso.optimizer.CmsoEnvironmentPostProcessor \ No newline at end of file
diff --git a/cmso-robot/robot/assets/test_properties.py b/cmso-robot/robot/assets/test_properties.py
index 38840ac..99e92e3 100644
--- a/cmso-robot/robot/assets/test_properties.py
+++ b/cmso-robot/robot/assets/test_properties.py
@@ -11,6 +11,14 @@ GLOBAL_OPTIMIZER_URL = "http://127.0.0.1:7997"
GLOBAL_OPTIMIZER_USER = "oof@oof.onap.org"
GLOBAL_OPTIMIZER_PASSWORD = "demo123456!"
+GLOBAL_TICKET_MGT_URL = "http://127.0.0.1:7999"
+GLOBAL_TICKET_MGT_USER = "oof@oof.onap.org"
+GLOBAL_TICKET_MGT_PASSWORD = "demo123456!"
+
+GLOBAL_TOPOLOGY_URL = "http://127.0.0.1:7998"
+GLOBAL_TOPOLOGY_USER = "oof@oof.onap.org"
+GLOBAL_TOPOLOGY_PASSWORD = "demo123456!"
+
GLOBAL_CALLBACK_USERID = "onap-user"
GLOBAL_CALLBACK_PASSWORD = "onap-user"
diff --git a/cmso-robot/robot/resources/optimizer_common.robot b/cmso-robot/robot/resources/optimizer_common.robot
index 81c0c75..7212f03 100644
--- a/cmso-robot/robot/resources/optimizer_common.robot
+++ b/cmso-robot/robot/resources/optimizer_common.robot
@@ -46,14 +46,28 @@ Delete Optimizer
Get Optimizer
[Documentation] Runs a scheduler GET request
- [Arguments] ${alias} ${resource}
+ [Arguments] ${alias} ${resource} ${accept}=application/json
${data_path}= Catenate ${OPTIMIZER_PATH}/${resource}
${url}= Catenate ${GLOBAL_OPTIMIZER_URL}
${uuid}= Generate UUID
${proxies}= Create Dictionary no=pass
${session}= Create Session ${alias} ${url}
${auth_string}= B64 Encode ${GLOBAL_OPTIMIZER_USER}:${GLOBAL_OPTIMIZER_PASSWORD}
- ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} Authorization=Basic ${auth_string}
+ ${headers}= Create Dictionary Accept=${accept} Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} Authorization=Basic ${auth_string}
${resp}= Get Request ${alias} ${data_path} headers=${headers}
Log Received response from scheduler ${resp.json()}
[Return] ${resp}
+
+Get Optimizer Plain Text
+ [Documentation] Runs a scheduler GET request
+ [Arguments] ${alias} ${resource} ${accept}=text/plain
+ ${data_path}= Catenate ${OPTIMIZER_PATH}/${resource}
+ ${url}= Catenate ${GLOBAL_OPTIMIZER_URL}
+ ${uuid}= Generate UUID
+ ${proxies}= Create Dictionary no=pass
+ ${session}= Create Session ${alias} ${url}
+ ${auth_string}= B64 Encode ${GLOBAL_OPTIMIZER_USER}:${GLOBAL_OPTIMIZER_PASSWORD}
+ ${headers}= Create Dictionary Accept=${accept} Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} Authorization=Basic ${auth_string}
+ ${resp}= Get Request ${alias} ${data_path} headers=${headers}
+ Log Received response from scheduler ${resp.text}
+ [Return] ${resp}
diff --git a/cmso-robot/robot/resources/scheduler_common.robot b/cmso-robot/robot/resources/scheduler_common.robot
index 1256480..ab1e8fb 100644
--- a/cmso-robot/robot/resources/scheduler_common.robot
+++ b/cmso-robot/robot/resources/scheduler_common.robot
@@ -83,3 +83,16 @@ Get Scheduler
${valid}= Split String ${valid_status_codes}
Validate Status ${resp} ${valid}
[Return] ${resp}
+
+Get Scheduler Plain Text
+ [Documentation] Runs a scheduler GET request
+ [Arguments] ${alias} ${data_path}
+ ${url}= Catenate ${GLOBAL_SCHEDULER_URL}
+ ${uuid}= Generate UUID
+ ${proxies}= Create Dictionary no=pass
+ ${session}= Create Session ${alias} ${url}
+ ${auth_string}= B64 Encode ${GLOBAL_SCHEDULER_USER}:${GLOBAL_SCHEDULER_PASSWORD}
+ ${headers}= Create Dictionary Accept=text/plain Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} Authorization=Basic ${auth_string}
+ ${resp}= Get Request ${alias} ${data_path} headers=${headers}
+ Log Received response from scheduler ${resp.text}
+ [Return] ${resp}
diff --git a/cmso-robot/robot/resources/ticketmgt_common.robot b/cmso-robot/robot/resources/ticketmgt_common.robot
new file mode 100644
index 0000000..42b54fe
--- /dev/null
+++ b/cmso-robot/robot/resources/ticketmgt_common.robot
@@ -0,0 +1,72 @@
+*** Settings ***
+Documentation The private interface for interacting with Openstack. It handles low level stuff like managing the authtoken and Openstack required fields
+
+Library Collections
+Library RequestsLibrary
+Library UUID
+Library HTTPUtils
+Library String
+Resource misc.robot
+*** Variables ***
+*** Variables ***
+${TICKET_MGT_PATH} /ticketmgt/v1
+#**************** Test Case Variables ******************
+
+*** Keywords ***
+
+
+Post Ticket Mgt
+ [Documentation] Runs a scheduler POST request
+ [Arguments] ${alias} ${resource} ${data}={}
+ ${data_path}= Catenate ${TICKET_MGT_PATH}/${resource}
+ ${url}= Catenate ${GLOBAL_TICKET_MGT_URL}
+ ${uuid}= Generate UUID
+ ${proxies}= Create Dictionary no=pass
+ ${session}= Create Session ${alias} ${url}
+ ${auth_string}= B64 Encode ${GLOBAL_TICKET_MGT_USER}:${GLOBAL_TICKET_MGT_PASSWORD}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} Authorization=Basic ${auth_string}
+ ${resp}= Post Request ${alias} ${data_path} headers=${headers} data=${data}
+ Log Received response from scheduler ${resp.text}
+ [Return] ${resp}
+
+Delete Ticket Mgt
+ [Documentation] Runs a scheduler DELETE request (this may need to be changed for 1802 US change Delete schedule to Cancel Schedule)
+ [Arguments] ${alias} ${resource}
+ ${data_path}= Catenate ${TICKET_MGT_PATH}/${resource}
+ ${url}= Catenate ${GLOBAL_TICKET_MGT_URL}
+ ${uuid}= Generate UUID
+ ${proxies}= Create Dictionary no=pass
+ ${session}= Create Session ${alias} ${url}
+ ${auth_string}= B64 Encode ${GLOBAL_TICKET_MGT_USER}:${GLOBAL_TICKET_MGT_PASSWORD}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} Authorization=Basic ${auth_string}
+ ${resp}= Delete Request ${alias} ${data_path} headers=${headers}
+ Log Received response from scheduler ${resp.text}
+ [Return] ${resp}
+
+Get Ticket Mgt
+ [Documentation] Runs a scheduler GET request
+ [Arguments] ${alias} ${resource}
+ ${data_path}= Catenate ${TICKET_MGT_PATH}/${resource}
+ ${url}= Catenate ${GLOBAL_TICKET_MGT_URL}
+ ${uuid}= Generate UUID
+ ${proxies}= Create Dictionary no=pass
+ ${session}= Create Session ${alias} ${url}
+ ${auth_string}= B64 Encode ${GLOBAL_TICKET_MGT_USER}:${GLOBAL_TICKET_MGT_PASSWORD}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} Authorization=Basic ${auth_string}
+ ${resp}= Get Request ${alias} ${data_path} headers=${headers}
+ Log Received response from scheduler ${resp.json()}
+ [Return] ${resp}
+
+Get Ticket Mgt Plain Text
+ [Documentation] Runs a scheduler GET request
+ [Arguments] ${alias} ${resource}
+ ${data_path}= Catenate ${TICKET_MGT_PATH}/${resource}
+ ${url}= Catenate ${GLOBAL_TICKET_MGT_URL}
+ ${uuid}= Generate UUID
+ ${proxies}= Create Dictionary no=pass
+ ${session}= Create Session ${alias} ${url}
+ ${auth_string}= B64 Encode ${GLOBAL_TICKET_MGT_USER}:${GLOBAL_TICKET_MGT_PASSWORD}
+ ${headers}= Create Dictionary Accept=text/plain Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} Authorization=Basic ${auth_string}
+ ${resp}= Get Request ${alias} ${data_path} headers=${headers}
+ Log Received response from scheduler ${resp.text}
+ [Return] ${resp}
diff --git a/cmso-robot/robot/resources/topology_common.robot b/cmso-robot/robot/resources/topology_common.robot
new file mode 100644
index 0000000..32176f0
--- /dev/null
+++ b/cmso-robot/robot/resources/topology_common.robot
@@ -0,0 +1,72 @@
+*** Settings ***
+Documentation The private interface for interacting with Openstack. It handles low level stuff like managing the authtoken and Openstack required fields
+
+Library Collections
+Library RequestsLibrary
+Library UUID
+Library HTTPUtils
+Library String
+Resource misc.robot
+*** Variables ***
+*** Variables ***
+${TOPOLOGY_PATH} /topology/v1
+#**************** Test Case Variables ******************
+
+*** Keywords ***
+
+
+Post Topology
+ [Documentation] Runs a scheduler POST request
+ [Arguments] ${alias} ${resource} ${data}={}
+ ${data_path}= Catenate ${TOPOLOGY_PATH}/${resource}
+ ${url}= Catenate ${GLOBAL_TOPOLOGY_URL}
+ ${uuid}= Generate UUID
+ ${proxies}= Create Dictionary no=pass
+ ${session}= Create Session ${alias} ${url}
+ ${auth_string}= B64 Encode ${GLOBAL_TOPOLOGY_USER}:${GLOBAL_TOPOLOGY_PASSWORD}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} Authorization=Basic ${auth_string}
+ ${resp}= Post Request ${alias} ${data_path} headers=${headers} data=${data}
+ Log Received response from scheduler ${resp.text}
+ [Return] ${resp}
+
+Delete Topology
+ [Documentation] Runs a scheduler DELETE request (this may need to be changed for 1802 US change Delete schedule to Cancel Schedule)
+ [Arguments] ${alias} ${resource}
+ ${data_path}= Catenate ${TOPOLOGY_PATH}/${resource}
+ ${url}= Catenate ${GLOBAL_TOPOLOGY_URL}
+ ${uuid}= Generate UUID
+ ${proxies}= Create Dictionary no=pass
+ ${session}= Create Session ${alias} ${url}
+ ${auth_string}= B64 Encode ${GLOBAL_TOPOLOGY_USER}:${GLOBAL_TOPOLOGY_PASSWORD}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} Authorization=Basic ${auth_string}
+ ${resp}= Delete Request ${alias} ${data_path} headers=${headers}
+ Log Received response from scheduler ${resp.text}
+ [Return] ${resp}
+
+Get Topology
+ [Documentation] Runs a scheduler GET request
+ [Arguments] ${alias} ${resource}
+ ${data_path}= Catenate ${TOPOLOGY_PATH}/${resource}
+ ${url}= Catenate ${GLOBAL_TOPOLOGY_URL}
+ ${uuid}= Generate UUID
+ ${proxies}= Create Dictionary no=pass
+ ${session}= Create Session ${alias} ${url}
+ ${auth_string}= B64 Encode ${GLOBAL_TOPOLOGY_USER}:${GLOBAL_TOPOLOGY_PASSWORD}
+ ${headers}= Create Dictionary Accept=application/json Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} Authorization=Basic ${auth_string}
+ ${resp}= Get Request ${alias} ${data_path} headers=${headers}
+ Log Received response from scheduler ${resp.json()}
+ [Return] ${resp}
+
+Get Topology Plain Text
+ [Documentation] Runs a scheduler GET request
+ [Arguments] ${alias} ${resource}
+ ${data_path}= Catenate ${TOPOLOGY_PATH}/${resource}
+ ${url}= Catenate ${GLOBAL_TOPOLOGY_URL}
+ ${uuid}= Generate UUID
+ ${proxies}= Create Dictionary no=pass
+ ${session}= Create Session ${alias} ${url}
+ ${auth_string}= B64 Encode ${GLOBAL_TOPOLOGY_USER}:${GLOBAL_TOPOLOGY_PASSWORD}
+ ${headers}= Create Dictionary Accept=text/plain Content-Type=application/json X-TransactionId=${GLOBAL_APPLICATION_ID}-${uuid} X-FromAppId=${GLOBAL_APPLICATION_ID} Authorization=Basic ${auth_string}
+ ${resp}= Get Request ${alias} ${data_path} headers=${headers}
+ Log Received response from scheduler ${resp.text}
+ [Return] ${resp}
diff --git a/cmso-robot/robot/testsuites/MiscTests.robot b/cmso-robot/robot/testsuites/MiscTests.robot
index 6873e3f..a3b9428 100644
--- a/cmso-robot/robot/testsuites/MiscTests.robot
+++ b/cmso-robot/robot/testsuites/MiscTests.robot
@@ -3,9 +3,12 @@ Documentation Creates VID VNF Instance
Library StringTemplater
Library UUID
+Library Collections
-Resource ../resources/test_templates/change_management.robot
-Resource ../resources/test_templates/check_logs.robot
+Resource ../resources/optimizer_common.robot
+Resource ../resources/scheduler_common.robot
+Resource ../resources/ticketmgt_common.robot
+Resource ../resources/topology_common.robot
# Test Setup
# Test Teardown
@@ -15,9 +18,45 @@ ${password}=
${uuid_list_file}= robot/assets/get_schedule_UUIDs.txt
${template_folder}= robot/assets/templates/changemanagement
*** Test Cases ***
-Get Schedule
- Get Schedule Test Template ${uuid_list_file}
+Test CMSO Optimizer Admin
+ [Tags] ete
+ ${response}= Get Optimizer Plain Text alias admin/password
+ Should Contain ${response.text} kECFDaLusYNHTN6Q4DmsYw==
-Post Existing Immediate Schedule
- Change Management Already Exists Immediate Template OneVnfImmediateReplaceVNFInfra.json.template ${template_folder}
+Test CMSO Service Admin
+ [Tags] ete
+ ${response}= Get Scheduler Plain Text alias /cmso/v1/admin/password
+ Should Contain ${response.text} kECFDaLusYNHTN6Q4DmsYw==
+Test CMSO Ticket Mgt Admin
+ [Tags] ete
+ ${response}= Get Ticket Mgt Plain Text alias admin/password
+ Should Contain ${response.text} kECFDaLusYNHTN6Q4DmsYw==
+
+Test CMSO Topology Admin
+ [Tags] ete
+ ${response}= Get Topology Plain Text alias admin/password
+ Should Contain ${response.text} kECFDaLusYNHTN6Q4DmsYw==
+
+Test CMSO Optimizer Health
+ [Tags] ete
+ ${response}= Get Optimizer alias health
+ Dictionary Should Contain Item ${response.json()} healthy True
+
+Test CMSO Service Health
+ [Tags] ete
+ ${response}= Get Scheduler alias /cmso/v1/health
+ Dictionary Should Contain Item ${response.json()} healthy True
+
+
+Test CMSO Ticket Mgt Health
+ [Tags] ete
+ ${response}= Get Ticket Mgt alias health
+ Dictionary Should Contain Item ${response.json()} healthy True
+
+
+Test CMSO Topology Health
+ [Tags] ete
+ ${response}= Get Topology alias health
+ Dictionary Should Contain Item ${response.json()} healthy True
+
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/CmsoEnvironmentPostProcessor.java b/cmso-service/src/main/java/org/onap/optf/cmso/CmsoEnvironmentPostProcessor.java
deleted file mode 100644
index 8b4c44a..0000000
--- a/cmso-service/src/main/java/org/onap/optf/cmso/CmsoEnvironmentPostProcessor.java
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
- * ============LICENSE_START=======================================================================================
- * Copyright (c) 2019 AT&T Intellectual Property.
- * ===================================================================
- * 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. See the License for the specific language governing permissions and
- * limitations under the License.
- * ============LICENSE_END=========================================================================================
- *
- ******************************************************************************/
-
-package org.onap.optf.cmso;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.onap.optf.cmso.common.PropertiesManagement;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.env.EnvironmentPostProcessor;
-import org.springframework.core.env.ConfigurableEnvironment;
-import org.springframework.core.env.MapPropertySource;
-import org.springframework.core.env.MutablePropertySources;
-
-public class CmsoEnvironmentPostProcessor implements EnvironmentPostProcessor {
- // TODO tested in ONAP springboot and this is called before all of the properties files have been
- // loaded...
- // perhaps there is a post post processor? Until this works. DB password will be in the clear in the
- // proeprties files.
- @Override
- public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
- String pwd = environment.getProperty("cmso.database.password");
- if (pwd != null) {
- pwd = PropertiesManagement.getDecryptedValue(pwd);
- Map<String, Object> map = new HashMap<>();
- map.put("spring.datasource.password", pwd);
- MapPropertySource propertySource = new MapPropertySource("abc", map);
- MutablePropertySources proeprtySources = environment.getPropertySources();
- proeprtySources.addLast(propertySource);
- }
- }
-
-}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/JerseyConfiguration.java b/cmso-service/src/main/java/org/onap/optf/cmso/JerseyConfiguration.java
index 2ba5fa3..eb4160a 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/JerseyConfiguration.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/JerseyConfiguration.java
@@ -47,7 +47,6 @@ import org.glassfish.jersey.servlet.ServletProperties;
import org.onap.optf.cmso.dispatcher.rs.DispatcherServiceImpl;
import org.onap.optf.cmso.filters.CmsoContainerFilters;
import org.onap.optf.cmso.service.rs.AdminToolImpl;
-import org.onap.optf.cmso.service.rs.CmsoOptimizerCallbackImpl;
import org.onap.optf.cmso.service.rs.CmsoServiceImpl;
import org.onap.optf.cmso.service.rs.HealthCheckImpl;
import org.onap.optf.cmso.test.loopback.SchedulerTestLoopbackServiceImpl;
@@ -84,7 +83,6 @@ public class JerseyConfiguration extends ResourceConfig {
@Autowired
public JerseyConfiguration( /* LogRequestFilter lrf */ ) {
register(CmsoServiceImpl.class);
- register(CmsoOptimizerCallbackImpl.class);
register(SchedulerTestLoopbackServiceImpl.class);
register(TicketMgtLoopbackServiceImpl.class);
register(HealthCheckImpl.class);
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoOptimizerRequest.java b/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoOptimizerRequest.java
deleted file mode 100644
index 05ab753..0000000
--- a/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoOptimizerRequest.java
+++ /dev/null
@@ -1,74 +0,0 @@
-/*
- * Copyright � 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright � 2018 IBM.
- *
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-package org.onap.optf.cmso.optimizer.bean;
-
-public class CmsoOptimizerRequest {
-
- /*
- *
- * { "schedulingInfo": { "scheduleId": "CM-<__SCHEDULE ID__>", "startTime":
- * "2017-02-15T00:00:00+05:00", "endTime": "2017-02-18T23:59:00+05:00",
- * "normalDurationInSecs": 60, "additionalDurationInSecs": 0, // for backout
- * "concurrencyLimit": 10, "policyId": ["SNIRO.TimeLimitAndVerticalTopology"],
- * "vnfDetails": [{ “node�?: "satmo415vbc", “groupId�?: “group1�?//optional }, {
- * “node�?: "satmo415vbc", “groupId�?: “group1�?//optional }] }, "requestInfo": {
- * “transactionId�?: �?__TRANSACTIONID__�?, //logging "requestId":
- * "CM-<__SCHEDULE ID__>", "sourceId": "cm-portal", “optimizer�?: [“scheduling�?],
- * "callbackUrl": "http://callbackurl.onap.org:8080/callback" } }
- *
- */
-
- private CmsoSchedulingInfo schedulingInfo;
- private CmsoRequestInfo requestInfo;
-
- public CmsoOptimizerRequest() {
- schedulingInfo = new CmsoSchedulingInfo();
- requestInfo = new CmsoRequestInfo();
- }
-
- public CmsoSchedulingInfo getSchedulingInfo() {
- return schedulingInfo;
- }
-
- public void setSchedulingInfo(CmsoSchedulingInfo schedulingInfo) {
- this.schedulingInfo = schedulingInfo;
- }
-
- public CmsoRequestInfo getRequestInfo() {
- return requestInfo;
- }
-
- public void setRequestInfo(CmsoRequestInfo requestInfo) {
- this.requestInfo = requestInfo;
- }
-
-}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoOptimizerResponse.java b/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoOptimizerResponse.java
deleted file mode 100644
index 1660866..0000000
--- a/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoOptimizerResponse.java
+++ /dev/null
@@ -1,124 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-package org.onap.optf.cmso.optimizer.bean;
-
-import io.swagger.annotations.ApiModel;
-import io.swagger.annotations.ApiModelProperty;
-
-@ApiModel(value = "Response from schedule optimizer",
- description = "Asynchronous response to schedule oprimizer request.")
-public class CmsoOptimizerResponse {
-
- /*
- *
- * { "transactionId": "dummy-transaction-id",
- * "scheduleId":"CM-<__SCHEDULE ID__>", "requestState": "complete", "status":
- * "Optimal", // diagnostic code "description": "Optimal solution found", //
- * diagnostic code "schedule": [ { "groupId": "grp06", "startTime":
- * "2016-10-01T00:30:00+05:00", // starting time for this group (In 1707,
- * seconds will always be zero but there is no reason to hardcode that decision)
- * "finishTime": "2016-10-01T00:40:00+05:00", // endtime for this group
- * (including failover) "latestInstanceStartTime": "2016-10-01T00:38:00Z", //
- * latest time when an instance of this group can be started "node": [ "up01",
- * "up03", "up09" ] // list of instances for this group. } ] }
- *
- */
-
- @ApiModelProperty(value = "Unique id of optimization request.")
- private String transactionId;
-
- @ApiModelProperty(value = "Schedule id for which the optimization request was executed.")
- private String scheduleId;
-
- @ApiModelProperty(value = "State of the request as reported by the optimizer.")
- private String requestState;
-
- @ApiModelProperty(value = "Status of the request.")
- private String status;
-
- @ApiModelProperty(value = "Description of the request status.")
- private String description;
-
- @ApiModelProperty(value = "List of schedules returned, one per group. Only 1 group supported at this time.")
- private CmsoSchedule[] schedule;
-
- public CmsoOptimizerResponse() {}
-
- public String getTransactionId() {
- return transactionId;
- }
-
- public void setTransactionId(String transactionId) {
- this.transactionId = transactionId;
- }
-
- public String getScheduleId() {
- return scheduleId;
- }
-
- public void setScheduleId(String scheduleId) {
- this.scheduleId = scheduleId;
- }
-
- public String getRequestState() {
- return requestState;
- }
-
- public void setRequestState(String requestState) {
- this.requestState = requestState;
- }
-
- public String getDescription() {
- return description;
- }
-
- public void setDescription(String description) {
- this.description = description;
- }
-
- public String getStatus() {
- return status;
- }
-
- public void setStatus(String status) {
- this.status = status;
- }
-
- public CmsoSchedule[] getSchedule() {
- return schedule;
- }
-
- public void setSchedule(CmsoSchedule[] schedule) {
- this.schedule = schedule;
- }
-
-}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoRequestInfo.java b/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoRequestInfo.java
deleted file mode 100644
index dd74db2..0000000
--- a/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoRequestInfo.java
+++ /dev/null
@@ -1,83 +0,0 @@
-/*
- * Copyright � 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright � 2018 IBM.
- *
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-package org.onap.optf.cmso.optimizer.bean;
-
-public class CmsoRequestInfo {
- private String transactionId;
- private String requestId;
- private String sourceId;
- private String[] optimizer;
- private String callbackUrl;
-
- public CmsoRequestInfo() {}
-
- public String getTransactionId() {
- return transactionId;
- }
-
- public void setTransactionId(String transactionId) {
- this.transactionId = transactionId;
- }
-
- public String getRequestId() {
- return requestId;
- }
-
- public void setRequestId(String requestId) {
- this.requestId = requestId;
- }
-
- public String getSourceId() {
- return sourceId;
- }
-
- public void setSourceId(String sourceId) {
- this.sourceId = sourceId;
- }
-
- public String[] getOptimizer() {
- return optimizer;
- }
-
- public void setOptimizer(String[] optimizer) {
- this.optimizer = optimizer;
- }
-
- public String getCallbackUrl() {
- return callbackUrl;
- }
-
- public void setCallbackUrl(String callbackUrl) {
- this.callbackUrl = callbackUrl;
- }
-
-}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoSchedule.java b/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoSchedule.java
deleted file mode 100644
index 0d56fbd..0000000
--- a/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoSchedule.java
+++ /dev/null
@@ -1,88 +0,0 @@
-/*
- * Copyright � 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright � 2018 IBM.
- *
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-package org.onap.optf.cmso.optimizer.bean;
-
-import java.util.ArrayList;
-import java.util.List;
-
-public class CmsoSchedule {
- private String groupId;
- private String startTime;
- private String finishTime;
- private String latestInstanceStartTime;
- private List<String> node;
-
- public CmsoSchedule() {
- node = new ArrayList<String>();
- }
-
- public String getGroupId() {
- return groupId;
- }
-
- public void setGroupId(String groupId) {
- this.groupId = groupId;
- }
-
- public String getStartTime() {
- return startTime;
- }
-
- public void setStartTime(String startTime) {
- this.startTime = startTime;
- }
-
- public String getFinishTime() {
- return finishTime;
- }
-
- public void setFinishTime(String finishTime) {
- this.finishTime = finishTime;
- }
-
- public String getLatestInstanceStartTime() {
- return latestInstanceStartTime;
- }
-
- public void setLatestInstanceStartTime(String latestInstanceStartTime) {
- this.latestInstanceStartTime = latestInstanceStartTime;
- }
-
- public List<String> getNode() {
- return node;
- }
-
- public void setNode(List<String> node) {
- this.node = node;
- }
-
-}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoSchedulingInfo.java b/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoSchedulingInfo.java
deleted file mode 100644
index 840cbb7..0000000
--- a/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoSchedulingInfo.java
+++ /dev/null
@@ -1,110 +0,0 @@
-/*
- * Copyright � 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright � 2018 IBM.
- *
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-package org.onap.optf.cmso.optimizer.bean;
-
-public class CmsoSchedulingInfo {
- private String scheduleId;
- private String startTime;
- private String endTime;
- private int normalDurationInSecs;
- private int additionalDurationInSecs;
- private int concurrencyLimit;
- private String[] policyId;
- private CmsoVnfDetails[] vnfDetails;
-
- public CmsoSchedulingInfo() {}
-
- public String getScheduleId() {
- return scheduleId;
- }
-
- public void setScheduleId(String scheduleId) {
- this.scheduleId = scheduleId;
- }
-
- public String getStartTime() {
- return startTime;
- }
-
- public void setStartTime(String startTime) {
- this.startTime = startTime;
- }
-
- public String getEndTime() {
- return endTime;
- }
-
- public void setEndTime(String endTime) {
- this.endTime = endTime;
- }
-
- public int getNormalDurationInSecs() {
- return normalDurationInSecs;
- }
-
- public void setNormalDurationInSecs(int normalDurationInSecs) {
- this.normalDurationInSecs = normalDurationInSecs;
- }
-
- public int getAdditionalDurationInSecs() {
- return additionalDurationInSecs;
- }
-
- public void setAdditionalDurationInSecs(int additionalDurationInSecs) {
- this.additionalDurationInSecs = additionalDurationInSecs;
- }
-
- public int getConcurrencyLimit() {
- return concurrencyLimit;
- }
-
- public void setConcurrencyLimit(int concurrencyLimit) {
- this.concurrencyLimit = concurrencyLimit;
- }
-
- public String[] getPolicyId() {
- return policyId;
- }
-
- public void setPolicyId(String[] policyId) {
- this.policyId = policyId;
- }
-
- public CmsoVnfDetails[] getVnfDetails() {
- return vnfDetails;
- }
-
- public void setVnfDetails(CmsoVnfDetails[] vnfDetails) {
- this.vnfDetails = vnfDetails;
- }
-
-}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoVnfDetails.java b/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoVnfDetails.java
deleted file mode 100644
index 4ee6053..0000000
--- a/cmso-service/src/main/java/org/onap/optf/cmso/optimizer/bean/CmsoVnfDetails.java
+++ /dev/null
@@ -1,60 +0,0 @@
-/*
- * Copyright � 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright � 2018 IBM.
- *
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-package org.onap.optf.cmso.optimizer.bean;
-
-public class CmsoVnfDetails {
- private String node;
- private String groupId;
-
- public CmsoVnfDetails() {}
-
- public CmsoVnfDetails(String groupId) {
- this.groupId = groupId;
- }
-
- public String getNode() {
- return node;
- }
-
- public void setNode(String node) {
- this.node = node;
- }
-
- public String getGroupId() {
- return groupId;
- }
-
- public void setGroupId(String groupId) {
- this.groupId = groupId;
- }
-
-}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoOptimizerCallback.java b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoOptimizerCallback.java
deleted file mode 100644
index b6b81e6..0000000
--- a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoOptimizerCallback.java
+++ /dev/null
@@ -1,64 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-package org.onap.optf.cmso.service.rs;
-
-import io.swagger.annotations.Api;
-import io.swagger.annotations.ApiOperation;
-import io.swagger.annotations.ApiParam;
-import io.swagger.annotations.ApiResponse;
-import io.swagger.annotations.ApiResponses;
-import javax.ws.rs.DefaultValue;
-import javax.ws.rs.POST;
-import javax.ws.rs.Path;
-import javax.ws.rs.PathParam;
-import javax.ws.rs.Produces;
-import javax.ws.rs.core.MediaType;
-import javax.ws.rs.core.Response;
-import org.onap.optf.cmso.optimizer.bean.CmsoOptimizerResponse;
-
-@Api("CMSO Optimized Schedule API")
-@Path("/{apiVersion}")
-@Produces({MediaType.APPLICATION_JSON})
-public interface CmsoOptimizerCallback {
-
- // ******************************************************************
- @POST
- @Path("/optimizerCallback")
- @Produces({MediaType.APPLICATION_JSON})
- @ApiOperation(value = "", notes = "Processes optimizer results callback to a Pending Optimization schedule.")
- @ApiResponses(value = {@ApiResponse(code = 200, message = "OK"),
- @ApiResponse(code = 500, message = "Unexpected Runtime error", response = Exception.class)})
- public Response sniroCallback(
- @ApiParam(value = "v1") @PathParam("apiVersion") @DefaultValue("v1") String apiVersion,
- @ApiParam(value = "Return schedules > lastScheduleId") CmsoOptimizerResponse reponse);
-
-}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoOptimizerCallbackImpl.java b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoOptimizerCallbackImpl.java
deleted file mode 100644
index ffe00c5..0000000
--- a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoOptimizerCallbackImpl.java
+++ /dev/null
@@ -1,304 +0,0 @@
-/*
- * Copyright © 2017-2019 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-package org.onap.optf.cmso.service.rs;
-
-import com.att.eelf.configuration.EELFLogger;
-import com.att.eelf.configuration.EELFManager;
-import com.fasterxml.jackson.databind.ObjectMapper;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
-import javax.servlet.http.HttpServletRequest;
-import javax.transaction.Transactional;
-import javax.ws.rs.core.Context;
-import javax.ws.rs.core.Response;
-import javax.ws.rs.core.Response.Status;
-import javax.ws.rs.core.UriInfo;
-import org.joda.time.DateTime;
-import org.joda.time.format.DateTimeFormat;
-import org.joda.time.format.ISODateTimeFormat;
-import org.onap.optf.cmso.common.CmsoStatusEnum;
-import org.onap.optf.cmso.common.DomainsEnum;
-import org.onap.optf.cmso.common.LogMessages;
-import org.onap.optf.cmso.common.exceptions.CmsoException;
-import org.onap.optf.cmso.common.exceptions.CmsoNotFoundException;
-import org.onap.optf.cmso.model.ChangeManagementGroup;
-import org.onap.optf.cmso.model.ChangeManagementSchedule;
-import org.onap.optf.cmso.model.Schedule;
-import org.onap.optf.cmso.model.dao.ChangeManagementChangeWindowDao;
-import org.onap.optf.cmso.model.dao.ChangeManagementDetailDao;
-import org.onap.optf.cmso.model.dao.ChangeManagementGroupDao;
-import org.onap.optf.cmso.model.dao.ChangeManagementScheduleDao;
-import org.onap.optf.cmso.optimizer.bean.CmsoOptimizerResponse;
-import org.onap.optf.cmso.optimizer.bean.CmsoSchedule;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.stereotype.Controller;
-
-/**
- * The Class CmsoOptimizerCallbackImpl.
- */
-@Controller
-public class CmsoOptimizerCallbackImpl extends BaseSchedulerServiceImpl implements CmsoOptimizerCallback {
- private static EELFLogger log = EELFManager.getInstance().getLogger(CmsoOptimizerCallbackImpl.class);
- private static EELFLogger debug = EELFManager.getInstance().getDebugLogger();
- private static EELFLogger errors = EELFManager.getInstance().getErrorLogger();
-
- @Context
- UriInfo uri;
-
- @Context
- HttpServletRequest request;
-
-
- @Autowired
- ChangeManagementScheduleDao cmScheduleDao;
-
- @Autowired
- ChangeManagementGroupDao cmGroupDao;
-
- @Autowired
- ChangeManagementChangeWindowDao cmChangeWindowDao;
-
- @Autowired
- ChangeManagementDetailDao cmDetailsDaoO;
-
- /**
- * Sniro callback.
- *
- * @param apiVersion the api version
- * @param sniroResponse the sniro response
- * @return the response
- */
- @Override
- @Transactional
- public Response sniroCallback(String apiVersion, CmsoOptimizerResponse sniroResponse) {
- Response response = null;
- log.info(LogMessages.PROCESS_OPTIMIZER_CALLBACK, "Received", request.getRemoteAddr(), "");
- log.info(LogMessages.OPTIMIZER_REQUEST, "Callback received", sniroResponse.getTransactionId(),
- uri.getAbsolutePath().toString());
- try {
- // Note that transaction ID and schedule ID are currently the same value.
-
- String transactionId = sniroResponse.getTransactionId();
-
- // Synchronize this with transaction that scheduled the SNIRO optimization
- // to ensure status updates are properly ordered.
- // This is necessary only in the race condition where SNIRO callback comes
- // before the SNIRO response is processed and the scheduling transaction is
- // still in flight.
- // Note that this may happen in loopback mode, but is not likely to happen with
- // real SNIRO unless SNIRO changes to be synchronous and the callback comes before
- // the response.
- // If this lock times out, the schedule will remain in 'Optimization In
- // Progress' and never complete.
- Schedule schedule = scheduleDao.lockOneByTransactionId(transactionId);
-
- if (schedule == null) {
- throw new CmsoNotFoundException(DomainsEnum.ChangeManagement.toString(),
- "(OptimizerTransactionID=" + transactionId + ")");
-
- }
- CmsoStatusEnum status = CmsoStatusEnum.PendingApproval.fromString(schedule.getStatus());
- debug.debug("Status at time of SNIRO callback is " + status.toString());
- switch (status) {
- // PendingSchedule may be a valid status in the cases where SNIRO async call
- // returns before
- // We have committed the OptimizationInProgress status
- // The dispatch logic ensures that we only every dispatch once.
- case OptimizationInProgress:
- processSniroResponse(sniroResponse, schedule);
- scheduleDao.save(schedule);
- response = Response.ok().build();
- break;
- default:
- throw new CmsoException(Status.PRECONDITION_FAILED, LogMessages.OPTIMIZER_CALLBACK_STATE_ERROR,
- CmsoStatusEnum.OptimizationInProgress.toString(), schedule.getStatus().toString());
- }
- } catch (CmsoException e) {
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
- response = Response.status(e.getStatus()).entity(e.getRequestError()).build();
- } catch (Exception e) {
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
- response = Response.serverError().entity(e.getMessage()).build();
- }
- return response;
- }
-
- private void processSniroResponse(CmsoOptimizerResponse sniroResponse, Schedule schedule) {
- try {
- schedule.setOptimizerReturnDateTimeMillis(System.currentTimeMillis());
- schedule.setOptimizerStatus(sniroResponse.getRequestState());
- schedule.setOptimizerMessage(sniroResponse.getDescription());
- String scheduleId = sniroResponse.getScheduleId();
- ObjectMapper om = new ObjectMapper();
- CmsoSchedule[] scheduleArray = sniroResponse.getSchedule();
- if (scheduleArray != null && scheduleArray.length > 0) {
- String scheduleString = om.writeValueAsString(scheduleArray);
- schedule.setSchedule(scheduleString);
- log.debug("scheduleId={0} schedule={1}", scheduleId, scheduleString);
- for (CmsoSchedule sniroSchedule : sniroResponse.getSchedule()) {
- String groupId = sniroSchedule.getGroupId();
- DateTime finishTime = convertDate(sniroSchedule.getFinishTime(), "finishTime");
- DateTime startTime = convertDate(sniroSchedule.getStartTime(), "startTime");
- ChangeManagementGroup group = cmGroupDao.findOneBySchedulesIdGroupId(schedule.getUuid(), groupId);
- if (group == null) {
- throw new CmsoException(Status.PRECONDITION_FAILED,
- LogMessages.CHANGE_MANAGEMENT_GROUP_NOT_FOUND, schedule.getScheduleId(), groupId);
- }
- group.setStartTimeMillis(startTime.getMillis());
- group.setFinishTimeMillis(finishTime.getMillis());
- DateTime latestInstanceStartTime =
- convertDate(sniroSchedule.getLatestInstanceStartTime(), "latestInstanceStartTime");
- group.setLastInstanceStartTimeMillis(latestInstanceStartTime.getMillis());
- cmGroupDao.save(group);
- long totalDuration =
- (group.getAdditionalDurationInSecs() + group.getNormalDurationInSecs()) * 1000L;
- Map<String, Map<String, Long>> startAndFinishTimeMap = new HashMap<String, Map<String, Long>>();
- makeMap(startTime.getMillis(), latestInstanceStartTime.getMillis(), group.getConcurrencyLimit(),
- totalDuration, sniroSchedule.getNode(), startAndFinishTimeMap);
- for (String node : sniroSchedule.getNode()) {
- processNode(schedule, group, node, startAndFinishTimeMap);
- }
- }
- schedule.setStatus(CmsoStatusEnum.PendingApproval.toString());
- } else {
- debug.debug("scheduleId={0} schedule=null status={1} ", scheduleId, schedule.getOptimizerStatus());
- schedule.setStatus(CmsoStatusEnum.OptimizationFailed.toString());
- }
- } catch (CmsoException e) {
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
- schedule.setStatus(CmsoStatusEnum.OptimizationFailed.toString());
- schedule.setOptimizerStatus(e.getStatus().toString());
- schedule.setOptimizerMessage(e.getLocalizedMessage());
- } catch (Exception e) {
- errors.error(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
- schedule.setStatus(CmsoStatusEnum.OptimizationFailed.toString());
- schedule.setOptimizerStatus("Exception");
- schedule.setOptimizerMessage(e.getLocalizedMessage());
- }
- }
-
- /**
- * Make map.
- *
- * @param startTime the start time
- * @param latestInstanceStartTime the latest instance start time
- * @param concurrencyLimit the concurrency limit
- * @param totalDuration the total duration
- * @param nodeList the node list
- * @param startAndFinishTimeMap the start and finish time map
- * @throws CmsoException the CMS exception
- */
- public static void makeMap(Long startTime, Long latestInstanceStartTime, int concurrencyLimit, long totalDuration,
- List<String> nodeList, Map<String, Map<String, Long>> startAndFinishTimeMap) throws CmsoException {
- Long nextStartTime = null;
- Long nextFinishTime = null;
- for (int nodeNumber = 0; nodeNumber < nodeList.size(); nodeNumber++) {
- if (nodeNumber % concurrencyLimit == 0) {
- if (nodeNumber == 0) {
- nextStartTime = startTime;
- }
- else {
- nextStartTime = nextStartTime + totalDuration;
- }
- if (nextStartTime > latestInstanceStartTime) {
- throw new CmsoException(Status.BAD_REQUEST, LogMessages.UNABLE_TO_ALLOCATE_VNF_TIMESLOTS,
- startTime.toString(), latestInstanceStartTime.toString(), String.valueOf(totalDuration),
- String.valueOf(concurrencyLimit), String.valueOf(nodeList.size()));
- }
- nextFinishTime = nextStartTime + totalDuration;
- }
- Map<String, Long> map = new HashMap<String, Long>();
- map.put("startTime", nextStartTime);
- map.put("finishTime", nextFinishTime);
- String node = nodeList.get(nodeNumber);
- startAndFinishTimeMap.put(node, map);
- }
-
- }
-
- private void processNode(Schedule schedule, ChangeManagementGroup group, String node,
- Map<String, Map<String, Long>> startAndFinishTimeMap) throws CmsoException {
- Map<String, Long> map = startAndFinishTimeMap.get(node);
- ChangeManagementSchedule detail = cmScheduleDao.findOneByGroupUuidAndVnfName(group.getUuid(), node);
- if (detail == null) {
- throw new CmsoException(Status.NOT_FOUND, LogMessages.UNABLE_TO_LOCATE_SCHEDULE_DETAIL,
- schedule.getScheduleId(), group.getGroupId(), node);
- }
- detail.setStartTimeMillis(map.get("startTime"));
- detail.setFinishTimeMillis(map.get("finishTime"));
- detail.setVnfId("");
- detail.setStatus(CmsoStatusEnum.PendingApproval.toString());
- cmScheduleDao.save(detail);
- }
-
- /**
- * Convert date.
- *
- * @param utcDate the utc date
- * @param attrName the attr name
- * @return the date time
- * @throws CmsoException the CMS exception
- */
- public static DateTime convertDate(String utcDate, String attrName) throws CmsoException {
- try {
- DateTime dateTime = DateTimeFormat.forPattern("yyyy-MM-dd HH:mm:ss").withZoneUTC().parseDateTime(utcDate);
- if (dateTime != null) {
- return dateTime;
- }
- } catch (Exception e) {
- debug.debug(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
- }
- throw new CmsoException(Status.BAD_REQUEST, LogMessages.INVALID_ATTRIBUTE, attrName, utcDate);
- }
-
- /**
- * Convert ISO date.
- *
- * @param utcDate the utc date
- * @param attrName the attr name
- * @return the date time
- * @throws CmsoException the CMS exception
- */
- public static DateTime convertIsoDate(String utcDate, String attrName) throws CmsoException {
- try {
- DateTime dateTime = ISODateTimeFormat.dateTimeParser().parseDateTime(utcDate);
- if (dateTime != null) {
- return dateTime;
- }
- } catch (Exception e) {
- debug.debug(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
- }
- throw new CmsoException(Status.BAD_REQUEST, LogMessages.INVALID_ATTRIBUTE, attrName, utcDate);
- }
-
-}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoServiceImpl.java b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoServiceImpl.java
index b9d0b60..8a1633a 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoServiceImpl.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/service/rs/CmsoServiceImpl.java
@@ -46,6 +46,7 @@ import javax.ws.rs.core.Response;
import javax.ws.rs.core.Response.Status;
import javax.ws.rs.core.UriInfo;
import org.joda.time.DateTime;
+import org.joda.time.format.ISODateTimeFormat;
import org.onap.observations.Observation;
import org.onap.optf.cmso.common.DomainsEnum;
import org.onap.optf.cmso.common.LogMessages;
@@ -244,8 +245,8 @@ public class CmsoServiceImpl extends CommonServiceImpl implements CmsoService {
if (vdm.getChangeWindow() != null) {
for (ChangeWindowMessage cwm : vdm.getChangeWindow()) {
ChangeWindow cw = new ChangeWindow();
- DateTime start = CmsoOptimizerCallbackImpl.convertIsoDate(cwm.getStartTime(), "startTime");
- DateTime end = CmsoOptimizerCallbackImpl.convertIsoDate(cwm.getEndTime(), "endTime");
+ DateTime start = convertIsoDate(cwm.getStartTime(), "startTime");
+ DateTime end = convertIsoDate(cwm.getEndTime(), "endTime");
cw.setStartTime(start.toDate());
cw.setEndTime(end.toDate());
windows.add(cw);
@@ -457,4 +458,24 @@ public class CmsoServiceImpl extends CommonServiceImpl implements CmsoService {
}
return msg;
}
+ /**
+ * Convert ISO date.
+ *
+ * @param utcDate the utc date
+ * @param attrName the attr name
+ * @return the date time
+ * @throws CmsoException the CMS exception
+ */
+ public static DateTime convertIsoDate(String utcDate, String attrName) throws CmsoException {
+ try {
+ DateTime dateTime = ISODateTimeFormat.dateTimeParser().parseDateTime(utcDate);
+ if (dateTime != null) {
+ return dateTime;
+ }
+ } catch (Exception e) {
+ debug.debug(LogMessages.UNEXPECTED_EXCEPTION, e, e.getMessage());
+ }
+ throw new CmsoException(Status.BAD_REQUEST, LogMessages.INVALID_ATTRIBUTE, attrName, utcDate);
+ }
+
}
diff --git a/cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/SchedulerTestLoopbackServiceImpl.java b/cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/SchedulerTestLoopbackServiceImpl.java
index 9be348a..a834878 100644
--- a/cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/SchedulerTestLoopbackServiceImpl.java
+++ b/cmso-service/src/main/java/org/onap/optf/cmso/test/loopback/SchedulerTestLoopbackServiceImpl.java
@@ -42,6 +42,7 @@ import org.joda.time.DateTime;
import org.onap.observations.Observation;
import org.onap.optf.cmso.common.LogMessages;
import org.onap.optf.cmso.common.PropertiesManagement;
+import org.onap.optf.cmso.common.exceptions.CmsoException;
import org.onap.optf.cmso.optimizer.model.OptimizerElementInfo;
import org.onap.optf.cmso.optimizer.model.OptimizerRequest;
import org.onap.optf.cmso.optimizer.model.OptimizerResponse;
@@ -49,7 +50,6 @@ import org.onap.optf.cmso.optimizer.model.OptimizerScheduleInfo;
import org.onap.optf.cmso.optimizer.model.ScheduledElement;
import org.onap.optf.cmso.optimizer.model.ScheduledElement.ScheduleType;
import org.onap.optf.cmso.optimizer.model.UnScheduledElement;
-import org.onap.optf.cmso.service.rs.CmsoOptimizerCallbackImpl;
import org.onap.optf.cmso.service.rs.models.v2.ChangeWindow;
import org.onap.optf.cmso.wf.bean.WfCmResponse200;
import org.onap.optf.cmso.wf.bean.WfMsoRequestReferences;
@@ -129,13 +129,12 @@ public class SchedulerTestLoopbackServiceImpl implements SchedulerTestLoopbackSe
serialized = (serialized * totalDuration);
}
DateTime latestInstanceStartTime = startTime.plus(serialized);
- DateTime finishTime = latestInstanceStartTime.plus(totalDuration);
// Reformat request into a response setting the groups start finish
// time based upon
Map<String, Map<String, Long>> startAndFinishTimeMap = new HashMap<String, Map<String, Long>>();
try {
- CmsoOptimizerCallbackImpl.makeMap(startTime.getMillis(), latestInstanceStartTime.getMillis(),
+ makeMap(startTime.getMillis(), latestInstanceStartTime.getMillis(),
concurrencyLimit, totalDuration, nodeList, startAndFinishTimeMap);
for (String node : nodes.keySet()) {
Map<String, Long> map = startAndFinishTimeMap.get(node);
@@ -197,5 +196,43 @@ public class SchedulerTestLoopbackServiceImpl implements SchedulerTestLoopbackSe
return Response.ok().entity(response).build();
}
+ /**
+ * Make map.
+ *
+ * @param startTime the start time
+ * @param latestInstanceStartTime the latest instance start time
+ * @param concurrencyLimit the concurrency limit
+ * @param totalDuration the total duration
+ * @param nodeList the node list
+ * @param startAndFinishTimeMap the start and finish time map
+ * @throws CmsoException the CMS exception
+ */
+ public static void makeMap(Long startTime, Long latestInstanceStartTime, int concurrencyLimit, long totalDuration,
+ List<String> nodeList, Map<String, Map<String, Long>> startAndFinishTimeMap) throws CmsoException {
+ Long nextStartTime = null;
+ Long nextFinishTime = null;
+ for (int nodeNumber = 0; nodeNumber < nodeList.size(); nodeNumber++) {
+ if (nodeNumber % concurrencyLimit == 0) {
+ if (nodeNumber == 0) {
+ nextStartTime = startTime;
+ }
+ else {
+ nextStartTime = nextStartTime + totalDuration;
+ }
+ if (nextStartTime > latestInstanceStartTime) {
+ throw new CmsoException(Status.BAD_REQUEST, LogMessages.UNABLE_TO_ALLOCATE_VNF_TIMESLOTS,
+ startTime.toString(), latestInstanceStartTime.toString(), String.valueOf(totalDuration),
+ String.valueOf(concurrencyLimit), String.valueOf(nodeList.size()));
+ }
+ nextFinishTime = nextStartTime + totalDuration;
+ }
+ Map<String, Long> map = new HashMap<String, Long>();
+ map.put("startTime", nextStartTime);
+ map.put("finishTime", nextFinishTime);
+ String node = nodeList.get(nodeNumber);
+ startAndFinishTimeMap.put(node, map);
+ }
+
+ }
}
diff --git a/cmso-service/src/main/resources/META-INF/spring.factories b/cmso-service/src/main/resources/META-INF/spring.factories
deleted file mode 100644
index c0b4a01..0000000
--- a/cmso-service/src/main/resources/META-INF/spring.factories
+++ /dev/null
@@ -1 +0,0 @@
-org.springframework.boot.env.EnvironmentPostProcessor=org.onap.optf.cmso.CmsoEnvironmentPostProcessor \ No newline at end of file
diff --git a/cmso-ticketmgt/src/main/java/org/onap/optf/cmso/CmsoEnvironmentPostProcessor.java b/cmso-ticketmgt/src/main/java/org/onap/optf/cmso/CmsoEnvironmentPostProcessor.java
deleted file mode 100644
index 2426a5c..0000000
--- a/cmso-ticketmgt/src/main/java/org/onap/optf/cmso/CmsoEnvironmentPostProcessor.java
+++ /dev/null
@@ -1,61 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property.
- * Modifications Copyright © 2018 IBM.
- *
- * 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.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- *
- *
- * Unless otherwise specified, all documentation contained herein is licensed
- * under the Creative Commons License, Attribution 4.0 Intl. (the "License");
- * you may not use this documentation except in compliance with the License.
- * You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
-*/
-
-package org.onap.optf.cmso;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.onap.optf.cmso.common.PropertiesManagement;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.env.EnvironmentPostProcessor;
-import org.springframework.core.env.ConfigurableEnvironment;
-import org.springframework.core.env.MapPropertySource;
-import org.springframework.core.env.MutablePropertySources;
-
-public class CmsoEnvironmentPostProcessor implements EnvironmentPostProcessor {
- // TODO tested in ONAP springboot and this is called before all of the properties files have been
- // loaded...
- // perhaps there is a post post processor? Until this works. DB password will be in the clear in the
- // proeprties files.
- @Override
- public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
- String pwd = environment.getProperty("cmso.database.password");
- if (pwd != null) {
- pwd = PropertiesManagement.getDecryptedValue(pwd);
- Map<String, Object> map = new HashMap<String, Object>();
- map.put("spring.datasource.password", pwd);
- MapPropertySource propertySource = new MapPropertySource("abc", map);
- MutablePropertySources proeprtySources = environment.getPropertySources();
- proeprtySources.addLast(propertySource);
- }
- }
-
-}
diff --git a/cmso-ticketmgt/src/main/resources/META-INF/spring.factories b/cmso-ticketmgt/src/main/resources/META-INF/spring.factories
deleted file mode 100644
index c0b4a01..0000000
--- a/cmso-ticketmgt/src/main/resources/META-INF/spring.factories
+++ /dev/null
@@ -1 +0,0 @@
-org.springframework.boot.env.EnvironmentPostProcessor=org.onap.optf.cmso.CmsoEnvironmentPostProcessor \ No newline at end of file
diff --git a/cmso-topology/src/main/java/org/onap/optf/cmso/CmsoEnvironmentPostProcessor.java b/cmso-topology/src/main/java/org/onap/optf/cmso/CmsoEnvironmentPostProcessor.java
deleted file mode 100644
index 7e15760..0000000
--- a/cmso-topology/src/main/java/org/onap/optf/cmso/CmsoEnvironmentPostProcessor.java
+++ /dev/null
@@ -1,56 +0,0 @@
-/*
- * Copyright © 2017-2018 AT&T Intellectual Property. Modifications Copyright © 2018 IBM.
- *
- * 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. See the License for the specific language governing permissions and limitations under
- * the License.
- *
- *
- * Unless otherwise specified, all documentation contained herein is licensed under the Creative
- * Commons License, Attribution 4.0 Intl. (the "License"); you may not use this documentation except
- * in compliance with the License. You may obtain a copy of the License at
- *
- * https://creativecommons.org/licenses/by/4.0/
- *
- * Unless required by applicable law or agreed to in writing, documentation distributed under the
- * License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
- * express or implied. See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-package org.onap.optf.cmso;
-
-import java.util.HashMap;
-import java.util.Map;
-import org.onap.optf.cmso.common.PropertiesManagement;
-import org.springframework.boot.SpringApplication;
-import org.springframework.boot.env.EnvironmentPostProcessor;
-import org.springframework.core.env.ConfigurableEnvironment;
-import org.springframework.core.env.MapPropertySource;
-import org.springframework.core.env.MutablePropertySources;
-
-public class CmsoEnvironmentPostProcessor implements EnvironmentPostProcessor {
- // TODO tested in ONAP springboot and this is called before all of the properties files have been
- // loaded...
- // perhaps there is a post post processor? Until this works. DB password will be in the clear in the
- // proeprties files.
- @Override
- public void postProcessEnvironment(ConfigurableEnvironment environment, SpringApplication application) {
- String pwd = environment.getProperty("cmso.database.password");
- if (pwd != null) {
- pwd = PropertiesManagement.getDecryptedValue(pwd);
- Map<String, Object> map = new HashMap<String, Object>();
- map.put("spring.datasource.password", pwd);
- MapPropertySource propertySource = new MapPropertySource("abc", map);
- MutablePropertySources proeprtySources = environment.getPropertySources();
- proeprtySources.addLast(propertySource);
- }
- }
-
-}
diff --git a/cmso-topology/src/main/resources/META-INF/spring.factories b/cmso-topology/src/main/resources/META-INF/spring.factories
deleted file mode 100644
index c0b4a01..0000000
--- a/cmso-topology/src/main/resources/META-INF/spring.factories
+++ /dev/null
@@ -1 +0,0 @@
-org.springframework.boot.env.EnvironmentPostProcessor=org.onap.optf.cmso.CmsoEnvironmentPostProcessor \ No newline at end of file