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.touchpoint.eclipse
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.touchpoint.eclipse')
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/AggregatedBundleRepository.java4
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseMarkSetProvider.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/CheckTrustAction.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/InstallBundleAction.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/UninstallBundleAction.java5
-rw-r--r--bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/p2/touchpoint/eclipse/query/OSGiBundleQuery.java5
6 files changed, 17 insertions, 12 deletions
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/AggregatedBundleRepository.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/AggregatedBundleRepository.java
index 75fb1fa1a..b268d65ba 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/AggregatedBundleRepository.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/AggregatedBundleRepository.java
@@ -101,7 +101,7 @@ public class AggregatedBundleRepository extends AbstractArtifactRepository imple
public IQueryResult<IArtifactKey> query(IQuery<IArtifactKey> query, IProgressMonitor monitor) {
// Query all the all the repositories
- CompoundQueryable<IArtifactKey> queryable = new CompoundQueryable<IArtifactKey>(bundleRepositories);
+ IQueryable<IArtifactKey> queryable = QueryUtil.compoundQueryable(bundleRepositories);
return queryable.query(query, monitor);
}
@@ -110,6 +110,6 @@ public class AggregatedBundleRepository extends AbstractArtifactRepository imple
for (IFileArtifactRepository repository : bundleRepositories)
descQueryables.add(repository.descriptorQueryable());
- return new CompoundQueryable<IArtifactDescriptor>(descQueryables);
+ return QueryUtil.compoundQueryable(descQueryables);
}
}
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseMarkSetProvider.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseMarkSetProvider.java
index c9d40c34c..adb22abbd 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseMarkSetProvider.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/EclipseMarkSetProvider.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.touchpoint.eclipse;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.io.File;
import java.util.*;
import org.eclipse.equinox.internal.p2.core.helpers.CollectionUtils;
@@ -22,7 +24,6 @@ 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.InstallableUnitQuery;
import org.eclipse.equinox.p2.query.IQueryResult;
import org.eclipse.equinox.p2.repository.artifact.ArtifactKeyQuery;
import org.eclipse.equinox.p2.repository.artifact.IArtifactRepository;
@@ -85,7 +86,7 @@ public class EclipseMarkSetProvider extends MarkSetProvider {
}
private void addArtifactKeys(IProfile aProfile) {
- Iterator<IInstallableUnit> installableUnits = aProfile.query(InstallableUnitQuery.ANY, null).iterator();
+ Iterator<IInstallableUnit> installableUnits = aProfile.query(QueryUtil.createIUAnyQuery(), null).iterator();
while (installableUnits.hasNext()) {
Collection<IArtifactKey> keys = installableUnits.next().getArtifacts();
if (keys == null)
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/CheckTrustAction.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/CheckTrustAction.java
index 7eb0d940b..713977723 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/CheckTrustAction.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/CheckTrustAction.java
@@ -10,6 +10,8 @@
*******************************************************************************/
package org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.io.File;
import java.util.Collection;
import java.util.Map;
@@ -22,7 +24,6 @@ import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.InstallableUnitQuery;
/**
* This action collects the set of bundle files on which the signature trust check
@@ -42,7 +43,7 @@ public class CheckTrustAction extends ProvisioningAction {
IProvisioningAgent agent = (IProvisioningAgent) parameters.get(ActionConstants.PARM_AGENT);
IProfile profile = (IProfile) parameters.get(ActionConstants.PARM_PROFILE);
//if the IU is already in the profile there is nothing to do
- if (!profile.available(new InstallableUnitQuery(iu), null).isEmpty())
+ if (!profile.available(QueryUtil.createIUQuery(iu), null).isEmpty())
return null;
@SuppressWarnings("unchecked")
Collection<File> bundleFiles = (Collection<File>) parameters.get(ActionConstants.PARM_ARTIFACT_FILES);
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/InstallBundleAction.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/InstallBundleAction.java
index c3ef27ec8..014209d54 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/InstallBundleAction.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/InstallBundleAction.java
@@ -8,6 +8,8 @@
******************************************************************************/
package org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.io.File;
import java.util.Collection;
import java.util.Map;
@@ -22,7 +24,6 @@ import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.FragmentQuery;
import org.eclipse.osgi.util.NLS;
public class InstallBundleAction extends ProvisioningAction {
@@ -46,7 +47,7 @@ public class InstallBundleAction extends ProvisioningAction {
return Util.createError(NLS.bind(Messages.parameter_not_set, ActionConstants.PARM_BUNDLE, ID));
//TODO: eventually remove this. What is a fragment doing here??
- if (FragmentQuery.isFragment(iu)) {
+ if (QueryUtil.isFragment(iu)) {
System.out.println("What is a fragment doing here!!! -- " + iu); //$NON-NLS-1$
return Status.OK_STATUS;
}
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/UninstallBundleAction.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/UninstallBundleAction.java
index 7eb4356c1..0ddeab509 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/UninstallBundleAction.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/internal/p2/touchpoint/eclipse/actions/UninstallBundleAction.java
@@ -8,6 +8,8 @@
******************************************************************************/
package org.eclipse.equinox.internal.p2.touchpoint.eclipse.actions;
+import org.eclipse.equinox.p2.query.QueryUtil;
+
import java.io.File;
import java.util.Collection;
import java.util.Map;
@@ -22,7 +24,6 @@ import org.eclipse.equinox.p2.engine.IProfile;
import org.eclipse.equinox.p2.engine.spi.ProvisioningAction;
import org.eclipse.equinox.p2.metadata.IArtifactKey;
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
-import org.eclipse.equinox.p2.metadata.query.FragmentQuery;
import org.eclipse.osgi.util.NLS;
public class UninstallBundleAction extends ProvisioningAction {
@@ -46,7 +47,7 @@ public class UninstallBundleAction extends ProvisioningAction {
return Util.createError(NLS.bind(Messages.parameter_not_set, ActionConstants.PARM_BUNDLE, ID));
//TODO: eventually remove this. What is a fragment doing here??
- if (FragmentQuery.isFragment(iu)) {
+ if (QueryUtil.isFragment(iu)) {
System.out.println("What is a fragment doing here!!! -- " + iu); //$NON-NLS-1$
return Status.OK_STATUS;
}
diff --git a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/p2/touchpoint/eclipse/query/OSGiBundleQuery.java b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/p2/touchpoint/eclipse/query/OSGiBundleQuery.java
index ef4809413..3afa090c9 100644
--- a/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/p2/touchpoint/eclipse/query/OSGiBundleQuery.java
+++ b/bundles/org.eclipse.equinox.p2.touchpoint.eclipse/src/org/eclipse/equinox/p2/touchpoint/eclipse/query/OSGiBundleQuery.java
@@ -11,16 +11,17 @@
*******************************************************************************/
package org.eclipse.equinox.p2.touchpoint.eclipse.query;
+import org.eclipse.equinox.p2.query.ExpressionMatchQuery;
+
import org.eclipse.equinox.p2.metadata.IInstallableUnit;
import org.eclipse.equinox.p2.metadata.expression.ExpressionUtil;
import org.eclipse.equinox.p2.metadata.expression.IMatchExpression;
-import org.eclipse.equinox.p2.metadata.query.ExpressionQuery;
/**
* A query matching every {@link IInstallableUnit} that describes an OSGi bundle.
* @since 2.0
*/
-public class OSGiBundleQuery extends ExpressionQuery<IInstallableUnit> {
+public class OSGiBundleQuery extends ExpressionMatchQuery<IInstallableUnit> {
private static final IMatchExpression<IInstallableUnit> bundleTest = ExpressionUtil.getFactory().matchExpression(ExpressionUtil.parse("providedCapabilities.exists(p | p.namespace == 'osgi.bundle')")); //$NON-NLS-1$

Back to the top