Package org.apache.maven.archiva.indexer

Examples of org.apache.maven.archiva.indexer.RepositoryContentIndex


    {
        boolean satisfies = false;

        if ( object instanceof RepositoryContentIndex )
        {
            RepositoryContentIndex index = (RepositoryContentIndex) object;
            try
            {
                satisfies = index.exists();
            }
            catch ( RepositoryIndexException e )
            {
                getLogger().info(
                                  "Repository Content Index [" + index.getId() + "] for repository ["
                                      + index.getRepository().getId() + "] does not exist yet in ["
                                      + index.getIndexDirectory().getAbsolutePath() + "]." );
            }
        }
       
        return satisfies;
    }
View Full Code Here


            return results;
        }

        // Setup the converter
        LuceneEntryConverter converter = null;
        RepositoryContentIndex index = indexes.get( 0 );
        converter = index.getEntryConverter();

        // Process indexes into an array of Searchables.
        List<Searchable> searchableList = toSearchables( indexes );

        Searchable searchables[] = new Searchable[searchableList.size()];
View Full Code Here

        for ( ManagedRepositoryConfiguration repoConfig : localIndexedRepositories )
        {
            // Only used selected repo
            if ( selectedRepos.contains( repoConfig.getId() ) )
            {
                RepositoryContentIndex index = indexFactory.createBytecodeIndex( repoConfig );
                // If they exist.
                if ( indexExists( index ) )
                {
                    ret.add( index );
                }
View Full Code Here

        }

        config.getConfiguration().addManagedRepository( repoConfig );

        // Create the (empty) indexes.
        RepositoryContentIndex indexHashcode = indexFactory.createHashcodeIndex( repository );
        RepositoryContentIndex indexBytecode = indexFactory.createBytecodeIndex( repository );
        RepositoryContentIndex indexContents = indexFactory.createFileContentIndex( repository );

        // Now populate them.
        Map<String, HashcodesRecord> hashcodesMap = new HashcodesIndexPopulator().populate( new File( getBasedir() ) );
        indexHashcode.indexRecords( hashcodesMap.values() );
        assertEquals( "Hashcode Key Count", hashcodesMap.size(), indexHashcode.getAllRecordKeys().size() );
        assertRecordCount( indexHashcode, hashcodesMap.size() );

        Map<String, BytecodeRecord> bytecodeMap = new BytecodeIndexPopulator().populate( new File( getBasedir() ) );
        indexBytecode.indexRecords( bytecodeMap.values() );
        assertEquals( "Bytecode Key Count", bytecodeMap.size(), indexBytecode.getAllRecordKeys().size() );
        assertRecordCount( indexBytecode, bytecodeMap.size() );

        Map<String, FileContentRecord> contentMap = new FileContentIndexPopulator().populate( new File( getBasedir() ) );
        indexContents.indexRecords( contentMap.values() );
        assertEquals( "File Content Key Count", contentMap.size(), indexContents.getAllRecordKeys().size() );
        assertRecordCount( indexContents, contentMap.size() );
    }
View Full Code Here

    private void updateIndices( List<LuceneRepositoryContentRecord> fileContentRecords,
                                List<LuceneRepositoryContentRecord> hashcodeRecords,
                                List<LuceneRepositoryContentRecord> bytecodeRecords )
        throws RepositoryIndexException
    {       
        RepositoryContentIndex index = indices.get( "filecontent" );
        index.deleteRecords( fileContentRecords );
       
        index = indices.get( "hashcodes" );
        index.deleteRecords( hashcodeRecords );
       
        index = indices.get( "bytecode" );
        index.deleteRecords( bytecodeRecords );
    }
View Full Code Here

            File file = new File( repoContent.getRepoRoot(), repoContent.toPath( artifact ) );
           
            if( !file.exists() )
            {  
                RepositoryContentIndex bytecodeIndex = repoIndexFactory.createBytecodeIndex( repoContent.getRepository() );
                RepositoryContentIndex hashcodesIndex = repoIndexFactory.createHashcodeIndex( repoContent.getRepository() );
                RepositoryContentIndex fileContentIndex =
                    repoIndexFactory.createFileContentIndex( repoContent.getRepository() );
   
                FileContentRecord fileContentRecord = new FileContentRecord();
                fileContentRecord.setFilename( repoContent.toPath( artifact ) );
                fileContentIndex.deleteRecord( fileContentRecord );
   
                HashcodesRecord hashcodesRecord = new HashcodesRecord();
                hashcodesRecord.setArtifact( artifact );
                hashcodesIndex.deleteRecord( hashcodesRecord );
   
View Full Code Here

                    List<String> files = readFilesInArchive( file );
                    Map<String, List<String>> mapOfClassesAndMethods =
                        getPublicClassesAndMethodsFromFiles( file.getAbsolutePath(), files );
                   
                    // NOTE: what about public variables? should these be indexed too?
                    RepositoryContentIndex bytecodeIndex = repoIndexFactory.createBytecodeIndex( repoContent.getRepository() );
                   
                    artifact.getModel().setRepositoryId( repoContent.getId() );
                   
                    BytecodeRecord bytecodeRecord = new BytecodeRecord();
                    bytecodeRecord.setFilename( file.getName() );
                    bytecodeRecord.setClasses( mapOfClassesAndMethods.get( CLASSES ) );
                    bytecodeRecord.setFiles( files );
                    bytecodeRecord.setMethods( mapOfClassesAndMethods.get( METHODS ) );
                    bytecodeRecord.setArtifact( artifact );
                    bytecodeRecord.setRepositoryId( repoContent.getId() );
                    bytecodeIndex.modifyRecord( bytecodeRecord );
                }
            }
        }
        catch ( RepositoryException e )
        {
View Full Code Here

            return results;
        }

        // Setup the converter
        LuceneEntryConverter converter = null;
        RepositoryContentIndex index = indexes.get( 0 );
        converter = index.getEntryConverter();

        // Process indexes into an array of Searchables.
        List<Searchable> searchableList = toSearchables( indexes );

        Searchable searchables[] = new Searchable[searchableList.size()];
View Full Code Here

        for ( ManagedRepositoryConfiguration repoConfig : localIndexedRepositories )
        {
            // Only used selected repo
            if ( selectedRepos.contains( repoConfig.getId() ) )
            {
                RepositoryContentIndex index = indexFactory.createBytecodeIndex( repoConfig );
                // If they exist.
                if ( indexExists( index ) )
                {
                    ret.add( index );
                }
View Full Code Here

        for ( ManagedRepositoryConfiguration repoConfig : localIndexedRepositories )
        {
            // Only used selected repo
            if ( selectedRepos.contains( repoConfig.getId() ) )
            {
                RepositoryContentIndex index = indexFactory.createFileContentIndex( repoConfig );
                // If they exist.
                if ( indexExists( index ) )
                {
                    ret.add( index );
                }
View Full Code Here

TOP

Related Classes of org.apache.maven.archiva.indexer.RepositoryContentIndex

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.