Examples of IArtifactRepositoryManager


Examples of org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager

                    (nickName == null) ? "null value" : nickName);
        }

        try {
            IMetadataRepositoryManager metadataRepositoryManager = ServiceHolder.getMetadataRepositoryManager();
            IArtifactRepositoryManager artifactRepositoryManager = ServiceHolder.getArtifactRepositoryManager();

            if (metadataRepositoryManager.contains(location)) {
                return;
            }

            //Validating the repositories
            status = metadataRepositoryManager.validateRepositoryLocation(location, null);
            if (!status.isOK()) {
                throw ProvisioningException.makeExceptionFromErrorCode(
                        CompMgtMessages.INVALID_REPO_LOCATION, location);
            }

            //Loading the metadata repository
            metadataRepositoryManager.loadRepository(location, null);
            metadataRepositoryManager.setRepositoryProperty(location, IRepository.PROP_NICKNAME, nickName);

            //Loading the artifact repository
            artifactRepositoryManager.loadRepository(location, null);
            artifactRepositoryManager.setRepositoryProperty(location, IRepository.PROP_NICKNAME, nickName);
        } catch (Exception e) {
            throw ProvisioningException.makeExceptionFromErrorCode(
                    CompMgtMessages.FAILD_TO_ADD_REPSITORY, e, location);
        }
    }
View Full Code Here

Examples of org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager

        }
    }

    public static void enableRepository(URI location, boolean enable) throws ProvisioningException {
        IMetadataRepositoryManager metadataRepositoryManager;
        IArtifactRepositoryManager artifactRepositoryManager;

        if (location == null) {
            throw ProvisioningException.makeExceptionFromErrorCode(CompMgtMessages.INVALID_REPO_LOCATION,
                    "null value");
        }

        try {
            metadataRepositoryManager = ServiceHolder.getMetadataRepositoryManager();
            artifactRepositoryManager = ServiceHolder.getArtifactRepositoryManager();
            metadataRepositoryManager.setEnabled(location, enable);
            artifactRepositoryManager.setEnabled(location, enable);
        } catch (Exception e) {
            throw ProvisioningException.makeExceptionFromErrorCode(
                    CompMgtMessages.FAILD_TO_ENABLE_REPSITORY, e, location);
        }
View Full Code Here

Examples of org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager

    }

    public static boolean isRepositoryEnabled(URI location) throws ProvisioningException {
        IMetadataRepositoryManager metadataRepositoryManager = ServiceHolder.getMetadataRepositoryManager();
        IArtifactRepositoryManager artifactRepositoryManager = ServiceHolder.getArtifactRepositoryManager();
        return metadataRepositoryManager.isEnabled(location) && artifactRepositoryManager.isEnabled(location);
    }
View Full Code Here

Examples of org.eclipse.equinox.internal.provisional.p2.artifact.repository.IArtifactRepositoryManager

        IMetadataRepositoryManager metadataRepositoryManager = ServiceHolder.getMetadataRepositoryManager();
        metadataRepositoryManager.removeRepository(location);
    }

    private static void removeArtifactRepository(URI location) throws ProvisioningException {
        IArtifactRepositoryManager artifactRepositoryManager = ServiceHolder.getArtifactRepositoryManager();
        artifactRepositoryManager.removeRepository(location);
    }
View Full Code Here

Examples of org.eclipse.equinox.p2.repository.artifact.IArtifactRepositoryManager

    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
TOP
Copyright © 2018 www.massapi.com. 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.