import io.lighty.core.controller.api.AbstractLightyModule;
import io.lighty.core.controller.api.LightyServices;
+
+import java.util.Arrays;
+import java.util.List;
+
import org.opendaylight.transportpce.common.crossconnect.CrossConnect;
import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl;
import org.opendaylight.transportpce.common.crossconnect.CrossConnectImpl121;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl121;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl221;
import org.opendaylight.transportpce.common.openroadminterfaces.OpenRoadmInterfacesImpl710;
+import org.opendaylight.transportpce.nbinotifications.impl.NbiNotificationsProvider;
import org.opendaylight.transportpce.networkmodel.NetConfTopologyListener;
import org.opendaylight.transportpce.networkmodel.NetworkModelProvider;
import org.opendaylight.transportpce.networkmodel.NetworkUtilsImpl;
private final TapiProvider tapiProvider;
// service-handler beans
private final ServicehandlerProvider servicehandlerProvider;
+ // nbi-notifications beans
+ private NbiNotificationsProvider nbiNotificationsProvider;
+ /**
+ * List of publisher topics.
+ */
+ private final List<String> publisherTopicList =
+ Arrays.asList("PceListener", "ServiceHandlerOperations", "ServiceHandler", "RendererListener");
- public TransportPCEImpl(LightyServices lightyServices) {
+ public TransportPCEImpl(LightyServices lightyServices, boolean activateNbiNotification) {
LOG.info("Initializing transaction providers ...");
deviceTransactionManager = new DeviceTransactionManagerImpl(lightyServices.getBindingMountPointService(),
MAX_DURATION_TO_SUBMIT_TRANSACTION);
serviceDataStoreOperations, pceListenerImpl, rendererListenerImpl, networkModelListenerImpl,
servicehandler);
tapiProvider = initTapi(lightyServices, servicehandler);
+ if(activateNbiNotification) {
+ LOG.info("Creating nbi-notifications beans ...");
+ nbiNotificationsProvider = new NbiNotificationsProvider(
+ publisherTopicList, null, null, lightyServices.getRpcProviderService(),
+ lightyServices.getNotificationService(), lightyServices.getAdapterContext().currentSerializer());
+ }
}
@Override
servicehandlerProvider.init();
LOG.info("Initializing tapi provider ...");
tapiProvider.init();
+ LOG.info("Initializing nbi-notifications provider ...");
+ nbiNotificationsProvider.init();
LOG.info("Init done.");
return true;
}
@Override
protected boolean stopProcedure() {
+ nbiNotificationsProvider.close();
+ LOG.info("Shutting down nbi-notifications provider ...");
tapiProvider.close();
LOG.info("Shutting down service-handler provider ...");
servicehandlerProvider.close();