* ONAP Portal
* ===================================================================
* Copyright (C) 2017 AT&T Intellectual Property. All rights reserved.
+ *
+ *
+ * Modifications Copyright © 2018 IBM.
* ===================================================================
*
* Unless otherwise specified, all software contained herein is licensed
*/
package org.onap.portalapp.config;
-import java.util.Timer;
-import java.util.TimerTask;
-
-import javax.annotation.PostConstruct;
-
-import org.springframework.beans.BeansException;
import org.springframework.context.ApplicationContext;
import org.springframework.context.ApplicationContextAware;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import javax.annotation.PostConstruct;
+import java.util.Timer;
+import java.util.TimerTask;
+
@Configuration
public class NotificationCleanupConfig implements ApplicationContextAware {
// Once every 10 minutes should be adequate
- public final static int CLEANUP_PERIOD_MINUTES = 10;
+ public static final int CLEANUP_PERIOD_MINUTES = 10;
private static ApplicationContext applicationContext;
- public void setApplicationContext(ApplicationContext context) throws BeansException {
+ public void setApplicationContext(ApplicationContext context) {
applicationContext = context;
}
public void StartSchedular() {
TimerTask task = new NotificationCleanup();
Timer timer = new Timer();
- timer.schedule(task, 1000, CLEANUP_PERIOD_MINUTES * 60 * 1000);
+ timer.schedule(task, 1000, (long) CLEANUP_PERIOD_MINUTES * 60 * 1000);
}
@Bean