Class BaseAddonFinder

java.lang.Object
org.openhab.core.config.discovery.addon.BaseAddonFinder
All Implemented Interfaces:
AddonFinder
Direct Known Subclasses:
IpAddonFinder, MDNSAddonFinder, ProcessAddonFinder, UpnpAddonFinder

@NonNullByDefault public abstract class BaseAddonFinder extends Object implements AddonFinder
This is a BaseAddonFinder abstract class for finding suggested add-ons.
Author:
Andrew Fiddian-Green - Initial contribution
  • Field Details

    • addonCandidates

      protected volatile List<AddonInfo> 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 given propertyName is in the propertyPatternMap and if so, the given propertyValue matches the respective regular expression Pattern.
      Parameters:
      propertyPatternMap - map of property names and regex patterns for value matching
      propertyName -
      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

      public void setAddonCandidates(List<AddonInfo> candidates)
      Description copied from interface: AddonFinder
      The framework calls this method to provide a list of AddonInfo elements which contain potential candidates that this finder can iterate over in order to detect which ones to return via the getSuggestedAddons() method.
      Specified by:
      setAddonCandidates in interface AddonFinder
      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 interface AddonFinder
    • getServiceName

      public abstract String getServiceName()