blob: 6f31752b0426688f0a2c8d13325bad37dca9c918 [file] [log] [blame]
Phaneendra Mandab212bc92016-07-08 16:50:11 +05301/*
Brian O'Connora09fe5b2017-08-03 21:12:30 -07002 * Copyright 2016-present Open Networking Foundation
Phaneendra Mandab212bc92016-07-08 16:50:11 +05303 *
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 */
16package org.onosproject.sfcweb;
17
18import org.onosproject.net.Link;
19import org.onosproject.net.LinkKey;
20import org.onosproject.ui.topo.BiLink;
21import org.onosproject.ui.topo.LinkHighlight;
22import org.onosproject.ui.topo.LinkHighlight.Flavor;
23
24/**
25 * Bi-directional link capable of different highlights.
26 */
27public class SfcLink extends BiLink {
28
29 private boolean primary = false;
30 private boolean secondary = false;
31
32 public SfcLink(LinkKey key, Link link) {
33 super(key, link);
34 }
35
36 @Override
37 public LinkHighlight highlight(Enum<?> anEnum) {
38 Flavor flavor = primary ? Flavor.PRIMARY_HIGHLIGHT :
39 (secondary ? Flavor.SECONDARY_HIGHLIGHT : Flavor.NO_HIGHLIGHT);
40 return new LinkHighlight(this.linkId(), Flavor.PRIMARY_HIGHLIGHT);
41 }
42}