Simon Hunt | a17fa67 | 2015-08-19 18:42:22 -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 | |
| 18 | package org.onosproject.ui.impl.topo; |
| 19 | |
| 20 | import org.onosproject.net.intent.Intent; |
| 21 | import org.onosproject.ui.topo.LinkHighlight; |
| 22 | |
| 23 | /** |
| 24 | * Auxiliary data carrier for assigning a highlight class to a set of |
| 25 | * intents, for visualization in the topology view. |
| 26 | */ |
| 27 | public class TrafficClass { |
| 28 | |
| 29 | private final LinkHighlight.Flavor flavor; |
| 30 | private final Iterable<Intent> intents; |
| 31 | private final boolean showTraffic; |
| 32 | |
| 33 | public TrafficClass(LinkHighlight.Flavor flavor, Iterable<Intent> intents) { |
| 34 | this(flavor, intents, false); |
| 35 | } |
| 36 | |
| 37 | public TrafficClass(LinkHighlight.Flavor flavor, Iterable<Intent> intents, |
| 38 | boolean showTraffic) { |
| 39 | this.flavor = flavor; |
| 40 | this.intents = intents; |
| 41 | this.showTraffic = showTraffic; |
| 42 | } |
| 43 | |
| 44 | public LinkHighlight.Flavor flavor() { |
| 45 | return flavor; |
| 46 | } |
| 47 | |
| 48 | public Iterable<Intent> intents() { |
| 49 | return intents; |
| 50 | } |
| 51 | |
| 52 | public boolean showTraffic() { |
| 53 | return showTraffic; |
| 54 | } |
| 55 | } |