+
+ /**
+ * Send notification to NBI notification in order to publish message.
+ * @param service PublishNotificationService
+ */
+ private void sendNbiNotification(PublishNotificationProcessService service) {
+ try {
+ notificationPublishService.putNotification(service);
+ } catch (InterruptedException e) {
+ LOG.warn("Cannot send notification to nbi", e);
+ Thread.currentThread().interrupt();
+ }
+ }
+
+
+ private void updateOtnTopology(RendererRpcResultSp notification, boolean isDeletion) {
+ Link link = notification.getLink();
+ if (link == null && notification.getLinkId() == null) {
+ return;
+ }
+ List<String> supportedLinkIds = null;
+ if (notification.getLinkId() != null) {
+ supportedLinkIds = new ArrayList<>(notification.getLinkId());
+ }
+ String serviceType = notification.getServiceType();
+ switch (serviceType) {
+ case StringConstants.SERVICE_TYPE_OTU4:
+ case StringConstants.SERVICE_TYPE_OTUC2:
+ case StringConstants.SERVICE_TYPE_OTUC3:
+ case StringConstants.SERVICE_TYPE_OTUC4:
+ case StringConstants.SERVICE_TYPE_ODU4:
+ case StringConstants.SERVICE_TYPE_ODUC2:
+ case StringConstants.SERVICE_TYPE_ODUC3:
+ case StringConstants.SERVICE_TYPE_ODUC4:
+ Map<String, OtnLinkType> otnLinkTypeMap = Map.of(
+ StringConstants.SERVICE_TYPE_OTU4, OtnLinkType.OTU4,
+ // TODO: need to change it when OtnLinkType is updated with enum
+ StringConstants.SERVICE_TYPE_OTUC2, OtnLinkType.OTUC4,
+ StringConstants.SERVICE_TYPE_OTUC3, OtnLinkType.OTUC4,
+ StringConstants.SERVICE_TYPE_OTUC4, OtnLinkType.OTUC4,
+ StringConstants.SERVICE_TYPE_ODU4, OtnLinkType.ODTU4,
+ // TODO: need to change it when OtnLinkType is updated with enum
+ StringConstants.SERVICE_TYPE_ODUC2, OtnLinkType.ODUC4,
+ StringConstants.SERVICE_TYPE_ODUC3, OtnLinkType.ODUC4,
+ StringConstants.SERVICE_TYPE_ODUC4, OtnLinkType.ODUC4);
+ if (isDeletion) {
+ LOG.info("updating otn-topology removing links");
+ this.networkModelService.deleteOtnLinks(link, supportedLinkIds, otnLinkTypeMap.get(serviceType));
+ } else {
+ LOG.info("updating otn-topology adding links");
+ this.networkModelService.createOtnLinks(link, supportedLinkIds, otnLinkTypeMap.get(serviceType));
+ }
+ break;
+ case StringConstants.SERVICE_TYPE_1GE:
+ case StringConstants.SERVICE_TYPE_10GE:
+ case StringConstants.SERVICE_TYPE_100GE_M:
+ Short tribPort = Short.valueOf(notification.getAToZDirection().getMinTribSlot().getValue()
+ .split("\\.")[0]);
+ Short minTribSlot = Short.valueOf(notification.getAToZDirection().getMinTribSlot().getValue()
+ .split("\\.")[1]);
+ Short maxTribSlot = Short.valueOf(notification.getAToZDirection().getMaxTribSlot().getValue()
+ .split("\\.")[1]);
+ LOG.info("updating otn-topology node tps -tps and tpn pools");
+ this.networkModelService.updateOtnLinks(link, supportedLinkIds,
+ notification.getAToZDirection().getRate(), tribPort, minTribSlot, maxTribSlot, isDeletion);
+ break;
+ case StringConstants.SERVICE_TYPE_100GE_S:
+ this.networkModelService.updateOtnLinks(supportedLinkIds, isDeletion);
+ break;
+ default:
+ LOG.warn("service-type {} not managed yet", serviceType);
+ break;
+ }
+ }
+