Package org.eclipse.equinox.p2.planner

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


      try {
        Location _location = iu.getLocation();
        String _uri = _location.getUri();
        java.net.URI _uRI = new java.net.URI(_uri);
        NullProgressMonitor _nullProgressMonitor = new NullProgressMonitor();
        final IMetadataRepository metadataRepository = repositoryManager.loadRepository(_uRI, _nullProgressMonitor);
        String _iD = iu.getID();
        IQuery<IInstallableUnit> _createIUQuery = QueryUtil.createIUQuery(_iD);
        NullProgressMonitor _nullProgressMonitor_1 = new NullProgressMonitor();
        IQueryResult<IInstallableUnit> _query = metadataRepository.query(_createIUQuery, _nullProgressMonitor_1);
        final Set<IInstallableUnit> idResults = _query.toUnmodifiableSet();
        boolean _isEmpty = idResults.isEmpty();
        if (_isEmpty) {
          StringConcatenation _builder = new StringConcatenation();
          _builder.append("No installable unit with ID \'");
          String _iD_1 = iu.getID();
          _builder.append(_iD_1, "");
          _builder.append("\' can be found in \'");
          Location _location_1 = iu.getLocation();
          String _uri_1 = _location_1.getUri();
          _builder.append(_uri_1, "");
          _builder.append("\'.");
          this.error(_builder.toString(), iu, TargetPlatformPackage.Literals.IU__ID, TargetPlatformValidator.CHECK__IU_IN_LOCATION);
        } else {
          boolean _and = false;
          String _version = iu.getVersion();
          boolean _isNullOrEmpty = StringExtensions.isNullOrEmpty(_version);
          boolean _not = (!_isNullOrEmpty);
          if (!_not) {
            _and = false;
          } else {
            String _version_1 = iu.getVersion();
            boolean _equals = "lazy".equals(_version_1);
            boolean _not_1 = (!_equals);
            _and = _not_1;
          }
          if (_and) {
            String _iD_2 = iu.getID();
            String _version_2 = iu.getVersion();
            VersionRange _versionRange = new VersionRange(_version_2);
            IQuery<IInstallableUnit> _createQuery = QueryUtil.createQuery("latest(x | x.id == $0 && x.version ~= $1)", _iD_2, _versionRange);
            NullProgressMonitor _nullProgressMonitor_2 = new NullProgressMonitor();
            final IQueryResult<IInstallableUnit> versionResult = metadataRepository.query(_createQuery, _nullProgressMonitor_2);
            boolean _isEmpty_1 = versionResult.isEmpty();
            if (_isEmpty_1) {
              StringConcatenation _builder_1 = new StringConcatenation();
              _builder_1.append("No installable unit with ID \'");
              String _iD_3 = iu.getID();
View Full Code Here


 
  public Diagnostic resolve(IMetadataRepositoryManager metadataRepositoryManager, IProgressMonitor monitor) {
    BasicDiagnostic diag = new BasicDiagnostic();
    SubMonitor subMonitor = SubMonitor.convert(monitor, 100);
   
    IMetadataRepository metadataRepository;
    try {
      metadataRepository = metadataRepositoryManager.loadRepository(uri, subMonitor.newChild(80));
      SubMonitor loopMonitor = subMonitor.newChild(20).setWorkRemaining(unresolvedIUs.size());
      for (UnresolvedIU iu : unresolvedIUs) {
        if (monitor.isCanceled()) {
          break;
        }
        Set<IInstallableUnit> results = metadataRepository.query(iu.getQuery(), loopMonitor.newChild(1)).toUnmodifiableSet();
        if (!results.isEmpty()) {
          IInstallableUnit unit =  results.iterator().next();
          if (iu.isLazyRange() && unit instanceof InstallableUnit) {
            ((InstallableUnit)unit).setVersion(Version.create("0.0.0"));
          }
View Full Code Here

      final TargetPlatform targetPlatform = this.parser.parse(_builder);
      final ResolvedTargetPlatform resolvedTargetPlatform = ResolvedTargetPlatform.create(targetPlatform, this.indexBuilder);
      NullProgressMonitor _nullProgressMonitor = new NullProgressMonitor();
      final Diagnostic d = resolvedTargetPlatform.resolve(new MockMetadataRepositoryManager(null) {
        public IMetadataRepository loadRepository(final URI location, final IProgressMonitor monitor) throws ProvisionException, OperationCanceledException {
          IMetadataRepository _xifexpression = null;
          String _string = location.toString();
          boolean _equals = "unknownHost".equals(_string);
          if (_equals) {
            throw new ProvisionException("Unknown Host");
          } else {
View Full Code Here

            Display _display = _shell.getDisplay();
            ReadAndDispatchProgressMonitorWrapper _readAndDispatchProgressMonitorWrapper = new ReadAndDispatchProgressMonitorWrapper(monitor, _display);
            final SubMonitor wpm = SubMonitor.convert(_readAndDispatchProgressMonitorWrapper, ("Creating content assist for " + uri), 100);
            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>() {
View Full Code Here

        try {
          ReadAndDispatchProgressMonitorWrapper _readAndDispatchProgressMonitorWrapper = new ReadAndDispatchProgressMonitorWrapper(monitor, display);
          final SubMonitor wpm = SubMonitor.convert(_readAndDispatchProgressMonitorWrapper, ("Creating content assist for " + uri), 100);
          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();
View Full Code Here

      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) {
            if (_t instanceof Exception) {
              final Exception e = (Exception)_t;
              String _message = e.getMessage();
              boolean _isNullOrEmpty_1 = StringExtensions.isNullOrEmpty(_message);
View Full Code Here

  @Check(value = CheckType.EXPENSIVE)
  public Object checkIUIDAndRangeInRepository(final IU iu) {
    Object _xblockexpression = null;
    {
      Object _service = this.provisioningAgent.getService(IMetadataRepositoryManager.SERVICE_NAME);
      final IMetadataRepositoryManager repositoryManager = ((IMetadataRepositoryManager) _service);
      Object _xtrycatchfinallyexpression = null;
      try {
        Location _location = iu.getLocation();
        String _uri = _location.getUri();
        java.net.URI _uRI = new java.net.URI(_uri);
        NullProgressMonitor _nullProgressMonitor = new NullProgressMonitor();
        final IMetadataRepository metadataRepository = repositoryManager.loadRepository(_uRI, _nullProgressMonitor);
        String _iD = iu.getID();
        IQuery<IInstallableUnit> _createIUQuery = QueryUtil.createIUQuery(_iD);
        NullProgressMonitor _nullProgressMonitor_1 = new NullProgressMonitor();
        IQueryResult<IInstallableUnit> _query = metadataRepository.query(_createIUQuery, _nullProgressMonitor_1);
        final Set<IInstallableUnit> idResults = _query.toUnmodifiableSet();
View Full Code Here

  private Diagnostic doGenerateTargetDefinitionFile(URI uri, TargetPlatform targetPlatform, IProgressMonitor monitor)  {
    final BasicDiagnostic ret = new BasicDiagnostic();
    SubMonitor subMonitor = SubMonitor.convert(monitor, 100);
   
    try {
      IMetadataRepositoryManager repositoryManager = (IMetadataRepositoryManager) agent.getService(IMetadataRepositoryManager.SERVICE_NAME);
      ResolvedTargetPlatform resolvedTargetPlatform = ResolvedTargetPlatform.create(targetPlatform, indexBuilder);
      subMonitor.worked(5);
     
      if (subMonitor.isCanceled()) {
        ret.merge(Diagnostic.CANCEL_INSTANCE);
View Full Code Here

        return type.cast(result);
    }

    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);
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.