protected void logSkippingRepositoryMessage( Repository repository ) { boolean isSupported = isIndexingSupported( repository ); boolean isIndexed = repository.isIndexable(); if ( getLogger().isDebugEnabled() ) { StringBuilder sb = new StringBuilder( "Indexing is " ); if ( !isSupported ) { sb.append( "not " ); } sb.append( "supported on repository \"" + repository.getName() + "\" (ID=\"" + repository.getId() + "\")" ); if ( isSupported ) { sb.append( " and is set as " ); if ( !isIndexed ) { sb.append( "not " ); } sb.append( "indexed. " ); } else { sb.append( ". " ); } sb.append( "Skipping it." ); getLogger().debug( sb.toString() ); } }
public void removeRepositoryIndexContext( String repositoryId, boolean deleteFiles ) throws IOException, NoSuchRepositoryException { Repository repository = repositoryRegistry.getRepository( repositoryId ); Lock lock = getLock( repository ).writeLock(); lock.lock(); try { if ( !isIndexingSupported( repository ) ) { logSkippingRepositoryMessage( repository ); return; } IndexingContext localCtx = getRepositoryLocalIndexContext( repository ); IndexingContext remoteCtx = getRepositoryRemoteIndexContext( repository ); if ( localCtx != null ) { nexusIndexer.removeIndexingContext( localCtx, deleteFiles ); } if ( remoteCtx != null ) { nexusIndexer.removeIndexingContext( remoteCtx, deleteFiles ); } } finally { lock.unlock(); } }
if ( !isIndexingSupported( repository ) )
public void setRepositoryIndexContextSearchable( String repositoryId, boolean searchable ) throws IOException, NoSuchRepositoryException { Repository repository = repositoryRegistry.getRepository( repositoryId ); // cannot do "!repository.isIndexable()" since we may be called to handle that config change (using events)! // the repo might be already non-indexable, but the context would still exist! if ( !isIndexingSupported( repository ) ) { logSkippingRepositoryMessage( repository ); return; } IndexingContext ctx = getRepositoryLocalIndexContext( repository ); IndexingContext rctx = getRepositoryRemoteIndexContext( repository ); // do this only if we have contexts, otherwise be muted if ( ctx != null && rctx != null ) { if ( getLogger().isDebugEnabled() ) { getLogger().debug( "Searching on repository ID='" + repositoryId + "' is set to: " + String.valueOf( searchable ) ); } ctx.setSearchable( searchable ); rctx.setSearchable( searchable ); } }
protected void mergeRepositoryGroupIndexWithMember( Repository repository ) throws IOException if ( !isIndexingSupported( repository ) ) if ( !isIndexingSupported( group ) )
protected void reindexRepository( Repository repository, boolean fullReindex ) throws IOException if ( !isIndexingSupported( repository ) || repository.getRepositoryKind().isFacetAvailable( GroupRepository.class ) )
if ( !isIndexingSupported( repository ) )
if ( !isIndexingSupported( repository ) || !repository.isIndexable() )
if ( !isIndexingSupported( repository ) )
protected boolean downloadRepositoryIndex( ProxyRepository repository ) throws IOException if ( !isIndexingSupported( repository ) )
if ( !isIndexingSupported( repository ) || !MavenRepository.class.isAssignableFrom( repository.getClass() ) )