From ac2749ef5c0de23a9874c049e043eb7eda2b1168 Mon Sep 17 00:00:00 2001 From: herbert Date: Fri, 28 Feb 2020 13:19:20 +0100 Subject: Update devicemanager components Adjust license and add Issue-ID: SDNC-1091 Signed-off-by: herbert Change-Id: Ic0eb5ff731c6c9cc982b9867d6731a9e470a9597 --- .../wt/devicemanager/gran/GRanNetworkElement.java | 4 +- .../gran/GRanNetworkElementFactory.java | 4 +- .../gran/impl/DeviceManagerGRanImpl.java | 4 +- .../gran/test/TestDeviceManagerGRanImpl.java | 4 +- .../gran/test/TestGRanNetworkElement.java | 4 +- .../gran/test/TestGRanNetworkElementFactory.java | 4 +- .../devicemanager/onf/NetworkElementCoreData.java | 4 +- .../onf/ONFCoreNetworkElementCallback.java | 4 +- .../onf/ONFCoreNetworkElementRepresentation.java | 4 +- .../devicemanager/onf/ifpac/OnfInterfacePac.java | 4 +- .../onf/ifpac/WrapperPTPModelRev170208.java | 4 +- .../onf/ifpac/equipment/ExtendedEquipment.java | 4 +- .../ONFCoreNetworkElement12Equipment.java | 4 +- .../onf/ifpac/equipment/ValueNameList.java | 4 +- .../equipment/WrapperEquipmentPacRev170402.java | 4 +- .../devicemanager/onf/ifpac/microwave/Helper.java | 4 +- .../onf/ifpac/microwave/LinkIdentifyingObject.java | 4 +- .../onf/ifpac/microwave/OnfMicrowaveModel.java | 4 +- .../microwave/WrapperMicrowaveModelRev170324.java | 4 +- .../microwave/WrapperMicrowaveModelRev180907.java | 4 +- .../microwave/WrapperMicrowaveModelRev181010.java | 4 +- .../PerformanceDataAirInterface170324Builder.java | 4 +- .../PerformanceDataAirInterface180907Builder.java | 4 +- .../PerformanceDataAirInterface181010Builder.java | 4 +- .../onf/impl/DeviceManagerOnfConfiguration.java | 53 +++ .../onf/impl/DeviceManagerOnfImpl.java | 8 +- .../onf/impl/ONFCoreNetworkElementFactory.java | 15 +- .../onf/ne/ONFCoreNetworkElement12Base.java | 4 +- .../onf/ne/ONFCoreNetworkElement12Basic.java | 13 +- .../onf/ne/ONFCoreNetworkElement12Microwave.java | 19 +- .../onf/ne/ONFCoreNetworkElementBase.java | 4 +- .../onf/notifications/NotificationActor.java | 4 +- .../onf/notifications/NotificationWorker.java | 4 +- .../onf/util/ONFLayerProtocolName.java | 4 +- .../equipment/test/TestExtendedEquipment.java | 4 +- .../test/TestONFCoreNetworkElement12Equipment.java | 4 +- .../onf/ifpac/microwave/test/TestHelper.java | 4 +- .../test/TestWrapperMicrowaveModelRev170324.java | 4 +- .../test/TestWrapperMicrowaveModelRev180907.java | 4 +- .../test/TestWrapperMicrowaveModelRev181010.java | 4 +- .../ifpac/test/TestWrapperPTPModelRev170208.java | 4 +- .../test/TestONFCoreNetworkElementFactory.java | 135 +++--- .../ne/test/TestONFCoreNetworkElement12Basic.java | 470 +++++++++---------- .../test/TestONFCoreNetworkElement12Microwave.java | 519 ++++++++++----------- .../oran/impl/DeviceManagerORanImpl.java | 4 +- .../devicemanager/oran/impl/NtsNetworkElement.java | 4 +- .../oran/impl/ORanChangeNotificationListener.java | 4 +- .../oran/impl/ORanFaultNotificationListener.java | 4 +- .../oran/impl/ORanNetworkElement.java | 4 +- .../oran/impl/ORanNetworkElementFactory.java | 4 +- .../test/TestORanChangeNotificationListener.java | 4 +- .../test/TestORanFaultNotificationListener.java | 4 +- .../oran/test/TestORanNetworkElement.java | 190 ++------ .../oran/test/TestORanNetworkElementFactory.java | 4 +- .../oran/test/TestORanToInternalDataModel.java | 4 +- .../oran/test/mock/NetconfAccessorMock.java | 4 +- .../oran/test/mock/NetconfConfigChangeMock.java | 4 +- .../oran/test/mock/TransactionUtilsMock.java | 4 +- .../ne/factory/FactoryRegistration.java | 4 +- .../ne/factory/NetworkElementFactory.java | 4 +- .../ne/service/DeviceMonitoredNe.java | 4 +- .../ne/service/InventoryProvider.java | 4 +- .../devicemanager/ne/service/NetworkElement.java | 4 +- .../ne/service/NetworkElementService.java | 4 +- .../ne/service/PerformanceDataProvider.java | 4 +- .../sdnr/wt/devicemanager/service/AaiService.java | 4 +- .../service/DeviceManagerService.java | 4 +- .../service/DeviceManagerServiceProvider.java | 8 +- .../wt/devicemanager/service/EquipmentService.java | 4 +- .../service/EventHandlingService.java | 4 +- .../wt/devicemanager/service/FaultService.java | 4 +- .../devicemanager/service/MaintenanceService.java | 4 +- .../service/NetconfNetworkElementService.java | 4 +- .../devicemanager/service/NotificationService.java | 4 +- .../devicemanager/service/PerformanceManager.java | 4 +- .../sdnr/wt/devicemanager/types/EquipmentData.java | 4 +- .../types/EventlogNotificationBuilder.java | 4 +- .../sdnr/wt/devicemanager/types/FaultData.java | 4 +- .../types/FaultNotificationBuilder2.java | 4 +- .../types/InternalConnectionStatus.java | 4 +- .../types/InventoryInformationDcae.java | 4 +- .../wt/devicemanager/types/PerformanceDataLtp.java | 4 +- .../util/UnkownDevicemanagerServiceException.java | 4 +- .../aaiconnector/impl/AaiProviderClient.java | 4 +- .../aaiconnector/impl/AaiWebApiClient.java | 4 +- .../aaiconnector/impl/URLParamEncoder.java | 4 +- .../impl/config/AaiClientPropertiesFile.java | 4 +- .../aaiconnector/impl/config/AaiConfig.java | 4 +- .../archiveservice/ArchiveCleanService.java | 4 +- .../dcaeconnector/impl/DcaeForwarderImpl.java | 10 +- .../dcaeconnector/impl/DcaeForwarderInternal.java | 4 +- .../dcaeconnector/impl/DcaeMessages.java | 4 +- .../dcaeconnector/impl/DcaeProviderClient.java | 4 +- .../dcaeconnector/impl/DcaeProviderTask.java | 4 +- .../dcaeconnector/impl/DcaeProviderWorker.java | 4 +- .../dcaeconnector/impl/DcaeSender.java | 4 +- .../dcaeconnector/impl/DcaeSenderImpl.java | 4 +- .../dcaeconnector/impl/config/DcaeConfig.java | 4 +- .../devicemanager/devicemonitor/impl/Checker.java | 4 +- .../devicemonitor/impl/DeviceMonitor.java | 4 +- .../devicemonitor/impl/DeviceMonitorEmptyImpl.java | 4 +- .../devicemonitor/impl/DeviceMonitorImpl.java | 4 +- .../devicemonitor/impl/DeviceMonitorProblems.java | 4 +- .../devicemonitor/impl/DeviceMonitorTask.java | 4 +- .../devicemonitor/impl/config/DmConfig.java | 4 +- .../DeviceManagerDatabaseNotificationService.java | 4 +- .../eventdatahandler/ODLEventListenerHandler.java | 4 +- .../ConnectionStatusHousekeepingService.java | 4 +- .../ResyncNetworkElementHouskeepingService.java | 4 +- .../ResyncNetworkElementsListener.java | 4 +- .../impl/DeviceManagerApiServiceImpl.java | 4 +- .../wt/devicemanager/impl/DeviceManagerImpl.java | 40 +- .../impl/DeviceManagerNetconfConnectHandler.java | 4 +- .../wt/devicemanager/impl/NetconfNodeService.java | 4 +- .../sdnr/wt/devicemanager/impl/ProviderClient.java | 4 +- .../wt/devicemanager/impl/PushNotifications.java | 4 +- .../impl/util/InternalDateAndTime.java | 4 +- .../devicemanager/impl/util/InternalSeverity.java | 4 +- .../util/NetworkElementConnectionEntitiyUtil.java | 4 +- .../xml/AttributeValueChangedNotificationXml.java | 4 +- .../devicemanager/impl/xml/FaultEntityManager.java | 4 +- .../wt/devicemanager/impl/xml/GetEventType.java | 4 +- .../impl/xml/MwtNotificationBase.java | 4 +- .../impl/xml/ObjectCreationNotificationXml.java | 4 +- .../impl/xml/ObjectDeletionNotificationXml.java | 4 +- .../impl/xml/ProblemNotificationXml.java | 4 +- .../impl/xml/WebSocketServiceClientDummyImpl.java | 4 +- .../impl/xml/WebSocketServiceClientImpl2.java | 4 +- .../impl/xml/WebSocketServiceClientInternal.java | 4 +- .../sdnr/wt/devicemanager/impl/xml/XmlMapper.java | 4 +- .../maintenance/MaintenanceRPCServiceAPI.java | 4 +- .../maintenance/impl/MaintenanceCalculator.java | 224 ++++----- .../maintenance/impl/MaintenanceServiceImpl.java | 4 +- .../impl/PerformanceManagerImpl.java | 4 +- .../impl/PerformanceManagerTask.java | 4 +- .../performancemanager/impl/config/PmConfig.java | 4 +- .../DevicemanagerNotificationDelayService.java | 4 +- .../toggleAlarmFilter/NotificationDelayFilter.java | 4 +- .../NotificationDelayService.java | 4 +- .../NotificationDelayedListener.java | 4 +- .../NotificationWithServerTimeStamp.java | 4 +- .../toggleAlarmFilter/ToggleAlarmFilterable.java | 4 +- .../toggleAlarmFilter/conf/ToggleAlarmConfig.java | 4 +- .../sdnr/wt/devicemanager/test/TestAai.java | 4 +- .../sdnr/wt/devicemanager/test/TestDcae.java | 4 +- .../test/TestDevMgrPropertiesFile.java | 4 +- .../wt/devicemanager/test/TestDeviceMonitor.java | 4 +- .../wt/devicemanager/test/TestDevicemanager.java | 6 +- .../test/TestMaintenanceTimeFilter.java | 6 +- .../sdnr/wt/devicemanager/test/TestNameSpace.java | 4 +- .../devicemanager/test/TestToggleAlarmFilter.java | 4 +- .../wt/devicemanager/test/TestXmlNotification.java | 4 +- .../devicemanager/test/TestsNectconfDateTime.java | 4 +- .../test/mock/RpcProviderServiceMock.java | 4 +- .../test/util/NetconfTimeStampOld.java | 4 +- 155 files changed, 1150 insertions(+), 1126 deletions(-) create mode 100644 sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/DeviceManagerOnfConfiguration.java (limited to 'sdnr/wt') diff --git a/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElement.java b/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElement.java index 0f7266061..239711f0a 100644 --- a/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElement.java +++ b/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElement.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.gran; import java.util.Optional; diff --git a/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElementFactory.java b/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElementFactory.java index dfce34d48..6c54e4213 100644 --- a/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElementFactory.java +++ b/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/GRanNetworkElementFactory.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.gran; diff --git a/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/impl/DeviceManagerGRanImpl.java b/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/impl/DeviceManagerGRanImpl.java index 961a9b7ff..891feda55 100644 --- a/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/impl/DeviceManagerGRanImpl.java +++ b/sdnr/wt/devicemanager-gran/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/impl/DeviceManagerGRanImpl.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.gran.impl; import org.onap.ccsdk.features.sdnr.wt.devicemanager.gran.GRanNetworkElementFactory; diff --git a/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestDeviceManagerGRanImpl.java b/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestDeviceManagerGRanImpl.java index c008986e0..aeb50e83f 100644 --- a/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestDeviceManagerGRanImpl.java +++ b/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestDeviceManagerGRanImpl.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.gran.test; import static org.mockito.Mockito.mock; diff --git a/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElement.java b/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElement.java index ac232a008..b13965933 100644 --- a/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElement.java +++ b/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElement.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.gran.test; import static org.junit.Assert.assertEquals; diff --git a/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElementFactory.java b/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElementFactory.java index db25465eb..4d0417bf7 100644 --- a/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElementFactory.java +++ b/sdnr/wt/devicemanager-gran/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/gran/test/TestGRanNetworkElementFactory.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.gran.test; import static org.junit.Assert.*; diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/NetworkElementCoreData.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/NetworkElementCoreData.java index ddfeac227..0537ec828 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/NetworkElementCoreData.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/NetworkElementCoreData.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf; import java.util.Optional; diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ONFCoreNetworkElementCallback.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ONFCoreNetworkElementCallback.java index 55765d7c3..ce91ae301 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ONFCoreNetworkElementCallback.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ONFCoreNetworkElementCallback.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf; public interface ONFCoreNetworkElementCallback { diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ONFCoreNetworkElementRepresentation.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ONFCoreNetworkElementRepresentation.java index 163c4a4f1..4122a7190 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ONFCoreNetworkElementRepresentation.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ONFCoreNetworkElementRepresentation.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf; import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.DeviceMonitoredNe; diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/OnfInterfacePac.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/OnfInterfacePac.java index 65b06a037..4d9c8b14d 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/OnfInterfacePac.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/OnfInterfacePac.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac; import org.eclipse.jdt.annotation.NonNull; 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 7df39c747..1d25b4be0 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 @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac; import java.util.List; diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ExtendedEquipment.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ExtendedEquipment.java index 4993b5e4a..56e616e9b 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ExtendedEquipment.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ExtendedEquipment.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.equipment; import java.util.ArrayList; 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 c67efe3df..aa88d98ad 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 @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.equipment; import java.util.ArrayList; diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ValueNameList.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ValueNameList.java index a3361a0fe..1deb4fa1e 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ValueNameList.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/ValueNameList.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.equipment; import java.util.HashMap; 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 229f88cfa..28042668c 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 @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.equipment; import java.lang.reflect.Constructor; diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/Helper.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/Helper.java index d200530fc..98b55b3ae 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/Helper.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/Helper.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave; import org.eclipse.jdt.annotation.NonNull; diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/LinkIdentifyingObject.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/LinkIdentifyingObject.java index 4429473cf..97bf3fbe5 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/LinkIdentifyingObject.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/LinkIdentifyingObject.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave; public interface LinkIdentifyingObject { diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/OnfMicrowaveModel.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/OnfMicrowaveModel.java index c2ca542a2..79e95cc59 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/OnfMicrowaveModel.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/OnfMicrowaveModel.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave; import org.eclipse.jdt.annotation.NonNull; 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 08783ecef..8aad824b0 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 @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave; 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 bee11b6be..0f200e91c 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 @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave; 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 633f24d96..2531baaac 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 @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave; diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/pm/PerformanceDataAirInterface170324Builder.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/pm/PerformanceDataAirInterface170324Builder.java index a24f235a3..6f9fd63c4 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/pm/PerformanceDataAirInterface170324Builder.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/pm/PerformanceDataAirInterface170324Builder.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.pm; import java.util.Optional; diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/pm/PerformanceDataAirInterface180907Builder.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/pm/PerformanceDataAirInterface180907Builder.java index 62382e326..022f3f160 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/pm/PerformanceDataAirInterface180907Builder.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/pm/PerformanceDataAirInterface180907Builder.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.pm; import java.util.Optional; diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/pm/PerformanceDataAirInterface181010Builder.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/pm/PerformanceDataAirInterface181010Builder.java index 2b80a13ad..83e3e72fd 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/pm/PerformanceDataAirInterface181010Builder.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/pm/PerformanceDataAirInterface181010Builder.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.pm; import java.util.Optional; diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/DeviceManagerOnfConfiguration.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/DeviceManagerOnfConfiguration.java new file mode 100644 index 000000000..85303d89c --- /dev/null +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/impl/DeviceManagerOnfConfiguration.java @@ -0,0 +1,53 @@ +/* + * ============LICENSE_START======================================================================== + * ONAP : ccsdk feature sdnr wt + * ================================================================================================= + * Copyright (C) 2019 highstreet technologies GmbH Intellectual Property. All rights reserved. + * ================================================================================================= + * Licensed under the Apache License, Version 2.0 (the "License"); you may not use this file except + * in compliance with the License. You may obtain a copy of the License at + * + * http://www.apache.org/licenses/LICENSE-2.0 + * + * Unless required by applicable law or agreed to in writing, software distributed under the License + * is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express + * or implied. See the License for the specific language governing permissions and limitations under + * the License. + * ============LICENSE_END========================================================================== + */ +package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.impl; + +import org.onap.ccsdk.features.sdnr.wt.common.configuration.Configuration; +import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation; + +public class DeviceManagerOnfConfiguration implements Configuration { + + private static final String SECTION_MARKER_DMONF = "dmonf"; + + private static final String DEFAULT_VALUE_ENABLED = String.valueOf(false); + private static final String PROPERTY_KEY_POLLALARMS = "pollAlarms"; + + private final ConfigurationFileRepresentation configuration; + + public DeviceManagerOnfConfiguration(ConfigurationFileRepresentation configuration) { + this.configuration = configuration; + this.configuration.addSection(SECTION_MARKER_DMONF); + defaults(); + } + + public boolean isPollAlarmsEnabled() { + return configuration.getPropertyBoolean(SECTION_MARKER_DMONF, PROPERTY_KEY_POLLALARMS); + } + + @Override + public String getSectionName() { + return SECTION_MARKER_DMONF; + } + + @Override + public void defaults() { + //Add default if not available + configuration.setPropertyIfNotAvailable(SECTION_MARKER_DMONF, PROPERTY_KEY_POLLALARMS, DEFAULT_VALUE_ENABLED); + } + +} 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 04c3bc57b..3d7ff88c7 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 @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.impl; import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient; @@ -33,6 +33,7 @@ public class DeviceManagerOnfImpl implements AutoCloseable { private HtDatabaseClient htDatabaseClient; private Boolean devicemanagerInitializationOk = false; private FactoryRegistration resOnf; + private DeviceManagerOnfConfiguration configuration; // Blueprint begin public DeviceManagerOnfImpl() { @@ -48,7 +49,8 @@ public class DeviceManagerOnfImpl implements AutoCloseable { LOG.info("Session Initiated start {}", APPLICATIONNAME); - resOnf = netconfNetworkElementService.registerNetworkElementFactory(new ONFCoreNetworkElementFactory()); + configuration = new DeviceManagerOnfConfiguration(netconfNetworkElementService.getServiceProvider().getConfigurationFileRepresentation()); + resOnf = netconfNetworkElementService.registerNetworkElementFactory(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 f9434f88c..3d2e04e87 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 @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.impl; import java.util.Optional; @@ -43,6 +43,13 @@ public class ONFCoreNetworkElementFactory implements NetworkElementFactory { private static final Logger log = LoggerFactory.getLogger(ONFCoreNetworkElementFactory.class); + private final @NonNull DeviceManagerOnfConfiguration configuration; + + public ONFCoreNetworkElementFactory(@NonNull DeviceManagerOnfConfiguration configuration) { + this.configuration = configuration; + } + + @Override public Optional create( @NonNull NetconfAccessor acessor, @NonNull DeviceManagerServiceProvider serviceProvider) { @@ -63,9 +70,9 @@ public class ONFCoreNetworkElementFactory implements NetworkElementFactory { } if (onfMicrowaveModel != null) { - return Optional.of(new ONFCoreNetworkElement12Microwave(acessor, serviceProvider, onfMicrowaveModel)); + return Optional.of(new ONFCoreNetworkElement12Microwave(acessor, serviceProvider, configuration, onfMicrowaveModel)); } else { - return Optional.of(new ONFCoreNetworkElement12Basic(acessor, serviceProvider)); + return Optional.of(new ONFCoreNetworkElement12Basic(acessor, 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 9fc0c9599..0b405d002 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 @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ne; import java.util.ArrayList; 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 b152824ee..de6947dd4 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 @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,10 +14,11 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ne; import org.eclipse.jdt.annotation.NonNull; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.impl.DeviceManagerOnfConfiguration; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.AaiService; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider; import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.EquipmentService; @@ -62,6 +63,7 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base { private final @NonNull String mountPointNodeName; private final @NonNull NetconfAccessor acessor; + private final @NonNull DeviceManagerOnfConfiguration pollAlarmConfig; /*----------------------------------------------------------------------------- * Construction @@ -73,11 +75,12 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base { * @param serviceProvider to get devicemanager services */ public ONFCoreNetworkElement12Basic(@NonNull NetconfAccessor acessor, - @NonNull DeviceManagerServiceProvider serviceProvider) { + @NonNull DeviceManagerServiceProvider serviceProvider, DeviceManagerOnfConfiguration configuration) { super(acessor); this.mountPointNodeName = acessor.getNodeId().getValue(); this.acessor = acessor; + this.pollAlarmConfig = configuration; this.faultService = serviceProvider.getFaultService(); this.equipmentService = serviceProvider.getEquipmentService(); @@ -100,7 +103,7 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base { public void prepareCheck() { synchronized (dmLock) { boolean change = readNetworkElementAndInterfaces(); - if (change) { + if (change || pollAlarmConfig.isPollAlarmsEnabled()) { int problems = faultService.removeAllCurrentProblemsOfNode(nodeId); FaultData resultList = readAllCurrentProblemsOfNode(); faultService.initCurrentProblemStatus(nodeId, resultList); @@ -198,7 +201,7 @@ public class ONFCoreNetworkElement12Basic extends ONFCoreNetworkElement12Base { @Override public void close() throws Exception { - // Close to be implemented + // Close to be implemented } 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 505e0ca12..ebdb8ccf1 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 @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ne; import java.util.List; @@ -23,6 +23,7 @@ import org.eclipse.jdt.annotation.NonNull; import org.eclipse.jdt.annotation.Nullable; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.Helper; 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.notifications.NotificationActor; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.notifications.NotificationWorker; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.util.ONFLayerProtocolName; @@ -81,10 +82,12 @@ public class ONFCoreNetworkElement12Microwave extends ONFCoreNetworkElement12Bas * @param serviceProvider to get services * @param onfMicrowaveModel handling ofmicrosoft model data */ - public ONFCoreNetworkElement12Microwave(@NonNull NetconfAccessor acessor, - @NonNull DeviceManagerServiceProvider serviceProvider, @NonNull OnfMicrowaveModel onfMicrowaveModel) { + public ONFCoreNetworkElement12Microwave(@NonNull NetconfAccessor acessor, + @NonNull DeviceManagerServiceProvider serviceProvider, + DeviceManagerOnfConfiguration configuration, + OnfMicrowaveModel onfMicrowaveModel) { - super(acessor, serviceProvider); + super(acessor, serviceProvider,configuration); this.microwaveModel = onfMicrowaveModel; this.microwaveEventListener = serviceProvider.getFaultService(); @@ -100,6 +103,12 @@ public class ONFCoreNetworkElement12Microwave extends ONFCoreNetworkElement12Bas */ /** + * @param acessor + * @param serviceProvider + * @param configuration + * @param onfMicrowaveModel + */ + /** * DeviceMonitor Prepare check by updating NE state and reading all interfaces. */ @Override 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 5bbeb74ef..1b03f8acb 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 @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ /** * */ diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/notifications/NotificationActor.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/notifications/NotificationActor.java index e216cff38..0fc9397ee 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/notifications/NotificationActor.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/notifications/NotificationActor.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.notifications; import org.eclipse.jdt.annotation.NonNull; diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/notifications/NotificationWorker.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/notifications/NotificationWorker.java index 5de65642b..ed6497c0f 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/notifications/NotificationWorker.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/notifications/NotificationWorker.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.notifications; import java.util.concurrent.BlockingQueue; diff --git a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/util/ONFLayerProtocolName.java b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/util/ONFLayerProtocolName.java index f9e5ea688..a768da078 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/util/ONFLayerProtocolName.java +++ b/sdnr/wt/devicemanager-onf/provider/src/main/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/util/ONFLayerProtocolName.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.util; import org.eclipse.jdt.annotation.NonNull; diff --git a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/test/TestExtendedEquipment.java b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/test/TestExtendedEquipment.java index f55ef4afc..cda0f5366 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/test/TestExtendedEquipment.java +++ b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/equipment/test/TestExtendedEquipment.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.equipment.test; import static org.junit.Assert.*; 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 c5107364f..ff2969eac 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 @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.equipment.test; import static org.junit.Assert.*; diff --git a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestHelper.java b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestHelper.java index 5d14e7d26..cae28f4fe 100644 --- a/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestHelper.java +++ b/sdnr/wt/devicemanager-onf/provider/src/test/java/org/onap/ccsdk/features/sdnr/wt/devicemanager/onf/ifpac/microwave/test/TestHelper.java @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.test; import static org.junit.Assert.*; 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 99e426adc..0140eaa59 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 @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.test; import static org.junit.Assert.*; 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 64c857173..e4d89f28f 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 @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.test; import static org.junit.Assert.*; 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 32d9849d8..eac003dac 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 @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.test; import static org.junit.Assert.*; 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 55db66a1a..bf9337291 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 @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,7 +14,7 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.test; import static org.junit.Assert.*; 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 6713a7821..93e65c0b9 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 @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,20 +14,24 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ 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 org.junit.After; +import org.junit.AfterClass; import org.junit.BeforeClass; import org.junit.Test; +import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.WrapperMicrowaveModelRev170324; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.WrapperMicrowaveModelRev180907; import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ifpac.microwave.WrapperMicrowaveModelRev181010; +import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.impl.DeviceManagerOnfConfiguration; 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; @@ -39,61 +43,76 @@ import org.opendaylight.yangtools.yang.common.QName; public class TestONFCoreNetworkElementFactory { - static NetconfAccessor accessor; - static DeviceManagerServiceProvider serviceProvider; - static Capabilities capabilities; - static DataBroker dataBroker; - static NodeId nNodeId; - QName qCapability; - - @BeforeClass - public static void init() throws InterruptedException, IOException { - capabilities = mock(Capabilities.class); - accessor = mock(NetconfAccessor.class); - serviceProvider = mock(DeviceManagerServiceProvider.class); - dataBroker = mock(DataBroker.class); - - when(accessor.getCapabilites()).thenReturn(capabilities); - //when(serviceProvider.getDataProvider()).thenReturn(dataProvider); - nNodeId = new NodeId("nSky"); - when(accessor.getNodeId()).thenReturn(nNodeId); - - - } - - @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)).thenReturn(false); - when(accessor.getCapabilites().isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev181010.QNAME)).thenReturn(false); - ONFCoreNetworkElementFactory factory = new ONFCoreNetworkElementFactory(); - assertTrue((factory.create(accessor, serviceProvider)).isPresent()); - } - - @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)).thenReturn(true); - when(accessor.getCapabilites().isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev181010.QNAME)).thenReturn(false); - ONFCoreNetworkElementFactory factory = new ONFCoreNetworkElementFactory(); - assertTrue(factory.create(accessor, serviceProvider).isPresent()); - } - - @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)).thenReturn(false); - when(accessor.getCapabilites().isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev181010.QNAME)).thenReturn(true); - ONFCoreNetworkElementFactory factory = new ONFCoreNetworkElementFactory(); - assertTrue(factory.create(accessor, serviceProvider).isPresent()); - } - - @After - public void cleanUp() throws Exception { - - } + static NetconfAccessor accessor; + static DeviceManagerServiceProvider serviceProvider; + static Capabilities capabilities; + static DataBroker dataBroker; + static NodeId nNodeId; + static DeviceManagerOnfConfiguration configuration; + QName qCapability; + static File configFile; + + + @BeforeClass + public static void init() throws InterruptedException, IOException { + + capabilities = mock(Capabilities.class); + accessor = mock(NetconfAccessor.class); + serviceProvider = mock(DeviceManagerServiceProvider.class); + dataBroker = mock(DataBroker.class); + + configFile = new File("devicemanager.properties"); + ConfigurationFileRepresentation configFileRep = new ConfigurationFileRepresentation(configFile); + configuration = new DeviceManagerOnfConfiguration(configFileRep); + + when(accessor.getCapabilites()).thenReturn(capabilities); + //when(serviceProvider.getDataProvider()).thenReturn(dataProvider); + nNodeId = new NodeId("nSky"); + when(accessor.getNodeId()).thenReturn(nNodeId); + + + } + + @AfterClass + public static void after() { + configFile.delete(); + } + + @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)).thenReturn(false); + when(accessor.getCapabilites().isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev181010.QNAME)).thenReturn(false); + ONFCoreNetworkElementFactory factory = new ONFCoreNetworkElementFactory(configuration); + assertTrue(factory.create(accessor, serviceProvider).isPresent()); + } + + @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)).thenReturn(true); + when(accessor.getCapabilites().isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev181010.QNAME)).thenReturn(false); + ONFCoreNetworkElementFactory factory = new ONFCoreNetworkElementFactory(configuration); + assertTrue(factory.create(accessor, serviceProvider).isPresent()); + } + + @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)).thenReturn(false); + when(accessor.getCapabilites().isSupportingNamespaceAndRevision(WrapperMicrowaveModelRev181010.QNAME)).thenReturn(true); + ONFCoreNetworkElementFactory factory = new ONFCoreNetworkElementFactory(configuration); + assertTrue(factory.create(accessor, serviceProvider).isPresent()); + } + + @After + public void cleanUp() throws Exception { + + } } 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 a09d6fcfc..ba295f6ce 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 @@ -1,4 +1,4 @@ -/******************************************************************************* +/* * ============LICENSE_START======================================================================== * ONAP : ccsdk feature sdnr wt * ================================================================================================= @@ -14,20 +14,18 @@ * or implied. See the License for the specific language governing permissions and limitations under * the License. * ============LICENSE_END========================================================================== - ******************************************************************************/ + */ package org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.ne.test; -import static org.junit.Assert.*; import static org.mockito.Mockito.mock; import static org.mockito.Mockito.when; import java.util.List; -import java.util.Optional; - import org.eclipse.jdt.annotation.Nullable; 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; @@ -60,236 +58,238 @@ import org.opendaylight.yangtools.yang.binding.InstanceIdentifier; public class TestONFCoreNetworkElement12Basic { - NetconfAccessor accessor; - DeviceManagerServiceProvider serviceProvider; - Capabilities capabilities; - TransactionUtils transactionUtils; - NetworkElement optionalNe; - OnfMicrowaveModel onfMicrowaveModel; - FaultService faultService; - EquipmentService equipmentService; - - protected static final InstanceIdentifier NETWORKELEMENT_IID = InstanceIdentifier - .builder(NetworkElement.class).build(); - - @Before - public void init() { - accessor = mock(NetconfAccessor.class); - serviceProvider = mock(DeviceManagerServiceProvider.class); - capabilities = mock(Capabilities.class); - transactionUtils = mock(TransactionUtils.class); - onfMicrowaveModel = mock(OnfMicrowaveModel.class); - faultService = mock(FaultService.class); - equipmentService = mock(EquipmentService.class); - - when(accessor.getCapabilites()).thenReturn(capabilities); - when(serviceProvider.getFaultService()).thenReturn(faultService); - when(serviceProvider.getEquipmentService()).thenReturn(equipmentService); - - NodeId nNodeId = new NodeId("nSky"); - when(accessor.getNodeId()).thenReturn(nNodeId); - when(accessor.getCapabilites().isSupportingNamespaceAndRevision(NetworkElementPac.QNAME)).thenReturn(true); - when(accessor.getTransactionUtils()).thenReturn(transactionUtils); - - } - - @Test - public void test() { - optionalNe = new NetworkElement() { - - @Override - public @Nullable List