X-Git-Url: https://git.opendaylight.org/gerrit/gitweb?a=blobdiff_plain;f=servicehandler%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fservicehandler%2Fimpl%2FServiceHandlerProvider.java;fp=servicehandler%2Fsrc%2Fmain%2Fjava%2Forg%2Fopendaylight%2Ftransportpce%2Fservicehandler%2Fimpl%2FServiceHandlerProvider.java;h=c1c1872756e8d2730a0b4df35c6c490e33d3d54a;hb=b1b3bafd549bb501937cea5c976d5344608b6ed3;hp=223f62960af27a3496f073dbbe5f46229ed5888e;hpb=49ce2e7166b83268dd637ada6ba5421cd08cf2a1;p=transportpce.git diff --git a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServiceHandlerProvider.java b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServiceHandlerProvider.java index 223f62960..c1c187275 100644 --- a/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServiceHandlerProvider.java +++ b/servicehandler/src/main/java/org/opendaylight/transportpce/servicehandler/impl/ServiceHandlerProvider.java @@ -19,7 +19,6 @@ import org.opendaylight.transportpce.servicehandler.listeners.RendererNotificati import org.opendaylight.transportpce.servicehandler.service.ServiceDataStoreOperations; import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.ServiceList; import org.opendaylight.yang.gen.v1.http.org.openroadm.service.rev230526.service.list.Services; -import org.opendaylight.yangtools.concepts.ListenerRegistration; import org.opendaylight.yangtools.concepts.Registration; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; import org.osgi.service.component.annotations.Activate; @@ -39,11 +38,11 @@ import org.slf4j.LoggerFactory; public class ServiceHandlerProvider { private static final Logger LOG = LoggerFactory.getLogger(ServiceHandlerProvider.class); - private static final InstanceIdentifier SERVICE = InstanceIdentifier.builder(ServiceList.class) - .child(Services.class).build(); + private static final InstanceIdentifier SERVICE = InstanceIdentifier.create(ServiceList.class) + .child(Services.class); private final Registration pcelistenerRegistration; - private ListenerRegistration> serviceDataTreeChangeListenerRegistration; + private Registration serviceListListenerRegistration; private final Registration rendererlistenerRegistration; private final Registration networkmodellistenerRegistration; private ServiceDataStoreOperations serviceDataStoreOperations; @@ -64,8 +63,8 @@ public class ServiceHandlerProvider { .registerCompositeListener(rendererNotificationHandler.getCompositeListener()); networkmodellistenerRegistration = notificationService .registerCompositeListener(networkModelNotificationHandler.getCompositeListener()); - serviceDataTreeChangeListenerRegistration = dataBroker.registerDataTreeChangeListener( - DataTreeIdentifier.create(LogicalDatastoreType.OPERATIONAL, SERVICE), serviceListener); + final var serviceListId = DataTreeIdentifier.of(LogicalDatastoreType.OPERATIONAL, SERVICE); + serviceListListenerRegistration = dataBroker.registerTreeChangeListener(serviceListId, serviceListener); LOG.info("ServicehandlerProvider Session Initiated"); LOG.info("Transportpce controller started"); } @@ -77,7 +76,7 @@ public class ServiceHandlerProvider { public void close() { LOG.info("ServicehandlerProvider Closed"); pcelistenerRegistration.close(); - serviceDataTreeChangeListenerRegistration.close(); + serviceListListenerRegistration.close(); rendererlistenerRegistration.close(); networkmodellistenerRegistration.close(); }