diff options
author | rameshiyer27 <ramesh.murugan.iyer@est.tech> | 2021-06-15 18:22:04 +0100 |
---|---|---|
committer | rameshiyer27 <ramesh.murugan.iyer@est.tech> | 2021-06-16 11:03:26 +0100 |
commit | 43fb6c9a683efb014c40d5736419cb0085556642 (patch) | |
tree | 0777ca250d3c2d0af417d29e46e7c5840b3bd429 /models/src | |
parent | 399e86d983057304673f701a22b172a69d5aa7dc (diff) |
Fix CLAMP build failure and kub-participant module startup issue.
Initialising ParticipantK8sParameters in the constructor to fix Null pointer Exception in kub-participant module.
Constructor cannot use autowired properties.
Updated pfDao getFiltered method signature to align with latest code in policy models.
Issue-ID: POLICY-3240
Signed-off-by: zrrmmua <ramesh.murugan.iyer@est.tech>
Change-Id: I9405c1e050b31b153ee53829ffece9f4be27818e
Diffstat (limited to 'models/src')
2 files changed, 30 insertions, 4 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 dacde8e79..00eab8f69 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 @@ -30,6 +30,7 @@ import org.onap.policy.clamp.controlloop.models.controlloop.concepts.ClElementSt import org.onap.policy.clamp.controlloop.models.controlloop.persistence.concepts.JpaClElementStatistics; import org.onap.policy.models.base.PfModelException; import org.onap.policy.models.base.PfReferenceTimestampKey; +import org.onap.policy.models.dao.PfFilterParameters; import org.onap.policy.models.provider.PolicyModelsProviderParameters; import org.onap.policy.models.provider.impl.AbstractModelsProvider; @@ -130,7 +131,19 @@ public class ClElementStatisticsProvider extends AbstractModelsProvider { public List<ClElementStatistics> getFilteredClElementStatistics(final String name, final String version, final Instant startTimeStamp, final Instant endTimeStamp, Map<String, Object> filterMap, final String sortOrder, final int getRecordNum) { - return asClElementStatisticsList(getPfDao().getFiltered(JpaClElementStatistics.class, name, version, - startTimeStamp, endTimeStamp, filterMap, sortOrder, getRecordNum)); + + // @formatter:off + PfFilterParameters filterParams = PfFilterParameters + .builder() + .name(name) + .version(version) + .startTime(startTimeStamp) + .endTime(endTimeStamp) + .filterMap(filterMap) + .sortOrder(sortOrder) + .recordNum(getRecordNum) + .build(); + // @formatter:on + return asClElementStatisticsList(getPfDao().getFiltered(JpaClElementStatistics.class, filterParams)); } } 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 4ea76ff4b..137af3a5e 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 @@ -30,6 +30,7 @@ import org.onap.policy.clamp.controlloop.models.controlloop.concepts.Participant import org.onap.policy.clamp.controlloop.models.controlloop.persistence.concepts.JpaParticipantStatistics; import org.onap.policy.models.base.PfModelException; import org.onap.policy.models.base.PfTimestampKey; +import org.onap.policy.models.dao.PfFilterParameters; import org.onap.policy.models.provider.PolicyModelsProviderParameters; import org.onap.policy.models.provider.impl.AbstractModelsProvider; @@ -87,8 +88,20 @@ public class ParticipantStatisticsProvider extends AbstractModelsProvider { final Instant startTimeStamp, final Instant endTimeStamp, Map<String, Object> filterMap, final String sortOrder, final int getRecordNum) { - return asParticipantStatisticsList(getPfDao().getFiltered(JpaParticipantStatistics.class, name, version, - startTimeStamp, endTimeStamp, filterMap, sortOrder, getRecordNum)); + // @formatter:off + PfFilterParameters filterParams = PfFilterParameters + .builder() + .name(name) + .version(version) + .startTime(startTimeStamp) + .endTime(endTimeStamp) + .filterMap(filterMap) + .sortOrder(sortOrder) + .recordNum(getRecordNum) + .build(); + // @formatter:on + + return asParticipantStatisticsList(getPfDao().getFiltered(JpaParticipantStatistics.class, filterParams)); } |