summaryrefslogtreecommitdiffstats
path: root/models/src
diff options
context:
space:
mode:
authorFrancescoFioraEst <francesco.fiora@est.tech>2021-11-19 15:59:54 +0000
committerFrancescoFioraEst <francesco.fiora@est.tech>2021-12-02 16:10:51 +0000
commit06499b21fb3a2842d1bbae3eb790c93ea6c9272a (patch)
tree1b8f4f2037c44cb7c8019193009f9c3abccaff21 /models/src
parent8f54ee96bb0b86425d9c177eb991b1fd91000ad4 (diff)
Add support transaction
Add support transaction in CommissioningProvider and ControlLoopInstantiationProvider Issue-ID: POLICY-3802 Change-Id: I8ddba4814547e335b7b27342189a3fc5d9dc4582 Signed-off-by: FrancescoFioraEst <francesco.fiora@est.tech>
Diffstat (limited to 'models/src')
-rw-r--r--models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ClElementStatisticsProvider.java4
-rw-r--r--models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ControlLoopProvider.java4
-rw-r--r--models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantProvider.java4
-rw-r--r--models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantStatisticsProvider.java4
-rw-r--r--models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ServiceTemplateProvider.java6
-rw-r--r--models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ControlLoopProviderTest.java4
6 files changed, 13 insertions, 13 deletions
diff --git a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ClElementStatisticsProvider.java b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ClElementStatisticsProvider.java
index 867c34aad..3a7fa9c87 100644
--- a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ClElementStatisticsProvider.java
+++ b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ClElementStatisticsProvider.java
@@ -33,7 +33,7 @@ import org.onap.policy.clamp.controlloop.models.controlloop.persistence.reposito
import org.onap.policy.models.base.PfModelException;
import org.onap.policy.models.base.PfReferenceTimestampKey;
import org.onap.policy.models.dao.PfFilterParameters;
-import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
@@ -41,7 +41,7 @@ import org.springframework.transaction.annotation.Transactional;
*
* @author Ramesh Murugan Iyer (ramesh.murugan.iyer@est.tech)
*/
-@Component
+@Service
@Transactional
@AllArgsConstructor
public class ClElementStatisticsProvider {
diff --git a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ControlLoopProvider.java b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ControlLoopProvider.java
index 7b6787c5d..a1b1045eb 100644
--- a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ControlLoopProvider.java
+++ b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ControlLoopProvider.java
@@ -44,13 +44,13 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
import org.onap.policy.models.tosca.authorative.concepts.ToscaTypedEntityFilter;
import org.onap.policy.models.tosca.simple.concepts.JpaToscaNodeTemplate;
import org.onap.policy.models.tosca.simple.concepts.JpaToscaNodeTemplates;
-import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* This class provides information on control loop concepts in the database to callers.
*/
-@Component
+@Service
@Transactional
@AllArgsConstructor
public class ControlLoopProvider {
diff --git a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantProvider.java b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantProvider.java
index 2a6f21c07..0c001c11c 100644
--- a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantProvider.java
+++ b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantProvider.java
@@ -32,15 +32,15 @@ import org.onap.policy.models.base.PfConceptKey;
import org.onap.policy.models.base.PfModelException;
import org.onap.policy.models.base.PfModelRuntimeException;
import org.onap.policy.models.tosca.authorative.concepts.ToscaTypedEntityFilter;
-import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* This class provides information on participant concepts in the database to callers.
*/
+@Service
@Transactional
@AllArgsConstructor
-@Component
public class ParticipantProvider {
private ParticipantRepository participantRepository;
diff --git a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantStatisticsProvider.java b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantStatisticsProvider.java
index 811412205..bb4f3a5dd 100644
--- a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantStatisticsProvider.java
+++ b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ParticipantStatisticsProvider.java
@@ -33,13 +33,13 @@ import org.onap.policy.clamp.controlloop.models.controlloop.persistence.reposito
import org.onap.policy.models.base.PfModelException;
import org.onap.policy.models.base.PfTimestampKey;
import org.onap.policy.models.dao.PfFilterParameters;
-import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
/**
* This class provides the provision of information on participant statistics in the database to callers.
*/
-@Component
+@Service
@Transactional
@AllArgsConstructor
public class ParticipantStatisticsProvider {
diff --git a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ServiceTemplateProvider.java b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ServiceTemplateProvider.java
index 6b3749fc5..8ff0dd102 100644
--- a/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ServiceTemplateProvider.java
+++ b/models/src/main/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ServiceTemplateProvider.java
@@ -34,12 +34,12 @@ import org.onap.policy.models.tosca.authorative.concepts.ToscaNodeType;
import org.onap.policy.models.tosca.authorative.concepts.ToscaProperty;
import org.onap.policy.models.tosca.authorative.concepts.ToscaServiceTemplate;
import org.onap.policy.models.tosca.simple.concepts.JpaToscaServiceTemplate;
-import org.springframework.stereotype.Component;
+import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;
-@Component
-@RequiredArgsConstructor
+@Service
@Transactional
+@RequiredArgsConstructor
public class ServiceTemplateProvider {
private final ToscaServiceTemplateRepository serviceTemplateRepository;
diff --git a/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ControlLoopProviderTest.java b/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ControlLoopProviderTest.java
index 2b472c835..4b8617b3d 100644
--- a/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ControlLoopProviderTest.java
+++ b/models/src/test/java/org/onap/policy/clamp/controlloop/models/controlloop/persistence/provider/ControlLoopProviderTest.java
@@ -209,7 +209,7 @@ class ControlLoopProviderTest {
mock(ToscaNodeTemplateRepository.class), mock(ToscaNodeTemplatesRepository.class));
var toscaServiceTemplate = testControlLoopRead();
controlLoopProvider.deleteInstanceProperties(controlLoopProvider.saveInstanceProperties(toscaServiceTemplate),
- controlLoopProvider.getNodeTemplates(null, null));
+ controlLoopProvider.getAllNodeTemplates());
assertThat(controlLoopProvider.getControlLoops()).isEmpty();
}
@@ -255,7 +255,7 @@ class ControlLoopProviderTest {
.thenReturn(List.of(toscaNodeTemplate0));
// Getting all nodes
- var listNodes = controlLoopProvider.getNodeTemplates(null, null);
+ var listNodes = controlLoopProvider.getAllNodeTemplates();
assertNotNull(listNodes);
assertThat(listNodes).hasSize(2);