blob: bc40f67443ff8d8bd57202590ffa60f6fd8941c2 [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2014-present Open Networking Foundation
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07003 *
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 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.cluster;
tomb41d1ac2014-09-24 01:51:24 -070017
Yuta HIGUCHI0c47d532017-08-18 23:16:35 -070018import java.time.Instant;
tomb41d1ac2014-09-24 01:51:24 -070019import java.util.Set;
20
Ray Milkey35958232015-07-29 11:19:28 -070021import org.onlab.packet.IpAddress;
22
23import com.google.common.collect.ImmutableSet;
Jordan Haltermanf70bf462017-07-29 13:12:00 -070024import org.onosproject.core.Version;
Madan Jampani7d2fab22015-03-18 17:21:57 -070025
tomb41d1ac2014-09-24 01:51:24 -070026/**
27 * Test adapter for the cluster service.
28 */
29public class ClusterServiceAdapter implements ClusterService {
Ray Milkey35958232015-07-29 11:19:28 -070030 ControllerNode local = new DefaultControllerNode(new NodeId("local"),
31 IpAddress.valueOf("127.0.0.1"));
32
tomb41d1ac2014-09-24 01:51:24 -070033 @Override
34 public ControllerNode getLocalNode() {
Ray Milkey35958232015-07-29 11:19:28 -070035 return local;
tomb41d1ac2014-09-24 01:51:24 -070036 }
37
38 @Override
39 public Set<ControllerNode> getNodes() {
Ray Milkey35958232015-07-29 11:19:28 -070040 return ImmutableSet.of(local);
tomb41d1ac2014-09-24 01:51:24 -070041 }
42
43 @Override
44 public ControllerNode getNode(NodeId nodeId) {
45 return null;
46 }
47
48 @Override
49 public ControllerNode.State getState(NodeId nodeId) {
50 return null;
51 }
52
53 @Override
Jordan Haltermanf70bf462017-07-29 13:12:00 -070054 public Version getVersion(NodeId nodeId) {
55 return null;
56 }
57
58 @Override
Yuta HIGUCHI0c47d532017-08-18 23:16:35 -070059 public Instant getLastUpdatedInstant(NodeId nodeId) {
Madan Jampani7d2fab22015-03-18 17:21:57 -070060 return null;
61 }
62
63 @Override
tomb41d1ac2014-09-24 01:51:24 -070064 public void addListener(ClusterEventListener listener) {
65 }
66
67 @Override
68 public void removeListener(ClusterEventListener listener) {
69 }
70}