Class MDNSAddonFinder
java.lang.Object
org.openhab.core.config.discovery.addon.BaseAddonFinder
org.openhab.core.config.discovery.addon.mdns.MDNSAddonFinder
- All Implemented Interfaces:
EventListener,javax.jmdns.ServiceListener,AddonFinder
@NonNullByDefault
public class MDNSAddonFinder
extends BaseAddonFinder
implements javax.jmdns.ServiceListener
This is a
MDNSAddonFinder for finding suggested add-ons via mDNS. This finder requires a
mdnsServiceType parameter to be present in the add-on info discovery method.- Author:
- Andrew Fiddian-Green - Initial contribution, Mark Herwege - refactor to allow uninstall, Mark Herwege - change to discovery method schema
-
Field Summary
FieldsFields inherited from class org.openhab.core.config.discovery.addon.BaseAddonFinder
addonCandidates -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidaddService(javax.jmdns.ServiceInfo service, boolean isResolved) Adds the given mDNS service to the set of discovered services.voidThe framework calls this method to scan through the candidate list ofAddonInfoand return a subset of those that it suggests to be installed.voidserviceAdded(@Nullable javax.jmdns.ServiceEvent event) voidserviceRemoved(@Nullable javax.jmdns.ServiceEvent event) voidserviceResolved(@Nullable javax.jmdns.ServiceEvent event) voidsetAddonCandidates(List<AddonInfo> candidates) The framework calls this method to provide a list ofAddonInfoelements which contain potential candidates that this finder can iterate over in order to detect which ones to return via thegetSuggestedAddons()method.voidThis method should be called from the framework to allow a finder to stop searching for add-ons and do cleanup.Methods inherited from class org.openhab.core.config.discovery.addon.BaseAddonFinder
propertyMatches
-
Field Details
-
SERVICE_TYPE
- See Also:
-
SERVICE_NAME
- See Also:
-
MDNS_SERVICE_TYPE
- See Also:
-
-
Constructor Details
-
MDNSAddonFinder
-
-
Method Details
-
addService
public void addService(javax.jmdns.ServiceInfo service, boolean isResolved) Adds the given mDNS service to the set of discovered services.- Parameters:
service- the mDNS service to be added.isResolved- indicates if mDNS has fully resolved the service information.
-
deactivate
public void deactivate() -
setAddonCandidates
Description copied from interface:AddonFinderThe framework calls this method to provide a list ofAddonInfoelements which contain potential candidates that this finder can iterate over in order to detect which ones to return via thegetSuggestedAddons()method.- Specified by:
setAddonCandidatesin interfaceAddonFinder- Overrides:
setAddonCandidatesin classBaseAddonFinder- Parameters:
candidates- a list of AddonInfo candidates.
-
unsetAddonCandidates
public void unsetAddonCandidates()Description copied from interface:AddonFinderThis method should be called from the framework to allow a finder to stop searching for add-ons and do cleanup.- Specified by:
unsetAddonCandidatesin interfaceAddonFinder- Overrides:
unsetAddonCandidatesin classBaseAddonFinder
-
getSuggestedAddons
Description copied from interface:AddonFinderThe framework calls this method to scan through the candidate list ofAddonInfoand return a subset of those that it suggests to be installed.- Specified by:
getSuggestedAddonsin interfaceAddonFinder
-
getServiceName
- Specified by:
getServiceNamein classBaseAddonFinder
-
serviceAdded
public void serviceAdded(@Nullable javax.jmdns.ServiceEvent event) - Specified by:
serviceAddedin interfacejavax.jmdns.ServiceListener
-
serviceRemoved
public void serviceRemoved(@Nullable javax.jmdns.ServiceEvent event) - Specified by:
serviceRemovedin interfacejavax.jmdns.ServiceListener
-
serviceResolved
public void serviceResolved(@Nullable javax.jmdns.ServiceEvent event) - Specified by:
serviceResolvedin interfacejavax.jmdns.ServiceListener
-