summaryrefslogtreecommitdiffstats
path: root/ecomp-portal-BE-common/src
diff options
context:
space:
mode:
authorDominik Mizyn <d.mizyn@samsung.com>2019-07-16 10:48:10 +0200
committerDominik Mizyn <d.mizyn@samsung.com>2019-07-16 10:48:20 +0200
commit55e5a4959170392857aa8ad95e50a49488f2d409 (patch)
tree5eeb1171961cc4cc9488eaf727e291db6fbd51d4 /ecomp-portal-BE-common/src
parent73248465fc2867a3dd1a6494afb6b0774c9028f2 (diff)
NotificationCleanupConfig class fix
Sonar errors fix in NotificationCleanupConfig class Issue-ID: PORTAL-663 Change-Id: I8b5f5e9c024fe0c11240367c7154cafd7d885e4a Signed-off-by: Dominik Mizyn <d.mizyn@samsung.com>
Diffstat (limited to 'ecomp-portal-BE-common/src')
-rw-r--r--ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/NotificationCleanupConfig.java18
1 files changed, 10 insertions, 8 deletions
diff --git a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/NotificationCleanupConfig.java b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/NotificationCleanupConfig.java
index f18dea93..c32650e2 100644
--- a/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/NotificationCleanupConfig.java
+++ b/ecomp-portal-BE-common/src/main/java/org/onap/portalapp/config/NotificationCleanupConfig.java
@@ -40,6 +40,7 @@
*/
package org.onap.portalapp.config;
+import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Bean;
@@ -51,23 +52,25 @@ import java.util.TimerTask;
@Configuration
public class NotificationCleanupConfig implements ApplicationContextAware {
-
+
// Once every 10 minutes should be adequate
- public static final int CLEANUP_PERIOD_MINUTES = 10;
-
+ private static final int CLEANUP_PERIOD_MINUTES = 10;
+
private static ApplicationContext applicationContext;
- public void setApplicationContext(ApplicationContext context) {
- applicationContext = context;
+
+ @Override
+ public void setApplicationContext(ApplicationContext applicationContext) throws BeansException {
+ NotificationCleanupConfig.applicationContext = applicationContext;
}
- public static ApplicationContext getApplicationContext() {
+ static ApplicationContext getApplicationContext() {
return applicationContext;
}
@PostConstruct
- public void StartSchedular() {
+ public void startSchedular() {
TimerTask task = new NotificationCleanup();
Timer timer = new Timer();
timer.schedule(task, 1000, (long) CLEANUP_PERIOD_MINUTES * 60 * 1000);
@@ -77,5 +80,4 @@ public class NotificationCleanupConfig implements ApplicationContextAware {
public NotificationCleanupConfig getConfig() {
return new NotificationCleanupConfig();
}
-
} \ No newline at end of file