@PostConstruct public void startup() throws DownloadRemoteIndexException, UnsupportedBaseContextException { archivaConfiguration.addListener( this ); // TODO add indexContexts even if null for ( org.apache.archiva.repository.RemoteRepository remoteRepository : repositoryRegistry.getRemoteRepositories() ) { String contextKey = "remote-" + remoteRepository.getId(); IndexingContext context = remoteRepository.getIndexingContext().getBaseContext(IndexingContext.class); if ( context == null ) { continue; } RemoteIndexFeature rif = remoteRepository.getFeature(RemoteIndexFeature.class).get(); // TODO record jobs from configuration if ( rif.isDownloadRemoteIndex() && StringUtils.isNotEmpty( remoteRepository.getSchedulingDefinition() ) ) { boolean fullDownload = context.getIndexDirectoryFile().list().length == 0; scheduleDownloadRemote( remoteRepository.getId(), false, fullDownload ); } } }
remoteRepositories.addAll( repositoryRegistry.getRemoteRepositories() );