From 3a27ad91be0bb73025de684d4cd35f6dd76ea074 Mon Sep 17 00:00:00 2001 From: sebdet Date: Tue, 23 Feb 2021 13:31:22 +0100 Subject: Refactoring java packages Get rid of *.target java package to avoid confusion with maven target folder Issue-ID: POLICY-3091 Signed-off-by: sebdet Change-Id: Id9501713bf13346b2842abffa7dd6b01b8e26206 Signed-off-by: sebdet --- .gitignore | 2 +- .../update/execution/ToscaMetadataExecutor.java | 3 +- .../execution/ToscaMetadataTargetProcess.java | 49 +++++++++++++++++++++ .../execution/cds/ToscaMetadataCdsProcess.java | 2 - .../target/ToscaMetadataTargetProcess.java | 50 ---------------------- 5 files changed, 51 insertions(+), 55 deletions(-) create mode 100644 src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/ToscaMetadataTargetProcess.java delete mode 100644 src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/target/ToscaMetadataTargetProcess.java diff --git a/.gitignore b/.gitignore index a159c8426..31aad71b5 100644 --- a/.gitignore +++ b/.gitignore @@ -1,4 +1,4 @@ -/target +target .settings .classpath .project diff --git a/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/ToscaMetadataExecutor.java b/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/ToscaMetadataExecutor.java index e18af7188..5fac9a213 100644 --- a/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/ToscaMetadataExecutor.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/ToscaMetadataExecutor.java @@ -2,7 +2,7 @@ * ============LICENSE_START======================================================= * ONAP CLAMP * ================================================================================ - * Copyright (C) 2020 AT&T Intellectual Property. All rights + * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights * reserved. * ================================================================================ * Licensed under the Apache License, Version 2.0 (the "License"); @@ -30,7 +30,6 @@ import java.util.HashMap; import java.util.Map; import javax.annotation.PostConstruct; import org.onap.policy.clamp.clds.tosca.update.execution.cds.ToscaMetadataCdsProcess; -import org.onap.policy.clamp.clds.tosca.update.execution.target.ToscaMetadataTargetProcess; import org.onap.policy.clamp.loop.service.Service; import org.onap.policy.clamp.tosca.DictionaryService; import org.springframework.beans.factory.annotation.Autowired; diff --git a/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/ToscaMetadataTargetProcess.java b/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/ToscaMetadataTargetProcess.java new file mode 100644 index 000000000..0ffd86f47 --- /dev/null +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/ToscaMetadataTargetProcess.java @@ -0,0 +1,49 @@ +/*- + * ============LICENSE_START======================================================= + * ONAP CLAMP + * ================================================================================ + * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights + * reserved. + * ================================================================================ + * 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.policy.clamp.clds.tosca.update.execution; + +import com.att.eelf.configuration.EELFLogger; +import com.att.eelf.configuration.EELFManager; +import com.google.gson.JsonObject; +import org.onap.policy.clamp.loop.service.Service; +import org.onap.policy.clamp.policy.operational.OperationalPolicyRepresentationBuilder; + +/** + * This class is there to add the JsonObject for CDS in the json Schema according to what is found in the Tosca model. + */ +public class ToscaMetadataTargetProcess extends ToscaMetadataProcess { + + + private static final EELFLogger logger = + EELFManager.getInstance().getLogger(ToscaMetadataTargetProcess.class); + + @Override + public void executeProcess(String parameters, JsonObject childObject, Service serviceModel) { + if (serviceModel == null) { + logger.info("serviceModel is null, therefore the ToscaMetadataTargetProcess is skipped"); + return; + } + childObject.add("anyOf", OperationalPolicyRepresentationBuilder.createAnyOfArray(serviceModel, false)); + } +} diff --git a/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java b/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java index 4ad47422c..c80c91170 100644 --- a/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java +++ b/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/cds/ToscaMetadataCdsProcess.java @@ -31,9 +31,7 @@ import com.google.gson.JsonObject; import java.util.Map; import java.util.Set; import org.onap.policy.clamp.clds.tosca.ToscaSchemaConstants; -import org.onap.policy.clamp.clds.tosca.ToscaSchemaConstants; import org.onap.policy.clamp.clds.tosca.update.execution.ToscaMetadataProcess; -import org.onap.policy.clamp.clds.tosca.update.execution.target.ToscaMetadataTargetProcess; import org.onap.policy.clamp.loop.service.Service; diff --git a/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/target/ToscaMetadataTargetProcess.java b/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/target/ToscaMetadataTargetProcess.java deleted file mode 100644 index dcfd0594f..000000000 --- a/src/main/java/org/onap/policy/clamp/clds/tosca/update/execution/target/ToscaMetadataTargetProcess.java +++ /dev/null @@ -1,50 +0,0 @@ -/*- - * ============LICENSE_START======================================================= - * ONAP CLAMP - * ================================================================================ - * Copyright (C) 2020-2021 AT&T Intellectual Property. All rights - * reserved. - * ================================================================================ - * 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.policy.clamp.clds.tosca.update.execution.target; - -import com.att.eelf.configuration.EELFLogger; -import com.att.eelf.configuration.EELFManager; -import com.google.gson.JsonObject; -import org.onap.policy.clamp.clds.tosca.update.execution.ToscaMetadataExecutor; -import org.onap.policy.clamp.clds.tosca.update.execution.ToscaMetadataProcess; -import org.onap.policy.clamp.loop.service.Service; -import org.onap.policy.clamp.policy.operational.OperationalPolicyRepresentationBuilder; - -/** - * This class is there to add the JsonObject for CDS in the json Schema according to what is found in the Tosca model. - */ -public class ToscaMetadataTargetProcess extends ToscaMetadataProcess { - - private static final EELFLogger logger = - EELFManager.getInstance().getLogger(ToscaMetadataTargetProcess.class); - - @Override - public void executeProcess(String parameters, JsonObject childObject, Service serviceModel) { - if (serviceModel == null) { - logger.info("serviceModel is null, therefore the ToscaMetadataTargetProcess is skipped"); - return; - } - childObject.add("anyOf", OperationalPolicyRepresentationBuilder.createAnyOfArray(serviceModel, false)); - } -} -- cgit 1.2.3-korg