Listen for available servers
The listener uses theCloudApi client your plugin already owns and notifies your application code when a server becomes available:
ServerAvailabilityListener.java
Events only report changes that happen after you subscribe. If your plugin also needs the current state when it starts, load it separately through the Servers API.
Close the listener
Close the listener when your plugin stops, before closing the sharedCloudApi client:
CloudApi client.
See the Events API reference for the other event categories and callback types.