Class BaseAddonFinder
java.lang.Object
org.openhab.core.config.discovery.addon.BaseAddonFinder
- All Implemented Interfaces:
AddonFinder
- Direct Known Subclasses:
IpAddonFinder,MDNSAddonFinder,ProcessAddonFinder,UpnpAddonFinder
This is a
BaseAddonFinder abstract class for finding suggested add-ons.- Author:
- Andrew Fiddian-Green - Initial contribution
-
Field Summary
Fields -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionabstract Stringprotected static booleanpropertyMatches(Map<String, Pattern> propertyPatternMap, String propertyName, @Nullable String propertyValue) Helper method to check if the givenpropertyNameis in thepropertyPatternMapand if so, the givenpropertyValuematches the respective regular expressionPattern.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 java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.openhab.core.config.discovery.addon.AddonFinder
getSuggestedAddons
-
Field Details
-
addonCandidates
-
-
Constructor Details
-
BaseAddonFinder
public BaseAddonFinder()
-
-
Method Details
-
propertyMatches
protected static boolean propertyMatches(Map<String, Pattern> propertyPatternMap, String propertyName, @Nullable String propertyValue) Helper method to check if the givenpropertyNameis in thepropertyPatternMapand if so, the givenpropertyValuematches the respective regular expressionPattern.- Parameters:
propertyPatternMap- map of property names and regex patterns for value matchingpropertyName-propertyValue-- Returns:
- true a) if the property name exists and the property value is not null and matches the regular expression, or b) the property name does not exist.
-
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- 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
-
getServiceName
-