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.net.link; |
tom | 61359e9 | 2014-09-16 15:50:27 -0700 | [diff] [blame] | 17 | |
alshabib | b5522ff | 2014-09-29 19:20:00 -0700 | [diff] [blame] | 18 | import java.util.Set; |
| 19 | |
Brian O'Connor | abafb50 | 2014-12-02 22:26:20 -0800 | [diff] [blame] | 20 | import org.onosproject.net.ConnectPoint; |
| 21 | import org.onosproject.net.DeviceId; |
| 22 | import org.onosproject.net.Link; |
| 23 | import org.onosproject.net.Link.State; |
Yuta HIGUCHI | f1f2ac0 | 2014-11-26 14:02:22 -0800 | [diff] [blame] | 24 | |
Yuta HIGUCHI | f1f2ac0 | 2014-11-26 14:02:22 -0800 | [diff] [blame] | 25 | import com.google.common.collect.FluentIterable; |
tom | 61359e9 | 2014-09-16 15:50:27 -0700 | [diff] [blame] | 26 | |
tom | 61359e9 | 2014-09-16 15:50:27 -0700 | [diff] [blame] | 27 | /** |
| 28 | * Test adapter for link service. |
| 29 | */ |
| 30 | public class LinkServiceAdapter implements LinkService { |
| 31 | @Override |
| 32 | public int getLinkCount() { |
| 33 | return 0; |
| 34 | } |
| 35 | |
| 36 | @Override |
| 37 | public Iterable<Link> getLinks() { |
| 38 | return null; |
| 39 | } |
| 40 | |
| 41 | @Override |
Yuta HIGUCHI | f1f2ac0 | 2014-11-26 14:02:22 -0800 | [diff] [blame] | 42 | public Iterable<Link> getActiveLinks() { |
| 43 | return FluentIterable.from(getLinks()) |
Sho SHIMIZU | 7462641 | 2015-09-11 11:46:27 -0700 | [diff] [blame] | 44 | .filter(input -> input.state() == State.ACTIVE); |
Yuta HIGUCHI | f1f2ac0 | 2014-11-26 14:02:22 -0800 | [diff] [blame] | 45 | } |
| 46 | |
| 47 | @Override |
tom | 61359e9 | 2014-09-16 15:50:27 -0700 | [diff] [blame] | 48 | public Set<Link> getDeviceLinks(DeviceId deviceId) { |
| 49 | return null; |
| 50 | } |
| 51 | |
| 52 | @Override |
| 53 | public Set<Link> getDeviceEgressLinks(DeviceId deviceId) { |
| 54 | return null; |
| 55 | } |
| 56 | |
| 57 | @Override |
| 58 | public Set<Link> getDeviceIngressLinks(DeviceId deviceId) { |
| 59 | return null; |
| 60 | } |
| 61 | |
| 62 | @Override |
| 63 | public Set<Link> getLinks(ConnectPoint connectPoint) { |
| 64 | return null; |
| 65 | } |
| 66 | |
| 67 | @Override |
| 68 | public Set<Link> getEgressLinks(ConnectPoint connectPoint) { |
| 69 | return null; |
| 70 | } |
| 71 | |
| 72 | @Override |
| 73 | public Set<Link> getIngressLinks(ConnectPoint connectPoint) { |
| 74 | return null; |
| 75 | } |
| 76 | |
| 77 | @Override |
| 78 | public Link getLink(ConnectPoint src, ConnectPoint dst) { |
| 79 | return null; |
| 80 | } |
| 81 | |
| 82 | @Override |
| 83 | public void addListener(LinkListener listener) { |
| 84 | } |
| 85 | |
| 86 | @Override |
| 87 | public void removeListener(LinkListener listener) { |
| 88 | } |
| 89 | |
tom | 61359e9 | 2014-09-16 15:50:27 -0700 | [diff] [blame] | 90 | } |