Interface UpnpDiscoveryParticipant


@NonNullByDefault public interface UpnpDiscoveryParticipant
A UpnpDiscoveryParticipant that is registered as a service is picked up by the UpnpDiscoveryService and can thus contribute DiscoveryResults from UPnP scans.
Author:
Kai Kreuzer - Initial contribution
  • Field Summary

    Fields
    Modifier and Type
    Field
    Description
    static final long
    According to the UPnP specification, the minimum MaxAge is 1800 seconds.
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable DiscoveryResult
    createResult(org.jupnp.model.meta.RemoteDevice device)
    Creates a discovery result for a upnp device
    default long
    getRemovalGracePeriodSeconds(org.jupnp.model.meta.RemoteDevice device)
    The JUPnP library strictly follows the UPnP specification insofar as if a device fails to send its next 'ssdp:alive' notification within its declared 'maxAge' period, it is immediately considered to be gone.
    Defines the list of thing types that this participant can identify
    @Nullable ThingUID
    getThingUID(org.jupnp.model.meta.RemoteDevice device)
    Returns the thing UID for a upnp device
    default boolean
    The discovery always notifies participants about discovered root devices.
  • Field Details

    • MIN_MAX_AGE_SECS

      static final long MIN_MAX_AGE_SECS
      According to the UPnP specification, the minimum MaxAge is 1800 seconds.
      See Also:
  • Method Details

    • getSupportedThingTypeUIDs

      Set<ThingTypeUID> getSupportedThingTypeUIDs()
      Defines the list of thing types that this participant can identify
      Returns:
      a set of thing type UIDs for which results can be created
    • createResult

      @Nullable DiscoveryResult createResult(org.jupnp.model.meta.RemoteDevice device)
      Creates a discovery result for a upnp device
      Parameters:
      device - the upnp device found on the network
      Returns:
      the according discovery result or null, if device is not supported by this participant
    • getThingUID

      @Nullable ThingUID getThingUID(org.jupnp.model.meta.RemoteDevice device)
      Returns the thing UID for a upnp device
      Parameters:
      device - the upnp device on the network
      Returns:
      a thing UID or null, if device is not supported by this participant
    • getRemovalGracePeriodSeconds

      default long getRemovalGracePeriodSeconds(org.jupnp.model.meta.RemoteDevice device)
      The JUPnP library strictly follows the UPnP specification insofar as if a device fails to send its next 'ssdp:alive' notification within its declared 'maxAge' period, it is immediately considered to be gone. But unfortunately some openHAB bindings handle devices that can sometimes be a bit late in sending their 'ssdp:alive' notifications even though they have not really gone offline, which means that such devices are repeatedly removed from, and (re)added to, the Inbox. To prevent this, a binding that implements a UpnpDiscoveryParticipant may OPTIONALLY implement this method to specify an additional delay period (grace period) to wait before the device is removed from the Inbox.
      Parameters:
      device - the UPnP device on the network
      Returns:
      the additional grace period delay in seconds before the device will be removed from the Inbox
    • notifyChildDevices

      default boolean notifyChildDevices()
      The discovery always notifies participants about discovered root devices. And if the participant also wants to be notified about embedded child devices then it shall override this method.
      Returns:
      true if the participant wants to be also notified about embedded child devices.