blob: b22f0a589d9cb565af854d5c5e0a16340e98f1a6 [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.link;
17
alshabibb5522ff2014-09-29 19:20:00 -070018import java.util.Set;
19
tom61359e92014-09-16 15:50:27 -070020import org.onlab.onos.net.ConnectPoint;
21import org.onlab.onos.net.DeviceId;
22import org.onlab.onos.net.Link;
Yuta HIGUCHIf1f2ac02014-11-26 14:02:22 -080023import org.onlab.onos.net.Link.State;
24
25import com.google.common.base.Predicate;
26import com.google.common.collect.FluentIterable;
tom61359e92014-09-16 15:50:27 -070027
tom61359e92014-09-16 15:50:27 -070028/**
29 * Test adapter for link service.
30 */
31public class LinkServiceAdapter implements LinkService {
32 @Override
33 public int getLinkCount() {
34 return 0;
35 }
36
37 @Override
38 public Iterable<Link> getLinks() {
39 return null;
40 }
41
42 @Override
Yuta HIGUCHIf1f2ac02014-11-26 14:02:22 -080043 public Iterable<Link> getActiveLinks() {
44 return FluentIterable.from(getLinks())
45 .filter(new Predicate<Link>() {
46
47 @Override
48 public boolean apply(Link input) {
49 return input.state() == State.ACTIVE;
50 }
51 });
52 }
53
54 @Override
tom61359e92014-09-16 15:50:27 -070055 public Set<Link> getDeviceLinks(DeviceId deviceId) {
56 return null;
57 }
58
59 @Override
60 public Set<Link> getDeviceEgressLinks(DeviceId deviceId) {
61 return null;
62 }
63
64 @Override
65 public Set<Link> getDeviceIngressLinks(DeviceId deviceId) {
66 return null;
67 }
68
69 @Override
70 public Set<Link> getLinks(ConnectPoint connectPoint) {
71 return null;
72 }
73
74 @Override
75 public Set<Link> getEgressLinks(ConnectPoint connectPoint) {
76 return null;
77 }
78
79 @Override
80 public Set<Link> getIngressLinks(ConnectPoint connectPoint) {
81 return null;
82 }
83
84 @Override
85 public Link getLink(ConnectPoint src, ConnectPoint dst) {
86 return null;
87 }
88
89 @Override
90 public void addListener(LinkListener listener) {
91 }
92
93 @Override
94 public void removeListener(LinkListener listener) {
95 }
96
tom61359e92014-09-16 15:50:27 -070097}