blob: e366da3c6518c81f0f14f2003aba508a6242d1bc [file] [log] [blame]
HIGUCHI Yuta15653fd2015-11-09 11:05:09 -08001/*
2 * Copyright 2015 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 */
16package org.onosproject.incubator.rpc.grpc;
17
18import static org.junit.Assert.*;
19import static org.onosproject.net.DeviceId.deviceId;
HIGUCHI Yuta7c1583c2015-12-03 23:08:54 -080020import static org.onosproject.net.PortNumber.portNumber;
HIGUCHI Yuta15653fd2015-11-09 11:05:09 -080021
HIGUCHI Yuta15653fd2015-11-09 11:05:09 -080022import java.net.URI;
23import java.util.Collection;
24import java.util.Collections;
25import java.util.List;
26import java.util.Set;
27import java.util.concurrent.CountDownLatch;
28import java.util.concurrent.TimeUnit;
29
HIGUCHI Yuta15653fd2015-11-09 11:05:09 -080030import org.junit.After;
31import org.junit.Before;
32import org.junit.Test;
HIGUCHI Yuta97f7e472016-01-22 10:03:48 -080033import org.onlab.junit.TestTools;
HIGUCHI Yuta15653fd2015-11-09 11:05:09 -080034import org.onlab.packet.ChassisId;
35import org.onosproject.incubator.rpc.RemoteServiceContext;
36import org.onosproject.incubator.rpc.RemoteServiceContextProvider;
37import org.onosproject.incubator.rpc.RemoteServiceContextProviderService;
38import org.onosproject.incubator.rpc.RemoteServiceProviderRegistry;
HIGUCHI Yuta7c1583c2015-12-03 23:08:54 -080039import org.onosproject.net.ConnectPoint;
HIGUCHI Yuta15653fd2015-11-09 11:05:09 -080040import org.onosproject.net.DefaultAnnotations;
41import org.onosproject.net.Device.Type;
42import org.onosproject.net.DeviceId;
HIGUCHI Yuta7c1583c2015-12-03 23:08:54 -080043import org.onosproject.net.Link;
HIGUCHI Yuta15653fd2015-11-09 11:05:09 -080044import org.onosproject.net.MastershipRole;
45import org.onosproject.net.PortNumber;
46import org.onosproject.net.SparseAnnotations;
47import org.onosproject.net.device.DefaultDeviceDescription;
48import org.onosproject.net.device.DefaultPortDescription;
49import org.onosproject.net.device.DeviceDescription;
50import org.onosproject.net.device.DeviceProvider;
51import org.onosproject.net.device.DeviceProviderRegistry;
52import org.onosproject.net.device.DeviceProviderService;
53import org.onosproject.net.device.PortDescription;
54import org.onosproject.net.device.PortStatistics;
HIGUCHI Yuta7c1583c2015-12-03 23:08:54 -080055import org.onosproject.net.link.DefaultLinkDescription;
56import org.onosproject.net.link.LinkDescription;
57import org.onosproject.net.link.LinkProvider;
58import org.onosproject.net.link.LinkProviderRegistry;
59import org.onosproject.net.link.LinkProviderService;
HIGUCHI Yuta15653fd2015-11-09 11:05:09 -080060import org.onosproject.net.provider.AbstractProviderRegistry;
61import org.onosproject.net.provider.AbstractProviderService;
62import org.onosproject.net.provider.ProviderId;
63import org.slf4j.Logger;
64import org.slf4j.LoggerFactory;
65
66import com.google.common.collect.ImmutableList;
67
68/**
69 * Set of tests of the gRPC RemoteService components.
70 */
71public class GrpcRemoteServiceTest {
72
73 private static final DeviceId DEVICE_ID = deviceId("dev:000001");
74
75 private final Logger log = LoggerFactory.getLogger(getClass());
76
77 private static final ProviderId PID = new ProviderId("test", "com.exmaple.test");
78
79 private static final URI DURI = URI.create("dev:000001");
80
81 private static final String MFR = "mfr";
82
83 private static final String HW = "hw";
84
85 private static final String SW = "sw";
86
87 private static final String SN = "serial";
88
89 private static final ChassisId CHASSIS = new ChassisId(42);
90
91 private static final SparseAnnotations ANON = DefaultAnnotations.builder()
92 .set("foo", "var")
93 .build();
94
95 private static final PortNumber PORT = PortNumber.portNumber(99);
96
97 private static final DeviceDescription DDESC
98 = new DefaultDeviceDescription(DURI, Type.SWITCH, MFR, HW, SW, SN,
99 CHASSIS, ANON);
100
101 private GrpcRemoteServiceServer server;
102 private GrpcRemoteServiceProvider client;
103
104 private DeviceProvider svSideDeviceProvider;
105
106 private MTestDeviceProviderService svDeviceProviderService;
107
HIGUCHI Yuta7c1583c2015-12-03 23:08:54 -0800108 private ServerSideLinkProviderService svLinkProviderService;
109
110
HIGUCHI Yuta15653fd2015-11-09 11:05:09 -0800111 private CountDownLatch serverReady;
112
113 private URI uri;
114
HIGUCHI Yuta15653fd2015-11-09 11:05:09 -0800115 @Before
116 public void setUp() throws Exception {
117 serverReady = new CountDownLatch(1);
118 server = new GrpcRemoteServiceServer();
119 server.deviceProviderRegistry = new MTestDeviceProviderRegistry();
HIGUCHI Yuta7c1583c2015-12-03 23:08:54 -0800120 server.linkProviderRegistry = new ServerSideLinkProviderRegistry();
HIGUCHI Yuta97f7e472016-01-22 10:03:48 -0800121 server.listenPort = TestTools.findAvailablePort(11984);
HIGUCHI Yuta15653fd2015-11-09 11:05:09 -0800122 uri = URI.create("grpc://localhost:" + server.listenPort);
HIGUCHI Yuta97f7e472016-01-22 10:03:48 -0800123 // todo: pass proper ComponentContext
HIGUCHI Yuta15653fd2015-11-09 11:05:09 -0800124 server.activate(null);
125
126 client = new GrpcRemoteServiceProvider();
127 client.rpcRegistry = new NoOpRemoteServiceProviderRegistry();
128 client.activate();
129 }
130
131 @After
132 public void tearDown() {
133 client.deactivate();
134 server.deactivate();
HIGUCHI Yuta7c1583c2015-12-03 23:08:54 -0800135 svLinkProviderService = null;
HIGUCHI Yuta15653fd2015-11-09 11:05:09 -0800136 }
137
138 private static void assertEqualsButNotSame(Object expected, Object actual) {
139 assertEquals(expected, actual);
140 assertNotSame("Cannot be same instance if it properly went through gRPC",
141 expected, actual);
142 }
143
144 @Test
HIGUCHI Yuta7c1583c2015-12-03 23:08:54 -0800145 public void deviceServiceBasics() throws InterruptedException {
HIGUCHI Yuta15653fd2015-11-09 11:05:09 -0800146 RemoteServiceContext remoteServiceContext = client.get(uri);
147 assertNotNull(remoteServiceContext);
148
149 DeviceProviderRegistry deviceProviderRegistry = remoteServiceContext.get(DeviceProviderRegistry.class);
150 assertNotNull(deviceProviderRegistry);
151
152 CTestDeviceProvider clDeviceProvider = new CTestDeviceProvider();
153 DeviceProviderService clDeviceProviderService = deviceProviderRegistry.register(clDeviceProvider);
154
155 assertTrue(serverReady.await(10, TimeUnit.SECONDS));
156
157 // client to server communication
158 clDeviceProviderService.deviceConnected(DEVICE_ID, DDESC);
159 assertTrue(svDeviceProviderService.deviceConnected.await(10, TimeUnit.SECONDS));
160 assertEqualsButNotSame(DEVICE_ID, svDeviceProviderService.deviceConnectedDid);
161 assertEqualsButNotSame(DDESC, svDeviceProviderService.deviceConnectedDesc);
162
163 PortDescription portDescription = new DefaultPortDescription(PORT, true, ANON);
164 List<PortDescription> portDescriptions = ImmutableList.of(portDescription);
165 clDeviceProviderService.updatePorts(DEVICE_ID, portDescriptions);
166 assertTrue(svDeviceProviderService.updatePorts.await(10, TimeUnit.SECONDS));
167 assertEqualsButNotSame(DEVICE_ID, svDeviceProviderService.updatePortsDid);
168 assertEqualsButNotSame(portDescriptions, svDeviceProviderService.updatePortsDescs);
169
170 MastershipRole cRole = MastershipRole.MASTER;
171 MastershipRole dRole = MastershipRole.STANDBY;
172 clDeviceProviderService.receivedRoleReply(DEVICE_ID, cRole, dRole);
173 assertTrue(svDeviceProviderService.receivedRoleReply.await(10, TimeUnit.SECONDS));
174 assertEqualsButNotSame(DEVICE_ID, svDeviceProviderService.receivedRoleReplyDid);
175 assertEquals(cRole, svDeviceProviderService.receivedRoleReplyRequested);
176 assertEquals(dRole, svDeviceProviderService.receivedRoleReplyResponse);
177
178 clDeviceProviderService.portStatusChanged(DEVICE_ID, portDescription);
179 assertTrue(svDeviceProviderService.portStatusChanged.await(10, TimeUnit.SECONDS));
180 assertEqualsButNotSame(DEVICE_ID, svDeviceProviderService.portStatusChangedDid);
181 assertEqualsButNotSame(portDescription, svDeviceProviderService.portStatusChangedDesc);
182
183 Collection<PortStatistics> portStatistics = Collections.emptyList();
184 clDeviceProviderService.updatePortStatistics(DEVICE_ID, portStatistics);
185 assertTrue(svDeviceProviderService.updatePortStatistics.await(10, TimeUnit.SECONDS));
186 assertEqualsButNotSame(DEVICE_ID, svDeviceProviderService.updatePortStatisticsDid);
187 assertEqualsButNotSame(portStatistics, svDeviceProviderService.updatePortStatisticsStats);
188
189 clDeviceProviderService.deviceDisconnected(DEVICE_ID);
190 assertTrue(svDeviceProviderService.deviceDisconnected.await(10, TimeUnit.SECONDS));
191 assertEqualsButNotSame(DEVICE_ID, svDeviceProviderService.deviceDisconnectedDid);
192
193
194
195 // server to client communication
196 svSideDeviceProvider.triggerProbe(DEVICE_ID);
197 assertTrue(clDeviceProvider.triggerProbe.await(10, TimeUnit.SECONDS));
198 assertEquals(DEVICE_ID, clDeviceProvider.triggerProbeDid);
199 assertNotSame("Cannot be same instance if it properly went through gRPC",
200 DEVICE_ID, clDeviceProvider.triggerProbeDid);
201
202 svSideDeviceProvider.roleChanged(DEVICE_ID, MastershipRole.STANDBY);
203 assertTrue(clDeviceProvider.roleChanged.await(10, TimeUnit.SECONDS));
204 assertEquals(DEVICE_ID, clDeviceProvider.roleChangedDid);
205 assertNotSame("Cannot be same instance if it properly went through gRPC",
206 DEVICE_ID, clDeviceProvider.roleChangedDid);
207 assertEquals(MastershipRole.STANDBY, clDeviceProvider.roleChangedNewRole);
208
209 clDeviceProvider.isReachableReply = false;
210 assertEquals(clDeviceProvider.isReachableReply,
211 svSideDeviceProvider.isReachable(DEVICE_ID));
212 assertTrue(clDeviceProvider.isReachable.await(10, TimeUnit.SECONDS));
213 assertEquals(DEVICE_ID, clDeviceProvider.isReachableDid);
214 assertNotSame("Cannot be same instance if it properly went through gRPC",
215 DEVICE_ID, clDeviceProvider.isReachableDid);
216 }
217
HIGUCHI Yuta7c1583c2015-12-03 23:08:54 -0800218 @Test
219 public void linkVanishedDevice() throws InterruptedException {
220 RemoteServiceContext remoteServiceContext = client.get(uri);
221 assertNotNull(remoteServiceContext);
222
223 LinkProviderRegistry providerRegistry = remoteServiceContext.get(LinkProviderRegistry.class);
224 assertNotNull(providerRegistry);
225
226 final String schemeTest = "test";
227 LinkProviderService client = providerRegistry.register(new StubLinkProvider(schemeTest));
228 assertNotNull(client);
229
230 client.linksVanished(DEVICE_ID);
231
232 assertEquals(schemeTest, svLinkProviderService.provider().id().scheme());
233 assertTrue(svLinkProviderService.calls.await(10, TimeUnit.SECONDS));
234 assertEqualsButNotSame(DEVICE_ID, svLinkProviderService.arg);
235 }
236
237 @Test
238 public void linkVanishedPort() throws InterruptedException {
239 RemoteServiceContext remoteServiceContext = client.get(uri);
240 assertNotNull(remoteServiceContext);
241
242 LinkProviderRegistry providerRegistry = remoteServiceContext.get(LinkProviderRegistry.class);
243 assertNotNull(providerRegistry);
244
245 final String schemeTest = "test";
246 LinkProviderService client = providerRegistry.register(new StubLinkProvider(schemeTest));
247 assertNotNull(client);
248
249
250 final ConnectPoint cp = new ConnectPoint(DEVICE_ID, PORT);
251 client.linksVanished(cp);
252 assertEquals(schemeTest, svLinkProviderService.provider().id().scheme());
253 assertTrue(svLinkProviderService.calls.await(10, TimeUnit.SECONDS));
254 assertEqualsButNotSame(cp, svLinkProviderService.arg);
255 }
256
257 @Test
258 public void linkVanishedDescription() throws InterruptedException {
259 RemoteServiceContext remoteServiceContext = client.get(uri);
260 assertNotNull(remoteServiceContext);
261
262 LinkProviderRegistry providerRegistry = remoteServiceContext.get(LinkProviderRegistry.class);
263 assertNotNull(providerRegistry);
264
265 final String schemeTest = "test";
266 LinkProviderService client = providerRegistry.register(new StubLinkProvider(schemeTest));
267 assertNotNull(client);
268
269 ConnectPoint src = new ConnectPoint(deviceId("dev:1"), portNumber(10));
270 ConnectPoint dst = new ConnectPoint(deviceId("dev:2"), portNumber(20));
271 LinkDescription linkDescription = new DefaultLinkDescription(src, dst, Link.Type.DIRECT, ANON);
272 client.linkVanished(linkDescription);
273 assertEquals(schemeTest, svLinkProviderService.provider().id().scheme());
274 assertTrue(svLinkProviderService.calls.await(10, TimeUnit.SECONDS));
275 assertEqualsButNotSame(linkDescription, svLinkProviderService.arg);
276 }
277
278 @Test
279 public void linkDetected() throws InterruptedException {
280 RemoteServiceContext remoteServiceContext = client.get(uri);
281 assertNotNull(remoteServiceContext);
282
283 LinkProviderRegistry providerRegistry = remoteServiceContext.get(LinkProviderRegistry.class);
284 assertNotNull(providerRegistry);
285
286 final String schemeTest = "test";
287 LinkProviderService client = providerRegistry.register(new StubLinkProvider(schemeTest));
288 assertNotNull(client);
289
290 ConnectPoint src = new ConnectPoint(deviceId("dev:1"), portNumber(10));
291 ConnectPoint dst = new ConnectPoint(deviceId("dev:2"), portNumber(20));
292 LinkDescription linkDescription = new DefaultLinkDescription(src, dst, Link.Type.DIRECT, ANON);
293 client.linkDetected(linkDescription);
294 assertEquals(schemeTest, svLinkProviderService.provider().id().scheme());
295 assertTrue(svLinkProviderService.calls.await(10, TimeUnit.SECONDS));
296 assertEqualsButNotSame(linkDescription, svLinkProviderService.arg);
297 }
298
299 @Test
300 public void linkServiceBasics() throws InterruptedException {
301 RemoteServiceContext remoteServiceContext = client.get(uri);
302 assertNotNull(remoteServiceContext);
303
304 LinkProviderRegistry providerRegistry = remoteServiceContext.get(LinkProviderRegistry.class);
305 assertNotNull(providerRegistry);
306
307 final String schemeTest = "test";
308 LinkProviderService client = providerRegistry.register(new StubLinkProvider(schemeTest));
309 assertNotNull(client);
310
311 ConnectPoint src = new ConnectPoint(deviceId("dev:1"), portNumber(10));
312 ConnectPoint dst = new ConnectPoint(deviceId("dev:2"), portNumber(20));
313 LinkDescription linkDescription = new DefaultLinkDescription(src, dst, Link.Type.DIRECT, ANON);
314
315 client.linkDetected(linkDescription);
316 assertEquals(schemeTest, svLinkProviderService.provider().id().scheme());
317 assertTrue(svLinkProviderService.calls.await(10, TimeUnit.SECONDS));
318 assertEqualsButNotSame(linkDescription, svLinkProviderService.arg);
319
320 svLinkProviderService.reset();
321
322 client.linkVanished(linkDescription);
323 assertEquals(schemeTest, svLinkProviderService.provider().id().scheme());
324 assertTrue(svLinkProviderService.calls.await(10, TimeUnit.SECONDS));
325 assertEqualsButNotSame(linkDescription, svLinkProviderService.arg);
326 }
327
HIGUCHI Yuta15653fd2015-11-09 11:05:09 -0800328 /**
329 * Device Provider on CO side.
330 */
331 public class CTestDeviceProvider implements DeviceProvider {
332
333 final CountDownLatch triggerProbe = new CountDownLatch(1);
334 DeviceId triggerProbeDid;
335
336 final CountDownLatch roleChanged = new CountDownLatch(1);
337 DeviceId roleChangedDid;
338 MastershipRole roleChangedNewRole;
339
340 final CountDownLatch isReachable = new CountDownLatch(1);
341 DeviceId isReachableDid;
342 boolean isReachableReply = false;
343
344 @Override
345 public ProviderId id() {
346 return PID;
347 }
348
349 @Override
350 public void triggerProbe(DeviceId deviceId) {
351 log.info("triggerProbe({}) on Client called", deviceId);
352 triggerProbeDid = deviceId;
353 triggerProbe.countDown();
354 }
355
356 @Override
357 public void roleChanged(DeviceId deviceId, MastershipRole newRole) {
358 log.info("roleChanged({},{}) on Client called", deviceId, newRole);
359 roleChangedDid = deviceId;
360 roleChangedNewRole = newRole;
361 roleChanged.countDown();
362 }
363
364 @Override
365 public boolean isReachable(DeviceId deviceId) {
366 log.info("isReachable({}) on Client called", deviceId);
367 isReachableDid = deviceId;
368 isReachable.countDown();
369 return isReachableReply;
370 }
371
372 }
373
374 class NoOpRemoteServiceProviderRegistry
375 implements RemoteServiceProviderRegistry {
376
377 @Override
378 public RemoteServiceContextProviderService register(RemoteServiceContextProvider provider) {
379 return new RemoteServiceContextProviderService() {
380
381 @Override
382 public RemoteServiceContextProvider provider() {
383 return provider;
384 }
385 };
386 }
387
388 @Override
389 public void unregister(RemoteServiceContextProvider provider) {
390 }
391
392 @Override
393 public Set<ProviderId> getProviders() {
394 return Collections.emptySet();
395 }
396 }
397
398 /**
399 * DeviceProvider on Metro side.
400 */
401 public class MTestDeviceProviderRegistry
402 extends AbstractProviderRegistry<DeviceProvider, DeviceProviderService>
403 implements DeviceProviderRegistry {
404
405 @Override
406 protected DeviceProviderService createProviderService(DeviceProvider provider) {
407 log.info("createProviderService({})", provider);
408 svSideDeviceProvider = provider;
409 svDeviceProviderService = new MTestDeviceProviderService(provider);
410 serverReady.countDown();
411 return svDeviceProviderService;
412 }
413
414 }
415
416 private final class MTestDeviceProviderService
417 extends AbstractProviderService<DeviceProvider>
418 implements DeviceProviderService {
419
420 public MTestDeviceProviderService(DeviceProvider provider) {
421 super(provider);
422 }
423
424
425 final CountDownLatch deviceConnected = new CountDownLatch(1);
426 DeviceId deviceConnectedDid;
427 DeviceDescription deviceConnectedDesc;
428
429 @Override
430 public void deviceConnected(DeviceId deviceId,
431 DeviceDescription deviceDescription) {
432 log.info("deviceConnected({}, {}) on Server called", deviceId, deviceDescription);
433 deviceConnectedDid = deviceId;
434 deviceConnectedDesc = deviceDescription;
435 deviceConnected.countDown();
436 }
437
438
439 final CountDownLatch updatePorts = new CountDownLatch(1);
440 DeviceId updatePortsDid;
441 List<PortDescription> updatePortsDescs;
442
443 @Override
444 public void updatePorts(DeviceId deviceId,
445 List<PortDescription> portDescriptions) {
446 log.info("updatePorts({}, {}) on Server called", deviceId, portDescriptions);
447 updatePortsDid = deviceId;
448 updatePortsDescs = portDescriptions;
449 updatePorts.countDown();
450 }
451
452 final CountDownLatch receivedRoleReply = new CountDownLatch(1);
453 DeviceId receivedRoleReplyDid;
454 MastershipRole receivedRoleReplyRequested;
455 MastershipRole receivedRoleReplyResponse;
456
457 @Override
458 public void receivedRoleReply(DeviceId deviceId, MastershipRole requested,
459 MastershipRole response) {
460 log.info("receivedRoleReply({}, {}, {}) on Server called", deviceId, requested, response);
461 receivedRoleReplyDid = deviceId;
462 receivedRoleReplyRequested = requested;
463 receivedRoleReplyResponse = response;
464 receivedRoleReply.countDown();
465 }
466
467 final CountDownLatch portStatusChanged = new CountDownLatch(1);
468 DeviceId portStatusChangedDid;
469 PortDescription portStatusChangedDesc;
470
471
472 @Override
473 public void portStatusChanged(DeviceId deviceId,
474 PortDescription portDescription) {
475 log.info("portStatusChanged({}, {}) on Server called", deviceId, portDescription);
476 portStatusChangedDid = deviceId;
477 portStatusChangedDesc = portDescription;
478 portStatusChanged.countDown();
479 }
480
481 final CountDownLatch updatePortStatistics = new CountDownLatch(1);
482 DeviceId updatePortStatisticsDid;
483 Collection<PortStatistics> updatePortStatisticsStats;
484
485
486 @Override
487 public void updatePortStatistics(DeviceId deviceId,
488 Collection<PortStatistics> portStatistics) {
489 log.info("updatePortStatistics({}, {}) on Server called", deviceId, portStatistics);
490 updatePortStatisticsDid = deviceId;
491 updatePortStatisticsStats = portStatistics;
492 updatePortStatistics.countDown();
493 }
494
495 final CountDownLatch deviceDisconnected = new CountDownLatch(1);
496 DeviceId deviceDisconnectedDid;
497
498 @Override
499 public void deviceDisconnected(DeviceId deviceId) {
500 log.info("deviceDisconnected({}) on Server called", deviceId);
501 deviceDisconnectedDid = deviceId;
502 deviceDisconnected.countDown();
503 }
504 }
505
HIGUCHI Yuta7c1583c2015-12-03 23:08:54 -0800506 public class ServerSideLinkProviderRegistry
507 extends AbstractProviderRegistry<LinkProvider, LinkProviderService>
508 implements LinkProviderRegistry {
509
510 @Override
511 protected LinkProviderService createProviderService(LinkProvider provider) {
512 svLinkProviderService = new ServerSideLinkProviderService(provider);
513 return svLinkProviderService;
514 }
515
516 }
517
518 public class ServerSideLinkProviderService
519 extends AbstractProviderService<LinkProvider>
520 implements LinkProviderService {
521
522 CountDownLatch calls = new CountDownLatch(1);
523 Object arg = null;
524
525 public void reset() {
526 calls = new CountDownLatch(1);
527 arg = null;
528 }
529
530 public ServerSideLinkProviderService(LinkProvider provider) {
531 super(provider);
532 }
533
534 @Override
535 public void linksVanished(DeviceId deviceId) {
536 log.info("linksVanished({})", deviceId);
537 arg = deviceId;
538 calls.countDown();
539 }
540
541 @Override
542 public void linksVanished(ConnectPoint connectPoint) {
543 log.info("linksVanished({})", connectPoint);
544 arg = connectPoint;
545 calls.countDown();
546 }
547
548 @Override
549 public void linkVanished(LinkDescription linkDescription) {
550 log.info("linksVanished({})", linkDescription);
551 arg = linkDescription;
552 calls.countDown();
553 }
554
555 @Override
556 public void linkDetected(LinkDescription linkDescription) {
557 log.info("linkDetected({})", linkDescription);
558 arg = linkDescription;
559 calls.countDown();
560 }
561 }
562
HIGUCHI Yuta15653fd2015-11-09 11:05:09 -0800563}