Package org.apache.archiva.metadata.repository

Examples of org.apache.archiva.metadata.repository.MetadataResolver


        //       is essentially presentation code
        Set<String> namespacesToCollapse;
        RepositorySession repositorySession = repositorySessionFactory.createSession();
        try
        {
            MetadataResolver metadataResolver = repositorySession.getResolver();
            namespacesToCollapse = new LinkedHashSet<String>();
            for ( String repoId : selectedRepos )
            {
                namespacesToCollapse.addAll( metadataResolver.resolveRootNamespaces( repositorySession, repoId ) );
            }

            for ( String n : namespacesToCollapse )
            {
                // TODO: check performance of this
View Full Code Here


        RepositorySession repositorySession = repositorySessionFactory.createSession();
        Set<String> namespaces;
        try
        {
            MetadataResolver metadataResolver = repositorySession.getResolver();

            Set<String> namespacesToCollapse = new LinkedHashSet<String>();
            for ( String repoId : selectedRepos )
            {
                namespacesToCollapse.addAll( metadataResolver.resolveNamespaces( repositorySession, repoId, groupId ) );

                projects.addAll( metadataResolver.resolveProjects( repositorySession, repoId, groupId ) );
            }

            // TODO: this logic should be optional, particularly remembering we want to keep this code simple
            //       it is located here to avoid the content repository implementation needing to do too much for what
            //       is essentially presentation code
View Full Code Here

        }

        RepositorySession repositorySession = repositorySessionFactory.createSession();
        try
        {
            MetadataResolver metadataResolver = repositorySession.getResolver();

            Set<String> versions = new LinkedHashSet<String>();
            for ( String repoId : selectedRepos )
            {
                versions.addAll(
                    metadataResolver.resolveProjectVersions( repositorySession, repoId, groupId, artifactId ) );
            }

            // TODO: sort by known version ordering method
            this.projectVersions = new ArrayList<String>( versions );
View Full Code Here

        results = search.search( "", observableRepos, queryString, limits, null );

        RepositorySession repositorySession = repositorySessionFactory.createSession();
        try
        {
            MetadataResolver metadataResolver = repositorySession.getResolver();

            for ( SearchResultHit resultHit : results.getHits() )
            {
                List<String> resultHitVersions = resultHit.getVersions();
                if ( resultHitVersions != null )
                {
                    for ( String version : resultHitVersions )
                    {
                        Artifact artifact = null;
                        for ( String repoId : observableRepos )
                        {
                            // slight behaviour change to previous implementation: instead of allocating "jar" when not
                            // found in the database, we can rely on the metadata repository to create it on the fly. We
                            // just allocate the default packaging if the Maven facet is not found.
                            FacetedMetadata model = metadataResolver.resolveProjectVersion( repositorySession, repoId,
                                                                                            resultHit.getGroupId(),
                                                                                            resultHit.getArtifactId(),
                                                                                            version );

                            if ( model != null )
View Full Code Here

        List<String> observableRepos = xmlRpcUserRepositories.getObservableRepositories();

        RepositorySession repositorySession = repositorySessionFactory.createSession();
        try
        {
            MetadataResolver metadataResolver = repositorySession.getResolver();

            for ( String repoId : observableRepos )
            {
                Collection<String> results = metadataResolver.resolveProjectVersions( repositorySession, repoId,
                                                                                      groupId, artifactId );

                for ( final String version : results )
                {
                    final Artifact artifact = new Artifact( repoId, groupId, artifactId, version, "pom" );
View Full Code Here

        List<String> observableRepos = xmlRpcUserRepositories.getObservableRepositories();

        RepositorySession repositorySession = repositorySessionFactory.createSession();
        try
        {
            MetadataResolver metadataResolver = repositorySession.getResolver();

            for ( String repoId : observableRepos )
            {
                ProjectVersionMetadata model = metadataResolver.resolveProjectVersion( repositorySession, repoId,
                                                                                       groupId, artifactId, version );
                if ( model != null )
                {
                    List<Dependency> dependencies = new ArrayList<Dependency>();
                    List<org.apache.archiva.metadata.model.Dependency> modelDeps = model.getDependencies();
View Full Code Here

        List<String> observableRepos = xmlRpcUserRepositories.getObservableRepositories();

        RepositorySession repositorySession = repositorySessionFactory.createSession();
        try
        {
            MetadataResolver metadataResolver = repositorySession.getResolver();

            for ( String repoId : observableRepos )
            {
                Collection<ProjectVersionReference> refs = metadataResolver.resolveProjectReferences( repositorySession,
                                                                                                      repoId, groupId,
                                                                                                      artifactId,
                                                                                                      version );
                for ( ProjectVersionReference ref : refs )
                {
View Full Code Here

        ProjectVersionMetadata versionMetadata = null;
        artifacts = new LinkedHashMap<String, List<ArtifactDownloadInfo>>();

        List<String> repos = getObservableRepos();

        MetadataResolver metadataResolver = session.getResolver();
        for ( String repoId : repos )
        {
            if ( versionMetadata == null )
            {
                // we don't want the implementation being that intelligent - so another resolver to do the
                // "just-in-time" nature of picking up the metadata (if appropriate for the repository type) is used
                try
                {
                    versionMetadata =
                        metadataResolver.resolveProjectVersion( session, repoId, groupId, artifactId, version );
                    if ( versionMetadata != null )
                    {
                        MetadataFacet repoProbFacet;
                        if ( ( repoProbFacet = versionMetadata.getFacet( RepositoryProblemFacet.FACET_ID ) ) != null )
                        {
                            addIncompleteModelWarning( "Artifact metadata is incomplete: "
                                                           + ( (RepositoryProblemFacet) repoProbFacet ).getProblem() );
                            //set metadata to complete so that no additional 'Artifact metadata is incomplete' warning is logged
                            versionMetadata.setIncomplete( false );
                        }
                    }

                }
                catch ( MetadataResolutionException e )
                {
                    addIncompleteModelWarning( "Error resolving artifact metadata: " + e.getMessage() );

                    // TODO: need a consistent way to construct this - same in ArchivaMetadataCreationConsumer
                    versionMetadata = new ProjectVersionMetadata();
                    versionMetadata.setId( version );
                }
                if ( versionMetadata != null )
                {
                    repositoryId = repoId;

                    List<ArtifactMetadata> artifacts;
                    try
                    {
                        artifacts = new ArrayList<ArtifactMetadata>(
                            metadataResolver.resolveArtifacts( session, repoId, groupId, artifactId, version ) );
                    }
                    catch ( MetadataResolutionException e )
                    {
                        addIncompleteModelWarning( "Error resolving artifact metadata: " + e.getMessage() );
                        artifacts = Collections.emptyList();
View Full Code Here

        List<ProjectVersionReference> references = new ArrayList<ProjectVersionReference>();
        // TODO: what if we get duplicates across repositories?
        RepositorySession repositorySession = repositorySessionFactory.createSession();
        try
        {
            MetadataResolver metadataResolver = repositorySession.getResolver();
            for ( String repoId : getObservableRepos() )
            {
                // TODO: what about if we want to see this irrespective of version?
                references.addAll(
                    metadataResolver.resolveProjectReferences( repositorySession, repoId, groupId, artifactId,
                                                               version ) );
            }
        }
        finally
        {
View Full Code Here

        //       is essentially presentation code
        Set<String> namespacesToCollapse = new LinkedHashSet<String>();
        RepositorySession repositorySession = repositorySessionFactory.createSession();
        try
        {
            MetadataResolver metadataResolver = repositorySession.getResolver();

            for ( String repoId : selectedRepos )
            {
                namespacesToCollapse.addAll( metadataResolver.resolveRootNamespaces( repositorySession, repoId ) );
            }
            for ( String n : namespacesToCollapse )
            {
                // TODO: check performance of this
                namespaces.add( collapseNamespaces( repositorySession, metadataResolver, selectedRepos, n ) );
View Full Code Here

TOP

Related Classes of org.apache.archiva.metadata.repository.MetadataResolver

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.