diff options
author | Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> | 2023-10-20 14:30:41 +0530 |
---|---|---|
committer | Ravi Pendurty <ravi.pendurty@highstreet-technologies.com> | 2023-10-20 14:31:01 +0530 |
commit | ea5ba02bdfd1ed6e16683b01f1f499cb2473e37e (patch) | |
tree | a12785119b185c6ec3777ad7826dc4c27f0c26ef /sdnr/wt/netconfnode-state-service/model | |
parent | 70cc4c4295376e4af9cb9009a6ee5ddc389d61d9 (diff) |
Support multiple YANG revisions
Provide o-ran-supervision messages to VES collector
Issue-ID: CCSDK-3948
Change-Id: I16cb880414dde00a48fa59d8b90251beedae2c0e
Signed-off-by: Ravi Pendurty <ravi.pendurty@highstreet-technologies.com>
Diffstat (limited to 'sdnr/wt/netconfnode-state-service/model')
3 files changed, 65 insertions, 1 deletions
diff --git a/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/Capabilities.java b/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/Capabilities.java index 7448c9fb7..08b2df6d3 100644 --- a/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/Capabilities.java +++ b/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/Capabilities.java @@ -28,12 +28,14 @@ import java.util.Date; import java.util.List; import java.util.Optional; import javax.annotation.Nullable; +import org.eclipse.jdt.annotation.NonNull; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev221225.connection.oper.AvailableCapabilities; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev221225.connection.oper.UnavailableCapabilities; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev221225.connection.oper.available.capabilities.AvailableCapability; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.device.rev221225.connection.oper.unavailable.capabilities.UnavailableCapability; import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev221225.NetconfNode; import org.opendaylight.yangtools.yang.common.QName; +import org.opendaylight.yangtools.yang.common.QNameModule; import org.opendaylight.yangtools.yang.common.Revision; import org.slf4j.Logger; import org.slf4j.LoggerFactory; @@ -152,6 +154,19 @@ public class Capabilities { } /** + * check if the namespace and its revision of module are supported by the given capabilities + * + * @param module + * @return true if supporting the model AND revision<br> + * false if revision not available or both not found. + */ + public boolean isSupportingNamespaceAndRevision(QNameModule module) { + String namespace = module.getNamespace().toString(); + @NonNull Optional<Revision> revision = module.getRevision(); + return revision.isEmpty() ? false : isSupportingNamespaceAndRevision(namespace, revision.get().toString()); + } + + /** * Provide namespace and its revision as String. * * @param qCapability capability from the model diff --git a/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/DomContext.java b/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/DomContext.java new file mode 100644 index 000000000..fe016a917 --- /dev/null +++ b/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/DomContext.java @@ -0,0 +1,38 @@ +/* + * ============LICENSE_START======================================================= + * ONAP : ccsdk features + * ================================================================================ + * Copyright (C) 2023 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.netconfnodestateservice; + +import org.opendaylight.mdsal.binding.dom.codec.api.BindingNormalizedNodeSerializer; +import org.opendaylight.yangtools.yang.parser.api.YangParserFactory; + +public interface DomContext { + + /** + * @return BindingNormalizedNodeSerializer + */ + public BindingNormalizedNodeSerializer getBindingNormalizedNodeSerializer(); + + /** + * @return YangParserFactory + */ + public YangParserFactory getYangParserFactory(); +} diff --git a/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfDomAccessor.java b/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfDomAccessor.java index b7eba42b8..2a36cfd96 100644 --- a/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfDomAccessor.java +++ b/sdnr/wt/netconfnode-state-service/model/src/main/java/org/onap/ccsdk/features/sdnr/wt/netconfnodestateservice/NetconfDomAccessor.java @@ -29,6 +29,7 @@ import org.opendaylight.mdsal.dom.api.DOMDataBroker; import org.opendaylight.mdsal.dom.api.DOMMountPoint; import org.opendaylight.mdsal.dom.api.DOMNotificationListener; import org.opendaylight.mdsal.dom.api.DOMRpcResult; +import org.opendaylight.mdsal.dom.api.DOMRpcService; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.CreateSubscriptionInput; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.create.subscription.input.Filter; import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.streams.Stream; @@ -52,10 +53,20 @@ public interface NetconfDomAccessor extends NetconfAccessor { /** * @return the MDSAL Mountpoint service - **/ + */ DOMMountPoint getMountpoint(); /** + * @return DOMRpcService + */ + DOMRpcService getRpcService(); + + /** + * @return DomContext + */ + DomContext getDomContext(); + + /** * Deliver the data into a class * * @param <T> DataObject type |