Thomas Vachuska | 4f1a60c | 2014-10-28 13:39:07 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2014 Open Networking Laboratory |
| 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 | */ |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 16 | package org.onosproject.mastership; |
tom | b41d1ac | 2014-09-24 01:51:24 -0700 | [diff] [blame] | 17 | |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 18 | import org.onosproject.cluster.NodeId; |
| 19 | import org.onosproject.cluster.RoleInfo; |
| 20 | import org.onosproject.net.DeviceId; |
| 21 | import org.onosproject.net.MastershipRole; |
tom | b41d1ac | 2014-09-24 01:51:24 -0700 | [diff] [blame] | 22 | |
| 23 | import java.util.Set; |
Madan Jampani | de003d9 | 2015-05-11 17:14:20 -0700 | [diff] [blame] | 24 | import java.util.concurrent.CompletableFuture; |
tom | b41d1ac | 2014-09-24 01:51:24 -0700 | [diff] [blame] | 25 | |
| 26 | /** |
| 27 | * Test adapter for mastership service. |
| 28 | */ |
| 29 | public class MastershipServiceAdapter implements MastershipService { |
| 30 | @Override |
| 31 | public MastershipRole getLocalRole(DeviceId deviceId) { |
| 32 | return null; |
| 33 | } |
| 34 | |
| 35 | @Override |
Madan Jampani | de003d9 | 2015-05-11 17:14:20 -0700 | [diff] [blame] | 36 | public CompletableFuture<MastershipRole> requestRoleFor(DeviceId deviceId) { |
tom | b41d1ac | 2014-09-24 01:51:24 -0700 | [diff] [blame] | 37 | return null; |
| 38 | } |
| 39 | |
| 40 | @Override |
Madan Jampani | c6e574f | 2015-05-29 13:41:52 -0700 | [diff] [blame] | 41 | public CompletableFuture<Void> relinquishMastership(DeviceId deviceId) { |
| 42 | return null; |
tom | b41d1ac | 2014-09-24 01:51:24 -0700 | [diff] [blame] | 43 | } |
| 44 | |
| 45 | @Override |
| 46 | public NodeId getMasterFor(DeviceId deviceId) { |
| 47 | return null; |
| 48 | } |
| 49 | |
| 50 | @Override |
| 51 | public Set<DeviceId> getDevicesOf(NodeId nodeId) { |
| 52 | return null; |
| 53 | } |
| 54 | |
| 55 | @Override |
| 56 | public void addListener(MastershipListener listener) { |
| 57 | } |
| 58 | |
| 59 | @Override |
| 60 | public void removeListener(MastershipListener listener) { |
| 61 | } |
Ayaka Koshibe | b70d34b | 2014-09-25 15:43:01 -0700 | [diff] [blame] | 62 | |
| 63 | @Override |
Ayaka Koshibe | abedb09 | 2014-10-20 17:01:31 -0700 | [diff] [blame] | 64 | public RoleInfo getNodesFor(DeviceId deviceId) { |
Ayaka Koshibe | 45503ce | 2014-10-14 11:26:45 -0700 | [diff] [blame] | 65 | return null; |
| 66 | } |
tom | b41d1ac | 2014-09-24 01:51:24 -0700 | [diff] [blame] | 67 | } |