Class LMSAdapterRegistry

java.lang.Object
com.nicholasalfonso.lato.integration.LMSAdapterRegistry

@Component public class LMSAdapterRegistry extends Object
Registry that resolves the correct LMSAdapter for a given iCalendar feed.
  • Constructor Details

    • LMSAdapterRegistry

      public LMSAdapterRegistry(List<LMSAdapter> adapters)
      Creates the registry from all available LMS adapter beans.
      Parameters:
      adapters - injected list of LMS adapter implementations
  • Method Details

    • resolve

      public LMSAdapter resolve(String feedContent, Integration.LMSProvider preferredProvider)
      Resolves an adapter for the given feed, preferring the specified provider when possible.
      Parameters:
      feedContent - the raw iCalendar feed content
      preferredProvider - optional preferred LMS provider, or null to auto-detect
      Returns:
      the adapter capable of parsing the feed
      Throws:
      org.springframework.web.server.ResponseStatusException - if no adapter supports the feed