Skip to main content
aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorThomas Hallgren2010-02-25 12:31:06 -0500
committerThomas Hallgren2010-02-25 12:31:06 -0500
commiteaa7cbe6e5818394bc1673a8babc7d4ebd30ed13 (patch)
tree6bc72abf5945357db9fa97b602b8d4b1ab138243 /bundles/org.eclipse.equinox.p2.console
parentd3c84a2ee68e14ef740e238f90a214a9b14422e8 (diff)
downloadrt.equinox.p2-eaa7cbe6e5818394bc1673a8babc7d4ebd30ed13.tar.gz
rt.equinox.p2-eaa7cbe6e5818394bc1673a8babc7d4ebd30ed13.tar.xz
rt.equinox.p2-eaa7cbe6e5818394bc1673a8babc7d4ebd30ed13.zip
302201 : Unify the two query approaches used in p2, final step.
Diffstat (limited to 'bundles/org.eclipse.equinox.p2.console')
-rw-r--r--bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java15
-rw-r--r--bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java5
2 files changed, 8 insertions, 12 deletions
diff --git a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java
index 912d92a15..3b105b1fa 100644
--- a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java
+++ b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvCommandProvider.java
@@ -22,10 +22,7 @@ import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.IProfileRegistry;
import org.eclipse.equinox.p2.metadata.*;
-import org.eclipse.equinox.p2.metadata.query.GroupQuery;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
-import org.eclipse.equinox.p2.query.IQueryResult;
-import org.eclipse.equinox.p2.query.IQueryable;
+import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.repository.artifact.*;
import org.eclipse.equinox.p2.repository.metadata.IMetadataRepositoryManager;
import org.eclipse.osgi.framework.console.CommandInterpreter;
@@ -234,7 +231,7 @@ public class ProvCommandProvider implements CommandProvider {
URI repoURL = null;
if (urlString != null && !urlString.equals(WILDCARD_ANY))
repoURL = toURI(interpreter, urlString);
- IInstallableUnit[] units = sort(ProvisioningHelper.getInstallableUnits(agent, repoURL, new InstallableUnitQuery(id, new VersionRange(version)), null));
+ IInstallableUnit[] units = sort(ProvisioningHelper.getInstallableUnits(agent, repoURL, QueryUtil.createIUQuery(id, new VersionRange(version)), null));
for (int i = 0; i < units.length; i++)
println(interpreter, units[i]);
}
@@ -259,7 +256,7 @@ public class ProvCommandProvider implements CommandProvider {
URI repoLocation = toURI(interpreter, urlString);
if (repoLocation == null)
return;
- IInstallableUnit[] units = sort(ProvisioningHelper.getInstallableUnits(agent, repoLocation, new InstallableUnitQuery(id, new VersionRange(version)), null));
+ IInstallableUnit[] units = sort(ProvisioningHelper.getInstallableUnits(agent, repoLocation, QueryUtil.createIUQuery(id, new VersionRange(version)), null));
for (int i = 0; i < units.length; i++)
println(interpreter, units[i]);
}
@@ -285,7 +282,7 @@ public class ProvCommandProvider implements CommandProvider {
if (queryable == null)
return;
}
- IInstallableUnit[] units = sort(queryable.query(new GroupQuery(), null));
+ IInstallableUnit[] units = sort(queryable.query(QueryUtil.createIUGroupQuery(), null));
for (int i = 0; i < units.length; i++)
println(interpreter, units[i]);
}
@@ -380,7 +377,7 @@ public class ProvCommandProvider implements CommandProvider {
return;
// list the profile contents
- IInstallableUnit[] result = sort(target.query(new InstallableUnitQuery(id, new VersionRange(range)), null));
+ IInstallableUnit[] result = sort(target.query(QueryUtil.createIUQuery(id, new VersionRange(range)), null));
for (int i = 0; i < result.length; i++)
interpreter.println(result[i]);
}
@@ -473,7 +470,7 @@ public class ProvCommandProvider implements CommandProvider {
interpreter.println("Profile " + profileId + " not found");
return;
}
- IInstallableUnit[] units = sort(profile.query(new GroupQuery(), new NullProgressMonitor()));
+ IInstallableUnit[] units = sort(profile.query(QueryUtil.createIUGroupQuery(), new NullProgressMonitor()));
// Now print out results
for (int i = 0; i < units.length; i++)
println(interpreter, units[i]);
diff --git a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java
index e9c974ffb..c5350dd35 100644
--- a/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java
+++ b/bundles/org.eclipse.equinox.p2.console/src/org/eclipse/equinox/internal/p2/console/ProvisioningHelper.java
@@ -23,7 +23,6 @@ import org.eclipse.equinox.p2.core.ProvisionException;
import org.eclipse.equinox.p2.engine.*;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.Version;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
import org.eclipse.equinox.p2.planner.IPlanner;
import org.eclipse.equinox.p2.query.*;
import org.eclipse.equinox.p2.repository.IRepositoryManager;
@@ -179,7 +178,7 @@ public class ProvisioningHelper {
public static IStatus install(IProvisioningAgent agent, String unitId, String version, IProfile profile, IProgressMonitor progress) throws ProvisionException {
if (profile == null)
return null;
- IQueryResult<IInstallableUnit> units = getInstallableUnits(agent, (URI) null, new InstallableUnitQuery(unitId, Version.create(version)), progress);
+ IQueryResult<IInstallableUnit> units = getInstallableUnits(agent, (URI) null, QueryUtil.createIUQuery(unitId, Version.create(version)), progress);
if (units.isEmpty()) {
StringBuffer error = new StringBuffer();
error.append("Installable unit not found: " + unitId + ' ' + version + '\n');
@@ -278,7 +277,7 @@ public class ProvisioningHelper {
public static IStatus uninstall(IProvisioningAgent agent, String unitId, String version, IProfile profile, IProgressMonitor progress) throws ProvisionException {
if (profile == null)
return null;
- IQueryResult<IInstallableUnit> units = profile.query(new InstallableUnitQuery(unitId, Version.create(version)), progress);
+ IQueryResult<IInstallableUnit> units = profile.query(QueryUtil.createIUQuery(unitId, Version.create(version)), progress);
if (units.isEmpty()) {
StringBuffer error = new StringBuffer();
error.append("Installable unit not found: " + unitId + ' ' + version + '\n');

Back to the top