blob: b8e91674c17e393fe65766d210ffececc5501893 [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 com.google.common.base.Preconditions.checkNotNull;
19
20import java.util.concurrent.CompletableFuture;
21
22import org.onosproject.yang.model.DataNode;
23import org.onosproject.yang.model.ResourceId;
24import org.onosproject.yang.model.RpcInput;
25import org.onosproject.yang.model.RpcOutput;
26
27/**
28 * A DynamicConfigService which forwards all its method calls
29 * to another DynamicConfigService.
30 */
31public class ForwardingDynamicConfigService implements DynamicConfigService {
32
33 private final DynamicConfigService delegate;
34
35 protected ForwardingDynamicConfigService(DynamicConfigService delegate) {
36 this.delegate = checkNotNull(delegate);
37 }
38
39 protected DynamicConfigService delegate() {
40 return delegate;
41 }
42
43 @Override
44 public void addListener(DynamicConfigListener listener) {
45 delegate.addListener(listener);
46 }
47
48 @Override
49 public void removeListener(DynamicConfigListener listener) {
50 delegate.removeListener(listener);
51 }
52
53 @Override
54 public void createNode(ResourceId path, DataNode node) {
55 delegate.createNode(path, node);
56 }
57
58 @Override
59 public DataNode readNode(ResourceId path, Filter filter) {
60 return delegate.readNode(path, filter);
61 }
62
63 @Override
64 public Boolean nodeExist(ResourceId path) {
65 return delegate.nodeExist(path);
66 }
67
68 @Override
69 public void updateNode(ResourceId path, DataNode node) {
70 delegate.updateNode(path, node);
71 }
72
73 @Override
74 public void replaceNode(ResourceId path, DataNode node) {
75 delegate.replaceNode(path, node);
76 }
77
78 @Override
79 public void deleteNode(ResourceId path) {
80 delegate.deleteNode(path);
81 }
82
83 @Override
84 public CompletableFuture<RpcOutput> invokeRpc(ResourceId id,
85 RpcInput input) {
86 return delegate.invokeRpc(id, input);
87 }
Yuta HIGUCHI24057822017-08-02 15:03:51 -070088}