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
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract String
protected static boolean
propertyMatches
(Map<String, Pattern> propertyPatternMap, String propertyName, @Nullable String propertyValue) Helper method to check if the givenpropertyName
is in thepropertyPatternMap
and if so, the givenpropertyValue
matches the respective regular expressionPattern
.void
setAddonCandidates
(List<AddonInfo> candidates) The framework calls this method to provide a list ofAddonInfo
elements which contain potential candidates that this finder can iterate over in order to detect which ones to return via thegetSuggestedAddons()
method.void
This 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, wait
Methods 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 givenpropertyName
is in thepropertyPatternMap
and if so, the givenpropertyValue
matches 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:AddonFinder
The framework calls this method to provide a list ofAddonInfo
elements which contain potential candidates that this finder can iterate over in order to detect which ones to return via thegetSuggestedAddons()
method.- Specified by:
setAddonCandidates
in interfaceAddonFinder
- Parameters:
candidates
- a list of AddonInfo candidates.
-
unsetAddonCandidates
public void unsetAddonCandidates()Description copied from interface:AddonFinder
This method should be called from the framework to allow a finder to stop searching for add-ons and do cleanup.- Specified by:
unsetAddonCandidates
in interfaceAddonFinder
-
getServiceName
-