1 package org.opendaylight.mwtn.performancemanager.impl;
3 import javax.annotation.Nullable;
5 import org.opendaylight.mwtn.base.netconf.ONFCoreNetworkElementRepresentation;
6 import org.opendaylight.mwtn.performancemanager.impl.database.service.MicrowaveHistoricalPerformanceWriterService;
7 import org.slf4j.Logger;
8 import org.slf4j.LoggerFactory;
10 public class PerformanceManagerImpl implements AutoCloseable {
12 private static final Logger LOG = LoggerFactory.getLogger(PerformanceManagerImpl.class);
14 private @Nullable PerformanceManagerTask task;
16 public PerformanceManagerImpl(long seconds, MicrowaveHistoricalPerformanceWriterService databaseService) {
18 LOG.info("Construct begin {} with {} Seconds",PerformanceManagerImpl.class.getSimpleName(), seconds);
20 if (MicrowaveHistoricalPerformanceWriterService.isAvailable(databaseService)) {
22 LOG.info("Do start of PM task");
23 task = new PerformanceManagerTask(seconds, databaseService);
25 LOG.info("PM task scheduled");
28 LOG.info("Database not available. Do not start PM task");
31 LOG.info("Construct end {}",PerformanceManagerImpl.class.getSimpleName());
35 LOG.info("Close {}", PerformanceManagerImpl.class.getSimpleName());
41 public void registration(String mountPointNodeName, ONFCoreNetworkElementRepresentation ne) {
42 LOG.debug("Register {}",mountPointNodeName);
44 task.registration(mountPointNodeName, ne);
47 public void deRegistration(String mountPointNodeName) {
48 LOG.debug("Deregister {}",mountPointNodeName);
50 task.deRegistration(mountPointNodeName);