[SOLVED] Is it possible to get notified (callback) when org.jupnp registry changes (device added or removed)?

Hey there,

currently I’m working on a binding for a my own upnp device. I need to keep track if the device is online or offline. I want this in addition to updating the device status when the control of it was successful or failed. My first thought was to run a polling mechanism which checks if the device is reachable. Then I remembered that my device sends out upnp notification (ssdp:alive and ssdp:byebye). The org.jupnp.registry.Registry keeps track of all devices that are alive. Is it possible to get notified by org.jupnp if a device is added to the registry (ssdp:alive) or removed from the registry (ssdp:byebye or expired)? This all should only happen in the binding. I don’t want to modify org.jupnp or upnpservice files, because in this case, everyone who wants to use my binding has to edit their files too.

Hope we can find a solution for this together :slight_smile:

Found a solution by myselfe. One can implement the interface RegistryListener. The listener can be added to the listeners of the actual upnp service. With this one gets access to all important events.

I don’t delete this topic but mark it as solved, so if someone has the same question he or she can find a solution quickly! :hugs: