blob: 3d2d74f8497124b095e9be129b2ffc9a8c87867b [file] [log] [blame]
Thomas Vachuska4f1a60c2014-10-28 13:39:07 -07001/*
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 */
tom61359e92014-09-16 15:50:27 -070016package org.onlab.onos.net.device;
17
18import org.onlab.onos.net.Device;
19import org.onlab.onos.net.DeviceId;
20import org.onlab.onos.net.MastershipRole;
21import org.onlab.onos.net.Port;
22import org.onlab.onos.net.PortNumber;
23
Yuta HIGUCHIf1f2ac02014-11-26 14:02:22 -080024import com.google.common.base.Predicate;
25import com.google.common.collect.FluentIterable;
26
tom61359e92014-09-16 15:50:27 -070027import java.util.List;
28
29/**
30 * Test adapter for device service.
31 */
32public class DeviceServiceAdapter implements DeviceService {
33 @Override
34 public int getDeviceCount() {
35 return 0;
36 }
37
38 @Override
39 public Iterable<Device> getDevices() {
40 return null;
41 }
42
43 @Override
Yuta HIGUCHIf1f2ac02014-11-26 14:02:22 -080044 public Iterable<Device> getAvailableDevices() {
45 return FluentIterable.from(getDevices())
46 .filter(new Predicate<Device>() {
47
48 @Override
49 public boolean apply(Device input) {
50 return isAvailable(input.id());
51 }
52 });
53 }
54
55 @Override
tom61359e92014-09-16 15:50:27 -070056 public Device getDevice(DeviceId deviceId) {
57 return null;
58 }
59
60 @Override
61 public MastershipRole getRole(DeviceId deviceId) {
62 return null;
63 }
64
65 @Override
66 public List<Port> getPorts(DeviceId deviceId) {
67 return null;
68 }
69
70 @Override
71 public Port getPort(DeviceId deviceId, PortNumber portNumber) {
72 return null;
73 }
74
75 @Override
76 public boolean isAvailable(DeviceId deviceId) {
77 return false;
78 }
79
80 @Override
81 public void addListener(DeviceListener listener) {
82 }
83
84 @Override
85 public void removeListener(DeviceListener listener) {
86 }
87
88}