Package org.eclipse.equinox.p2.planner

Examples of org.eclipse.equinox.p2.planner.IPlanner


    private NewVersion checkForUpdates(IProgressMonitor monitor) throws OperationCanceledException, CoreException
    {
        loadRepository(agent);

        ProvisioningSession session = new ProvisioningSession(agent);
        operation = new UpdateOperation(session);

        IStatus status = operation.resolveModal(monitor);

        if (status.getCode() == UpdateOperation.STATUS_NOTHING_TO_UPDATE)
View Full Code Here


  @Override
  public void checkUpdate(final Callback<UpdateCheckData> callback) {
    try {
      IProvisioningAgent agent = getProvisioningAgent();
      final ProvisioningSession session = new ProvisioningSession(agent);
      Job o = new Job("Check for Updates") {
       
        @Override
        protected IStatus run(IProgressMonitor monitor) {
          UpdateOperation o = new UpdateOperation(session);
View Full Code Here

        if (status.getSeverity() == IStatus.ERROR)
            throw new CoreException(status);

        Update[] possibleUpdates = operation.getPossibleUpdates();
        Update update = possibleUpdates.length > 0 ? possibleUpdates[0] : null;

        if (update == null)
        {
            return new NewVersion(Messages.LabelUnknownVersion, null, null);
        }
View Full Code Here

    private NewVersion checkForUpdates(IProgressMonitor monitor) throws OperationCanceledException, CoreException
    {
        loadRepository(agent);

        ProvisioningSession session = new ProvisioningSession(agent);
        operation = new UpdateOperation(session);

        IStatus status = operation.resolveModal(monitor);

        if (status.getCode() == UpdateOperation.STATUS_NOTHING_TO_UPDATE)
            return null;
View Full Code Here

      final ProvisioningSession session = new ProvisioningSession(agent);
      Job o = new Job("Check for Updates") {
       
        @Override
        protected IStatus run(IProgressMonitor monitor) {
          UpdateOperation o = new UpdateOperation(session);
          IStatus s = o.resolveModal(monitor);
          State state = fromStatus(s);
          callback.call(new P2UpdateCheckRV(o, state, s.getMessage(), state == State.OK,s.getException()));
          return Status.OK_STATUS;
        }
      };
      o.schedule();
    } catch (ProvisionException e) {
      getLogger().error(e.getMessage(), e);
      callback.call(new P2UpdateCheckRV(null, State.ERROR,"Failure while try to collect updateable units", null, e));
    }
  }
View Full Code Here

    // EV: throw a regular Exception to account for reflection exceptions
    //throws CoreException
    throws Exception
  {
    // EV: pull some private vars in to local scope.
    IPlanner planner = (IPlanner)this.getPrivateField("planner");

    IProvisioningPlan result = planner.getProvisioningPlan(
        request, context, new NullProgressMonitor());
    IStatus operationStatus = result.getStatus();
    if (!operationStatus.isOK())
      throw new CoreException(operationStatus);
    executePlan(context, result);
View Full Code Here

    private void loadRepository(IProvisioningAgent agent) throws CoreException
    {
        IMetadataRepositoryManager repositoryManager = (IMetadataRepositoryManager) agent
                        .getService(IMetadataRepositoryManager.SERVICE_NAME);

        IArtifactRepositoryManager artifactManager = (IArtifactRepositoryManager) agent
                        .getService(IArtifactRepositoryManager.SERVICE_NAME);

        // first: remove existing repositories (preferences might have changed)
        for (URI r : repositoryManager.getKnownRepositories(IMetadataRepositoryManager.REPOSITORIES_ALL))
            repositoryManager.removeRepository(r);

        for (URI r : artifactManager.getKnownRepositories(IArtifactRepositoryManager.REPOSITORIES_ALL))
            artifactManager.removeRepository(r);

        // second: add repository as configured in preferences
        try
        {
            String updateSite = PortfolioPlugin.getDefault().getPreferenceStore()
                            .getString(PortfolioPlugin.Preferences.UPDATE_SITE);
            URI repoLocation = new URI(updateSite);
            repositoryManager.loadRepository(repoLocation, null);
            artifactManager.loadRepository(repoLocation, null);
        }
        catch (URISyntaxException e)
        {
            IStatus status = new Status(IStatus.ERROR, PortfolioPlugin.PLUGIN_ID, e.getMessage(), e);
            throw new CoreException(status);
View Full Code Here

            try {
              Object _service = TargetPlatformProposalProvider.this.provisioningAgent.getService(IMetadataRepositoryManager.SERVICE_NAME);
              final IMetadataRepositoryManager repositoryManager = ((IMetadataRepositoryManager) _service);
              URI _uRI = new URI(uri);
              SubMonitor _newChild = wpm.newChild(90);
              final IMetadataRepository metadataRepository = repositoryManager.loadRepository(_uRI, _newChild);
              IQuery<IInstallableUnit> _iUAssistQuery = TargetPlatformProposalProvider.this.getIUAssistQuery();
              SubMonitor _newChild_1 = wpm.newChild(5);
              IQueryResult<IInstallableUnit> _query = metadataRepository.query(_iUAssistQuery, _newChild_1);
              final Set<IInstallableUnit> results = _query.toUnmodifiableSet();
              final Function1<IInstallableUnit, Boolean> _function = new Function1<IInstallableUnit, Boolean>() {
                public Boolean apply(final IInstallableUnit it) {
                  EList<IU> _ius = location.getIus();
                  final Function1<IU, String> _function = new Function1<IU, String>() {
                    public String apply(final IU it) {
                      return it.getID();
                    }
                  };
                  List<String> _map = ListExtensions.<IU, String>map(_ius, _function);
                  String _id = it.getId();
                  boolean _contains = _map.contains(_id);
                  return Boolean.valueOf((!_contains));
                }
              };
              Iterable<IInstallableUnit> _filter = IterableExtensions.<IInstallableUnit>filter(results, _function);
              final Procedure1<IInstallableUnit> _function_1 = new Procedure1<IInstallableUnit>() {
                public void apply(final IInstallableUnit it) {
                  String _id = it.getId();
                  IQuery<IInstallableUnit> _createIUQuery = QueryUtil.createIUQuery(_id);
                  SubMonitor _newChild = wpm.newChild(5);
                  final IQueryResult<IInstallableUnit> allVersions = metadataRepository.query(_createIUQuery, _newChild);
                  String _id_1 = it.getId();
                  Iterator<IInstallableUnit> _iterator = allVersions.iterator();
                  final Function1<IInstallableUnit, String> _function = new Function1<IInstallableUnit, String>() {
                    public String apply(final IInstallableUnit it) {
                      Version _version = it.getVersion();
View Full Code Here

          try {
            Object _service = TargetPlatformProposalProvider.this.provisioningAgent.getService(IMetadataRepositoryManager.SERVICE_NAME);
            final IMetadataRepositoryManager repositoryManager = ((IMetadataRepositoryManager) _service);
            URI _uRI = new URI(uri);
            SubMonitor _newChild = wpm.newChild(95);
            final IMetadataRepository metadataRepository = repositoryManager.loadRepository(_uRI, _newChild);
            String _iD = iu.getID();
            IQuery<IInstallableUnit> _createIUQuery = QueryUtil.createIUQuery(_iD);
            SubMonitor _newChild_1 = wpm.newChild(5);
            IQueryResult<IInstallableUnit> _query = metadataRepository.query(_createIUQuery, _newChild_1);
            final Set<IInstallableUnit> results = _query.toUnmodifiableSet();
            final Procedure1<IInstallableUnit> _function = new Procedure1<IInstallableUnit>() {
              public void apply(final IInstallableUnit it) {
                Version _version = it.getVersion();
                Comparable<?> _segment = _version.getSegment(0);
View Full Code Here

    }
  }
 
  @Check(value = CheckType.EXPENSIVE)
  public IMetadataRepository checkLocationURI(final Location location) {
    IMetadataRepository _xblockexpression = null;
    {
      IProgressMonitor _xifexpression = null;
      boolean _and = false;
      Map<Object, Object> _context = this.getContext();
      boolean _notEquals = (!Objects.equal(_context, null));
      if (!_notEquals) {
        _and = false;
      } else {
        Map<Object, Object> _context_1 = this.getContext();
        Object _get = _context_1.get(IProgressMonitor.class);
        boolean _notEquals_1 = (!Objects.equal(_get, null));
        _and = _notEquals_1;
      }
      if (_and) {
        Map<Object, Object> _context_2 = this.getContext();
        Object _get_1 = _context_2.get(IProgressMonitor.class);
        _xifexpression = ((IProgressMonitor) _get_1);
      } else {
        _xifexpression = new NullProgressMonitor();
      }
      final IProgressMonitor monitor = _xifexpression;
      IMetadataRepository _xifexpression_1 = null;
      String _uri = location.getUri();
      boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(_uri);
      boolean _not = (!_isNullOrEmpty);
      if (_not) {
        IMetadataRepository _xblockexpression_1 = null;
        {
          Object _service = this.provisioningAgent.getService(IMetadataRepositoryManager.SERVICE_NAME);
          final IMetadataRepositoryManager repositoryManager = ((IMetadataRepositoryManager) _service);
          IMetadataRepository _xtrycatchfinallyexpression = null;
          try {
            String _uri_1 = location.getUri();
            java.net.URI _uRI = new java.net.URI(_uri_1);
            _xtrycatchfinallyexpression = repositoryManager.loadRepository(_uRI, monitor);
          } catch (final Throwable _t) {
View Full Code Here

TOP

Related Classes of org.eclipse.equinox.p2.planner.IPlanner

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.