public class DefaultRegistryListener extends Object implements RegistryListener
Also unifies local and remote device additions and removals with
deviceAdded(Registry, org.fourthline.cling.model.meta.Device)
and
deviceRemoved(Registry, org.fourthline.cling.model.meta.Device)
methods.
Constructor and Description |
---|
DefaultRegistryListener() |
Modifier and Type | Method and Description |
---|---|
void |
afterShutdown()
Called after the registry has been cleared on shutdown.
|
void |
beforeShutdown(Registry registry)
Called after registry maintenance stops but before the registry is cleared.
|
void |
deviceAdded(Registry registry,
Device device) |
void |
deviceRemoved(Registry registry,
Device device) |
void |
localDeviceAdded(Registry registry,
LocalDevice device)
Calls the
deviceAdded(Registry, org.fourthline.cling.model.meta.Device) method. |
void |
localDeviceRemoved(Registry registry,
LocalDevice device)
Calls the
deviceRemoved(Registry, org.fourthline.cling.model.meta.Device) method. |
void |
remoteDeviceAdded(Registry registry,
RemoteDevice device)
Calls the
deviceAdded(Registry, org.fourthline.cling.model.meta.Device) method. |
void |
remoteDeviceDiscoveryFailed(Registry registry,
RemoteDevice device,
Exception ex)
Called when service metadata couldn't be initialized.
|
void |
remoteDeviceDiscoveryStarted(Registry registry,
RemoteDevice device)
Called as soon as possible after a device has been discovered.
|
void |
remoteDeviceRemoved(Registry registry,
RemoteDevice device)
Calls the
deviceRemoved(Registry, org.fourthline.cling.model.meta.Device) method. |
void |
remoteDeviceUpdated(Registry registry,
RemoteDevice device)
Called when a discovered device's expiration timestamp is updated.
|
public void remoteDeviceDiscoveryStarted(Registry registry, RemoteDevice device)
RegistryListener
This method will be called after SSDP notification datagrams of a new alive
UPnP device have been received and processed. The announced device XML descriptor
will be retrieved and parsed. The given RemoteDevice
metadata
is validated and partial Service
metadata is available. The
services are unhydrated, they have no actions or state variable metadata because the
service descriptors of the device model have not been retrieved at this point.
You typically do not use this method on a regular machine, this is an optimization for slower UPnP hosts (such as Android handsets).
remoteDeviceDiscoveryStarted
in interface RegistryListener
registry
- The Cling registry of all devices and services know to the local UPnP stack.device
- A validated and hydrated device metadata graph, with anemic service metadata.public void remoteDeviceDiscoveryFailed(Registry registry, RemoteDevice device, Exception ex)
RegistryListener
If you override the RegistryListener.remoteDeviceDiscoveryStarted(Registry, org.fourthline.cling.model.meta.RemoteDevice)
method, you might want to override this method as well.
remoteDeviceDiscoveryFailed
in interface RegistryListener
registry
- The Cling registry of all devices and services know to the local UPnP stack.device
- A validated and hydrated device metadata graph, with anemic service metadata.ex
- The reason why service metadata could not be initialized, or null
if service
descriptors couldn't be retrieved at all.public void remoteDeviceAdded(Registry registry, RemoteDevice device)
deviceAdded(Registry, org.fourthline.cling.model.meta.Device)
method.remoteDeviceAdded
in interface RegistryListener
registry
- The Cling registry of all devices and services know to the local UPnP stack.device
- A validated and hydrated device metadata graph, with complete service metadata.public void remoteDeviceUpdated(Registry registry, RemoteDevice device)
RegistryListener
This is a signal that a device is still alive and you typically don't have to react to this event. You will be notified when a device disappears through timeout.
remoteDeviceUpdated
in interface RegistryListener
registry
- The Cling registry of all devices and services know to the local UPnP stack.device
- A validated and hydrated device metadata graph, with complete service metadata.public void remoteDeviceRemoved(Registry registry, RemoteDevice device)
deviceRemoved(Registry, org.fourthline.cling.model.meta.Device)
method.remoteDeviceRemoved
in interface RegistryListener
registry
- The Cling registry of all devices and services know to the local UPnP stack.device
- A validated and hydrated device metadata graph, with complete service metadata.public void localDeviceAdded(Registry registry, LocalDevice device)
deviceAdded(Registry, org.fourthline.cling.model.meta.Device)
method.localDeviceAdded
in interface RegistryListener
registry
- The Cling registry of all devices and services know to the local UPnP stack.device
- The local device added to the Registry
.public void localDeviceRemoved(Registry registry, LocalDevice device)
deviceRemoved(Registry, org.fourthline.cling.model.meta.Device)
method.localDeviceRemoved
in interface RegistryListener
registry
- The Cling registry of all devices and services know to the local UPnP stack.device
- The local device removed from the Registry
.public void beforeShutdown(Registry registry)
RegistryListener
This method should typically not block, it executes in the thread that shuts down the UPnP stack.
beforeShutdown
in interface RegistryListener
registry
- The Cling registry of all devices and services know to the local UPnP stack.public void afterShutdown()
RegistryListener
This method should typically not block, it executes in the thread that shuts down the UPnP stack.
afterShutdown
in interface RegistryListener
Copyright © 2016 4th Line GmbH, Switzerland. All rights reserved.