blob: b1b46f97908ddc50ed06ea6366e8d3be55d555ef [file] [log] [blame]
Ayaka Koshibe48229222016-05-16 18:04:26 -07001/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Ayaka Koshibe48229222016-05-16 18:04:26 -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 */
16package org.onosproject.cluster;
17
Ayaka Koshibe48229222016-05-16 18:04:26 -070018import com.google.common.collect.Sets;
Jordan Halterman00e92da2018-05-22 23:05:52 -070019import org.onlab.packet.IpAddress;
Ayaka Koshibe48229222016-05-16 18:04:26 -070020
21/**
22 * Test adapter for the ClusterMetadata service.
23 */
24public class ClusterMetadataServiceAdapter implements ClusterMetadataService {
25
26 @Override
27 public ClusterMetadata getClusterMetadata() {
28 final NodeId nid = new NodeId("test-node");
29 final IpAddress addr = IpAddress.valueOf(0);
Jordan Halterman00e92da2018-05-22 23:05:52 -070030 return new ClusterMetadata("test-cluster", new DefaultControllerNode(nid, addr), Sets.newHashSet());
Ayaka Koshibe48229222016-05-16 18:04:26 -070031 }
32
33 @Override
34 public ControllerNode getLocalNode() {
35 return null;
36 }
37
38 @Override
39 public void addListener(ClusterMetadataEventListener listener) {
40 }
41
42 @Override
43 public void removeListener(ClusterMetadataEventListener listener) {
44 }
45
46}