Class 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.
Andrew Fiddian-Green - Initial contribution, Mark Herwege - refactor to allow uninstall, Mark Herwege - change to discovery method schema
  • Field Details

  • Constructor Details

    • MDNSAddonFinder

      public MDNSAddonFinder(MDNSClient mdnsClient)
  • Method Details

    • addService

      public void addService(javax.jmdns.ServiceInfo service, boolean isResolved)
      Adds the given mDNS service to the set of discovered services.
      service - the mDNS service to be added.
      isResolved - indicates if mDNS has fully resolved the service information.
    • deactivate

      public void deactivate()
    • 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
      setAddonCandidates in class BaseAddonFinder
      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
      unsetAddonCandidates in class BaseAddonFinder
    • getSuggestedAddons

      public Set<AddonInfo> getSuggestedAddons()
      Description copied from interface: AddonFinder
      The framework calls this method to scan through the candidate list of AddonInfo and return a subset of those that it suggests to be installed.
      Specified by:
      getSuggestedAddons in interface AddonFinder
    • getServiceName

      public String getServiceName()
      Specified by:
      getServiceName in class BaseAddonFinder
    • serviceAdded

      public void serviceAdded(@Nullable javax.jmdns.ServiceEvent event)
      Specified by:
      serviceAdded in interface javax.jmdns.ServiceListener
    • serviceRemoved

      public void serviceRemoved(@Nullable javax.jmdns.ServiceEvent event)
      Specified by:
      serviceRemoved in interface javax.jmdns.ServiceListener
    • serviceResolved

      public void serviceResolved(@Nullable javax.jmdns.ServiceEvent event)
      Specified by:
      serviceResolved in interface javax.jmdns.ServiceListener