Ray Milkey | 2d572dd | 2017-04-14 10:01:24 -0700 | [diff] [blame] | 1 | /* |
Brian O'Connor | a09fe5b | 2017-08-03 21:12:30 -0700 | [diff] [blame] | 2 | * Copyright 2016-present Open Networking Foundation |
Ray Milkey | 2d572dd | 2017-04-14 10:01:24 -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 | |
Avantika-Huawei | 3c2d3eb | 2016-06-22 09:34:00 +0530 | [diff] [blame] | 17 | package org.onosproject.pcep.controller.impl; |
| 18 | |
harikrushna-Huawei | a2c7c20 | 2017-04-10 18:22:00 +0530 | [diff] [blame^] | 19 | import static org.onosproject.pcep.server.PcepLspSyncAction.SEND_UPDATE; |
| 20 | import static org.onosproject.pcep.server.PcepLspSyncAction.UNSTABLE; |
Avantika-Huawei | 3c2d3eb | 2016-06-22 09:34:00 +0530 | [diff] [blame] | 21 | |
| 22 | import java.net.SocketAddress; |
| 23 | import java.util.ArrayList; |
| 24 | import java.util.Collection; |
| 25 | import java.util.Collections; |
| 26 | import java.util.HashMap; |
| 27 | import java.util.HashSet; |
| 28 | import java.util.List; |
| 29 | |
| 30 | import org.jboss.netty.buffer.ChannelBuffer; |
| 31 | import org.jboss.netty.buffer.ChannelBuffers; |
| 32 | import org.jboss.netty.channel.Channel; |
| 33 | import org.jboss.netty.channel.ChannelConfig; |
| 34 | import org.jboss.netty.channel.ChannelFactory; |
| 35 | import org.jboss.netty.channel.ChannelFuture; |
| 36 | import org.jboss.netty.channel.ChannelPipeline; |
| 37 | import org.junit.After; |
| 38 | import org.junit.Before; |
| 39 | import org.junit.Test; |
| 40 | import org.onlab.packet.IpAddress; |
| 41 | import org.onosproject.core.ApplicationId; |
| 42 | import org.onosproject.incubator.net.tunnel.DefaultTunnel; |
| 43 | import org.onosproject.incubator.net.tunnel.Tunnel; |
| 44 | import org.onosproject.incubator.net.tunnel.TunnelEndPoint; |
| 45 | import org.onosproject.incubator.net.tunnel.TunnelId; |
| 46 | import org.onosproject.incubator.net.tunnel.TunnelListener; |
| 47 | import org.onosproject.incubator.net.tunnel.TunnelName; |
| 48 | import org.onosproject.incubator.net.tunnel.TunnelService; |
| 49 | import org.onosproject.incubator.net.tunnel.TunnelSubscription; |
| 50 | import org.onosproject.incubator.net.tunnel.Tunnel.Type; |
| 51 | import org.onosproject.net.Annotations; |
| 52 | import org.onosproject.net.DeviceId; |
| 53 | import org.onosproject.net.ElementId; |
| 54 | import org.onosproject.net.Path; |
harikrushna-Huawei | a2c7c20 | 2017-04-10 18:22:00 +0530 | [diff] [blame^] | 55 | import org.onosproject.pcep.server.ClientCapability; |
| 56 | import org.onosproject.pcep.server.PccId; |
| 57 | import org.onosproject.pcep.server.PcepEventListener; |
| 58 | import org.onosproject.pcep.server.PcepLspSyncAction; |
| 59 | import org.onosproject.pcep.server.PcepPacketStats; |
| 60 | import org.onosproject.pcep.server.PcepSyncStatus; |
| 61 | import org.onosproject.pcep.server.driver.PcepAgent; |
| 62 | import org.onosproject.pcep.server.impl.PcepClientControllerImpl; |
| 63 | import org.onosproject.pcep.server.impl.PcepClientImpl; |
| 64 | import org.onosproject.pcep.server.impl.PcepPacketStatsImpl; |
Avantika-Huawei | 3c2d3eb | 2016-06-22 09:34:00 +0530 | [diff] [blame] | 65 | import org.onosproject.pcepio.exceptions.PcepOutOfBoundMessageException; |
| 66 | import org.onosproject.pcepio.exceptions.PcepParseException; |
| 67 | import org.onosproject.pcepio.protocol.PcepFactories; |
| 68 | import org.onosproject.pcepio.protocol.PcepInitiateMsg; |
| 69 | import org.onosproject.pcepio.protocol.PcepMessage; |
| 70 | import org.onosproject.pcepio.protocol.PcepMessageReader; |
| 71 | import org.onosproject.pcepio.protocol.PcepVersion; |
| 72 | import com.google.common.collect.ImmutableSet; |
| 73 | |
| 74 | import static org.hamcrest.MatcherAssert.assertThat; |
| 75 | import static org.hamcrest.core.Is.is; |
| 76 | |
| 77 | public class PcepClientControllerImplTest { |
harikrushna-Huawei | a2c7c20 | 2017-04-10 18:22:00 +0530 | [diff] [blame^] | 78 | TestPcepClientControllerImpl controllerImpl = new TestPcepClientControllerImpl(); |
Avantika-Huawei | 3c2d3eb | 2016-06-22 09:34:00 +0530 | [diff] [blame] | 79 | TunnelService tunnelService = new MockTunnelService(); |
| 80 | private PcepEventListener listener; |
| 81 | private Channel channel; |
| 82 | |
| 83 | @Before |
| 84 | public void startUp() { |
harikrushna-Huawei | a2c7c20 | 2017-04-10 18:22:00 +0530 | [diff] [blame^] | 85 | controllerImpl.setTunnelService(tunnelService); |
Avantika-Huawei | 3c2d3eb | 2016-06-22 09:34:00 +0530 | [diff] [blame] | 86 | listener = new PcepEventListenerAdapter(); |
| 87 | controllerImpl.addEventListener(listener); |
| 88 | channel = new MockChannel(); |
| 89 | } |
| 90 | |
| 91 | @After |
| 92 | public void tearDown() { |
| 93 | controllerImpl.removeEventListener(listener); |
| 94 | listener = null; |
harikrushna-Huawei | a2c7c20 | 2017-04-10 18:22:00 +0530 | [diff] [blame^] | 95 | controllerImpl.setTunnelService(null); |
Avantika-Huawei | 3c2d3eb | 2016-06-22 09:34:00 +0530 | [diff] [blame] | 96 | } |
| 97 | |
| 98 | @Test |
| 99 | public void tunnelProviderAddedTest1() throws PcepParseException, PcepOutOfBoundMessageException { |
| 100 | PccId pccId = PccId.pccId(IpAddress.valueOf("1.1.1.1")); |
| 101 | |
| 102 | byte[] reportMsg = new byte[] {0x20, 0x0a, 0x00, (byte) 0x50, 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, |
| 103 | 0x00, 0x00, 0x00, 0x01, // SRP object |
| 104 | 0x00, 0x1c, 0x00, 0x04, // PATH-SETUP-TYPE TLV |
| 105 | 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x00, 0x24, // LSP object |
| 106 | 0x00, 0x00, 0x10, (byte) 0xAB, |
| 107 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, // symbolic path tlv |
| 108 | 0x00, 0x12, 0x00, 0x10, // IPv4-LSP-IDENTIFIER-TLV |
| 109 | 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x05, |
| 110 | 0x05, 0x05, 0x05, |
| 111 | |
| 112 | 0x07, 0x10, 0x00, 0x14, // ERO object |
| 113 | 0x01, 0x08, (byte) 0x01, 0x01, // ERO IPv4 sub objects |
| 114 | 0x01, 0x01, 0x04, 0x00, |
| 115 | 0x01, 0x08, (byte) 0x05, 0x05, 0x05, 0x05, 0x04, 0x00, }; |
| 116 | |
| 117 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 118 | buffer.writeBytes(reportMsg); |
| 119 | |
| 120 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 121 | PcepMessage message = reader.readFrom(buffer); |
| 122 | |
| 123 | PcepClientImpl pc = new PcepClientImpl(); |
| 124 | PcepPacketStats pktStats = new PcepPacketStatsImpl(); |
| 125 | |
| 126 | pc.init(pccId, PcepVersion.PCEP_1, pktStats); |
| 127 | pc.setChannel(channel); |
harikrushna-Huawei | a2c7c20 | 2017-04-10 18:22:00 +0530 | [diff] [blame^] | 128 | pc.setAgent(controllerImpl.agent()); |
Avantika-Huawei | 3c2d3eb | 2016-06-22 09:34:00 +0530 | [diff] [blame] | 129 | pc.setConnected(true); |
| 130 | pc.setCapability(new ClientCapability(true, true, true, true, true)); |
| 131 | |
harikrushna-Huawei | a2c7c20 | 2017-04-10 18:22:00 +0530 | [diff] [blame^] | 132 | controllerImpl.agent().addConnectedClient(pccId, pc); |
Avantika-Huawei | 3c2d3eb | 2016-06-22 09:34:00 +0530 | [diff] [blame] | 133 | controllerImpl.processClientMessage(pccId, message); |
| 134 | |
| 135 | pc.setLspDbSyncStatus(PcepSyncStatus.SYNCED); |
| 136 | pc.setLabelDbSyncStatus(PcepSyncStatus.IN_SYNC); |
| 137 | pc.setLabelDbSyncStatus(PcepSyncStatus.SYNCED); |
| 138 | |
| 139 | List<PcepMessage> deleteMsgs = ((MockChannel) channel).msgsWritten(); |
| 140 | assertThat(deleteMsgs.size(), is(1)); |
| 141 | |
| 142 | for (PcepMessage msg : deleteMsgs) { |
| 143 | assertThat(((PcepInitiateMsg) msg).getPcInitiatedLspRequestList().getFirst().getSrpObject().getRFlag(), |
| 144 | is(true)); |
| 145 | } |
| 146 | } |
| 147 | |
| 148 | @Test |
| 149 | public void tunnelProviderAddedTest2() throws PcepParseException, PcepOutOfBoundMessageException { |
| 150 | PccId pccId = PccId.pccId(IpAddress.valueOf("1.1.1.1")); |
| 151 | |
| 152 | byte[] reportMsg = new byte[] {0x20, 0x0a, 0x00, (byte) 0x50, 0x21, 0x10, 0x00, 0x14, 0x00, 0x00, 0x00, 0x00, |
| 153 | 0x00, 0x00, 0x00, 0x01, // SRP object |
| 154 | 0x00, 0x1c, 0x00, 0x04, // PATH-SETUP-TYPE TLV |
| 155 | 0x00, 0x00, 0x00, 0x00, 0x20, 0x10, 0x00, 0x24, 0x00, // LSP object |
| 156 | 0x00, 0x10, (byte) 0xAB, |
| 157 | 0x00, 0x11, 0x00, 0x02, 0x54, 0x31, 0x00, 0x00, // symbolic path tlv |
| 158 | 0x00, 0x12, 0x00, 0x10, // IPv4-LSP-IDENTIFIER-TLV |
| 159 | 0x01, 0x01, 0x01, 0x01, 0x00, 0x01, 0x00, 0x01, 0x01, 0x01, 0x01, 0x01, 0x05, |
| 160 | 0x05, 0x05, 0x05, |
| 161 | |
| 162 | 0x07, 0x10, 0x00, 0x14, // ERO object |
| 163 | 0x01, 0x08, (byte) 0x01, 0x01, 0x01, 0x01, 0x04, 0x00, // ERO IPv4 sub objects |
| 164 | 0x01, 0x08, (byte) 0x05, 0x05, 0x05, 0x05, 0x04, 0x00, }; |
| 165 | |
| 166 | ChannelBuffer buffer = ChannelBuffers.dynamicBuffer(); |
| 167 | buffer.writeBytes(reportMsg); |
| 168 | |
| 169 | PcepMessageReader<PcepMessage> reader = PcepFactories.getGenericReader(); |
| 170 | PcepMessage message = reader.readFrom(buffer); |
| 171 | |
| 172 | PcepClientImpl pc = new PcepClientImpl(); |
| 173 | PcepPacketStats pktStats = new PcepPacketStatsImpl(); |
| 174 | |
| 175 | pc.init(pccId, PcepVersion.PCEP_1, pktStats); |
| 176 | pc.setChannel(channel); |
harikrushna-Huawei | a2c7c20 | 2017-04-10 18:22:00 +0530 | [diff] [blame^] | 177 | pc.setAgent(controllerImpl.agent()); |
Avantika-Huawei | 3c2d3eb | 2016-06-22 09:34:00 +0530 | [diff] [blame] | 178 | pc.setConnected(true); |
| 179 | pc.setCapability(new ClientCapability(true, true, true, true, true)); |
| 180 | |
harikrushna-Huawei | a2c7c20 | 2017-04-10 18:22:00 +0530 | [diff] [blame^] | 181 | controllerImpl.agent().addConnectedClient(pccId, pc); |
Avantika-Huawei | 3c2d3eb | 2016-06-22 09:34:00 +0530 | [diff] [blame] | 182 | controllerImpl.processClientMessage(pccId, message); |
| 183 | |
| 184 | pc.setLspDbSyncStatus(PcepSyncStatus.SYNCED); |
| 185 | pc.setLabelDbSyncStatus(PcepSyncStatus.IN_SYNC); |
| 186 | pc.setLabelDbSyncStatus(PcepSyncStatus.SYNCED); |
| 187 | } |
| 188 | |
| 189 | class PcepEventListenerAdapter implements PcepEventListener { |
| 190 | |
| 191 | public List<PcepMessage> handledMsg = new ArrayList<>(); |
| 192 | public List<Tunnel> tunnelsToBeUpdatedToNw = new ArrayList<>(); |
| 193 | public List<Tunnel> deletedFromNwTunnels = new ArrayList<>(); |
| 194 | |
| 195 | @Override |
| 196 | public void handleMessage(PccId pccId, PcepMessage msg) { |
| 197 | handledMsg.add(msg); |
| 198 | } |
| 199 | |
| 200 | @Override |
| 201 | public void handleEndOfSyncAction(Tunnel tunnel, PcepLspSyncAction endOfSyncAction) { |
| 202 | if (endOfSyncAction == SEND_UPDATE) { |
| 203 | tunnelsToBeUpdatedToNw.add(tunnel); |
| 204 | return; |
| 205 | } else if (endOfSyncAction == UNSTABLE) { |
| 206 | deletedFromNwTunnels.add(tunnel); |
| 207 | } |
| 208 | } |
| 209 | } |
| 210 | |
| 211 | class MockChannel implements Channel { |
| 212 | private List<PcepMessage> msgOnWire = new ArrayList<>(); |
| 213 | |
| 214 | @Override |
| 215 | public ChannelFuture write(Object o) { |
| 216 | if (o instanceof List<?>) { |
| 217 | @SuppressWarnings("unchecked") |
| 218 | List<PcepMessage> msgs = (List<PcepMessage>) o; |
| 219 | for (PcepMessage msg : msgs) { |
| 220 | if (msg instanceof PcepInitiateMsg) { |
| 221 | msgOnWire.add(msg); |
| 222 | } |
| 223 | } |
| 224 | } |
| 225 | return null; |
| 226 | } |
| 227 | |
| 228 | public List<PcepMessage> msgsWritten() { |
| 229 | return msgOnWire; |
| 230 | } |
| 231 | |
| 232 | @Override |
| 233 | public int compareTo(Channel o) { |
| 234 | // TODO Auto-generated method stub |
| 235 | return 0; |
| 236 | } |
| 237 | |
| 238 | @Override |
| 239 | public Integer getId() { |
| 240 | // TODO Auto-generated method stub |
| 241 | return null; |
| 242 | } |
| 243 | |
| 244 | @Override |
| 245 | public ChannelFactory getFactory() { |
| 246 | // TODO Auto-generated method stub |
| 247 | return null; |
| 248 | } |
| 249 | |
| 250 | @Override |
| 251 | public Channel getParent() { |
| 252 | // TODO Auto-generated method stub |
| 253 | return null; |
| 254 | } |
| 255 | |
| 256 | @Override |
| 257 | public ChannelConfig getConfig() { |
| 258 | // TODO Auto-generated method stub |
| 259 | return null; |
| 260 | } |
| 261 | |
| 262 | @Override |
| 263 | public ChannelPipeline getPipeline() { |
| 264 | // TODO Auto-generated method stub |
| 265 | return null; |
| 266 | } |
| 267 | |
| 268 | @Override |
| 269 | public boolean isOpen() { |
| 270 | // TODO Auto-generated method stub |
| 271 | return false; |
| 272 | } |
| 273 | |
| 274 | @Override |
| 275 | public boolean isBound() { |
| 276 | // TODO Auto-generated method stub |
| 277 | return false; |
| 278 | } |
| 279 | |
| 280 | @Override |
| 281 | public boolean isConnected() { |
| 282 | // TODO Auto-generated method stub |
| 283 | return false; |
| 284 | } |
| 285 | |
| 286 | @Override |
| 287 | public SocketAddress getLocalAddress() { |
| 288 | // TODO Auto-generated method stub |
| 289 | return null; |
| 290 | } |
| 291 | |
| 292 | @Override |
| 293 | public SocketAddress getRemoteAddress() { |
| 294 | // TODO Auto-generated method stub |
| 295 | return null; |
| 296 | } |
| 297 | |
| 298 | @Override |
| 299 | public ChannelFuture write(Object message, SocketAddress remoteAddress) { |
| 300 | // TODO Auto-generated method stub |
| 301 | return null; |
| 302 | } |
| 303 | |
| 304 | @Override |
| 305 | public ChannelFuture bind(SocketAddress localAddress) { |
| 306 | // TODO Auto-generated method stub |
| 307 | return null; |
| 308 | } |
| 309 | |
| 310 | @Override |
| 311 | public ChannelFuture connect(SocketAddress remoteAddress) { |
| 312 | // TODO Auto-generated method stub |
| 313 | return null; |
| 314 | } |
| 315 | |
| 316 | @Override |
| 317 | public ChannelFuture disconnect() { |
| 318 | // TODO Auto-generated method stub |
| 319 | return null; |
| 320 | } |
| 321 | |
| 322 | @Override |
| 323 | public ChannelFuture unbind() { |
| 324 | // TODO Auto-generated method stub |
| 325 | return null; |
| 326 | } |
| 327 | |
| 328 | @Override |
| 329 | public ChannelFuture close() { |
| 330 | // TODO Auto-generated method stub |
| 331 | return null; |
| 332 | } |
| 333 | |
| 334 | @Override |
| 335 | public ChannelFuture getCloseFuture() { |
| 336 | // TODO Auto-generated method stub |
| 337 | return null; |
| 338 | } |
| 339 | |
| 340 | @Override |
| 341 | public int getInterestOps() { |
| 342 | // TODO Auto-generated method stub |
| 343 | return 0; |
| 344 | } |
| 345 | |
| 346 | @Override |
| 347 | public boolean isReadable() { |
| 348 | // TODO Auto-generated method stub |
| 349 | return false; |
| 350 | } |
| 351 | |
| 352 | @Override |
| 353 | public boolean isWritable() { |
| 354 | // TODO Auto-generated method stub |
| 355 | return false; |
| 356 | } |
| 357 | |
| 358 | @Override |
| 359 | public ChannelFuture setInterestOps(int interestOps) { |
| 360 | // TODO Auto-generated method stub |
| 361 | return null; |
| 362 | } |
| 363 | |
| 364 | @Override |
| 365 | public ChannelFuture setReadable(boolean readable) { |
| 366 | // TODO Auto-generated method stub |
| 367 | return null; |
| 368 | } |
| 369 | |
| 370 | @Override |
| 371 | public boolean getUserDefinedWritability(int index) { |
| 372 | // TODO Auto-generated method stub |
| 373 | return false; |
| 374 | } |
| 375 | |
| 376 | @Override |
| 377 | public void setUserDefinedWritability(int index, boolean isWritable) { |
| 378 | // TODO Auto-generated method stub |
| 379 | |
| 380 | } |
| 381 | |
| 382 | @Override |
| 383 | public Object getAttachment() { |
| 384 | // TODO Auto-generated method stub |
| 385 | return null; |
| 386 | } |
| 387 | |
| 388 | @Override |
| 389 | public void setAttachment(Object attachment) { |
| 390 | // TODO Auto-generated method stub |
| 391 | |
| 392 | } |
| 393 | } |
| 394 | |
| 395 | class MockTunnelService implements TunnelService { |
| 396 | private HashMap<TunnelId, Tunnel> tunnelIdAsKeyStore = new HashMap<TunnelId, Tunnel>(); |
| 397 | private int tunnelIdCounter = 0; |
| 398 | |
| 399 | @Override |
| 400 | public TunnelId setupTunnel(ApplicationId producerId, ElementId srcElementId, Tunnel tunnel, Path path) { |
| 401 | TunnelId tunnelId = TunnelId.valueOf(String.valueOf(++tunnelIdCounter)); |
| 402 | Tunnel tunnelToInsert = new DefaultTunnel(tunnel.providerId(), tunnel.src(), tunnel.dst(), tunnel.type(), |
| 403 | tunnel.state(), tunnel.groupId(), tunnelId, tunnel.tunnelName(), |
| 404 | path, tunnel.annotations()); |
| 405 | tunnelIdAsKeyStore.put(tunnelId, tunnelToInsert); |
| 406 | return tunnelId; |
| 407 | } |
| 408 | |
| 409 | @Override |
| 410 | public Tunnel queryTunnel(TunnelId tunnelId) { |
| 411 | for (TunnelId tunnelIdKey : tunnelIdAsKeyStore.keySet()) { |
| 412 | if (tunnelIdKey.equals(tunnelId)) { |
| 413 | return tunnelIdAsKeyStore.get(tunnelId); |
| 414 | } |
| 415 | } |
| 416 | return null; |
| 417 | } |
| 418 | |
| 419 | @Override |
| 420 | public Collection<Tunnel> queryTunnel(TunnelEndPoint src, TunnelEndPoint dst) { |
| 421 | Collection<Tunnel> result = new HashSet<Tunnel>(); |
| 422 | Tunnel tunnel = null; |
| 423 | for (TunnelId tunnelId : tunnelIdAsKeyStore.keySet()) { |
| 424 | tunnel = tunnelIdAsKeyStore.get(tunnelId); |
| 425 | |
| 426 | if ((null != tunnel) && (src.equals(tunnel.src())) && (dst.equals(tunnel.dst()))) { |
| 427 | result.add(tunnel); |
| 428 | } |
| 429 | } |
| 430 | |
| 431 | return result.size() == 0 ? Collections.emptySet() : ImmutableSet.copyOf(result); |
| 432 | } |
| 433 | |
| 434 | @Override |
| 435 | public Collection<Tunnel> queryTunnel(Tunnel.Type type) { |
| 436 | Collection<Tunnel> result = new HashSet<Tunnel>(); |
| 437 | |
| 438 | for (TunnelId tunnelId : tunnelIdAsKeyStore.keySet()) { |
| 439 | result.add(tunnelIdAsKeyStore.get(tunnelId)); |
| 440 | } |
| 441 | |
| 442 | return result.size() == 0 ? Collections.emptySet() : ImmutableSet.copyOf(result); |
| 443 | } |
| 444 | |
| 445 | @Override |
| 446 | public Collection<Tunnel> queryAllTunnels() { |
| 447 | Collection<Tunnel> result = new HashSet<Tunnel>(); |
| 448 | |
| 449 | for (TunnelId tunnelId : tunnelIdAsKeyStore.keySet()) { |
| 450 | result.add(tunnelIdAsKeyStore.get(tunnelId)); |
| 451 | } |
| 452 | |
| 453 | return result.size() == 0 ? Collections.emptySet() : ImmutableSet.copyOf(result); |
| 454 | } |
| 455 | |
| 456 | @Override |
| 457 | public void addListener(TunnelListener listener) { |
| 458 | // TODO Auto-generated method stub |
| 459 | |
| 460 | } |
| 461 | |
| 462 | @Override |
| 463 | public void removeListener(TunnelListener listener) { |
| 464 | // TODO Auto-generated method stub |
| 465 | |
| 466 | } |
| 467 | |
| 468 | @Override |
| 469 | public Tunnel borrowTunnel(ApplicationId consumerId, TunnelId tunnelId, Annotations... annotations) { |
| 470 | // TODO Auto-generated method stub |
| 471 | return null; |
| 472 | } |
| 473 | |
| 474 | @Override |
| 475 | public Collection<Tunnel> borrowTunnel(ApplicationId consumerId, TunnelName tunnelName, |
| 476 | Annotations... annotations) { |
| 477 | // TODO Auto-generated method stub |
| 478 | return null; |
| 479 | } |
| 480 | |
| 481 | @Override |
| 482 | public Collection<Tunnel> borrowTunnel(ApplicationId consumerId, TunnelEndPoint src, TunnelEndPoint dst, |
| 483 | Annotations... annotations) { |
| 484 | // TODO Auto-generated method stub |
| 485 | return null; |
| 486 | } |
| 487 | |
| 488 | @Override |
| 489 | public Collection<Tunnel> borrowTunnel(ApplicationId consumerId, TunnelEndPoint src, TunnelEndPoint dst, |
| 490 | Type type, Annotations... annotations) { |
| 491 | // TODO Auto-generated method stub |
| 492 | return null; |
| 493 | } |
| 494 | |
| 495 | @Override |
| 496 | public boolean downTunnel(ApplicationId producerId, TunnelId tunnelId) { |
| 497 | // TODO Auto-generated method stub |
| 498 | return false; |
| 499 | } |
| 500 | |
| 501 | @Override |
| 502 | public boolean returnTunnel(ApplicationId consumerId, TunnelId tunnelId, Annotations... annotations) { |
| 503 | // TODO Auto-generated method stub |
| 504 | return false; |
| 505 | } |
| 506 | |
| 507 | @Override |
| 508 | public boolean returnTunnel(ApplicationId consumerId, TunnelName tunnelName, Annotations... annotations) { |
| 509 | // TODO Auto-generated method stub |
| 510 | return false; |
| 511 | } |
| 512 | |
| 513 | @Override |
| 514 | public boolean returnTunnel(ApplicationId consumerId, TunnelEndPoint src, TunnelEndPoint dst, Type type, |
| 515 | Annotations... annotations) { |
| 516 | // TODO Auto-generated method stub |
| 517 | return false; |
| 518 | } |
| 519 | |
| 520 | @Override |
| 521 | public boolean returnTunnel(ApplicationId consumerId, TunnelEndPoint src, TunnelEndPoint dst, |
| 522 | Annotations... annotations) { |
| 523 | // TODO Auto-generated method stub |
| 524 | return false; |
| 525 | } |
| 526 | |
| 527 | @Override |
| 528 | public Collection<TunnelSubscription> queryTunnelSubscription(ApplicationId consumerId) { |
| 529 | // TODO Auto-generated method stub |
| 530 | return null; |
| 531 | } |
| 532 | |
| 533 | @Override |
| 534 | public int tunnelCount() { |
| 535 | // TODO Auto-generated method stub |
| 536 | return 0; |
| 537 | } |
| 538 | |
| 539 | @Override |
| 540 | public Iterable<Tunnel> getTunnels(DeviceId deviceId) { |
| 541 | // TODO Auto-generated method stub |
| 542 | return null; |
| 543 | } |
| 544 | } |
harikrushna-Huawei | a2c7c20 | 2017-04-10 18:22:00 +0530 | [diff] [blame^] | 545 | |
| 546 | private class TestPcepClientControllerImpl extends PcepClientControllerImpl { |
| 547 | public void setTunnelService(TunnelService tunnelService) { |
| 548 | this.tunnelService = tunnelService; |
| 549 | } |
| 550 | |
| 551 | public PcepAgent agent() { |
| 552 | return this.agent; |
| 553 | } |
| 554 | } |
Ray Milkey | 2d572dd | 2017-04-14 10:01:24 -0700 | [diff] [blame] | 555 | } |