package org.opendaylight.transportpce.servicehandler.listeners;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
+import java.util.ArrayList;
import java.util.List;
import java.util.Map;
import org.opendaylight.mdsal.binding.api.NotificationPublishService;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.rev210915.renderer.rpc.result.sp.Link;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.servicehandler.rev201125.ServiceRpcResultSh;
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.servicehandler.rev201125.ServiceRpcResultShBuilder;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev190531.ServiceNotificationTypes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev211210.ServiceNotificationTypes;
import org.opendaylight.yang.gen.v1.http.org.openroadm.common.state.types.rev191129.State;
import org.opendaylight.yang.gen.v1.http.org.openroadm.equipment.states.types.rev191129.AdminStates;
-import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev190531.service.list.Services;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev211210.service.list.Services;
import org.opendaylight.yang.gen.v1.http.transportpce.topology.rev220123.OtnLinkType;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev210813.PublishNotificationProcessService;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev210813.PublishNotificationProcessServiceBuilder;
sendNbiNotification(nbiNotificationBuilder
.setResponseFailed("")
.setMessage("Service implemented !")
- .setOperationalState(org.opendaylight.yang.gen.v1.http
- .org.openroadm.common.state.types.rev181130.State.InService)
+ .setOperationalState(State.InService)
.build());
if (!tempService) {
sendServiceHandlerNotification(notification, ServiceNotificationTypes.ServiceCreateResult);
sendNbiNotification(nbiNotificationBuilder
.setResponseFailed(serviceTemp + "Service status not updated in datastore !")
.setMessage("ServiceCreate request failed ...")
- .setOperationalState(org.opendaylight.yang.gen.v1.http
- .org.openroadm.common.state.types.rev181130.State.OutOfService)
+ .setOperationalState(State.OutOfService)
.build());
}
}
private void updateOtnTopology(RendererRpcResultSp notification, boolean isDeletion) {
Link link = notification.getLink();
- List<String> supportedLinkIds = notification.getLinkId();
- if (link == null && supportedLinkIds == null) {
+ 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: