diff options
Diffstat (limited to 'sdnr/wt/devicemanager-onf/provider/src')
20 files changed, 90 insertions, 101 deletions
diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/WrapperPTPModelRev170208.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/WrapperPTPModelRev170208.java index f1ddbe73c..a0813eee6 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/WrapperPTPModelRev170208.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/WrapperPTPModelRev170208.java @@ -22,6 +22,7 @@ import org.eclipse.jdt.annotation.Nullable; import org.onap.ccsdk.features.sdnr.wt.common.YangHelper; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ptp.dataset.rev170208.InstanceList; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.ptp.dataset.rev170208.InstanceListKey; @@ -47,7 +48,7 @@ public class WrapperPTPModelRev170208 { * Query synchronization information out of NE */ - public static void initSynchronizationExtension(NetconfAccessor acessor) { + public static void initSynchronizationExtension(NetconfBindingAccessor acessor) { String mountPointNodeName = acessor.getNodeId().getValue(); Capabilities capabilities = acessor.getCapabilites(); @@ -93,7 +94,7 @@ public class WrapperPTPModelRev170208 { } @Nullable - private static InstanceList readPTPClockInstances(NetconfAccessor acessor) { + private static InstanceList readPTPClockInstances(NetconfBindingAccessor acessor) { return acessor.getTransactionUtils().readData(acessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL, PTPINSTANCES_IID); } diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ONFCoreNetworkElement12Equipment.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ONFCoreNetworkElement12Equipment.java index f32acb46e..0c51c5ebc 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ONFCoreNetworkElement12Equipment.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ONFCoreNetworkElement12Equipment.java @@ -30,6 +30,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.EquipmentData; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.InventoryInformationDcae; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.Equipment; @@ -56,18 +57,18 @@ public class ONFCoreNetworkElement12Equipment { private final NetworkElementCoreData coreData; private final @Nullable OnfInterfacePac equipmentPac; - private final NetconfAccessor acessor; + private final NetconfBindingAccessor acessor; private final ValueNameList extensionList; private final @NonNull List<UniversalId> topLevelEqUuidList; private final @NonNull FaultData globalProblemList; private final @NonNull List<ExtendedEquipment> globalEquipmentList; - public ONFCoreNetworkElement12Equipment(NetconfAccessor acessor, NetworkElementCoreData coreData) { + public ONFCoreNetworkElement12Equipment(NetconfBindingAccessor acessor, NetworkElementCoreData coreData) { this(acessor, coreData, false); } - public ONFCoreNetworkElement12Equipment(NetconfAccessor acessor, NetworkElementCoreData coreData, + public ONFCoreNetworkElement12Equipment(NetconfBindingAccessor acessor, NetworkElementCoreData coreData, Boolean disabled) { LOG.debug("Initialize class: {} " + ONFCoreNetworkElement12Equipment.class.getName()); this.acessor = acessor; diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/WrapperEquipmentPacRev170402.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/WrapperEquipmentPacRev170402.java index c93c80f4f..d0b4cc51a 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/WrapperEquipmentPacRev170402.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/WrapperEquipmentPacRev170402.java @@ -25,6 +25,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.OnfInterfacePac; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.WrapperMicrowaveModelRev181010; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId; @@ -42,10 +43,10 @@ public class WrapperEquipmentPacRev170402 implements OnfInterfacePac { private static final Logger LOG = LoggerFactory.getLogger(WrapperEquipmentPacRev170402.class); public static final QName QNAME = EquipmentPac.QNAME; - private final NetconfAccessor acessor; + private final NetconfBindingAccessor acessor; - public WrapperEquipmentPacRev170402(NetconfAccessor acessor) { + public WrapperEquipmentPacRev170402(NetconfBindingAccessor acessor) { this.acessor = acessor; } diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev170324.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev170324.java index ff23dfe2b..12c8b540a 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev170324.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev170324.java @@ -34,6 +34,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NotificationService import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.PerformanceDataLtp; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId; @@ -88,7 +89,7 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw private final NotificationService microwaveModelListener; - private final NetconfAccessor acessor; + private final NetconfBindingAccessor acessor; private final TransactionUtils genericTransactionUtils; private final FaultService faultService; @@ -97,7 +98,7 @@ public class WrapperMicrowaveModelRev170324 implements OnfMicrowaveModel, Microw /** * @param acessor to access device */ - public WrapperMicrowaveModelRev170324(@NonNull NetconfAccessor acessor, + public WrapperMicrowaveModelRev170324(@NonNull NetconfBindingAccessor acessor, @NonNull DeviceManagerServiceProvider serviceProvider) { this.acessor = acessor; this.genericTransactionUtils = acessor.getTransactionUtils(); diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev180907.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev180907.java index 4402b86b6..653a786f0 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev180907.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev180907.java @@ -34,6 +34,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NotificationService import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.PerformanceDataLtp; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId; @@ -88,7 +89,7 @@ public class WrapperMicrowaveModelRev180907 implements OnfMicrowaveModel, Microw private final NotificationService microwaveModelListener; - private final NetconfAccessor acessor; + private final NetconfBindingAccessor acessor; private final TransactionUtils genericTransactionUtil; private final String mountpointId; private final @NonNull FaultService faultService; @@ -102,7 +103,7 @@ public class WrapperMicrowaveModelRev180907 implements OnfMicrowaveModel, Microw * @param acessor to access device * @param serviceProvider for devicemanager services */ - public WrapperMicrowaveModelRev180907(@NonNull NetconfAccessor acessor, + public WrapperMicrowaveModelRev180907(@NonNull NetconfBindingAccessor acessor, @NonNull DeviceManagerServiceProvider serviceProvider) { this.acessor = acessor; this.mountpointId = acessor.getNodeId().getValue(); diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev181010.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev181010.java index 299ed14f0..a1f71c586 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev181010.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/WrapperMicrowaveModelRev181010.java @@ -34,6 +34,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NotificationService import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.PerformanceDataLtp; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId; @@ -87,7 +88,7 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw public static final QName QNAME = MwAirInterfacePac.QNAME; - private final NetconfAccessor acessor; + private final NetconfBindingAccessor acessor; private final NotificationService microwaveModelListener; private final TransactionUtils genericTransactionUtils; private final String mountpointId; @@ -101,7 +102,7 @@ public class WrapperMicrowaveModelRev181010 implements OnfMicrowaveModel, Microw * @param acessor to access device * @param serviceProvider for devicemanager services */ - public WrapperMicrowaveModelRev181010(@NonNull NetconfAccessor acessor, + public WrapperMicrowaveModelRev181010(@NonNull NetconfBindingAccessor acessor, @NonNull DeviceManagerServiceProvider serviceProvider) { this.acessor = acessor; this.genericTransactionUtils = acessor.getTransactionUtils(); diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/DeviceManagerOnfImpl.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/DeviceManagerOnfImpl.java index b4900b599..10ee24201 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/DeviceManagerOnfImpl.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/DeviceManagerOnfImpl.java @@ -52,7 +52,7 @@ public class DeviceManagerOnfImpl implements AutoCloseable { configuration = new DeviceManagerOnfConfiguration( netconfNetworkElementService.getServiceProvider().getConfigurationFileRepresentation()); resOnf = netconfNetworkElementService - .registerNetworkElementFactory(new ONFCoreNetworkElementFactory(configuration)); + .registerBindingNetworkElementFactory(new ONFCoreNetworkElementFactory(configuration)); netconfNetworkElementService.writeToEventLog(APPLICATIONNAME, "startup", "done"); diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/ONFCoreNetworkElementFactory.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/ONFCoreNetworkElementFactory.java index bcfc3e0e4..06558ad5a 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/ONFCoreNetworkElementFactory.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/ONFCoreNetworkElementFactory.java @@ -29,6 +29,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ne.ONFCoreNetworkElemen import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.NetworkElement; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -51,28 +52,28 @@ public class ONFCoreNetworkElementFactory implements NetworkElementFactory { @Override public Optional<org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElement> create( - @NonNull NetconfAccessor acessor, @NonNull DeviceManagerServiceProvider serviceProvider) { + @NonNull NetconfAccessor accessor, @NonNull DeviceManagerServiceProvider serviceProvider) { - log.info("Enter factory {}", ONFCoreNetworkElementFactory.class.getName(), acessor.getNodeId()); + log.info("Enter factory {}", ONFCoreNetworkElementFactory.class.getName(), accessor.getNodeId()); - Capabilities capabilities = acessor.getCapabilites(); + Capabilities capabilities = accessor.getCapabilites(); if (capabilities.isSupportingNamespaceAndRevision(NetworkElement.QNAME)) { OnfMicrowaveModel onfMicrowaveModel = null; - + Optional<NetconfBindingAccessor> bindingAccessor = accessor.getNetconfBindingAccessor(); if (capabilities.isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev170324.QNAME)) { - onfMicrowaveModel = new WrapperMicrowaveModelRev170324(acessor, serviceProvider); + onfMicrowaveModel = new WrapperMicrowaveModelRev170324(bindingAccessor.get(), serviceProvider); } else if (capabilities.isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev180907.QNAME)) { - onfMicrowaveModel = new WrapperMicrowaveModelRev180907(acessor, serviceProvider); + onfMicrowaveModel = new WrapperMicrowaveModelRev180907(bindingAccessor.get(), serviceProvider); } else if (capabilities.isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev181010.QNAME)) { - onfMicrowaveModel = new WrapperMicrowaveModelRev181010(acessor, serviceProvider); + onfMicrowaveModel = new WrapperMicrowaveModelRev181010(bindingAccessor.get(), serviceProvider); } if (onfMicrowaveModel != null) { - return Optional.of(new ONFCoreNetworkElement12Microwave(acessor, serviceProvider, configuration, + return Optional.of(new ONFCoreNetworkElement12Microwave(bindingAccessor.get(), serviceProvider, configuration, onfMicrowaveModel)); } else { - return Optional.of(new ONFCoreNetworkElement12Basic(acessor, serviceProvider, configuration)); + return Optional.of(new ONFCoreNetworkElement12Basic(bindingAccessor.get(), serviceProvider, configuration)); } } diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Base.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Base.java index 30897da1d..af2b2405b 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Base.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Base.java @@ -37,6 +37,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.InventoryInformationDcae; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.PerformanceDataLtp; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; import org.opendaylight.mdsal.binding.api.MountPoint; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.NetworkElement; @@ -98,7 +99,7 @@ public abstract class ONFCoreNetworkElement12Base extends ONFCoreNetworkElementB * Constructor */ - protected ONFCoreNetworkElement12Base(@NonNull NetconfAccessor acessor) { + protected ONFCoreNetworkElement12Base(@NonNull NetconfBindingAccessor acessor) { super(acessor); this.optionalNe = Optional.empty(); this.nodeId = getAcessor().get().getNodeId(); diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java index f48eb60fe..3c6140d82 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Basic.java @@ -30,6 +30,8 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.PerformanceManager; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfNotifications; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementConnectionBuilder; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.NetworkElementDeviceType; @@ -66,8 +68,10 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base { private final @NonNull String mountPointNodeName; - private final @NonNull NetconfAccessor acessor; + private final @NonNull NetconfBindingAccessor acessor; private final @NonNull DeviceManagerOnfConfiguration pollAlarmConfig; + + private final NetconfNotifications notificationAccessor; /*----------------------------------------------------------------------------- * Construction @@ -79,7 +83,7 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base { * @param acessor to manage device connection * @param serviceProvider to get devicemanager services */ - public ONFCoreNetworkElement12Basic(@NonNull NetconfAccessor acessor, + public ONFCoreNetworkElement12Basic(@NonNull NetconfBindingAccessor acessor, @NonNull DeviceManagerServiceProvider serviceProvider, DeviceManagerOnfConfiguration configuration) { super(acessor); @@ -95,6 +99,7 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base { this.eventListenerHandler = serviceProvider.getEventHandlingService(); this.dataProvider = serviceProvider.getDataProvider(); + this.notificationAccessor = acessor.getNotificationAccessor().get(); } @@ -202,7 +207,7 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base { doRegisterEventListener(acessor.getMountpoint()); // Register netconf stream - acessor.registerNotificationsStream(NetconfAccessor.DefaultNotificationsStream); + notificationAccessor.registerNotificationsStream(NetconfAccessor.DefaultNotificationsStream); // Set core-model revision value in "core-model-capability" field setCoreModel(acessor.getNetconfNode()); diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java index 3ae2724e7..6cd6c949a 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElement12Microwave.java @@ -34,6 +34,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.PerformanceDataLtp; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; import org.opendaylight.mdsal.binding.api.MountPoint; import org.opendaylight.mdsal.binding.api.NotificationService; import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId; @@ -82,7 +83,7 @@ public class ONFCoreNetworkElement12Microwave extends ONFCoreNetworkElement12Bas * @param serviceProvider to get services * @param onfMicrowaveModel handling ofmicrosoft model data */ - public ONFCoreNetworkElement12Microwave(@NonNull NetconfAccessor acessor, + public ONFCoreNetworkElement12Microwave(@NonNull NetconfBindingAccessor acessor, @NonNull DeviceManagerServiceProvider serviceProvider, DeviceManagerOnfConfiguration configuration, OnfMicrowaveModel onfMicrowaveModel) { diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElementBase.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElementBase.java index deacab8f2..318741dd9 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElementBase.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/ONFCoreNetworkElementBase.java @@ -23,6 +23,7 @@ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ne; import java.util.Optional; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ONFCoreNetworkElementRepresentation; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.opendaylight.mdsal.binding.api.DataBroker; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; @@ -42,9 +43,9 @@ public abstract class ONFCoreNetworkElementBase implements AutoCloseable, ONFCor private final String mountPointNodeName; private final NodeId nodeId; private final DataBroker netconfNodeDataBroker; - private final NetconfAccessor acessor; + private final NetconfBindingAccessor acessor; - protected ONFCoreNetworkElementBase(NetconfAccessor acessor) { + protected ONFCoreNetworkElementBase(NetconfBindingAccessor acessor) { LOG.info("Create ONFCoreNetworkElementBase"); this.mountPointNodeName = acessor.getNodeId().getValue(); this.nodeId = acessor.getNodeId(); diff --git a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/test/TestONFCoreNetworkElement12Equipment.java b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/test/TestONFCoreNetworkElement12Equipment.java index 095446f0b..30cd7647a 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/test/TestONFCoreNetworkElement12Equipment.java +++ b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/test/TestONFCoreNetworkElement12Equipment.java @@ -32,7 +32,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.equipment.ONFCore import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.equipment.WrapperEquipmentPacRev170402; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities; -import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.opendaylight.mdsal.binding.api.DataBroker; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; @@ -45,7 +45,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class TestONFCoreNetworkElement12Equipment { - NetconfAccessor netconfAccessor; + NetconfBindingAccessor netconfAccessor; Capabilities capabilities; NetworkElementCoreData coreData; FaultData faultData; @@ -57,7 +57,7 @@ public class TestONFCoreNetworkElement12Equipment { @Before public void init() throws Exception { - netconfAccessor = mock(NetconfAccessor.class); + netconfAccessor = mock(NetconfBindingAccessor.class); capabilities = mock(Capabilities.class); coreData = mock(NetworkElementCoreData.class); faultData = mock(FaultData.class); diff --git a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev170324.java b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev170324.java index 96c3c757d..bee34b5b5 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev170324.java +++ b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev170324.java @@ -32,7 +32,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.Wrapper import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.util.ONFLayerProtocolName; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData; -import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.opendaylight.mdsal.binding.api.DataBroker; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; @@ -82,7 +82,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class TestWrapperMicrowaveModelRev170324 { - NetconfAccessor accessor; + NetconfBindingAccessor accessor; DeviceManagerServiceProvider serviceProvider; FaultData resultList; UniversalId uid; @@ -99,7 +99,7 @@ public class TestWrapperMicrowaveModelRev170324 { @Before public void init() { - accessor = mock(NetconfAccessor.class); + accessor = mock(NetconfBindingAccessor.class); serviceProvider = mock(DeviceManagerServiceProvider.class); resultList = mock(FaultData.class); transactionUtils = mock(TransactionUtils.class); diff --git a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev180907.java b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev180907.java index dec443519..4c4c9734a 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev180907.java +++ b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev180907.java @@ -33,7 +33,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.util.ONFLayerProtocolNa import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData; -import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId; @@ -82,7 +82,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class TestWrapperMicrowaveModelRev180907 { - NetconfAccessor accessor; + NetconfBindingAccessor accessor; DeviceManagerServiceProvider serviceProvider; FaultData resultList; UniversalId uid; @@ -98,7 +98,7 @@ public class TestWrapperMicrowaveModelRev180907 { @Before public void init() { - accessor = mock(NetconfAccessor.class); + accessor = mock(NetconfBindingAccessor.class); serviceProvider = mock(DeviceManagerServiceProvider.class); resultList = mock(FaultData.class); transactionUtils = mock(TransactionUtils.class); diff --git a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev181010.java b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev181010.java index 94f8e6c19..0259fea5e 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev181010.java +++ b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestWrapperMicrowaveModelRev181010.java @@ -33,7 +33,7 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.util.ONFLayerProtocolNa import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService; import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.FaultData; -import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.opendaylight.mdsal.binding.api.DataBroker; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; @@ -84,7 +84,7 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; @SuppressWarnings("deprecation") public class TestWrapperMicrowaveModelRev181010 { - NetconfAccessor accessor; + NetconfBindingAccessor accessor; DeviceManagerServiceProvider serviceProvider; FaultData resultList; UniversalId uid; @@ -101,7 +101,7 @@ public class TestWrapperMicrowaveModelRev181010 { @Before public void init() { - accessor = mock(NetconfAccessor.class); + accessor = mock(NetconfBindingAccessor.class); serviceProvider = mock(DeviceManagerServiceProvider.class); resultList = mock(FaultData.class); transactionUtils = mock(TransactionUtils.class); diff --git a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/test/TestWrapperPTPModelRev170208.java b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/test/TestWrapperPTPModelRev170208.java index 42f7de1d6..0694bcecc 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/test/TestWrapperPTPModelRev170208.java +++ b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/test/TestWrapperPTPModelRev170208.java @@ -23,7 +23,7 @@ import org.junit.Before; import org.junit.Test; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.WrapperPTPModelRev170208; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities; -import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.opendaylight.mdsal.binding.api.DataBroker; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; @@ -48,14 +48,14 @@ import static org.mockito.Mockito.*; public class TestWrapperPTPModelRev170208 { private static final String NODEID = "node1"; - NetconfAccessor netconfAccessor; + NetconfBindingAccessor netconfAccessor; Capabilities capabilities; TransactionUtils transactionUtils; DataBroker dataBroker; @Before public void init() { - netconfAccessor = mock(NetconfAccessor.class); + netconfAccessor = mock(NetconfBindingAccessor.class); capabilities = mock(Capabilities.class); dataBroker = mock(DataBroker.class); transactionUtils = mock(TransactionUtils.class); diff --git a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/test/TestONFCoreNetworkElementFactory.java b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/test/TestONFCoreNetworkElementFactory.java index 909a67edc..14bd1bd91 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/test/TestONFCoreNetworkElementFactory.java +++ b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/test/TestONFCoreNetworkElementFactory.java @@ -20,9 +20,9 @@ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.impl.test; import static org.junit.Assert.assertTrue; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; - import java.io.File; import java.io.IOException; +import java.util.Optional; import org.junit.After; import org.junit.AfterClass; import org.junit.BeforeClass; @@ -35,7 +35,8 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.impl.DeviceManagerOnfCo import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.impl.ONFCoreNetworkElementFactory; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities; -import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfNotifications; import org.opendaylight.mdsal.binding.api.DataBroker; import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.NetworkElement; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; @@ -43,7 +44,7 @@ import org.opendaylight.yangtools.yang.common.QName; public class TestONFCoreNetworkElementFactory { - static NetconfAccessor accessor; + static NetconfBindingAccessor accessor; static DeviceManagerServiceProvider serviceProvider; static Capabilities capabilities; static DataBroker dataBroker; @@ -57,7 +58,7 @@ public class TestONFCoreNetworkElementFactory { public static void init() throws InterruptedException, IOException { capabilities = mock(Capabilities.class); - accessor = mock(NetconfAccessor.class); + accessor = mock(NetconfBindingAccessor.class); serviceProvider = mock(DeviceManagerServiceProvider.class); dataBroker = mock(DataBroker.class); @@ -68,8 +69,14 @@ public class TestONFCoreNetworkElementFactory { when(accessor.getCapabilites()).thenReturn(capabilities); //when(serviceProvider.getDataProvider()).thenReturn(dataProvider); nNodeId = new NodeId("nSky"); - when(accessor.getNodeId()).thenReturn(nNodeId); + NetconfBindingAccessor bindingAccessor = mock(NetconfBindingAccessor.class); + when(bindingAccessor.getNodeId()).thenReturn(nNodeId); + when(bindingAccessor.getNotificationAccessor()).thenReturn(Optional.of(mock(NetconfNotifications.class))); + when(bindingAccessor.getCapabilites()).thenReturn(capabilities); + when(accessor.getNodeId()).thenReturn(nNodeId); + when(accessor.getNetconfBindingAccessor()).thenReturn(Optional.of(bindingAccessor)); + when(accessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkElement.QNAME)).thenReturn(true); } @@ -80,9 +87,6 @@ public class TestONFCoreNetworkElementFactory { @Test public void testCreateMWModelRev170324() throws Exception { - - - when(accessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkElement.QNAME)).thenReturn(true); when(accessor.getCapabilites().isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev170324.QNAME)) .thenReturn(true); when(accessor.getCapabilites().isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev180907.QNAME)) @@ -95,7 +99,6 @@ public class TestONFCoreNetworkElementFactory { @Test public void testCreateMWModelRev180907() throws Exception { - when(accessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkElement.QNAME)).thenReturn(true); when(accessor.getCapabilites().isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev170324.QNAME)) .thenReturn(false); when(accessor.getCapabilites().isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev180907.QNAME)) @@ -108,7 +111,6 @@ public class TestONFCoreNetworkElementFactory { @Test public void testCreateMWModelRev181010() throws Exception { - when(accessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkElement.QNAME)).thenReturn(true); when(accessor.getCapabilites().isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev170324.QNAME)) .thenReturn(false); when(accessor.getCapabilites().isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev180907.QNAME)) diff --git a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/test/TestONFCoreNetworkElement12Basic.java b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/test/TestONFCoreNetworkElement12Basic.java index 027ad2405..0749823a2 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/test/TestONFCoreNetworkElement12Basic.java +++ b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/test/TestONFCoreNetworkElement12Basic.java @@ -19,46 +19,29 @@ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ne.test; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; - -import java.util.List; -import org.eclipse.jdt.annotation.Nullable; +import java.util.Optional; import org.junit.Before; import org.junit.Test; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.OnfMicrowaveModel; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.impl.DeviceManagerOnfConfiguration; -import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ne.ONFCoreNetworkElement12Basic; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ne.ONFCoreNetworkElement12Microwave; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.EquipmentService; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService; -import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; -import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfNotifications; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.AdministrativeControl; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.AdministrativeState; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.LifecycleState; import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.NetworkElement; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.OperationalState; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.extension.g.Extension; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.global._class.g.LocalId; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.label.g.Label; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.name.g.Name; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.network.element.Fd; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.network.element.Ltp; import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.onf.core.model.conditional.packages.rev170402.NetworkElementPac; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SourceType; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; -import org.opendaylight.yangtools.yang.binding.Augmentation; -import org.opendaylight.yangtools.yang.binding.DataContainer; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class TestONFCoreNetworkElement12Basic { - NetconfAccessor accessor; + NetconfBindingAccessor accessor; DeviceManagerServiceProvider serviceProvider; Capabilities capabilities; TransactionUtils transactionUtils; @@ -73,7 +56,7 @@ public class TestONFCoreNetworkElement12Basic { @Before public void init() { - accessor = mock(NetconfAccessor.class); + accessor = mock(NetconfBindingAccessor.class); serviceProvider = mock(DeviceManagerServiceProvider.class); capabilities = mock(Capabilities.class); transactionUtils = mock(TransactionUtils.class); @@ -90,6 +73,10 @@ public class TestONFCoreNetworkElement12Basic { when(accessor.getNodeId()).thenReturn(nNodeId); when(accessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkElementPac.QNAME)).thenReturn(true); when(accessor.getTransactionUtils()).thenReturn(transactionUtils); + when(accessor.getNotificationAccessor()).thenReturn(Optional.of(mock(NetconfNotifications.class))); + NetconfBindingAccessor bindingAccessor = mock(NetconfBindingAccessor.class); + when(bindingAccessor.getNodeId()).thenReturn(nNodeId); + when(accessor.getNetconfBindingAccessor()).thenReturn(Optional.of(bindingAccessor)); } @@ -105,7 +92,7 @@ public class TestONFCoreNetworkElement12Basic { EventlogEntity eventlogEntity = mock(EventlogEntity.class); when(eventlogEntity.getObjectId()).thenReturn("ABCD"); when(eventlogEntity.getAttributeName()).thenReturn("/equipment-pac/equipment-current-problems"); - + onfCoreNetworkElement12MW.notificationActor(eventlogEntity); } diff --git a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/test/TestONFCoreNetworkElement12Microwave.java b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/test/TestONFCoreNetworkElement12Microwave.java index 5f101b031..3e743ca3b 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/test/TestONFCoreNetworkElement12Microwave.java +++ b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ne/test/TestONFCoreNetworkElement12Microwave.java @@ -19,9 +19,7 @@ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ne.test; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; - -import java.util.List; -import org.eclipse.jdt.annotation.Nullable; +import java.util.Optional; import org.junit.Before; import org.junit.Test; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.OnfMicrowaveModel; @@ -30,34 +28,20 @@ import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ne.ONFCoreNetworkElemen import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.EquipmentService; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService; -import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor; -import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfBindingAccessor; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfNotifications; +import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils; import org.opendaylight.mdsal.common.api.LogicalDatastoreType; -import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.AdministrativeControl; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.AdministrativeState; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.LifecycleState; import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.NetworkElement; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.OperationalState; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.UniversalId; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.extension.g.Extension; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.global._class.g.LocalId; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.label.g.Label; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.name.g.Name; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.network.element.Fd; -import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.core.model.rev170320.network.element.Ltp; import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.onf.core.model.conditional.packages.rev170402.NetworkElementPac; import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.EventlogEntity; -import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev201110.SourceType; import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId; -import org.opendaylight.yangtools.yang.binding.Augmentation; -import org.opendaylight.yangtools.yang.binding.DataContainer; import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class TestONFCoreNetworkElement12Microwave { - NetconfAccessor accessor; + NetconfBindingAccessor accessor; DeviceManagerServiceProvider serviceProvider; Capabilities capabilities; TransactionUtils transactionUtils; @@ -72,7 +56,7 @@ public class TestONFCoreNetworkElement12Microwave { @Before public void init() { - accessor = mock(NetconfAccessor.class); + accessor = mock(NetconfBindingAccessor.class); serviceProvider = mock(DeviceManagerServiceProvider.class); capabilities = mock(Capabilities.class); transactionUtils = mock(TransactionUtils.class); @@ -89,6 +73,7 @@ public class TestONFCoreNetworkElement12Microwave { when(accessor.getNodeId()).thenReturn(nNodeId); when(accessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkElementPac.QNAME)).thenReturn(true); when(accessor.getTransactionUtils()).thenReturn(transactionUtils); + when(accessor.getNotificationAccessor()).thenReturn(Optional.of(mock(NetconfNotifications.class))); } |