Simon Hunt | 5f6dbf8 | 2016-03-30 08:53:33 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | 5ab426f | 2016-04-09 01:19:45 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Laboratory |
Simon Hunt | 5f6dbf8 | 2016-03-30 08:53:33 -0700 | [diff] [blame] | 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.ui.model.topo; |
| 18 | |
Simon Hunt | 23fb135 | 2016-04-11 12:15:19 -0700 | [diff] [blame] | 19 | import org.onosproject.net.Device; |
| 20 | import org.onosproject.net.EdgeLink; |
| 21 | import org.onosproject.net.Link; |
| 22 | |
| 23 | import java.util.Set; |
| 24 | |
Simon Hunt | 5f6dbf8 | 2016-03-30 08:53:33 -0700 | [diff] [blame] | 25 | /** |
| 26 | * Represents a bi-directional link backed by two uni-directional links. |
| 27 | */ |
Simon Hunt | cda9c03 | 2016-04-11 10:32:54 -0700 | [diff] [blame] | 28 | public class UiLink extends UiElement { |
Simon Hunt | 23fb135 | 2016-04-11 12:15:19 -0700 | [diff] [blame] | 29 | |
| 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 Hunt | 642bc45 | 2016-05-04 19:34:45 -0700 | [diff] [blame] | 57 | |
| 58 | @Override |
| 59 | public String idAsString() { |
| 60 | // TODO |
| 61 | return null; |
| 62 | } |
Simon Hunt | 5f6dbf8 | 2016-03-30 08:53:33 -0700 | [diff] [blame] | 63 | } |