Interface MDNSDiscoveryParticipant


@NonNullByDefault public interface MDNSDiscoveryParticipant
A MDNSDiscoveryParticipant that is registered as a service is picked up by the MDNSDiscoveryService and can thus contribute DiscoveryResults from mDNS scans.
Author:
Tobias Bräutigam - Initial contribution
  • Method Summary

    Modifier and Type
    Method
    Description
    @Nullable DiscoveryResult
    createResult(javax.jmdns.ServiceInfo service)
    Creates a discovery result for a mDNS service
    default long
    getRemovalGracePeriodSeconds(javax.jmdns.ServiceInfo serviceInfo)
    Some openHAB bindings handle devices that can sometimes be a bit late in updating their mDNS announcements, which means that such devices are repeatedly removed from, and (re)added to, the Inbox.
    Defines the mDNS service type this participant listens to
    Defines the list of thing types that this participant can identify
    @Nullable ThingUID
    getThingUID(javax.jmdns.ServiceInfo service)
    Returns the thing UID for a mDNS service
  • 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
    • getServiceType

      String getServiceType()
      Defines the mDNS service type this participant listens to
      Returns:
      a valid mDNS service type (see: http://www.dns-sd.org/ServiceTypes.html)
    • createResult

      @Nullable DiscoveryResult createResult(javax.jmdns.ServiceInfo service)
      Creates a discovery result for a mDNS service
      Parameters:
      service - the mDNS service found on the network
      Returns:
      the according discovery result or null, if device is not supported by this participant
    • getThingUID

      @Nullable ThingUID getThingUID(javax.jmdns.ServiceInfo service)
      Returns the thing UID for a mDNS service
      Parameters:
      service - the mDNS service on the network
      Returns:
      a thing UID or null, if device is not supported by this participant
    • getRemovalGracePeriodSeconds

      default long getRemovalGracePeriodSeconds(javax.jmdns.ServiceInfo serviceInfo)
      Some openHAB bindings handle devices that can sometimes be a bit late in updating their mDNS announcements, which means that such devices are repeatedly removed from, and (re)added to, the Inbox. To prevent this, a binding that implements an MDNSDiscoveryParticipant may OPTIONALLY implement this method to specify an additional delay period (grace period) to wait before the device is removed from the Inbox.
      Parameters:
      serviceInfo - the mDNS ServiceInfo describing the device on the network.
      Returns:
      the additional grace period delay in seconds before the device will be removed from the Inbox.