blob: afb9015c5ffa5cba1cb0898a956d2fb09d5cc5e8 [file] [log] [blame]
Yuta HIGUCHI8810aa42017-08-02 15:05:37 -07001/*
2 * Copyright 2017-present Open Networking Foundation
3 *
4 * Licensed under the Apache License, Version 2.0 (the "License");
5 * you may not use this file except in compliance with the License.
6 * You may obtain a copy of the License at
7 *
8 * http://www.apache.org/licenses/LICENSE-2.0
9 *
10 * Unless required by applicable law or agreed to in writing, software
11 * distributed under the License is distributed on an "AS IS" BASIS,
12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13 * See the License for the specific language governing permissions and
14 * limitations under the License.
15 */
16package org.onosproject.netconf;
17
Yuta HIGUCHIdd7c3f82017-09-03 14:18:01 -070018import java.util.Collections;
19import java.util.Set;
Yuta HIGUCHI8810aa42017-08-02 15:05:37 -070020import java.util.concurrent.CompletableFuture;
21
22import org.onlab.util.Tools;
23
24/**
25 * Adapter mainly intended for usage in tests.
26 */
Yuta HIGUCHI4f55c672018-06-14 18:10:43 -070027public class NetconfSessionAdapter
28 extends AbstractNetconfSession
29 implements NetconfSession {
30
31 // TODO remove methods defined in AbstractNetconfSession
Yuta HIGUCHI8810aa42017-08-02 15:05:37 -070032
33 @Override
34 public void startSubscription(String filterSchema) throws NetconfException {
35 }
36
37 @Override
38 public void startSubscription() throws NetconfException {
39 }
40
41 @Override
Yuta HIGUCHI8810aa42017-08-02 15:05:37 -070042 public String requestSync(String request) throws NetconfException {
43 return null;
44 }
45
46 @Override
47 public CompletableFuture<String> request(String request)
48 throws NetconfException {
49 return Tools.exceptionalFuture(new UnsupportedOperationException());
50 }
51
52 @Override
Yuta HIGUCHI4f55c672018-06-14 18:10:43 -070053 public CompletableFuture<String> rpc(String request)
54 throws NetconfException {
55 return Tools.exceptionalFuture(new UnsupportedOperationException());
56 }
57
58
59 @Override
Yuta HIGUCHI8810aa42017-08-02 15:05:37 -070060 public void removeDeviceOutputListener(NetconfDeviceOutputEventListener listener) {
61 }
62
63 @Override
64 public String getSessionId() {
65 return null;
66 }
67
68 @Override
Yuta HIGUCHI8810aa42017-08-02 15:05:37 -070069 public String get(String filterSchema, String withDefaultsMode)
70 throws NetconfException {
71 return null;
72 }
73
74 @Override
75 public String get(String request) throws NetconfException {
76 return null;
77 }
78
79 @Override
80 public void endSubscription() throws NetconfException {
81 }
82
83 @Override
84 public boolean editConfig(String newConfiguration) throws NetconfException {
85 return true;
86 }
87
88 @Override
89 public String doWrappedRpc(String request) throws NetconfException {
90 return null;
91 }
92
93 @Override
Yuta HIGUCHIdd7c3f82017-09-03 14:18:01 -070094 public boolean copyConfig(DatastoreId destination, DatastoreId source)
95 throws NetconfException {
96 return true;
97 }
98
99 @Override
100 public boolean copyConfig(DatastoreId netconfTargetConfig,
101 String newConfiguration)
102 throws NetconfException {
103 return true;
104 }
105
106 @Override
Yuta HIGUCHI8810aa42017-08-02 15:05:37 -0700107 public boolean copyConfig(String netconfTargetConfig,
108 String newConfiguration)
109 throws NetconfException {
110 return true;
111 }
112
113 @Override
114 public boolean close() throws NetconfException {
115 return true;
116 }
117
118 @Override
119 public void addDeviceOutputListener(NetconfDeviceOutputEventListener listener) {
120 }
Yuta HIGUCHIdd7c3f82017-09-03 14:18:01 -0700121
122 @Override
123 public String getConfig(DatastoreId netconfTargetConfig)
124 throws NetconfException {
125 return null;
126 }
127
128 @Override
129 public String getConfig(DatastoreId netconfTargetConfig,
130 String configurationFilterSchema)
131 throws NetconfException {
132 return null;
133 }
134
135 @Override
136 public boolean editConfig(DatastoreId netconfTargetConfig, String mode,
137 String newConfiguration)
138 throws NetconfException {
139 return true;
140 }
141
142 @Override
143 public boolean deleteConfig(DatastoreId netconfTargetConfig)
144 throws NetconfException {
145 return true;
146 }
147
148 @Override
149 public boolean lock(DatastoreId datastore) throws NetconfException {
150 return true;
151 }
152
153 @Override
154 public boolean unlock(DatastoreId datastore) throws NetconfException {
155 return true;
156 }
157
158 @Override
159 public Set<String> getDeviceCapabilitiesSet() {
160 return Collections.emptySet();
161 }
Yuta HIGUCHI8810aa42017-08-02 15:05:37 -0700162}