2 * ============LICENSE_START=======================================================
3 * ONAP : ccsdk features
4 * ================================================================================
5 * Copyright (C) 2023 highstreet technologies GmbH Intellectual Property.
7 * ================================================================================
8 * Licensed under the Apache License, Version 2.0 (the "License");
9 * you may not use this file except in compliance with the License.
10 * You may obtain a copy of the License at
12 * http://www.apache.org/licenses/LICENSE-2.0
14 * Unless required by applicable law or agreed to in writing, software
15 * distributed under the License is distributed on an "AS IS" BASIS,
16 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
17 * See the License for the specific language governing permissions and
18 * limitations under the License.
19 * ============LICENSE_END=========================================================
22 package org.onap.ccsdk.features.sdnr.wt.devicemanager.oran.yangspecs;
24 import java.util.Arrays;
25 import java.util.List;
26 import java.util.Optional;
27 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities;
28 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfDomAccessor;
29 import org.opendaylight.yangtools.yang.common.QName;
30 import org.opendaylight.yangtools.yang.common.QNameModule;
31 import org.opendaylight.yangtools.yang.common.Revision;
32 import org.opendaylight.yangtools.yang.common.XMLNamespace;
34 public class ORANFM extends YangModule {
36 public static final String NAMESPACE = "urn:o-ran:fm:1.0";
37 public static final QNameModule ORANFM_2019_02_04 =
38 QNameModule.create(XMLNamespace.of(NAMESPACE), Revision.of("2019-02-04"));
39 public static final QNameModule ORANFM_2022_08_15 =
40 QNameModule.create(XMLNamespace.of(NAMESPACE), Revision.of("2022-08-15"));
41 private static final List<QNameModule> MODULES = Arrays.asList(ORANFM_2019_02_04, ORANFM_2022_08_15);
43 ORANFM(NetconfDomAccessor netconfDomAccessor, QNameModule module) {
44 super(netconfDomAccessor, module);
47 public QName getFaultSourceQName() {
48 return getQName("fault-source");
51 public QName getFaultIdQName() {
52 return getQName("fault-id");
55 public QName getFaultSeverityQName() {
56 return getQName("fault-severity");
59 public QName getFaultTextQName() {
60 return getQName("fault-text");
63 public QName getAlarmNotifQName() {
64 return getQName("alarm-notif");
67 public QName getFaultIsClearedQName() {
68 return getQName("is-cleared");
71 public QName getFaultEventTimeQName() {
72 return getQName("event-time");
75 public QName getFaultActiveAlarmListQName() {
76 return getQName("active-alarm-list");
79 public QName getFaultActiveAlarmsQName() {
80 return getQName("active-alarms");
84 * Get specific instance, depending on capabilities
89 public static Optional<ORANFM> getModule(NetconfDomAccessor netconfDomAccessor) {
90 Capabilities capabilities = netconfDomAccessor.getCapabilites();
91 for (QNameModule module : MODULES) {
92 if (capabilities.isSupportingNamespaceAndRevision(module)) {
93 return Optional.of(new ORANFM(netconfDomAccessor, module));
96 return Optional.empty();