Interface MDNSDiscoveryParticipant
@NonNullByDefault
public interface MDNSDiscoveryParticipant
A
MDNSDiscoveryParticipant
that is registered as a service is picked up by the MDNSDiscoveryService
and can thus contribute DiscoveryResult
s from
mDNS scans.- Author:
- Tobias Bräutigam - Initial contribution
-
Method Summary
Modifier and TypeMethodDescription@Nullable DiscoveryResult
createResult
(javax.jmdns.ServiceInfo service) Creates a discovery result for a mDNS servicedefault 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 toDefines 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
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
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.
-