blob: de397da40a5429a6f21063ff6aad37e1a5eeb317 [file] [log] [blame]
Yuta HIGUCHI24057822017-08-02 15:03:51 -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.config;
17
18import static org.onosproject.yang.model.RpcOutput.Status.RPC_NODATA;
19
20import java.util.concurrent.CompletableFuture;
21
22import org.onosproject.event.ListenerRegistry;
23import org.onosproject.yang.model.DataNode;
24import org.onosproject.yang.model.ResourceId;
25import org.onosproject.yang.model.RpcInput;
26import org.onosproject.yang.model.RpcOutput;
27
28/**
29 * Adapter for DynamicConfigService.
30 */
31public class DynamicConfigServiceAdapter
32 implements DynamicConfigService {
33
34 protected final ListenerRegistry<DynamicConfigEvent, DynamicConfigListener>
35 listenerRegistry = new ListenerRegistry<>();
36
37
38
39 @Override
40 public void createNode(ResourceId path, DataNode node) {
41 }
42
43 @Override
44 public DataNode readNode(ResourceId path, Filter filter) {
45 return null;
46 }
47
48 @Override
49 public Boolean nodeExist(ResourceId path) {
50 return true;
51 }
52
53 @Override
54 public void updateNode(ResourceId path, DataNode node) {
55 }
56
57 @Override
58 public void replaceNode(ResourceId path, DataNode node) {
59 }
60
61 @Override
62 public void deleteNode(ResourceId path) {
63 }
64
65 @Override
Gaurav Agrawal142ceb02018-02-16 12:19:08 +053066 public CompletableFuture<RpcOutput> invokeRpc(RpcInput input) {
Ray Milkey765b6442018-09-14 12:08:02 -070067 return CompletableFuture.completedFuture(new RpcOutput(RPC_NODATA, null));
Gaurav Agrawal142ceb02018-02-16 12:19:08 +053068 }
69
70 @Override
Yuta HIGUCHI24057822017-08-02 15:03:51 -070071 public void addListener(DynamicConfigListener listener) {
72 listenerRegistry.addListener(listener);
73 }
74
75 @Override
76 public void removeListener(DynamicConfigListener listener) {
77 listenerRegistry.removeListener(listener);
78 }
79
80}