Class AbstractIndexedRepo

java.lang.Object
aQute.bnd.osgi.repository.BaseRepository
aQute.bnd.deployer.repository.AbstractIndexedRepo
All Implemented Interfaces:
aQute.bnd.service.IndexProvider, aQute.bnd.service.Plugin, aQute.bnd.service.Refreshable, aQute.bnd.service.RegistryPlugin, aQute.bnd.service.RemoteRepositoryPlugin, aQute.bnd.service.RepositoryPlugin, aQute.bnd.service.tags.Tagged, org.osgi.service.repository.Repository
Direct Known Subclasses:
LocalIndexedRepo

public abstract class AbstractIndexedRepo extends aQute.bnd.osgi.repository.BaseRepository implements aQute.bnd.service.RegistryPlugin, aQute.bnd.service.Plugin, aQute.bnd.service.RemoteRepositoryPlugin, aQute.bnd.service.IndexProvider, org.osgi.service.repository.Repository, aQute.bnd.service.Refreshable
Abstract base class for indexed repositories.

The repository implementation is read-only by default. To implement a writable repository, subclasses should override canWrite() and put(InputStream, aQute.bnd.service.RepositoryPlugin.PutOptions).

  • Field Details

  • Constructor Details

    • AbstractIndexedRepo

      protected AbstractIndexedRepo()
  • Method Details

    • reset

      public void reset()
    • loadIndexes

      protected abstract List<URI> loadIndexes() throws Exception
      Returns:
      a list of URIs, parsed from the 'locations' property
      Throws:
      Exception
    • loadAllContentProviders

      protected void loadAllContentProviders()
      Add all repository content providers that are in the registry (through workspace plugins) to the known content providers
    • init

      protected final void init() throws Exception
      Throws:
      Exception
    • init

      protected final void init(boolean ignoreCachedFile) throws Exception
      Throws:
      Exception
    • getIndexLocations

      public final List<URI> getIndexLocations() throws Exception
      Specified by:
      getIndexLocations in interface aQute.bnd.service.IndexProvider
      Throws:
      Exception
    • setRegistry

      public final void setRegistry(aQute.bnd.service.Registry registry)
      Specified by:
      setRegistry in interface aQute.bnd.service.RegistryPlugin
    • setProperties

      public void setProperties(Map<String,String> map)
      Specified by:
      setProperties in interface aQute.bnd.service.Plugin
    • get

      public File[] get(String bsn, String range) throws Exception
      Throws:
      Exception
    • requestAll

      protected static File[] requestAll(aQute.bnd.service.ResourceHandle[] handles) throws Exception
      Throws:
      Exception
    • getHandles

      protected aQute.bnd.service.ResourceHandle[] getHandles(String bsn, String rangeStr) throws Exception
      Throws:
      Exception
    • setReporter

      public void setReporter(aQute.service.reporter.Reporter reporter)
      Specified by:
      setReporter in interface aQute.bnd.service.Plugin
    • get

      public File get(String bsn, String range, aQute.bnd.service.Strategy strategy, Map<String,String> properties) throws Exception
      Throws:
      Exception
    • getHandle

      public aQute.bnd.service.ResourceHandle getHandle(String bsn, String range, aQute.bnd.service.Strategy strategy, Map<String,String> properties) throws Exception
      Specified by:
      getHandle in interface aQute.bnd.service.RemoteRepositoryPlugin
      Throws:
      Exception
    • canWrite

      public boolean canWrite()
      Specified by:
      canWrite in interface aQute.bnd.service.RepositoryPlugin
    • put

      public aQute.bnd.service.RepositoryPlugin.PutResult put(InputStream stream, aQute.bnd.service.RepositoryPlugin.PutOptions options) throws Exception
      Specified by:
      put in interface aQute.bnd.service.RepositoryPlugin
      Throws:
      Exception
    • list

      public List<String> list(String pattern) throws Exception
      Specified by:
      list in interface aQute.bnd.service.RepositoryPlugin
      Throws:
      Exception
    • versions

      public SortedSet<aQute.bnd.version.Version> versions(String bsn) throws Exception
      Specified by:
      versions in interface aQute.bnd.service.RepositoryPlugin
      Throws:
      Exception
    • getName

      public String getName()
      Specified by:
      getName in interface aQute.bnd.service.RepositoryPlugin
    • findProviders

      public Map<org.osgi.resource.Requirement,Collection<org.osgi.resource.Capability>> findProviders(Collection<? extends org.osgi.resource.Requirement> requirements)
      Specified by:
      findProviders in interface org.osgi.service.repository.Repository
    • parseLocations

      protected static List<URI> parseLocations(String locationsStr) throws MalformedURLException, URISyntaxException
      Utility function for parsing lists of URLs.
      Parameters:
      locationsStr - Comma-separated list of URLs
      Returns:
      a list of URIs
      Throws:
      MalformedURLException
      URISyntaxException
    • getSupportedPhases

      public Set<aQute.bnd.service.ResolutionPhase> getSupportedPhases()
      Specified by:
      getSupportedPhases in interface aQute.bnd.service.IndexProvider
    • toString

      public String toString()
      Overrides:
      toString in class Object
    • get

      public File get(String bsn, aQute.bnd.version.Version version, Map<String,String> properties, aQute.bnd.service.RepositoryPlugin.DownloadListener... listeners) throws Exception
      This can be optimized to use the download technique with the listeners. Now just a quick hack to make it work. I actually think these classes should extend FileRepo. TODO
      Specified by:
      get in interface aQute.bnd.service.RepositoryPlugin
      Throws:
      Exception
    • refresh

      public boolean refresh() throws Exception
      Specified by:
      refresh in interface aQute.bnd.service.Refreshable
      Throws:
      Exception