this.oranDomChangeNotificationListener =
new ORanDOMChangeNotificationListener(netconfDomAccessor, vesCollectorService, databaseService);
if(oranfm.isEmpty()) {
+ LOG.error("unable to detect ORAN FM module version");
throw new RuntimeException("unable to detect ORAN FM module version");
}
this.oranDomFaultNotificationListener =
import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.factory.NetworkElementFactory;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElement;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.config.ORanDMConfig;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.util.ORanDeviceManagerQNames;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.yangspecs.OranHardware;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities;
import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
QName.create("urn:onf:otcc:wireless:yang:radio-access:commscope-onecell", "2020-06-22", "onecell").intern();
private ORanDMConfig oranSupervisionConfig;
private ConfigurationFileRepresentation configFileRepresentation;
+ private Optional<OranHardware> oranhw = Optional.empty();
- public ORanNetworkElementFactory(ConfigurationFileRepresentation configFileRepresentation, ORanDMConfig oranSupervisionConfig) {
+ public ORanNetworkElementFactory(ConfigurationFileRepresentation configFileRepresentation,
+ ORanDMConfig oranSupervisionConfig) {
this.configFileRepresentation = configFileRepresentation;
this.oranSupervisionConfig = oranSupervisionConfig;
}
@Override
public Optional<NetworkElement> create(NetconfAccessor accessor, DeviceManagerServiceProvider serviceProvider) {
+ Optional<NetconfDomAccessor> domAccessor = accessor.getNetconfDomAccessor();
+ if (domAccessor.isPresent()) {
+ this.oranhw = OranHardware.getModule(accessor.getNetconfDomAccessor().get());
+ }
Capabilities capabilites = accessor.getCapabilites();
if (!capabilites.isSupportingNamespace(OneCell)) {
- if (capabilites.isSupportingNamespace(ORanDeviceManagerQNames.ORAN_HW_COMPONENT)) {
+ if (this.oranhw.isPresent()) {
log.info("Create device {} ", ORanDOMNetworkElement.class.getName());
- Optional<NetconfDomAccessor> domAccessor = accessor.getNetconfDomAccessor();
- if (domAccessor.isPresent()) {
- return Optional.of(new ORanDOMNetworkElement(domAccessor.get(), serviceProvider, oranSupervisionConfig, configFileRepresentation));
- }
+ return Optional.of(new ORanDOMNetworkElement(domAccessor.get(), serviceProvider, oranSupervisionConfig,
+ configFileRepresentation));
}
}
return Optional.empty();
QName.create(CALLHOME_SERVER_MODULE, "unique-id");
//o-ran-hardware.yang
- public static final String ORAN_HW_NS = "urn:o-ran:hardware:1.0";
- public static final String ORAN_HW_REVISION = "2019-03-28";
- public static final @NonNull QName ORAN_HW_MODULE = QName.create(ORAN_HW_NS, ORAN_HW_REVISION, "o-ran-hardware").intern();
- public static final @NonNull QName ORAN_HW_COMPONENT = QName.create(ORAN_HW_MODULE, "O-RAN-HW-COMPONENT");
+// public static final String ORAN_HW_NS = "urn:o-ran:hardware:1.0";
+// public static final String ORAN_HW_REVISION = "2024-04-15";
+// public static final @NonNull QName ORAN_HW_MODULE = QName.create(ORAN_HW_NS, ORAN_HW_REVISION, "o-ran-hardware").intern();
+// public static final @NonNull QName ORAN_HW_COMPONENT = QName.create(ORAN_HW_MODULE, "O-RAN-HW-COMPONENT");
//ietf-netconf-notifications.yang
public static final String IETF_NETCONF_NOTIFICATIONS_NS = "urn:ietf:params:xml:ns:yang:ietf-netconf-notifications";
QNameModule.of(XMLNamespace.of(NAMESPACE), Revision.of("2019-02-04"));
public static final QNameModule ORANFM_2022_08_15 =
QNameModule.of(XMLNamespace.of(NAMESPACE), Revision.of("2022-08-15"));
- private static final List<QNameModule> MODULES = Arrays.asList(ORANFM_2019_02_04, ORANFM_2022_08_15);
+ public static final QNameModule ORANFM_2024_08_12 =
+ QNameModule.of(XMLNamespace.of(NAMESPACE), Revision.of("2024-08-12"));
+ private static final List<QNameModule> MODULES = Arrays.asList(ORANFM_2019_02_04, ORANFM_2022_08_15, ORANFM_2024_08_12);
ORANFM(NetconfDomAccessor netconfDomAccessor, QNameModule module) {
super(netconfDomAccessor, module);
--- /dev/null
+/*
+ * ============LICENSE_START=======================================================
+ * ONAP : ccsdk features
+ * ================================================================================
+ * Copyright (C) 2025 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.oran.yangspecs;
+
+import java.util.Arrays;
+import java.util.List;
+import java.util.Optional;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities;
+import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfDomAccessor;
+import org.opendaylight.yangtools.yang.common.QName;
+import org.opendaylight.yangtools.yang.common.QNameModule;
+import org.opendaylight.yangtools.yang.common.Revision;
+import org.opendaylight.yangtools.yang.common.XMLNamespace;
+
+public class OranHardware extends YangModule {
+
+ public static final String NAMESPACE = "urn:o-ran:hardware:1.0";
+ public static final QNameModule ORANHW_2019_03_28 =
+ QNameModule.of(XMLNamespace.of(NAMESPACE), Revision.of("2019-03-28"));
+ public static final QNameModule ORANHW_2024_04_15 =
+ QNameModule.of(XMLNamespace.of(NAMESPACE), Revision.of("2024-04-15"));
+ private static final List<QNameModule> MODULES = Arrays.asList(ORANHW_2019_03_28, ORANHW_2024_04_15);
+
+ OranHardware(NetconfDomAccessor netconfDomAccessor, QNameModule module) {
+ super(netconfDomAccessor, module);
+ }
+
+ public QName getModuleQName() {
+ return getQName("o-ran-hardware");
+ }
+
+ public QName getComponentQName() {
+ return getQName("O-RAN-HW-COMPONENT");
+ }
+
+
+ /**
+ * Get specific instance, depending on capabilities
+ *
+ * @param netconfDomAccessor
+ * @return
+ */
+ public static Optional<OranHardware> getModule(NetconfDomAccessor netconfDomAccessor) {
+ Capabilities capabilities = netconfDomAccessor.getCapabilites();
+ for (QNameModule module : MODULES) {
+ if (capabilities.isSupportingNamespaceAndRevision(module)) {
+ return Optional.of(new OranHardware(netconfDomAccessor, module));
+ }
+ }
+ return Optional.empty();
+ }
+
+}
import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.ne.service.NetworkElement;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.config.ORanDMConfig;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.util.ORanDeviceManagerQNames;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.yangspecs.ORANFM;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.yangspecs.OnapSystem;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.yangspecs.OranHardware;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.NotificationProxyParser;
@Test
public void test() {
Optional<NetworkElement> oRanNe;
- when(capabilities.isSupportingNamespace(ORanDeviceManagerQNames.ORAN_HW_COMPONENT)).thenReturn(true);
+ when(capabilities.isSupportingNamespaceAndRevision(
+ QNameModule.of(XMLNamespace.of(OranHardware.NAMESPACE), Revision.of("2019-03-28")))).thenReturn(true);
when(capabilities.isSupportingNamespace(OneCell)).thenReturn(false);
when(capabilities.isSupportingNamespace(OnapSystem1)).thenReturn(false);
import org.onap.ccsdk.features.sdnr.wt.common.configuration.ConfigurationFileRepresentation;
import org.onap.ccsdk.features.sdnr.wt.dataprovider.model.DataProvider;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.config.ORanDMConfig;
-import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.util.ORanDeviceManagerQNames;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.yangspecs.ORANFM;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.yangspecs.OnapSystem;
+import org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.yangspecs.OranHardware;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.DeviceManagerServiceProvider;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.FaultService;
import org.onap.ccsdk.features.sdnr.wt.devicemanager.service.VESCollectorService;
@Test
public void testCreateORANHWComponent() throws Exception {
- when(domAccessor.getCapabilites().isSupportingNamespace(ORanDeviceManagerQNames.ORAN_HW_COMPONENT)).thenReturn(true);
+ when(capabilities.isSupportingNamespaceAndRevision(
+ QNameModule.of(XMLNamespace.of(OranHardware.NAMESPACE), Revision.of("2019-03-28")))).thenReturn(true);
ORanNetworkElementFactory factory = new ORanNetworkElementFactory(oranCfg, oranDmConfig);
assertTrue((factory.create(accessor, serviceProvider)).isPresent());
}
@Test
public void testCreateNone() throws Exception {
- when(domAccessor.getCapabilites().isSupportingNamespace(ORanDeviceManagerQNames.ORAN_HW_COMPONENT)).thenReturn(false);
+ when(capabilities.isSupportingNamespaceAndRevision(
+ QNameModule.of(XMLNamespace.of(OranHardware.NAMESPACE), Revision.of("2019-03-28")))).thenReturn(false);
ORanNetworkElementFactory factory = new ORanNetworkElementFactory(oranCfg, oranDmConfig);
assertTrue(!(factory.create(accessor, serviceProvider).isPresent()));
}