blob: 99d6144fcc97ac8ffb44f2da3b32eaae194dd13c [file] [log] [blame]
Simon Hunt5f6dbf82016-03-30 08:53:33 -07001/*
Brian O'Connor5ab426f2016-04-09 01:19:45 -07002 * Copyright 2016-present Open Networking Laboratory
Simon Hunt5f6dbf82016-03-30 08:53:33 -07003 *
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.ui.model.topo;
18
Simon Hunt23fb1352016-04-11 12:15:19 -070019import org.onosproject.net.Device;
20import org.onosproject.net.EdgeLink;
21import org.onosproject.net.Link;
22
23import java.util.Set;
24
Simon Hunt5f6dbf82016-03-30 08:53:33 -070025/**
26 * Represents a bi-directional link backed by two uni-directional links.
27 */
Simon Huntcda9c032016-04-11 10:32:54 -070028public class UiLink extends UiElement {
Simon Hunt23fb1352016-04-11 12:15:19 -070029
30 // devices at either end of this link
31 private Device deviceA;
32 private Device deviceB;
33
34 // two unidirectional links underlying this link...
35 private Link linkAtoB;
36 private Link linkBtoA;
37
38 // ==OR== : private (synthetic) host link
39 private EdgeLink edgeLink;
40
41 // ==OR== : set of underlying UI links that this link aggregates
42 private Set<UiLink> children;
43
44
45 @Override
46 protected void destroy() {
47 deviceA = null;
48 deviceB = null;
49 linkAtoB = null;
50 linkBtoA = null;
51 edgeLink = null;
52 if (children != null) {
53 children.clear();
54 children = null;
55 }
56 }
Simon Hunt642bc452016-05-04 19:34:45 -070057
58 @Override
59 public String idAsString() {
60 // TODO
61 return null;
62 }
Simon Hunt5f6dbf82016-03-30 08:53:33 -070063}