blob: ccd4a6df1b35b91ae98c953ba67d8e10458b6d32 [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 */
Brian O'Connorabafb502014-12-02 22:26:20 -080016package org.onosproject.net.device;
tom61359e92014-09-16 15:50:27 -070017
Bri Prebilic Cole09e464b2015-01-07 17:13:54 -080018import com.google.common.base.Predicate;
19import com.google.common.collect.FluentIterable;
Brian O'Connorabafb502014-12-02 22:26:20 -080020import org.onosproject.net.Device;
21import org.onosproject.net.DeviceId;
22import org.onosproject.net.MastershipRole;
23import org.onosproject.net.Port;
24import org.onosproject.net.PortNumber;
tom61359e92014-09-16 15:50:27 -070025
26import java.util.List;
27
28/**
29 * Test adapter for device service.
30 */
31public class DeviceServiceAdapter implements DeviceService {
32 @Override
33 public int getDeviceCount() {
34 return 0;
35 }
36
37 @Override
38 public Iterable<Device> getDevices() {
39 return null;
40 }
41
42 @Override
Yuta HIGUCHIf1f2ac02014-11-26 14:02:22 -080043 public Iterable<Device> getAvailableDevices() {
44 return FluentIterable.from(getDevices())
45 .filter(new Predicate<Device>() {
46
47 @Override
48 public boolean apply(Device input) {
49 return isAvailable(input.id());
50 }
51 });
52 }
53
54 @Override
tom61359e92014-09-16 15:50:27 -070055 public Device getDevice(DeviceId deviceId) {
56 return null;
57 }
58
59 @Override
60 public MastershipRole getRole(DeviceId deviceId) {
61 return null;
62 }
63
64 @Override
65 public List<Port> getPorts(DeviceId deviceId) {
66 return null;
67 }
68
69 @Override
70 public Port getPort(DeviceId deviceId, PortNumber portNumber) {
71 return null;
72 }
73
74 @Override
75 public boolean isAvailable(DeviceId deviceId) {
76 return false;
77 }
78
79 @Override
80 public void addListener(DeviceListener listener) {
81 }
82
83 @Override
84 public void removeListener(DeviceListener listener) {
85 }
86
87}