Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame^] | 2 | * Copyright 2016-present Open Networking Foundation |
Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [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 | package org.onosproject.tetopology.management.api; |
| 17 | |
| 18 | import org.onosproject.net.DeviceId; |
| 19 | import org.onosproject.tetopology.management.api.link.TeLink; |
| 20 | import org.onosproject.tetopology.management.api.link.TeLinkTpKey; |
| 21 | import org.onosproject.tetopology.management.api.node.TeNode; |
| 22 | |
| 23 | import java.util.BitSet; |
| 24 | import java.util.Map; |
| 25 | |
| 26 | /** |
| 27 | * Abstraction of a TE topology. |
| 28 | */ |
| 29 | public interface TeTopology extends TeTopologyEventSubject { |
| 30 | /** |
| 31 | * Indicates that the specified topology is not usable for |
| 32 | * any ACTN operations. |
| 33 | */ |
| 34 | public static final int BIT_DISABLED = 0; |
| 35 | |
| 36 | /** |
| 37 | * Indicates that the topology is auto-constructed by |
| 38 | * the controller by an auto-discovery mechanism. |
| 39 | */ |
| 40 | public static final int BIT_LEARNT = 1; |
| 41 | |
| 42 | /** |
| 43 | * Indicates that the topology is merged from other |
| 44 | * supporting topologies. |
| 45 | */ |
| 46 | public static final int BIT_MERGED = 2; |
| 47 | |
| 48 | /** |
| 49 | * Indicates that the topology is customized based on |
| 50 | * another topology. |
| 51 | */ |
| 52 | public static final int BIT_CUSTOMIZED = 3; |
| 53 | |
| 54 | /** |
| 55 | * Returns the TE topology identifier. |
| 56 | * |
| 57 | * @return the topology id |
| 58 | */ |
| 59 | TeTopologyKey teTopologyId(); |
| 60 | |
| 61 | /** |
| 62 | * Returns the topology characteristics flags. |
| 63 | * |
| 64 | * @return the flags |
| 65 | */ |
| 66 | public BitSet flags(); |
| 67 | |
| 68 | /** |
| 69 | * Returns the topology optimization criteria. |
| 70 | * |
| 71 | * @return the optimization |
| 72 | */ |
| 73 | public OptimizationType optimization(); |
| 74 | |
| 75 | /** |
| 76 | * Returns a collection of TE nodes in the topology. |
| 77 | * |
| 78 | * @return a collection of currently known TE nodes |
| 79 | */ |
| 80 | Map<Long, TeNode> teNodes(); |
| 81 | |
| 82 | /** |
| 83 | * Returns a TE node in the topology that matches the given node |
| 84 | * identifier. A null will be returned if no such node exists. |
| 85 | * |
| 86 | * @param teNodeId the TE node id |
| 87 | * @return the corresponding node; or null if not found |
| 88 | */ |
| 89 | TeNode teNode(long teNodeId); |
| 90 | |
| 91 | /** |
| 92 | * Returns a collection of links in the topology. |
| 93 | * |
| 94 | * @return a collection of currently known te links |
| 95 | */ |
| 96 | Map<TeLinkTpKey, TeLink> teLinks(); |
| 97 | |
| 98 | /** |
| 99 | * Returns a TE link in the topology that matches the given |
| 100 | * link identifier. If no such a link is found, a null is returned. |
| 101 | * |
| 102 | * @param teLinkId the TE link id |
| 103 | * @return the corresponding link; or null if not found |
| 104 | */ |
| 105 | TeLink teLink(TeLinkTpKey teLinkId); |
| 106 | |
| 107 | /** |
| 108 | * Returns the TE topology identifier string value. |
| 109 | * |
| 110 | * @return the topology id in String format |
| 111 | */ |
| 112 | String teTopologyIdStringValue(); |
| 113 | |
| 114 | /** |
| 115 | * Returns the network identifier. |
| 116 | * |
| 117 | * @return network identifier |
| 118 | */ |
| 119 | KeyId networkId(); |
| 120 | |
| 121 | /** |
| 122 | * Returns the identity of the controller owning this abstracted topology. |
| 123 | * |
| 124 | * @return the controller id |
| 125 | */ |
| 126 | DeviceId ownerId(); |
| 127 | |
| 128 | } |