blob: a5cfc07f1ea3e39d3c01537d472b3cffffe80ae0 [file] [log] [blame]
Jonathan Hart443ebed2015-05-05 14:02:12 -07001/*
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
17package org.onosproject.cordfabric;
18
19import com.google.common.collect.ImmutableList;
20import org.onlab.packet.VlanId;
21import org.onosproject.net.ConnectPoint;
22
23import java.util.Collection;
24import java.util.List;
25
26import static com.google.common.base.Preconditions.checkNotNull;
27
28/**
29 * Vlan which spans multiple fabric ports.
30 */
31public class FabricVlan {
32
33 private final VlanId vlan;
34
35 private final List<ConnectPoint> ports;
alshabibc4b5d462015-06-08 23:06:24 -070036 private final boolean iptv;
Jonathan Hart443ebed2015-05-05 14:02:12 -070037
alshabibc4b5d462015-06-08 23:06:24 -070038 public FabricVlan(VlanId vlan, Collection<ConnectPoint> ports, boolean iptv) {
Jonathan Hart443ebed2015-05-05 14:02:12 -070039 checkNotNull(vlan);
40 checkNotNull(ports);
41 this.vlan = vlan;
42 this.ports = ImmutableList.copyOf(ports);
alshabibc4b5d462015-06-08 23:06:24 -070043 this.iptv = iptv;
Jonathan Hart443ebed2015-05-05 14:02:12 -070044 }
45
46 public VlanId vlan() {
47 return vlan;
48 }
49
50 public List<ConnectPoint> ports() {
51 return ports;
52 }
alshabibc4b5d462015-06-08 23:06:24 -070053
54 public boolean iptv() {
55 return iptv;
56 }
Jonathan Hart443ebed2015-05-05 14:02:12 -070057}