-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.*;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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<T> {
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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 {
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
--- /dev/null
+/*
+ * ============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);
+ }
+
+}
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
private HtDatabaseClient htDatabaseClient;
private Boolean devicemanagerInitializationOk = false;
private FactoryRegistration<ONFCoreNetworkElementFactory> resOnf;
+ private DeviceManagerOnfConfiguration configuration;
// Blueprint begin
public DeviceManagerOnfImpl() {
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");
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
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<org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElement> create(
@NonNull NetconfAccessor acessor, @NonNull DeviceManagerServiceProvider serviceProvider) {
}
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));
}
}
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
private final @NonNull String mountPointNodeName;
private final @NonNull NetconfAccessor acessor;
+ private final @NonNull DeviceManagerOnfConfiguration pollAlarmConfig;
/*-----------------------------------------------------------------------------
* Construction
* @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();
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);
@Override
public void close() throws Exception {
- // Close to be implemented
+ // Close to be implemented
}
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
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;
* @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();
*/
/**
+ * @param acessor
+ * @param serviceProvider
+ * @param configuration
+ * @param onfMicrowaveModel
+ */
+ /**
* DeviceMonitor Prepare check by updating NE state and reading all interfaces.
*/
@Override
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
* ============LICENSE_END==========================================================================
- ******************************************************************************/
+ */
/**
*
*/
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.*;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.*;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.*;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.*;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.*;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.*;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.*;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
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 {
+
+ }
}
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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;
public class TestONFCoreNetworkElement12Basic {
- NetconfAccessor accessor;
- DeviceManagerServiceProvider serviceProvider;
- Capabilities capabilities;
- TransactionUtils transactionUtils;
- NetworkElement optionalNe;
- OnfMicrowaveModel onfMicrowaveModel;
- FaultService faultService;
- EquipmentService equipmentService;
-
- protected static final InstanceIdentifier<NetworkElement> 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<Label> getLabel() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable List<Extension> getExtension() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable OperationalState getOperationalState() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable LifecycleState getLifecycleState() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable AdministrativeState getAdministrativeState() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable AdministrativeControl getAdministrativeControl() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable List<Name> getName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable UniversalId getUuid() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable List<LocalId> getLocalId() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public <E$$ extends Augmentation<NetworkElement>> @Nullable E$$ augmentation(Class<E$$> augmentationType) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public Class<? extends DataContainer> getImplementedInterface() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable List<Ltp> getLtp() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable List<Fd> getFd() {
- // TODO Auto-generated method stub
- return null;
- }
- };
-
- when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
- NETWORKELEMENT_IID)).thenReturn(optionalNe);
-
- ONFCoreNetworkElement12Basic onfCoreNetworkElement12Basic = new ONFCoreNetworkElement12Basic(accessor,
- serviceProvider);
- onfCoreNetworkElement12Basic.prepareCheck();
-
- /*
- * EventlogEntity eventlogEntity = new EventlogEntity() {
- *
- * @Override public @Nullable String getId() { // TODO Auto-generated method
- * stub return null; }
- *
- * @Override public @Nullable DateAndTime getTimestamp() { // TODO
- * Auto-generated method stub return null; }
- *
- * @Override public @Nullable String getObjectId() { // TODO Auto-generated
- * method stub return "ABCD"; }
- *
- * @Override public @Nullable String getNodeId() { // TODO Auto-generated method
- * stub return null; }
- *
- * @Override public @Nullable Integer getCounter() { // TODO Auto-generated
- * method stub return null; }
- *
- * @Override public @Nullable SourceType getSourceType() { // TODO
- * Auto-generated method stub return null; }
- *
- * @Override public @Nullable String getNewValue() { // TODO Auto-generated
- * method stub return null; }
- *
- * @Override public @Nullable String getAttributeName() { // TODO Auto-generated
- * method stub return
- * "/network-element/extension[value-name=\"top-level-equipment\"]/value"; //
- * "/equipment-pac/equipment-current-problems"; }
- *
- * @Override public Class<? extends DataContainer> getImplementedInterface() {
- * // TODO Auto-generated method stub return null; } };
- *
- * onfCoreNetworkElement12Basic.notificationActor(eventlogEntity);
- */
-
- }
-
-
- @Test
- public void test1()
- {
- when (accessor.getTransactionUtils().readData(accessor.getDataBroker(),
- LogicalDatastoreType.OPERATIONAL, NETWORKELEMENT_IID)).thenReturn(null);
-
- ONFCoreNetworkElement12Microwave onfCoreNetworkElement12MW =
- new ONFCoreNetworkElement12Microwave(accessor, serviceProvider,
- onfMicrowaveModel); onfCoreNetworkElement12MW.prepareCheck();
-
- EventlogEntity eventlogEntity = new EventlogEntity() {
-
- @Override
- public @Nullable String getId() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable DateAndTime getTimestamp() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable String getObjectId() {
- // TODO Auto-generated method stub
- return "ABCD";
- }
-
- @Override
- public @Nullable String getNodeId() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable Integer getCounter() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable SourceType getSourceType() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable String getNewValue() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable String getAttributeName() {
- // TODO Auto-generated method stub
- return "/equipment-pac/equipment-current-problems";
- }
-
- @Override
- public Class<? extends DataContainer> getImplementedInterface() {
- // TODO Auto-generated method stub
- return null;
- }
- };
-
- onfCoreNetworkElement12MW.notificationActor(eventlogEntity);
- }
+ NetconfAccessor accessor;
+ DeviceManagerServiceProvider serviceProvider;
+ Capabilities capabilities;
+ TransactionUtils transactionUtils;
+ NetworkElement optionalNe;
+ OnfMicrowaveModel onfMicrowaveModel;
+ FaultService faultService;
+ EquipmentService equipmentService;
+ DeviceManagerOnfConfiguration configuration;
+
+ protected static final InstanceIdentifier<NetworkElement> 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);
+ configuration = mock(DeviceManagerOnfConfiguration.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<Label> getLabel() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable List<Extension> getExtension() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable OperationalState getOperationalState() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable LifecycleState getLifecycleState() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable AdministrativeState getAdministrativeState() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable AdministrativeControl getAdministrativeControl() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable List<Name> getName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable UniversalId getUuid() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable List<LocalId> getLocalId() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public <E$$ extends Augmentation<NetworkElement>> @Nullable E$$ augmentation(Class<E$$> augmentationType) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Class<? extends DataContainer> getImplementedInterface() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable List<Ltp> getLtp() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable List<Fd> getFd() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ };
+
+ when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
+ NETWORKELEMENT_IID)).thenReturn(optionalNe);
+
+ ONFCoreNetworkElement12Basic onfCoreNetworkElement12Basic = new ONFCoreNetworkElement12Basic(accessor,
+ serviceProvider,configuration);
+ onfCoreNetworkElement12Basic.prepareCheck();
+
+ /*
+ * EventlogEntity eventlogEntity = new EventlogEntity() {
+ *
+ * @Override public @Nullable String getId() { // TODO Auto-generated method
+ * stub return null; }
+ *
+ * @Override public @Nullable DateAndTime getTimestamp() { // TODO
+ * Auto-generated method stub return null; }
+ *
+ * @Override public @Nullable String getObjectId() { // TODO Auto-generated
+ * method stub return "ABCD"; }
+ *
+ * @Override public @Nullable String getNodeId() { // TODO Auto-generated method
+ * stub return null; }
+ *
+ * @Override public @Nullable Integer getCounter() { // TODO Auto-generated
+ * method stub return null; }
+ *
+ * @Override public @Nullable SourceType getSourceType() { // TODO
+ * Auto-generated method stub return null; }
+ *
+ * @Override public @Nullable String getNewValue() { // TODO Auto-generated
+ * method stub return null; }
+ *
+ * @Override public @Nullable String getAttributeName() { // TODO Auto-generated
+ * method stub return
+ * "/network-element/extension[value-name=\"top-level-equipment\"]/value"; //
+ * "/equipment-pac/equipment-current-problems"; }
+ *
+ * @Override public Class<? extends DataContainer> getImplementedInterface() {
+ * // TODO Auto-generated method stub return null; } };
+ *
+ * onfCoreNetworkElement12Basic.notificationActor(eventlogEntity);
+ */
+
+ }
+
+
+ @Test
+ public void test1()
+ {
+ when (accessor.getTransactionUtils().readData(accessor.getDataBroker(),
+ LogicalDatastoreType.OPERATIONAL, NETWORKELEMENT_IID)).thenReturn(null);
+
+ ONFCoreNetworkElement12Microwave onfCoreNetworkElement12MW =
+ new ONFCoreNetworkElement12Microwave(accessor, serviceProvider, configuration,
+ onfMicrowaveModel); onfCoreNetworkElement12MW.prepareCheck();
+
+ EventlogEntity eventlogEntity = new EventlogEntity() {
+
+ @Override
+ public @Nullable String getId() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable DateAndTime getTimestamp() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable String getObjectId() {
+ // TODO Auto-generated method stub
+ return "ABCD";
+ }
+
+ @Override
+ public @Nullable String getNodeId() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable Integer getCounter() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable SourceType getSourceType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable String getNewValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable String getAttributeName() {
+ // TODO Auto-generated method stub
+ return "/equipment-pac/equipment-current-problems";
+ }
+
+ @Override
+ public Class<? extends DataContainer> getImplementedInterface() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ };
+
+ onfCoreNetworkElement12MW.notificationActor(eventlogEntity);
+ }
}
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.ne.ONFCoreNetworkElement12Basic;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.onf.impl.DeviceManagerOnfConfiguration;
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;
public class TestONFCoreNetworkElement12Microwave {
- NetconfAccessor accessor;
- DeviceManagerServiceProvider serviceProvider;
- Capabilities capabilities;
- TransactionUtils transactionUtils;
- NetworkElement optionalNe;
- OnfMicrowaveModel onfMicrowaveModel;
- FaultService faultService;
- EquipmentService equipmentService;
-
- protected static final InstanceIdentifier<NetworkElement> 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<Label> getLabel() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable List<Extension> getExtension() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable OperationalState getOperationalState() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable LifecycleState getLifecycleState() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable AdministrativeState getAdministrativeState() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable AdministrativeControl getAdministrativeControl() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable List<Name> getName() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable UniversalId getUuid() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable List<LocalId> getLocalId() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public <E$$ extends Augmentation<NetworkElement>> @Nullable E$$ augmentation(Class<E$$> augmentationType) {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public Class<? extends DataContainer> getImplementedInterface() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable List<Ltp> getLtp() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable List<Fd> getFd() {
- // TODO Auto-generated method stub
- return null;
- }
- };
-
- when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
- NETWORKELEMENT_IID)).thenReturn(optionalNe);
-
- ONFCoreNetworkElement12Microwave onfCoreNetworkElement12MW = new ONFCoreNetworkElement12Microwave(accessor,
- serviceProvider, onfMicrowaveModel);
- onfCoreNetworkElement12MW.prepareCheck();
-
- EventlogEntity eventlogEntity = new EventlogEntity() {
-
- @Override
- public @Nullable String getId() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable DateAndTime getTimestamp() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable String getObjectId() {
- // TODO Auto-generated method stub
- return "ABCD";
- }
-
- @Override
- public @Nullable String getNodeId() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable Integer getCounter() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable SourceType getSourceType() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable String getNewValue() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable String getAttributeName() {
- // TODO Auto-generated method stub
- return "/network-element/extension[value-name=\"top-level-equipment\"]/value"; // "/equipment-pac/equipment-current-problems";
- }
-
- @Override
- public Class<? extends DataContainer> getImplementedInterface() {
- // TODO Auto-generated method stub
- return null;
- }
- };
-
- onfCoreNetworkElement12MW.notificationActor(eventlogEntity);
-
- }
-
-
- @Test
- public void test1()
- {
- when (accessor.getTransactionUtils().readData(accessor.getDataBroker(),
- LogicalDatastoreType.OPERATIONAL, NETWORKELEMENT_IID)).thenReturn(null);
-
- ONFCoreNetworkElement12Microwave onfCoreNetworkElement12MW =
- new ONFCoreNetworkElement12Microwave(accessor, serviceProvider,
- onfMicrowaveModel); onfCoreNetworkElement12MW.prepareCheck();
-
- EventlogEntity eventlogEntity = new EventlogEntity() {
-
- @Override
- public @Nullable String getId() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable DateAndTime getTimestamp() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable String getObjectId() {
- // TODO Auto-generated method stub
- return "ABCD";
- }
-
- @Override
- public @Nullable String getNodeId() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable Integer getCounter() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable SourceType getSourceType() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable String getNewValue() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public @Nullable String getAttributeName() {
- // TODO Auto-generated method stub
- return "/equipment-pac/equipment-current-problems";
- }
-
- @Override
- public Class<? extends DataContainer> getImplementedInterface() {
- // TODO Auto-generated method stub
- return null;
- }
- };
-
- onfCoreNetworkElement12MW.notificationActor(eventlogEntity);
- }
+ NetconfAccessor accessor;
+ DeviceManagerServiceProvider serviceProvider;
+ Capabilities capabilities;
+ TransactionUtils transactionUtils;
+ NetworkElement optionalNe;
+ OnfMicrowaveModel onfMicrowaveModel;
+ FaultService faultService;
+ EquipmentService equipmentService;
+ DeviceManagerOnfConfiguration configuration;
+
+ protected static final InstanceIdentifier<NetworkElement> 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);
+ configuration = mock(DeviceManagerOnfConfiguration.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<Label> getLabel() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable List<Extension> getExtension() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable OperationalState getOperationalState() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable LifecycleState getLifecycleState() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable AdministrativeState getAdministrativeState() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable AdministrativeControl getAdministrativeControl() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable List<Name> getName() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable UniversalId getUuid() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable List<LocalId> getLocalId() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public <E$$ extends Augmentation<NetworkElement>> @Nullable E$$ augmentation(Class<E$$> augmentationType) {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public Class<? extends DataContainer> getImplementedInterface() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable List<Ltp> getLtp() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable List<Fd> getFd() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ };
+
+ when(accessor.getTransactionUtils().readData(accessor.getDataBroker(), LogicalDatastoreType.OPERATIONAL,
+ NETWORKELEMENT_IID)).thenReturn(optionalNe);
+
+ ONFCoreNetworkElement12Microwave onfCoreNetworkElement12MW = new ONFCoreNetworkElement12Microwave(accessor,
+ serviceProvider, configuration, onfMicrowaveModel);
+ onfCoreNetworkElement12MW.prepareCheck();
+
+ EventlogEntity eventlogEntity = new EventlogEntity() {
+
+ @Override
+ public @Nullable String getId() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable DateAndTime getTimestamp() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable String getObjectId() {
+ // TODO Auto-generated method stub
+ return "ABCD";
+ }
+
+ @Override
+ public @Nullable String getNodeId() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable Integer getCounter() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable SourceType getSourceType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable String getNewValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable String getAttributeName() {
+ // TODO Auto-generated method stub
+ return "/network-element/extension[value-name=\"top-level-equipment\"]/value"; // "/equipment-pac/equipment-current-problems";
+ }
+
+ @Override
+ public Class<? extends DataContainer> getImplementedInterface() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ };
+
+ onfCoreNetworkElement12MW.notificationActor(eventlogEntity);
+
+ }
+
+
+ @Test
+ public void test1()
+ {
+ when (accessor.getTransactionUtils().readData(accessor.getDataBroker(),
+ LogicalDatastoreType.OPERATIONAL, NETWORKELEMENT_IID)).thenReturn(null);
+
+ ONFCoreNetworkElement12Microwave onfCoreNetworkElement12MW =
+ new ONFCoreNetworkElement12Microwave(accessor, serviceProvider, configuration,
+ onfMicrowaveModel); onfCoreNetworkElement12MW.prepareCheck();
+
+ EventlogEntity eventlogEntity = new EventlogEntity() {
+
+ @Override
+ public @Nullable String getId() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable DateAndTime getTimestamp() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable String getObjectId() {
+ // TODO Auto-generated method stub
+ return "ABCD";
+ }
+
+ @Override
+ public @Nullable String getNodeId() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable Integer getCounter() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable SourceType getSourceType() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable String getNewValue() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+
+ @Override
+ public @Nullable String getAttributeName() {
+ // TODO Auto-generated method stub
+ return "/equipment-pac/equipment-current-problems";
+ }
+
+ @Override
+ public Class<? extends DataContainer> getImplementedInterface() {
+ // TODO Auto-generated method stub
+ return null;
+ }
+ };
+
+ onfCoreNetworkElement12MW.notificationActor(eventlogEntity);
+ }
}
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.oran.impl;
import org.onap.ccsdk.features.sdnr.wt.common.database.HtDatabaseClient;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
* ============LICENSE_END==========================================================================
- ******************************************************************************/
+ */
/**
*
*/
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.oran.impl;
import java.util.List;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.oran.impl;
import org.opendaylight.yang.gen.v1.urn.o.ran.fm._1._0.rev190204.AlarmNotif;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.oran.impl;
import java.util.List;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.oran.impl;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.oran.test;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.oran.test;
import org.junit.Test;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.oran.test;
import static org.junit.Assert.assertEquals;
import static org.mockito.Mockito.when;
import static org.mockito.Mockito.*;
-import java.util.List;
import java.util.Optional;
import java.io.IOException;
-import java.util.Date;
-
import org.junit.After;
import org.junit.BeforeClass;
import org.junit.Test;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.test.mock.TransactionUtilsMock;
import org.opendaylight.yang.gen.v1.urn.o.ran.hardware._1._0.rev190328.ORANHWCOMPONENT;
import org.opendaylight.yang.gen.v1.urn.onf.params.xml.ns.yang.network.topology.simulator.rev191025.SimulatorStatus;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.ConnectionlogEntity;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.EventlogEntity;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultcurrentEntity;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.FaultlogEntity;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.Inventory;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.NetworkElementConnectionEntity;
-import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.PmdataEntity;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
import org.opendaylight.yangtools.yang.common.QName;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
public class TestORanNetworkElement {
- static NetconfAccessorMock accessor;
- static DeviceManagerServiceProvider serviceProvider;
- static Capabilities capabilities;
- QName qCapability;
-
- @SuppressWarnings("unchecked")
- @BeforeClass
- public static void init() throws InterruptedException, IOException {
- capabilities = mock(Capabilities.class);
- //accessor = mock(NetconfAccessorMock.class);
- accessor = spy(new NetconfAccessorMock(null, null, null, null));
- serviceProvider = mock(DeviceManagerServiceProvider.class);
-
- NodeId nNodeId = new NodeId("nSky");
- when(accessor.getCapabilites()).thenReturn(capabilities);
- when (accessor.getNodeId()).thenReturn(nNodeId);
- when (accessor.getTransactionUtils()).thenReturn(new TransactionUtilsMock());
-
- when(serviceProvider.getDataProvider()).thenReturn(new DataProvider() {
-
- @Override
- public void writeConnectionLog(ConnectionlogEntity event) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void writeEventLog(EventlogEntity event) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void writeFaultLog(FaultlogEntity fault) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void updateFaultCurrent(FaultcurrentEntity fault) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public int clearFaultsCurrentOfNode(String nodeName) {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
- public int clearFaultsCurrentOfNodeWithObjectId(String nodeName, String objectId) {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
- public List<String> getAllNodesWithCurrentAlarms() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void writeInventory(Inventory internalEquipment) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void updateNetworkConnectionDeviceType(
- NetworkElementConnectionEntity networkElementConnectionEntitiy, String nodeId) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void updateNetworkConnection22(NetworkElementConnectionEntity networkElementConnectionEntitiy,
- String nodeId) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public void removeNetworkConnection(String nodeId) {
- // TODO Auto-generated method stub
-
- }
-
- @Override
- public int doIndexClean(Date olderAreOutdated) {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
- public int getNumberOfOldObjects(Date olderAreOutdated) {
- // TODO Auto-generated method stub
- return 0;
- }
-
- @Override
- public List<NetworkElementConnectionEntity> getNetworkElementConnections() {
- // TODO Auto-generated method stub
- return null;
- }
-
- @Override
- public void doWritePerformanceData(List<PmdataEntity> list) {
- // TODO Auto-generated method stub
-
- }
-
- });
-
-
- }
-
- @Test
- public void test() {
- Optional<NetworkElement> oRanNe;
- when(accessor.getCapabilites().isSupportingNamespace(ORANHWCOMPONENT.QNAME)).thenReturn(true);
- when(accessor.getCapabilites().isSupportingNamespace(SimulatorStatus.QNAME)).thenReturn(false);
- ORanNetworkElementFactory factory = new ORanNetworkElementFactory();
- oRanNe = factory.create(accessor, serviceProvider);
- assertTrue((factory.create(accessor, serviceProvider)).isPresent());
- oRanNe.get().register();
- oRanNe.get().deregister();
- oRanNe.get().getAcessor();
- oRanNe.get().getDeviceType();
- assertEquals(oRanNe.get().getNodeId().getValue(), "nSky");
- }
-
- @After
- public void cleanUp() throws Exception {
-
- }
+ static NetconfAccessorMock accessor;
+ static DeviceManagerServiceProvider serviceProvider;
+ static Capabilities capabilities;
+ QName qCapability;
+
+ @BeforeClass
+ public static void init() throws InterruptedException, IOException {
+ capabilities = mock(Capabilities.class);
+ //accessor = mock(NetconfAccessorMock.class);
+ accessor = spy(new NetconfAccessorMock(null, null, null, null));
+ serviceProvider = mock(DeviceManagerServiceProvider.class);
+
+ NodeId nNodeId = new NodeId("nSky");
+ when(accessor.getCapabilites()).thenReturn(capabilities);
+ when (accessor.getNodeId()).thenReturn(nNodeId);
+ when (accessor.getTransactionUtils()).thenReturn(new TransactionUtilsMock());
+
+ DataProvider dataProvider = mock(DataProvider.class);
+ when(serviceProvider.getDataProvider()).thenReturn(dataProvider);
+ }
+
+ @Test
+ public void test() {
+ Optional<NetworkElement> oRanNe;
+ when(accessor.getCapabilites().isSupportingNamespace(ORANHWCOMPONENT.QNAME)).thenReturn(true);
+ when(accessor.getCapabilites().isSupportingNamespace(SimulatorStatus.QNAME)).thenReturn(false);
+ ORanNetworkElementFactory factory = new ORanNetworkElementFactory();
+ oRanNe = factory.create(accessor, serviceProvider);
+ assertTrue(factory.create(accessor, serviceProvider).isPresent());
+ oRanNe.get().register();
+ oRanNe.get().deregister();
+ oRanNe.get().getAcessor();
+ oRanNe.get().getDeviceType();
+ assertEquals(oRanNe.get().getNodeId().getValue(), "nSky");
+ }
+
+ @After
+ public void cleanUp() throws Exception {
+
+ }
}
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.oran.test;
import static org.junit.Assert.assertTrue;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.oran.test;
import static org.junit.Assert.assertEquals;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.oran.test.mock;
import com.google.common.util.concurrent.ListenableFuture;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.oran.test.mock;
import java.util.ArrayList;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.oran.test.mock;
import java.util.concurrent.atomic.AtomicBoolean;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.ne.factory;
import org.opendaylight.yangtools.concepts.ObjectRegistration;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.ne.factory;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
* ============LICENSE_END==========================================================================
- ******************************************************************************/
+ */
/**
*
*/
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.ne.service;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.types.InventoryInformationDcae;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.ne.service;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.ne.service;
import java.util.Optional;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.ne.service;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.service;
/**
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.service;
/**
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.service;
import org.eclipse.jdt.annotation.NonNull;
+import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
public interface DeviceManagerServiceProvider {
/** @return Event Handling service */
@NonNull
EventHandlingService getEventHandlingService();
+
+ /** @return Get configuration descriptor */
+ @NonNull ConfigurationFileRepresentation getConfigurationFileRepresentation();
}
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.service;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.service;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.service;
import org.eclipse.jdt.annotation.NonNull;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.service;
public interface MaintenanceService extends DeviceManagerService {
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.service;
import org.eclipse.jdt.annotation.NonNull;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.service;
import org.eclipse.jdt.annotation.NonNull;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.service;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElement;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.types;
import java.util.ArrayList;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.types;
import org.eclipse.jdt.annotation.Nullable;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.types;
import java.util.ArrayList;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.types;
import org.eclipse.jdt.annotation.Nullable;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.types;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.types;
import java.util.ArrayList;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.types;
import java.util.ArrayList;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.util;
public class UnkownDevicemanagerServiceException extends Exception {
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.aaiconnector.impl;
import java.util.List;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.aaiconnector.impl;
import java.io.IOException;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.aaiconnector.impl;
class URLParamEncoder {
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.aaiconnector.impl.config;
import java.io.File;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.aaiconnector.impl.config;
import java.io.File;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.archiveservice;
import java.util.Date;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.dcaeconnector.impl;
public void sendProblemNotification(String nodeId, ProblemNotificationXml notificationXml) {
//to prevent push alarms on reconnect
//=> only pushed alarms are forwared to dcae
- //dcaeProvider.sendProblemNotification(nodeName, notificationXml);
- if(aotsmClient!=null) {
+ if(dcaeProvider!=null) {
+ dcaeProvider.sendProblemNotification(nodeId, notificationXml);
+ }
+ if(aotsmClient!=null) {
aotsmClient.sendProblemNotification(nodeId, notificationXml);
}
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.dcaeconnector.impl;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.ProblemNotificationXml;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
* ============LICENSE_END==========================================================================
- ******************************************************************************/
+ */
/**
ecompProvider.sendProblemNotification(ownKeyName, notificationXml);
* ECOMP Messages are generated an send to destination
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.dcaeconnector.impl;
import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
* ============LICENSE_END==========================================================================
- ******************************************************************************/
+ */
/**
* Event provider to ECOMP for heartbeat message
*
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.dcaeconnector.impl;
import java.util.concurrent.Executors;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
* ============LICENSE_END==========================================================================
- ******************************************************************************/
+ */
/**
*
*/
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
* ============LICENSE_END==========================================================================
- ******************************************************************************/
+ */
/**
* Client for ECOMP notification server
*
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.dcaeconnector.impl.config;
import org.onap.ccsdk.features.sdnr.wt.common.configuration.Configuration;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
* ============LICENSE_END==========================================================================
- ******************************************************************************/
+ */
/**
* (c) highstreet technologies GmbH
*/
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.devicemonitor.impl;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.DeviceMonitoredNe;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.devicemonitor.impl;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.DeviceMonitoredNe;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
* ============LICENSE_END==========================================================================
- ******************************************************************************/
+ */
/**
* (c) 2017 highstreet technologies GmbH
*/
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
* ============LICENSE_END==========================================================================
- ******************************************************************************/
+ */
/**
* Problems generated by DeviceMonitor
*
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
* ============LICENSE_END==========================================================================
- ******************************************************************************/
+ */
/**
* @author herbert
*
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.devicemonitor.impl.config;
import org.onap.ccsdk.features.sdnr.wt.common.configuration.Configuration;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.eventdatahandler;
import java.util.List;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.eventdatahandler;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
-/*******************************************************************************
+/*
* ============LICENSE_START=======================================================
* ONAP : ccsdk feature sdnr wt
* ================================================================================
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
- ******************************************************************************/
+ */
package org.onap.ccsdk.features.sdnr.wt.devicemanager.housekeeping;
import com.google.common.util.concurrent.FluentFuture;
-/*******************************************************************************
+/*
* ============LICENSE_START=======================================================
* ONAP : ccsdk feature sdnr wt
* ================================================================================
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
- ******************************************************************************/
+ */
package org.onap.ccsdk.features.sdnr.wt.devicemanager.housekeeping;
import java.util.ArrayList;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.housekeeping;
import java.util.List;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.impl;
import java.util.List;
-/*******************************************************************************
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : ccsdk features
+ * ================================================================================
+ * Copyright (C) 2020 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=========================================================
+ *
+ */
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.impl;
import java.util.List;
private ClusterSingletonServiceRegistration cssRegistration;
private ClusterSingletonServiceRegistration cssRegistration2;
-
+ ConfigurationFileRepresentation config;
private Boolean devicemanagerInitializationOk;
// Blueprint 1
this.iEntityDataProvider.setReadyStatus(false);
- this.dataProvider = iEntityDataProvider.getDataProvider(); // Get configuration
+ this.dataProvider = iEntityDataProvider.getDataProvider();
- ConfigurationFileRepresentation config = new ConfigurationFileRepresentation(CONFIGURATIONFILE);
+ // Get configuration
+ this.config = new ConfigurationFileRepresentation(CONFIGURATIONFILE);
this.notificationDelayService = new DevicemanagerNotificationDelayService(config);
public @NonNull EventHandlingService getEventHandlingService() {
return this.odlEventListenerHandler;
}
+
+ @SuppressWarnings("null")
+ @Override
+ public @NonNull ConfigurationFileRepresentation getConfigurationFileRepresentation() {
+ return this.config;
+ }
+
// Deviceinitialization
/**
this.odlEventListenerHandler.writeEventLog(objectId, msg, value);
}
+
}
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.impl;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.impl;
import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.impl;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.impl.xml.ProblemNotificationXml;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.impl;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.impl.util;
import org.eclipse.jdt.annotation.Nullable;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
* ============LICENSE_END==========================================================================
- ******************************************************************************/
+ */
/**
* @author herbert
*
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
* ============LICENSE_END==========================================================================
- ******************************************************************************/
+ */
/**
*
*/
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.impl.xml;
import javax.xml.bind.annotation.XmlElement;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.impl.xml;
import java.util.regex.Matcher;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
* ============LICENSE_END==========================================================================
- ******************************************************************************/
+ */
/**
*
*/
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.impl.xml;
import com.fasterxml.jackson.annotation.JsonProperty;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.impl.xml;
import javax.xml.bind.annotation.XmlRootElement;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.impl.xml;
import javax.xml.bind.annotation.XmlRootElement;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.impl.xml;
import com.fasterxml.jackson.annotation.JsonIgnore;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.impl.xml;
import org.eclipse.jdt.annotation.NonNull;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.impl.xml;
import java.util.concurrent.Future;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* or implied. See the License for the specific language governing permissions and limitations under
* the License.
* ============LICENSE_END==========================================================================
- ******************************************************************************/
+ */
/**
*
*/
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.impl.xml;
import java.io.StringWriter;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.maintenance;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.devicemanager.rev190109.GetMaintenanceModeInput;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.maintenance.impl;
import java.time.format.DateTimeFormatter;
import java.time.format.DateTimeParseException;
import javax.annotation.Nonnull;
+
+import org.onap.ccsdk.features.sdnr.wt.common.HtAssert;
import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.yang.ietf.yang.types.rev130715.DateAndTime;
import org.opendaylight.yang.gen.v1.urn.opendaylight.params.xml.ns.yang.data.provider.rev190801.MaintenanceEntity;
import org.slf4j.Logger;
public class MaintenanceCalculator {
- private static final Logger LOG = LoggerFactory.getLogger(MaintenanceCalculator.class);
-
- private static ZoneId EsMaintenanceFilterTimeZone = ZoneId.of("UTC");
- //private static DateTimeFormatter FORMAT = DateTimeFormatter.ISO_DATE_TIME; // "1986-04-08T12:30:00"
- private static DateTimeFormatter FORMAT = DateTimeFormatter.ISO_OFFSET_DATE_TIME; // 2011-12-03T10:15:30+01:00
- private static ZonedDateTime EMPTYDATETIME = ZonedDateTime.ofInstant(Instant.EPOCH, EsMaintenanceFilterTimeZone);
-
- /** Intended to be used static **/
- private MaintenanceCalculator() {
- }
-
-
-
-
- /**
- * Verify maintenance status
- * @param maintenance if null false, else according to settings
- * @param objectIdRef NETCONF object id
- * @param problem name that was provided
- * @param now time to verify with
- * @return true if in maintenance status
- */
- public static boolean isONFObjectInMaintenance(MaintenanceEntity maintenance, String objectIdRef, String problem,
- ZonedDateTime now) {
-
- if (maintenance != null) {
- Boolean isActive = maintenance.isActive();
- if (isActive != null && isActive && isInMaintenance(maintenance, objectIdRef, problem, now)) {
- return true;
- }
-
- }
- return false;
- }
-
- /** Shortcut **/
- public static boolean isONFObjectInMaintenance(MaintenanceEntity maintenance, String objectIdRef, String problem) {
- return isONFObjectInMaintenance(maintenance, objectIdRef, problem, getNow());
- }
-
-
- /*---------------------------------------------
- * private static helper functions to verify
- */
-
- /**
- * Get the actual time in the Filter time zone.
- * @return actual Time
- */
- private static ZonedDateTime getNow() {
- return ZonedDateTime.now(EsMaintenanceFilterTimeZone);
- }
-
-
- /**
- * Verify if the filter is active for an object
- *
- * @param now point of time to verify
- * @return if the object is covered by filter and now within point of time
- */
- private static boolean isInMaintenance(MaintenanceEntity maintenance, String objectIdRef, String problem, ZonedDateTime now) {
- return appliesToObjectReference(maintenance, objectIdRef, problem) && isInPeriod(maintenance.getStart(), maintenance.getEnd(), now);
- }
-
- /**
- * Compare the if probe is within the range of start and end.
- *
- * @param start of range
- * @param end of range
- * @param probe time to verify
- * @return boolean result true if (start <= probe <= end)
- */
- public static boolean isInPeriod(DateAndTime start, DateAndTime end, ZonedDateTime probe) {
- ZonedDateTime startZT = valueOf(start.getValue());
- ZonedDateTime endZT = valueOf(end.getValue());
- return startZT.compareTo(endZT) < 0 && startZT.compareTo(probe) <= 0 && endZT.compareTo(probe) >= 0;
- }
-
- /**
- * Verify if the definied object is matching to the referenced object
- * @param definition definition with parameters
- * @param pObjectIdRef If empty considered as true
- * @param pProblem if empty considered as true
- * @return true if if referenced
- */
- private static boolean appliesToObjectReference(@Nonnull MaintenanceEntity definition, @Nonnull String pObjectIdRef, @Nonnull String pProblem) {
- boolean res = (pObjectIdRef.isEmpty() || pObjectIdRef.contains(definition.getObjectIdRef()))
- && (pProblem.isEmpty() || pProblem.contains(definition.getProblem()));
- LOG.debug("Check result applies {}: {} {} against: {}", res, pObjectIdRef, pProblem, definition);
- return res;
- }
-
- /**
- * Convert String to time value
- * @param zoneTimeString with time
- * @return ZonedDateTime string
- */
- public static ZonedDateTime valueOf(String zoneTimeString) {
- if (zoneTimeString == null || zoneTimeString.isEmpty()) {
- LOG.warn("Null or empty zoneTimeString");
- return EMPTYDATETIME;
- }
- try {
- return ZonedDateTime.parse(zoneTimeString, FORMAT);
- } catch (DateTimeParseException e) {
- LOG.warn("Can not parse zoneTimeString '{}'",zoneTimeString);
- return EMPTYDATETIME;
- }
- }
+ private static final Logger LOG = LoggerFactory.getLogger(MaintenanceCalculator.class);
+
+ private static ZoneId EsMaintenanceFilterTimeZone = ZoneId.of("UTC");
+ //private static DateTimeFormatter FORMAT = DateTimeFormatter.ISO_DATE_TIME; // "1986-04-08T12:30:00"
+ private static DateTimeFormatter FORMAT = DateTimeFormatter.ISO_OFFSET_DATE_TIME; // 2011-12-03T10:15:30+01:00
+ private static ZonedDateTime EMPTYDATETIME = ZonedDateTime.ofInstant(Instant.EPOCH, EsMaintenanceFilterTimeZone);
+
+ /** Intended to be used static **/
+ private MaintenanceCalculator() {
+ }
+
+ /**
+ * Verify maintenance status
+ * @param maintenance if null false, else according to settings
+ * @param objectIdRef NETCONF object id
+ * @param problem name that was provided
+ * @param now time to verify with
+ * @return true if in maintenance status
+ */
+ public static boolean isONFObjectInMaintenance(MaintenanceEntity maintenance, String objectIdRef, String problem,
+ ZonedDateTime now) {
+
+ if (maintenance != null) {
+ Boolean isActive = maintenance.isActive();
+ if (isActive != null && isActive && isInMaintenance(maintenance, objectIdRef, problem, now)) {
+ return true;
+ }
+
+ }
+ return false;
+ }
+
+ /** Shortcut **/
+ public static boolean isONFObjectInMaintenance(MaintenanceEntity maintenance, String objectIdRef, String problem) {
+ return isONFObjectInMaintenance(maintenance, objectIdRef, problem, getNow());
+ }
+
+ /*---------------------------------------------
+ * private static helper functions to verify
+ */
+
+ /**
+ * Get the actual time in the Filter time zone.
+ * @return actual Time
+ */
+ private static ZonedDateTime getNow() {
+ return ZonedDateTime.now(EsMaintenanceFilterTimeZone);
+ }
+
+ /**
+ * Verify if the filter is active for an object
+ *
+ * @param now point of time to verify
+ * @return if the object is covered by filter and now within point of time
+ */
+ private static boolean isInMaintenance(MaintenanceEntity maintenance, String objectIdRef, String problem,
+ ZonedDateTime now) {
+ return appliesToObjectReference(maintenance, objectIdRef, problem)
+ && isInPeriod(maintenance.getStart(), maintenance.getEnd(), now);
+ }
+
+ /**
+ * Compare the if probe is within the range of start and end.
+ *
+ * @param start of range
+ * @param end of range
+ * @param probe time to verify
+ * @return boolean result true if (start <= probe <= end)
+ */
+ public static boolean isInPeriod(DateAndTime start, DateAndTime end, ZonedDateTime probe) {
+ HtAssert.nonnull(start,end,probe);
+ ZonedDateTime startZT = valueOf(start.getValue());
+ ZonedDateTime endZT = valueOf(end.getValue());
+ return startZT.compareTo(endZT) < 0 && startZT.compareTo(probe) <= 0 && endZT.compareTo(probe) >= 0;
+ }
+
+ /**
+ * Verify if the definied object is matching to the referenced object
+ * @param definition definition with parameters
+ * @param pObjectIdRef object-id-ref of fault notification
+ * @param pProblem problem of fault notification
+ * @return true if if referenced
+ */
+ private static boolean appliesToObjectReference(@Nonnull MaintenanceEntity definition, @Nonnull String pObjectIdRef,
+ @Nonnull String pProblem) {
+ HtAssert.nonnull(definition,pObjectIdRef,pProblem);
+ boolean res = (definition.getObjectIdRef()==null || pObjectIdRef.contains(definition.getObjectIdRef()))
+ && (definition.getProblem()==null || pProblem.contains(definition.getProblem()));
+ LOG.debug("Check result applies {}: {} {} against: {}", res, pObjectIdRef, pProblem, definition);
+ return res;
+ }
+
+ /**
+ * Convert String to time value
+ * @param zoneTimeString with time
+ * @return ZonedDateTime string
+ */
+ public static ZonedDateTime valueOf(String zoneTimeString) {
+ if (zoneTimeString == null || zoneTimeString.isEmpty()) {
+ LOG.warn("Null or empty zoneTimeString");
+ return EMPTYDATETIME;
+ }
+ try {
+ return ZonedDateTime.parse(zoneTimeString, FORMAT);
+ } catch (DateTimeParseException e) {
+ LOG.warn("Can not parse zoneTimeString '{}'", zoneTimeString);
+ return EMPTYDATETIME;
+ }
+ }
}
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.maintenance.impl;
import java.time.ZonedDateTime;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.performancemanager.impl;
import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.performancemanager.impl;
import java.util.Iterator;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.performancemanager.impl.config;
import org.onap.ccsdk.features.sdnr.wt.common.configuration.Configuration;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.toggleAlarmFilter;
import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.toggleAlarmFilter;
import java.util.Map.Entry;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.toggleAlarmFilter;
import java.util.HashMap;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.toggleAlarmFilter;
public interface NotificationDelayedListener<T> {
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.toggleAlarmFilter;
public class NotificationWithServerTimeStamp<T2> {
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.toggleAlarmFilter;
/**
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.toggleAlarmFilter.conf;
import org.onap.ccsdk.features.sdnr.wt.common.configuration.Configuration;
-/*******************************************************************************
+/*
* ============LICENSE_START=======================================================
* ONAP : ccsdk feature sdnr wt
* ================================================================================
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
- ******************************************************************************/
+ */
package org.onap.ccsdk.features.sdnr.wt.devicemanager.test;
import static org.junit.Assert.assertEquals;
-/*******************************************************************************
+/*
* ============LICENSE_START=======================================================
* ONAP : ccsdk feature sdnr wt
* ================================================================================
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
- ******************************************************************************/
+ */
package org.onap.ccsdk.features.sdnr.wt.devicemanager.test;
import static org.junit.Assert.fail;
-/*******************************************************************************
+/*
* ============LICENSE_START=======================================================
* ONAP : ccsdk feature sdnr wt
* ================================================================================
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
- ******************************************************************************/
+ */
package org.onap.ccsdk.features.sdnr.wt.devicemanager.test;
import static org.junit.Assert.assertNotNull;
-/*******************************************************************************
+/*
* ============LICENSE_START=======================================================
* ONAP : ccsdk feature sdnr wt
* ================================================================================
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
- ******************************************************************************/
+ */
package org.onap.ccsdk.features.sdnr.wt.devicemanager.test;
import java.io.File;
-/*******************************************************************************
+/*
* ============LICENSE_START=======================================================
* ONAP : ccsdk feature sdnr wt
* ================================================================================
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
- ******************************************************************************/
+ */
package org.onap.ccsdk.features.sdnr.wt.devicemanager.test;
import static org.junit.Assert.assertTrue;
FaultService n = deviceManager.getFaultService();
FaultlogBuilder faultLogEntityBuilder = new FaultlogBuilder();
- n.faultNotification(faultLogEntityBuilder.build());
+ n.faultNotification(faultLogEntityBuilder.setNodeId("node1").build());
}
-/*******************************************************************************
+/*
* ============LICENSE_START=======================================================
* ONAP : ccsdk feature sdnr wt
* ================================================================================
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
- ******************************************************************************/
+ */
package org.onap.ccsdk.features.sdnr.wt.devicemanager.test;
import static org.junit.Assert.assertFalse;
ZonedDateTime now;
now = MaintenanceCalculator.valueOf("2000-01-01T00:00Z");
- res = MaintenanceCalculator.isONFObjectInMaintenance(mb.build(), "", "", now);
+ res = MaintenanceCalculator.isONFObjectInMaintenance(mb.build(), "Interface1", "Problem1", now);
assertTrue("within period",res);
now = MaintenanceCalculator.valueOf("2002-01-01T00:00Z");
-/*******************************************************************************
+/*
* ============LICENSE_START=======================================================
* ONAP : ccsdk feature sdnr wt
* ================================================================================
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
- ******************************************************************************/
+ */
package org.onap.ccsdk.features.sdnr.wt.devicemanager.test;
import static org.junit.Assert.assertEquals;
-/*******************************************************************************
+/*
* ============LICENSE_START=======================================================
* ONAP : ccsdk feature sdnr wt
* ================================================================================
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
- ******************************************************************************/
+ */
package org.onap.ccsdk.features.sdnr.wt.devicemanager.test;
import org.junit.Test;
-/*******************************************************************************
+/*
* ============LICENSE_START=======================================================
* ONAP : ccsdk feature sdnr wt
* ================================================================================
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
- ******************************************************************************/
+ */
package org.onap.ccsdk.features.sdnr.wt.devicemanager.test;
import static org.junit.Assert.assertFalse;
-/*******************************************************************************
+/*
* ============LICENSE_START=======================================================
* ONAP : ccsdk feature sdnr wt
* ================================================================================
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
- ******************************************************************************/
+ */
package org.onap.ccsdk.features.sdnr.wt.devicemanager.test;
import static org.junit.Assert.assertTrue;
-/*******************************************************************************
+/*
* ============LICENSE_START=======================================================
* ONAP : ccsdk feature sdnr wt
* ================================================================================
* See the License for the specific language governing permissions and
* limitations under the License.
* ============LICENSE_END=========================================================
- ******************************************************************************/
+ */
package org.onap.ccsdk.features.sdnr.wt.devicemanager.test.mock;
import java.util.Set;
-/*******************************************************************************
+/*
* ============LICENSE_START========================================================================
* ONAP : ccsdk feature sdnr wt
* =================================================================================================
* 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.test.util;
import java.text.ParseException;