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;
import org.opendaylight.transportpce.renderer.RendererProvider;
import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterface121;
import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterface221;
+import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterface710;
import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmInterfaceFactory;
// Adding OTN interface
import org.opendaylight.transportpce.renderer.openroadminterface.OpenRoadmOtnInterface221;
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);
RequestProcessor requestProcessor = new RequestProcessor(lightyServices.getBindingDataBroker());
networkTransaction = new NetworkTransactionImpl(requestProcessor);
- LOG.info("Creating PCE beans ...");
- // TODO: pass those parameters through command line
- GnpyConsumer gnpyConsumer = new GnpyConsumerImpl("http://127.0.0.1:8008",
- "gnpy", "gnpy", lightyServices.getAdapterContext().currentSerializer());
- PathComputationService pathComputationService = new PathComputationServiceImpl(
- networkTransaction,
- lightyServices.getBindingNotificationPublishService(),
- gnpyConsumer
- );
- pceProvider = new PceProvider(lightyServices.getRpcProviderService(), pathComputationService);
-
LOG.info("Creating network-model beans ...");
R2RLinkDiscovery linkDiscoveryImpl = new R2RLinkDiscovery(lightyServices.getBindingDataBroker(),
deviceTransactionManager, networkTransaction);
lightyServices.getRpcProviderService(), networkutilsServiceImpl, netConfTopologyListener,
lightyServices.getNotificationService(), networkModelWavelengthService);
+ LOG.info("Creating PCE beans ...");
+ // TODO: pass those parameters through command line
+ GnpyConsumer gnpyConsumer = new GnpyConsumerImpl("http://127.0.0.1:8008",
+ "gnpy", "gnpy", lightyServices.getAdapterContext().currentSerializer());
+ PathComputationService pathComputationService = new PathComputationServiceImpl(
+ networkTransaction,
+ lightyServices.getBindingNotificationPublishService(),
+ gnpyConsumer,
+ portMapping
+ );
+ pceProvider = new PceProvider(lightyServices.getRpcProviderService(), pathComputationService);
+
LOG.info("Creating OLM beans ...");
CrossConnect crossConnect = initCrossConnect(mappingUtils);
PowerMgmt powerMgmt = new PowerMgmtImpl(lightyServices.getBindingDataBroker(), openRoadmInterfaces,
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();
OpenRoadmInterfaces openRoadmInterfaces, PortMapping portMapping) {
OpenRoadmInterface121 openRoadmInterface121 = new OpenRoadmInterface121(portMapping, openRoadmInterfaces);
OpenRoadmInterface221 openRoadmInterface221 = new OpenRoadmInterface221(portMapping, openRoadmInterfaces);
+ OpenRoadmInterface710 openRoadmInterface710 = new OpenRoadmInterface710(portMapping, openRoadmInterfaces);
OpenRoadmOtnInterface221 openRoadmOtnInterface221 = new OpenRoadmOtnInterface221(portMapping,
openRoadmInterfaces);
return new OpenRoadmInterfaceFactory(mappingUtils, openRoadmInterface121, openRoadmInterface221,
- openRoadmOtnInterface221);
+ openRoadmInterface710, openRoadmOtnInterface221);
}
/**