Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [diff] [blame] | 1 | /* |
| 2 | * Copyright 2016 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 | package org.onosproject.tetopology.management.api; |
| 17 | |
| 18 | import org.onosproject.event.ListenerService; |
| 19 | import org.onosproject.tetopology.management.api.link.NetworkLinkKey; |
| 20 | import org.onosproject.tetopology.management.api.link.TeLink; |
| 21 | import org.onosproject.tetopology.management.api.link.TeLinkTpGlobalKey; |
| 22 | import org.onosproject.tetopology.management.api.node.NetworkNodeKey; |
| 23 | import org.onosproject.tetopology.management.api.node.TeNode; |
| 24 | import org.onosproject.tetopology.management.api.node.TeNodeKey; |
| 25 | import org.onosproject.tetopology.management.api.node.TerminationPointKey; |
| 26 | import org.onosproject.tetopology.management.api.node.TtpKey; |
| 27 | import org.onosproject.tetopology.management.api.node.TunnelTerminationPoint; |
| 28 | |
| 29 | /** |
| 30 | * TE Topology Service API. |
| 31 | */ |
| 32 | public interface TeTopologyService |
| 33 | extends ListenerService<TeTopologyEvent, TeTopologyListener> { |
| 34 | |
| 35 | /** |
| 36 | * Returns a collection of currently known networks. |
| 37 | * |
| 38 | * @return a collection of networks |
| 39 | */ |
| 40 | Networks networks(); |
| 41 | |
| 42 | /** |
| 43 | * Returns the network identified by its network identifier. if no |
| 44 | * network can be found, a null is returned. |
| 45 | * |
| 46 | * @param networkId network id in URI format |
| 47 | * @return the corresponding network; or null if not found |
| 48 | */ |
| 49 | Network network(KeyId networkId); |
| 50 | |
| 51 | /** |
| 52 | * Updates the network. |
| 53 | * |
| 54 | * @param network network to be updated |
| 55 | */ |
| 56 | void updateNetwork(Network network); |
| 57 | |
| 58 | /** |
| 59 | * Removes the network corresponding to the given network identifier. |
| 60 | * |
| 61 | * @param networkId network id in URI format |
| 62 | */ |
| 63 | void removeNetwork(KeyId networkId); |
| 64 | |
| 65 | /** |
| 66 | * Returns a collection of currently known TE topologies. |
| 67 | * |
| 68 | * @return a collection of topologies |
| 69 | */ |
| 70 | TeTopologies teTopologies(); |
| 71 | |
| 72 | /** |
| 73 | * Returns the TE Topology identified by the given key. |
| 74 | * |
| 75 | * @param topologyKey the given TE topology Key |
| 76 | * @return the corresponding TE topology |
| 77 | */ |
| 78 | TeTopology teTopology(TeTopologyKey topologyKey); |
| 79 | |
| 80 | /** |
| 81 | * Returns the merged topology in MDSC. |
| 82 | * |
| 83 | * @return the merged topology |
| 84 | */ |
| 85 | TeTopology mergedTopology(); |
| 86 | |
| 87 | /** |
| 88 | * Creates or Updates a TE topology based on the given topology. |
| 89 | * |
| 90 | * @param teTopology the given TE topology |
| 91 | */ |
| 92 | void updateTeTopology(TeTopology teTopology); |
| 93 | |
| 94 | /** |
| 95 | * Removes the TE Topology identified by its key. Does nothing if |
| 96 | * no topology is found which matches the key. |
| 97 | * |
| 98 | * @param topologyKey the TE topology key |
| 99 | */ |
| 100 | void removeTeTopology(TeTopologyKey topologyKey); |
| 101 | |
| 102 | /** |
| 103 | * Returns the TE node identified by the given node key. If no TE |
| 104 | * node is found, a null is returned. |
| 105 | * |
| 106 | * @param nodeKey the TE node key |
| 107 | * @return the corresponding TE node,or null |
| 108 | */ |
| 109 | TeNode teNode(TeNodeKey nodeKey); |
| 110 | |
| 111 | /** |
| 112 | * Returns the TE link identified by the given TE link key. If no |
| 113 | * TE link is found, a null is returned. |
| 114 | * |
| 115 | * @param linkKey the TE link key |
| 116 | * @return the corresponding TE link or null |
| 117 | */ |
| 118 | TeLink teLink(TeLinkTpGlobalKey linkKey); |
| 119 | |
| 120 | /** |
| 121 | * Returns a tunnel termination point identified by the given tunnel |
| 122 | * termination point key. If no tunnel termination point is found, |
| 123 | * a null is returned. |
| 124 | * |
| 125 | * @param ttpKey the tunnel termination point key |
| 126 | * @return the corresponding tunnel termination point |
| 127 | */ |
| 128 | TunnelTerminationPoint tunnelTerminationPoint(TtpKey ttpKey); |
| 129 | |
| 130 | /** |
| 131 | * Returns the network Id for a TE Topology key. |
| 132 | * |
| 133 | * @param teTopologyKey the TE topology key |
| 134 | * @return value of network Id |
| 135 | */ |
| 136 | KeyId networkId(TeTopologyKey teTopologyKey); |
| 137 | |
| 138 | /** |
| 139 | * Returns the network node key for a TE node key. |
| 140 | * |
| 141 | * @param teNodeKey a TE node key |
| 142 | * @return value of network node key |
| 143 | */ |
| 144 | NetworkNodeKey nodeKey(TeNodeKey teNodeKey); |
| 145 | |
| 146 | /** |
| 147 | * Returns the network link key for a TE link key. |
| 148 | * |
| 149 | * @param teLinkKey a TE node key |
| 150 | * @return value of network link key |
| 151 | */ |
| 152 | NetworkLinkKey linkKey(TeLinkTpGlobalKey teLinkKey); |
| 153 | |
| 154 | /** |
| 155 | * Returns the termination point key for a TE termination point key. |
| 156 | * |
| 157 | * @param teTpKey a TE termination point key |
| 158 | * @return value of termination point key |
| 159 | */ |
| 160 | TerminationPointKey terminationPointKey(TeLinkTpGlobalKey teTpKey); |
Yixiao Chen | 265b3bb | 2017-01-13 10:17:03 -0500 | [diff] [blame^] | 161 | |
| 162 | /** |
| 163 | * Returns the TE controller global identification. |
| 164 | * |
| 165 | * @return value of controller id |
| 166 | */ |
| 167 | long teContollerId(); |
Henry Yu | 4b4a7eb | 2016-11-09 20:07:53 -0500 | [diff] [blame] | 168 | } |