Package dev.equo.solstice.p2
Class P2Query
- java.lang.Object
-
- dev.equo.solstice.p2.P2Query
-
public class P2Query extends java.lang.ObjectFollows the dependency information of a set ofP2Unitso that they can be installed from maven or directly from p2 if necessary.
-
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidaddAllUnits()Adds every unit in the session, subject to the query filters.voidexclude(java.lang.String toExclude)Excludes the unit with the given id.voidexcludePrefix(java.lang.String prefix)Excludes all units whose id start with the given prefix.voidexcludeSuffix(java.lang.String prefix)Excludes all units whose id end with the given suffix.voidfilterProp(java.lang.String key, java.lang.String value)java.util.List<P2Unit>getAllAvailableUnitsById(java.lang.String id)Returns every unit available in the parent session with the given id, possibly multiple versions of the same id.java.util.Set<P2Session.Requirement>getAmbiguousRequirements()Returns every requirement for which there were multiple providers and no clear winner.java.util.List<P2Unit>getCategories()Returns all categories.java.util.List<P2Unit>getFeatures()Returns all features.P2UnitgetInstalledUnitById(java.lang.String id)Returns the unit, if any, which has been installed at the given id.java.util.List<P2Unit>getJars()Returns all jars.java.util.List<P2Unit>getJarsNotOnMavenCentral(boolean useMavenCentral)Returns all jars which are not on maven central.java.util.List<java.lang.String>getJarsOnMavenCentral(boolean useMavenCentral)Returns all jars which are on maven central.java.util.Map<P2Session.Requirement,java.util.Set<P2Unit>>getOptionalRequirementsNotInstalled()Returns all optional requirements which were not installed, along with every unit which optionally wanted it.java.util.List<P2Unit>getUnitsWithProperty(java.lang.String key, java.lang.String value)Returns all units which have the given property set to the given value.java.util.List<P2Unit>getUnitsWithProperty1or2(java.lang.String key1, java.lang.String value1, java.lang.String key2, java.lang.String value2)Returns all units which have the given property set to the given value.java.util.Map<P2Session.Requirement,java.util.Set<P2Unit>>getUnmetRequirements()Returns every unmet requirement mapped to the units which needed it.voidinstall(java.lang.String idToResolve)Resolves the given P2Unit by eagerly traversing all its dependencies.booleanisInstalled(P2Unit unit)Returns true of the given unit was installed.voidplatform(com.diffplug.common.swt.os.SwtPlatform platform)Sets the platform filter to match true against only the given platform.voidplatformAll()Sets the platform filter to match true against all platforms.voidplatformNone()Sets the platform filter to match true against no platforms.
-
-
-
Method Detail
-
exclude
public void exclude(java.lang.String toExclude)
Excludes the unit with the given id.
-
excludePrefix
public void excludePrefix(java.lang.String prefix)
Excludes all units whose id start with the given prefix.
-
excludeSuffix
public void excludeSuffix(java.lang.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(java.lang.String key, java.lang.String value)
-
install
public void install(java.lang.String idToResolve)
Resolves the given P2Unit by eagerly traversing all its dependencies.
-
getInstalledUnitById
public P2Unit getInstalledUnitById(java.lang.String id)
Returns the unit, if any, which has been installed at the given id.
-
getAllAvailableUnitsById
public java.util.List<P2Unit> getAllAvailableUnitsById(java.lang.String id)
Returns every unit available in the parent session with the given id, possibly multiple versions of the same id.
-
getJars
public java.util.List<P2Unit> getJars()
Returns all jars.
-
getFeatures
public java.util.List<P2Unit> getFeatures()
Returns all features.
-
getCategories
public java.util.List<P2Unit> getCategories()
Returns all categories.
-
getUnitsWithProperty
public java.util.List<P2Unit> getUnitsWithProperty(java.lang.String key, java.lang.String value)
Returns all units which have the given property set to the given value.
-
getUnitsWithProperty1or2
public java.util.List<P2Unit> getUnitsWithProperty1or2(java.lang.String key1, java.lang.String value1, java.lang.String key2, java.lang.String value2)
Returns all units which have the given property set to the given value.
-
getJarsOnMavenCentral
public java.util.List<java.lang.String> getJarsOnMavenCentral(boolean useMavenCentral)
Returns all jars which are on maven central.
-
getJarsNotOnMavenCentral
public java.util.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 java.util.Set<P2Session.Requirement> getAmbiguousRequirements()
Returns every requirement for which there were multiple providers and no clear winner.
-
getUnmetRequirements
public java.util.Map<P2Session.Requirement,java.util.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 java.util.Map<P2Session.Requirement,java.util.Set<P2Unit>> getOptionalRequirementsNotInstalled()
Returns all optional requirements which were not installed, along with every unit which optionally wanted it.
-
-