Code Review
/
transportpce.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
review
|
tree
raw
|
inline
| side by side
Adapt TransportPCE code to Sulfur
[transportpce.git]
/
servicehandler
/
src
/
main
/
java
/
org
/
opendaylight
/
transportpce
/
servicehandler
/
listeners
/
RendererListenerImpl.java
diff --git
a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/listeners/RendererListenerImpl.java
b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/listeners/RendererListenerImpl.java
index 50272fa418c5a6c12f36e4ced50bde6c8d6d23db..a30c7d2378cffc7656ea27af9c952b044cbecdea 100644
(file)
--- a/
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/listeners/RendererListenerImpl.java
+++ b/
servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/listeners/RendererListenerImpl.java
@@
-8,6
+8,7
@@
package org.opendaylight.transportpce.servicehandler.listeners;
import edu.umd.cs.findbugs.annotations.SuppressFBWarnings;
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 java.util.List;
import java.util.Map;
import org.opendaylight.mdsal.binding.api.NotificationPublishService;
@@
-23,11
+24,11
@@
import org.opendaylight.yang.gen.v1.http.org.opendaylight.transportpce.renderer.
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.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.rev
190531
.ServiceNotificationTypes;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.common.service.types.rev
211210
.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.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.rev
190531
.service.list.Services;
-import org.opendaylight.yang.gen.v1.http.transportpce.topology.rev2
10511
.OtnLinkType;
+import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev
211210
.service.list.Services;
+import org.opendaylight.yang.gen.v1.http.transportpce.topology.rev2
20123
.OtnLinkType;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev210813.PublishNotificationProcessService;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev210813.PublishNotificationProcessServiceBuilder;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev210813.notification.process.service.ServiceAEndBuilder;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev210813.PublishNotificationProcessService;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev210813.PublishNotificationProcessServiceBuilder;
import org.opendaylight.yang.gen.v1.nbi.notifications.rev210813.notification.process.service.ServiceAEndBuilder;
@@
-183,8
+184,7
@@
public class RendererListenerImpl implements TransportpceRendererListener {
sendNbiNotification(nbiNotificationBuilder
.setResponseFailed("")
.setMessage("Service implemented !")
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);
.build());
if (!tempService) {
sendServiceHandlerNotification(notification, ServiceNotificationTypes.ServiceCreateResult);
@@
-194,8
+194,7
@@
public class RendererListenerImpl implements TransportpceRendererListener {
sendNbiNotification(nbiNotificationBuilder
.setResponseFailed(serviceTemp + "Service status not updated in datastore !")
.setMessage("ServiceCreate request failed ...")
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());
}
}
.build());
}
}
@@
-303,21
+302,33
@@
public class RendererListenerImpl implements TransportpceRendererListener {
private void updateOtnTopology(RendererRpcResultSp notification, boolean isDeletion) {
Link link = notification.getLink();
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;
}
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:
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_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,
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,
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");
StringConstants.SERVICE_TYPE_ODUC4, OtnLinkType.ODUC4);
if (isDeletion) {
LOG.info("updating otn-topology removing links");