Class MavenGroupRepository

  • All Implemented Interfaces:
    Repository

    public class MavenGroupRepository
    extends aQute.bnd.osgi.repository.ResourcesRepository
    A repository with artifacts from a single group.
    • Field Summary

      • Fields inherited from interface org.osgi.service.repository.Repository

        URL
    • Constructor Summary

      Constructors 
      Constructor Description
      MavenGroupRepository​(String groupId, Path directory, boolean requested, IndexedMavenRepository indexedRepository, aQute.bnd.http.HttpClient client, aQute.service.reporter.Reporter reporter)
      Instantiates a new representation of group data backed by the specified directory.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void flush()
      Writes all changes to persistent storage and removes any backup information prepared by reset(Path, boolean).
      String id()
      Returns the group id.
      boolean isRequested()
      Checks if is requested.
      boolean removeIfRedundant()
      Removes the group directory if empty.
      void reset​(Path directory, boolean requested)
      Clears this repository and updates the path and the requested flag.
      String toString()  
      • Methods inherited from class aQute.bnd.osgi.repository.ResourcesRepository

        add, addAll, findProvider, findProviders, getResources, set, toCapabilities, toResourcesRepository
      • Methods inherited from class aQute.bnd.osgi.repository.BaseRepository

        findProviders, getExpressionCombiner, newRequirementBuilder
    • Constructor Detail

      • MavenGroupRepository

        public MavenGroupRepository​(String groupId,
                                    Path directory,
                                    boolean requested,
                                    IndexedMavenRepository indexedRepository,
                                    aQute.bnd.http.HttpClient client,
                                    aQute.service.reporter.Reporter reporter)
                             throws IOException
        Instantiates a new representation of group data backed by the specified directory.
        Parameters:
        groupId - the maven groupId indexed by this repository
        directory - the directory used to persist data
        requested - if it is a requested group id
        indexedRepository - the indexed maven repository
        client - the client used for remote access
        reporter - the reporter
        Throws:
        IOException - Signals that an I/O exception has occurred.
    • Method Detail

      • isRequested

        public final boolean isRequested()
        Checks if is requested.
        Returns:
        the requested
      • removeIfRedundant

        public boolean removeIfRedundant()
                                  throws IOException
        Removes the group directory if empty.
        Returns:
        true, if removed
        Throws:
        IOException - Signals that an I/O exception has occurred.
      • id

        public final String id()
        Returns the group id.
        Returns:
        the groupId
      • reset

        public void reset​(Path directory,
                          boolean requested)
        Clears this repository and updates the path and the requested flag. Keeps the current content as backup for reuse in a subsequent call to reload().
        Parameters:
        directory - this group's directory
        requested - whether this is a requested group
      • toString

        public String toString()
        Overrides:
        toString in class aQute.bnd.osgi.repository.ResourcesRepository