Jonathan Hart | 443ebed | 2015-05-05 14:02:12 -0700 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2015 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 | */ |
| 16 | |
| 17 | package org.onosproject.cordfabric; |
| 18 | |
| 19 | import com.google.common.collect.ImmutableList; |
| 20 | import org.onlab.packet.VlanId; |
| 21 | import org.onosproject.net.ConnectPoint; |
| 22 | |
| 23 | import java.util.Collection; |
| 24 | import java.util.List; |
| 25 | |
| 26 | import static com.google.common.base.Preconditions.checkNotNull; |
| 27 | |
| 28 | /** |
| 29 | * Vlan which spans multiple fabric ports. |
| 30 | */ |
| 31 | public class FabricVlan { |
| 32 | |
| 33 | private final VlanId vlan; |
| 34 | |
| 35 | private final List<ConnectPoint> ports; |
alshabib | c4b5d46 | 2015-06-08 23:06:24 -0700 | [diff] [blame] | 36 | private final boolean iptv; |
Jonathan Hart | 443ebed | 2015-05-05 14:02:12 -0700 | [diff] [blame] | 37 | |
alshabib | c4b5d46 | 2015-06-08 23:06:24 -0700 | [diff] [blame] | 38 | public FabricVlan(VlanId vlan, Collection<ConnectPoint> ports, boolean iptv) { |
Jonathan Hart | 443ebed | 2015-05-05 14:02:12 -0700 | [diff] [blame] | 39 | checkNotNull(vlan); |
| 40 | checkNotNull(ports); |
| 41 | this.vlan = vlan; |
| 42 | this.ports = ImmutableList.copyOf(ports); |
alshabib | c4b5d46 | 2015-06-08 23:06:24 -0700 | [diff] [blame] | 43 | this.iptv = iptv; |
Jonathan Hart | 443ebed | 2015-05-05 14:02:12 -0700 | [diff] [blame] | 44 | } |
| 45 | |
| 46 | public VlanId vlan() { |
| 47 | return vlan; |
| 48 | } |
| 49 | |
| 50 | public List<ConnectPoint> ports() { |
| 51 | return ports; |
| 52 | } |
alshabib | c4b5d46 | 2015-06-08 23:06:24 -0700 | [diff] [blame] | 53 | |
| 54 | public boolean iptv() { |
| 55 | return iptv; |
| 56 | } |
Jonathan Hart | 443ebed | 2015-05-05 14:02:12 -0700 | [diff] [blame] | 57 | } |