2 * ============LICENSE_START=======================================================
3 * ONAP : ccsdk features
4 * ================================================================================
5 * Copyright (C) 2020 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.openroadm.test.mock;
24 import com.google.common.util.concurrent.ListenableFuture;
25 import java.util.List;
26 import org.eclipse.jdt.annotation.NonNull;
27 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.Capabilities;
28 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.NetconfAccessor;
29 import org.onap.ccsdk.features.sdnr.wt.netconfnodestateservice.TransactionUtils;
30 import org.opendaylight.mdsal.binding.api.DataBroker;
31 import org.opendaylight.mdsal.binding.api.MountPoint;
32 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netconf.notification._1._0.rev080714.CreateSubscriptionOutput;
33 import org.opendaylight.yang.gen.v1.urn.ietf.params.xml.ns.netmod.notification.rev080714.netconf.streams.Stream;
34 import org.opendaylight.yang.gen.v1.urn.opendaylight.netconf.node.topology.rev150114.NetconfNode;
35 import org.opendaylight.yang.gen.v1.urn.tbd.params.xml.ns.yang.network.topology.rev131021.NodeId;
36 import org.opendaylight.yangtools.concepts.ListenerRegistration;
37 import org.opendaylight.yangtools.yang.binding.NotificationListener;
38 import org.opendaylight.yangtools.yang.common.RpcResult;
42 public class NetconfAccessorMock implements NetconfAccessor {
44 private final NodeId nNodeId;
45 private final NetconfNode netconfNode;
46 private final MountPoint mountpoint;
47 private final DataBroker netconfNodeDataBroker;
49 public NetconfAccessorMock(NodeId nNodeId, NetconfNode netconfNode, MountPoint mountpoint,
50 DataBroker netconfNodeDataBroker) {
51 this.nNodeId = nNodeId;
52 this.netconfNode = netconfNode;
53 this.mountpoint = mountpoint;
54 this.netconfNodeDataBroker = netconfNodeDataBroker;
58 public NodeId getNodeId() {
63 public NetconfNode getNetconfNode() {
68 public Capabilities getCapabilites() {
73 public DataBroker getDataBroker() {
74 return netconfNodeDataBroker;
78 public MountPoint getMountpoint() {
83 public TransactionUtils getTransactionUtils() {
88 public <T extends NotificationListener> ListenerRegistration<NotificationListener> doRegisterNotificationListener(
89 @NonNull T listener) {
94 public ListenableFuture<RpcResult<CreateSubscriptionOutput>> registerNotificationsStream(String streamName) {
99 public void registerNotificationsStream(List<Stream> streamList) {
103 public boolean isNCNotificationsSupported() {
108 public List<Stream> getNotificationStreams() {