@Override public IQueryResult<IInstallableUnit> available(IQuery<IInstallableUnit> query, IProgressMonitor monitor) { return profile.available(query, monitor); }
private Map<IInstallableUnit, IInstallableUnit> getAvailableProfileIUs() { IQueryResult<IInstallableUnit> profileQueryResult = profile.available(QueryUtil.createIUAnyQuery(), null); Map<IInstallableUnit, IInstallableUnit> result = new HashMap<IInstallableUnit, IInstallableUnit>(); for (Iterator<IInstallableUnit> it = profileQueryResult.iterator(); it.hasNext();) { IInstallableUnit iu = it.next(); result.put(iu, iu); } return result; }
private boolean hasProduct() { if (!profile.available(QueryUtil.createIUProductQuery(), new NullProgressMonitor()).isEmpty()) { return true; } //Support for legacy identification of product using the lineUp. if (!profile.available(QueryUtil.createIUPropertyQuery("lineUp", "true"), new NullProgressMonitor()).isEmpty()) //$NON-NLS-1$//$NON-NLS-2$ return true; return false; }
private boolean hasProduct() { if (!profile.available(QueryUtil.createIUProductQuery(), new NullProgressMonitor()).isEmpty()) { return true; } //Support for legacy identification of product using the lineUp. if (!profile.available(QueryUtil.createIUPropertyQuery("lineUp", "true"), new NullProgressMonitor()).isEmpty()) //$NON-NLS-1$//$NON-NLS-2$ return true; return false; }
/** * @param previousProfile is the profile used previous to the current one * @param currentProfile is the current profile used by eclipse. * @return true if set difference between previousProfile units and currentProfile units not empty, otherwise false */ protected boolean needsMigration(IProfile previousProfile, IProfile currentProfile) { //First, try the case of inclusion Set<IInstallableUnit> previousProfileUnits = getUserRoots(previousProfile); Set<IInstallableUnit> currentProfileUnits = currentProfile.available(new UserVisibleRootQuery(), null).toSet(); previousProfileUnits.removeAll(currentProfileUnits); //For the IUs left in the previous profile, look for those that could be in the base but not as roots Iterator<IInstallableUnit> previousProfileIterator = previousProfileUnits.iterator(); while (previousProfileIterator.hasNext()) { if (!currentProfile.available(QueryUtil.createIUQuery(previousProfileIterator.next()), null).isEmpty()) previousProfileIterator.remove(); } //For the IUs left in the previous profile, look for those that could be available in the root but as higher versions (they could be root or not) previousProfileIterator = previousProfileUnits.iterator(); while (previousProfileIterator.hasNext()) { if (!currentProfile.available(new UpdateQuery(previousProfileIterator.next()), null).isEmpty()) previousProfileIterator.remove(); } return !previousProfileUnits.isEmpty(); }
public IStatus execute(Map<String, Object> parameters) { IInstallableUnit iu = (IInstallableUnit) parameters.get(EclipseTouchpoint.PARM_IU); if (iu == null) return null; 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(QueryUtil.createIUQuery(iu), null).isEmpty()) return null; @SuppressWarnings("unchecked") Collection<File> bundleFiles = (Collection<File>) parameters.get(ActionConstants.PARM_ARTIFACT_FILES); Collection<IArtifactKey> artifacts = iu.getArtifacts(); if (artifacts == null) return null; for (IArtifactKey key : artifacts) { File bundleFile = Util.getArtifactFile(agent, key, profile); if (!bundleFiles.contains(bundleFile)) bundleFiles.add(bundleFile); } return null; }
public IStatus execute(Map<String, Object> parameters) { IInstallableUnit iu = (IInstallableUnit) parameters.get(EclipseTouchpoint.PARM_IU); if (iu == null) return null; 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(QueryUtil.createIUQuery(iu), null).isEmpty()) return null; @SuppressWarnings("unchecked") Collection<File> bundleFiles = (Collection<File>) parameters.get(ActionConstants.PARM_ARTIFACT_FILES); Collection<IArtifactKey> artifacts = iu.getArtifacts(); if (artifacts == null) return null; for (IArtifactKey key : artifacts) { File bundleFile = Util.getArtifactFile(agent, key, profile); if (!bundleFiles.contains(bundleFile)) bundleFiles.add(bundleFile); } return null; }
IQueryResult result = profile.available(QueryUtil.createIUAnyQuery(), null); SortedSet sorted = new TreeSet(); for (Iterator iter = result.iterator(); iter.hasNext();) {
potentialRootChange = matches.iterator().next(); IQueryResult<IInstallableUnit> iuAlreadyInstalled = profile.available(query, new NullProgressMonitor());
potentialRootChange = matches.iterator().next(); IQueryResult<IInstallableUnit> iuAlreadyInstalled = profile.available(query, new NullProgressMonitor());
@Override public IProvisioningPlan getDiffPlan(IProfile currentProfile, IProfile targetProfile, IProgressMonitor monitor) { SubMonitor sub = SubMonitor.convert(monitor, ExpandWork); sub.setTaskName(Messages.Director_Task_Resolving_Dependencies); try { IProfileChangeRequest profileChangeRequest = FormerState.generateProfileDeltaChangeRequest(currentProfile, targetProfile); ProvisioningContext context = new ProvisioningContext(agent); if (context.getProperty(INCLUDE_PROFILE_IUS) == null) context.setProperty(INCLUDE_PROFILE_IUS, Boolean.FALSE.toString()); context.setExtraInstallableUnits(Arrays.asList( targetProfile.available(QueryUtil.createIUAnyQuery(), null).toArray(IInstallableUnit.class))); return getProvisioningPlan(profileChangeRequest, context, sub.newChild(ExpandWork / 2)); } finally { sub.done(); } }
if (context == null || context.getProperty(INCLUDE_PROFILE_IUS) == null || context.getProperty(INCLUDE_PROFILE_IUS).equalsIgnoreCase(Boolean.TRUE.toString())) { Iterator<IInstallableUnit> itor = profile.available(QueryUtil.createIUAnyQuery(), null).iterator(); while (itor.hasNext()) { extraIUs.add(itor.next());