Class P2Query

java.lang.Object
dev.equo.solstice.p2.P2Query

public class P2Query extends Object
Follows the dependency information of a set of P2Unit so that they can be installed from maven or directly from p2 if necessary.
  • Method Details

    • exclude

      public void exclude(String toExclude)
      Excludes the unit with the given id.
    • excludePrefix

      public void excludePrefix(String prefix)
      Excludes all units whose id start with the given prefix.
    • excludeSuffix

      public void excludeSuffix(String prefix)
      Excludes all units whose id end with the given suffix.
    • platform

      public void platform(com.diffplug.common.swt.os.SwtPlatform platform)
      Sets the platform filter to match true against only the given platform.
    • platformAll

      public void platformAll()
      Sets the platform filter to match true against all platforms.
    • platformNone

      public void platformNone()
      Sets the platform filter to match true against no platforms.
    • filterProp

      public void filterProp(String key, String value)
    • install

      public void install(String idToResolve)
      Resolves the given P2Unit by eagerly traversing all its dependencies.
    • getInstalledUnitById

      public P2Unit getInstalledUnitById(String id)
      Returns the unit, if any, which has been installed at the given id.
    • getAllAvailableUnitsById

      public List<P2Unit> getAllAvailableUnitsById(String id)
      Returns every unit available in the parent session with the given id, possibly multiple versions of the same id.
    • getJars

      public List<P2Unit> getJars()
      Returns all jars.
    • getFeatures

      public List<P2Unit> getFeatures()
      Returns all features.
    • getCategories

      public List<P2Unit> getCategories()
      Returns all categories.
    • getUnitsWithProperty

      public List<P2Unit> getUnitsWithProperty(String key, String value)
      Returns all units which have the given property set to the given value.
    • getUnitsWithProperty1or2

      public List<P2Unit> getUnitsWithProperty1or2(String key1, String value1, String key2, String value2)
      Returns all units which have the given property set to the given value.
    • getJarsOnMavenCentral

      public List<String> getJarsOnMavenCentral(boolean useMavenCentral)
      Returns all jars which are on maven central.
    • getJarsNotOnMavenCentral

      public List<P2Unit> getJarsNotOnMavenCentral(boolean useMavenCentral)
      Returns all jars which are not on maven central.
    • addAllUnits

      public void addAllUnits()
      Adds every unit in the session, subject to the query filters.
    • getAmbiguousRequirements

      public Set<P2Session.Requirement> getAmbiguousRequirements()
      Returns every requirement for which there were multiple providers and no clear winner.
    • getUnmetRequirements

      public Map<P2Session.Requirement,Set<P2Unit>> getUnmetRequirements()
      Returns every unmet requirement mapped to the units which needed it.
    • isInstalled

      public boolean isInstalled(P2Unit unit)
      Returns true of the given unit was installed.
    • getOptionalRequirementsNotInstalled

      public Map<P2Session.Requirement,Set<P2Unit>> getOptionalRequirementsNotInstalled()
      Returns all optional requirements which were not installed, along with every unit which optionally wanted it.