use of org.eclipse.leshan.server.queue.PresenceListener in project leshan by eclipse.
the class QueueModeIntegrationTestHelper method createServer.
public void createServer(int clientAwakeTime) {
server = createServerBuilder(clientAwakeTime).build();
awakeNotifications.set(0);
server.getPresenceService().addListener(new PresenceListener() {
@Override
public void onAwake(Registration registration) {
if (registration.getEndpoint().equals(currentEndpointIdentifier.get())) {
awakeNotifications.addAndGet(1);
}
}
@Override
public void onSleeping(Registration registration) {
awakeNotifications.set(0);
awakeLatch.countDown();
}
});
// monitor client registration
setupRegistrationMonitoring();
}
Aggregations