protected IProfile getSelfProfile() { if (profileRegistry != null) { String selfID = System.getProperty("eclipse.p2.profile"); //$NON-NLS-1$ if (selfID == null) selfID = IProfileRegistry.SELF; return profileRegistry.getProfile(selfID); } return null; }
private IProfile getCurrentProfile(IProvisioningAgent agent) { IProfileRegistry pr = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME); if (pr == null) return null; return pr.getProfile(IProfileRegistry.SELF); }
private IProfile getProfile(String id) { IProfileRegistry profileRegistry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME); return profileRegistry == null ? null : profileRegistry.getProfile(id); }
private IProfile getCurrentProfile(IProvisioningAgent agent) { IProfileRegistry pr = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME); if (pr == null) return null; return pr.getProfile(IProfileRegistry.SELF); }
private IProfile getProfile(String id) { IProfileRegistry profileRegistry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME); return profileRegistry == null ? null : profileRegistry.getProfile(id); }
private IProfile getProfile(String id) { IProfileRegistry profileRegistry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME); return profileRegistry == null ? null : profileRegistry.getProfile(id); }
static IProfile getProfile(IProvisioningAgent agent, String id) { IProfileRegistry profileRegistry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME); if (profileRegistry == null) return null; return profileRegistry.getProfile(id); }
void validateIusToUpdate() { ArrayList<IInstallableUnit> list = new ArrayList<IInstallableUnit>(iusWithUpdates.size()); IProfile profile = getProfileRegistry().getProfile(profileId); for (IInstallableUnit iuWithUpdate : iusWithUpdates) { try { if (validToUpdate(profile, iuWithUpdate)) list.add(iuWithUpdate); } catch (OperationCanceledException e) { // Nothing to report } } iusWithUpdates = list; }
public static ProfileChangeRequest createByProfileId(IProvisioningAgent agent, String profileId) { IProfileRegistry profileRegistry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME); if (profileRegistry == null) throw new IllegalStateException(Messages.Planner_no_profile_registry); IProfile profile = profileRegistry.getProfile(profileId); if (profile == null) throw new IllegalArgumentException("Profile id " + profileId + " is not registered."); //$NON-NLS-1$//$NON-NLS-2$ return new ProfileChangeRequest(profile); }
public int getRestartPolicy() { //if we are installing into self we must always use the restart policy if (IProfileRegistry.SELF.equals(profileId)) return restartPolicy; //otherwise only apply restart policy if the profile being modified is the one that is currently running IProfile profile = getSession().getProfileRegistry().getProfile(IProfileRegistry.SELF); String id = profile == null ? null : profile.getProfileId(); if (id != null && profileId.equals(id)) { return restartPolicy; } return ProvisioningJob.RESTART_NONE; }
private IProfile findMostRecentReset(IProfileRegistry registry, IProfile profile) { long ts = findMostRecentResetTimestamp(registry, profile); if (ts == -1) return null; return registry.getProfile(profile.getProfileId(), ts); }
public static IProfile getCurrentProfile() { IProfileRegistry profileRegistry = (IProfileRegistry) getCurrentAgent().getService(IProfileRegistry.SERVICE_NAME); return profileRegistry.getProfile(IProfileRegistry.SELF); }
public static IProfile getCurrentProfile(BundleContext context) { IProvisioningAgent agent = getAgent(); IProfileRegistry profileRegistry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME); if (profileRegistry == null) return null; return profileRegistry.getProfile(IProfileRegistry.SELF); }
private void updateProfileFromRegistry(ITargetDefinition target) { if (fProfile == null) { try { fProfile = getProfileRegistry().getProfile(getProfileId(target)); } catch (CoreException e) { } } }
private Collection<IInstallableUnit> getInstalledIUs() { IProfile profile = session.getProfileRegistry().getProfile(profileId); if (profile == null) return Collections.<IInstallableUnit> emptyList(); IQuery<IInstallableUnit> query = new UserVisibleRootQuery(); IQueryResult<IInstallableUnit> queryResult = profile.query(query, null); return queryResult.toUnmodifiableSet(); }
public void deselectLockedIUs() { IProfileRegistry profileRegistry = (IProfileRegistry) ui.getSession().getProvisioningAgent().getService(IProfileRegistry.SERVICE_NAME); IProfile profile = profileRegistry.getProfile(ui.getProfileId()); ArrayList<Update> newSelection = new ArrayList<Update>(initialSelections.length); for (int i = 0; i < initialSelections.length; i++) { if (!isLocked(profile, initialSelections[i].toUpdate)) { newSelection.add(initialSelections[i]); } } ((UpdateOperation) operation).setSelectedUpdates(newSelection.toArray(new Update[newSelection.size()])); recomputePlan(getContainer()); }
private Collection<IInstallableUnit> getInstalledIUs() { IProfile profile = session.getProfileRegistry().getProfile(profileId); if (profile == null) return CollectionUtils.emptyList(); IQuery<IInstallableUnit> query = new UserVisibleRootQuery(); IQueryResult<IInstallableUnit> queryResult = profile.query(query, null); return queryResult.toUnmodifiableSet(); }
public Collection<IInstallableUnit> getInstalledIUs() { IProfile profile = getProfileRegistry().getProfile(profileId); if (profile == null) return CollectionUtils.emptyList(); IQuery<IInstallableUnit> query = new UserVisibleRootQuery(); IQueryResult<IInstallableUnit> queryResult = profile.query(query, null); return queryResult.toUnmodifiableSet(); }
/** * Return the {@link IInstallableUnit} that are installed in the running instance of eclipse. * @param rootsOnly set to true to return only the elements that have been explicitly installed (aka roots). * @param monitor the progress monitor * @return the installable units installed */ public IQueryResult<IInstallableUnit> listInstalledElements(boolean rootsOnly, IProgressMonitor monitor) { IProfileRegistry registry = (IProfileRegistry) getAgent().getService(IProfileRegistry.SERVICE_NAME); IProfile profile = registry.getProfile(IProfileRegistry.SELF); if (rootsOnly) return profile.query(new UserVisibleRootQuery(), monitor); return profile.query(QueryUtil.ALL_UNITS, monitor); }
public void earlyStartup() { IProvisioningAgent agent = (IProvisioningAgent) ServiceHelper.getService(AutomaticUpdatePlugin.getContext(), IProvisioningAgent.SERVICE_NAME); IProfileRegistry registry = (IProfileRegistry) agent.getService(IProfileRegistry.SERVICE_NAME); IProfile currentProfile = registry.getProfile(profileId); if (currentProfile != null && new MigrationSupport().performMigration(agent, registry, currentProfile)) return; garbageCollect(); scheduleUpdate(); }