diff options
Diffstat (limited to 'sdnr/wt/devicemanager-onap/onf12/provider/src')
2 files changed, 25 insertions, 16 deletions
diff --git a/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/ONFCoreNetworkElementFactory.java b/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/ONFCoreNetworkElementFactory.java index 06558ad5a..b0125f4f0 100644 --- a/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/ONFCoreNetworkElementFactory.java +++ b/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/ONFCoreNetworkElementFactory.java @@ -61,19 +61,24 @@ public class ONFCoreNetworkElementFactory implements NetworkElementFactory { if (capabilities.isSupportingNamespaceAndRevision(NetworkElement.QNAME)) { OnfMicrowaveModel onfMicrowaveModel = null; Optional<NetconfBindingAccessor> bindingAccessor = accessor.getNetconfBindingAccessor(); - if (capabilities.isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev170324.QNAME)) { - onfMicrowaveModel = new WrapperMicrowaveModelRev170324(bindingAccessor.get(), serviceProvider); - } else if (capabilities.isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev180907.QNAME)) { - onfMicrowaveModel = new WrapperMicrowaveModelRev180907(bindingAccessor.get(), serviceProvider); - } else if (capabilities.isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev181010.QNAME)) { - onfMicrowaveModel = new WrapperMicrowaveModelRev181010(bindingAccessor.get(), serviceProvider); - } + if (bindingAccessor.isPresent()) { + if (capabilities.isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev170324.QNAME)) { + onfMicrowaveModel = new WrapperMicrowaveModelRev170324(bindingAccessor.get(), serviceProvider); + } else if (capabilities.isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev180907.QNAME)) { + onfMicrowaveModel = new WrapperMicrowaveModelRev180907(bindingAccessor.get(), serviceProvider); + } else if (capabilities.isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev181010.QNAME)) { + onfMicrowaveModel = new WrapperMicrowaveModelRev181010(bindingAccessor.get(), serviceProvider); + } - if (onfMicrowaveModel != null) { - return Optional.of(new ONFCoreNetworkElement12Microwave(bindingAccessor.get(), serviceProvider, configuration, - onfMicrowaveModel)); + if (onfMicrowaveModel != null) { + return Optional.of(new ONFCoreNetworkElement12Microwave(bindingAccessor.get(), serviceProvider, + configuration, onfMicrowaveModel)); + } else { + return Optional.of( + new ONFCoreNetworkElement12Basic(bindingAccessor.get(), serviceProvider, configuration)); + } } else { - return Optional.of(new ONFCoreNetworkElement12Basic(bindingAccessor.get(), serviceProvider, configuration)); + log.error("Netconf Bindingaccessor is not present. This is a fatal issue and needs to be corrected for devicemanagers to work correctly."); } } diff --git a/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java b/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java index 836f36214..736fd4742 100644 --- a/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java +++ b/sdnr/wt/devicemanager-onap/onf12/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java @@ -380,11 +380,15 @@ public class ONFCoreNetworkElement12Microwave extends ONFCoreNetworkElement12Bas LOG.info("Begin registration listener for Mountpoint"); final Optional<NotificationService> optionalNotificationService = mountPoint.getService(NotificationService.class); - final NotificationService notificationService = optionalNotificationService.get(); - // notificationService.registerNotificationListener(microwaveEventListener); - listenerRegistrationresult = - notificationService.registerNotificationListener(microwaveModel.getNotificationListener()); - LOG.info("End registration listener for Mountpoint Result: {}", listenerRegistrationresult); + if (optionalNotificationService.isPresent()) { + final NotificationService notificationService = optionalNotificationService.get(); + // notificationService.registerNotificationListener(microwaveEventListener); + listenerRegistrationresult = + notificationService.registerNotificationListener(microwaveModel.getNotificationListener()); + LOG.info("End registration listener for Mountpoint Result: {}", listenerRegistrationresult); + } else { + LOG.error("Could not get NotificationService, hence microwave notification listener not registered"); + } } /*------------------------------------------------------------ |