aboutsummaryrefslogtreecommitdiffstats
path: root/app/src/main/java/org/onap/portal/history/configuration
diff options
context:
space:
mode:
Diffstat (limited to 'app/src/main/java/org/onap/portal/history/configuration')
-rw-r--r--app/src/main/java/org/onap/portal/history/configuration/HistoryConfig.java (renamed from app/src/main/java/org/onap/portal/history/configuration/PortalHistoryConfig.java)4
-rw-r--r--app/src/main/java/org/onap/portal/history/configuration/SchedulerConfig.java11
2 files changed, 7 insertions, 8 deletions
diff --git a/app/src/main/java/org/onap/portal/history/configuration/PortalHistoryConfig.java b/app/src/main/java/org/onap/portal/history/configuration/HistoryConfig.java
index 9a42214..f70a9d4 100644
--- a/app/src/main/java/org/onap/portal/history/configuration/PortalHistoryConfig.java
+++ b/app/src/main/java/org/onap/portal/history/configuration/HistoryConfig.java
@@ -27,8 +27,8 @@ import org.springframework.boot.context.properties.ConfigurationProperties;
import jakarta.validation.constraints.NotBlank;
@Data
-@ConfigurationProperties("portal-history")
-public class PortalHistoryConfig {
+@ConfigurationProperties("history")
+public class HistoryConfig {
@NotBlank
private final Integer saveInterval;
diff --git a/app/src/main/java/org/onap/portal/history/configuration/SchedulerConfig.java b/app/src/main/java/org/onap/portal/history/configuration/SchedulerConfig.java
index 2295a5f..88531af 100644
--- a/app/src/main/java/org/onap/portal/history/configuration/SchedulerConfig.java
+++ b/app/src/main/java/org/onap/portal/history/configuration/SchedulerConfig.java
@@ -23,7 +23,6 @@ package org.onap.portal.history.configuration;
import org.onap.portal.history.services.ActionsService;
import lombok.extern.slf4j.Slf4j;
-import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.scheduling.annotation.EnableScheduling;
import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;
@@ -34,20 +33,20 @@ import org.springframework.stereotype.Component;
public class SchedulerConfig {
private final ActionsService actionsService;
- private final PortalHistoryConfig portalHistoryConfig;
+ private final HistoryConfig historyConfig;
- public SchedulerConfig(ActionsService actionsService, PortalHistoryConfig portalHistoryConfig){
+ public SchedulerConfig(ActionsService actionsService, HistoryConfig historyConfig){
this.actionsService = actionsService;
- this.portalHistoryConfig = portalHistoryConfig;
+ this.historyConfig = historyConfig;
}
/**
* This method will be trigger by Spring Boot scheduler.
* The cron execution time is configured in the application properties as well as the save interval.
*/
- @Scheduled(cron="${portal-history.delete-interval}")
+ @Scheduled(cron="${history.delete-interval}")
public void runDeleteActions(){
- actionsService.deleteActions(portalHistoryConfig.getSaveInterval());
+ actionsService.deleteActions(historyConfig.getSaveInterval());
log.info("Delete actions in scheduled job");
}
}