diff options
author | Olivier Lamy <olamy@apache.org> | 2013-11-14 03:11:06 +0000 |
---|---|---|
committer | Olivier Lamy <olamy@apache.org> | 2013-11-14 03:11:06 +0000 |
commit | c230bdbe4102ad02eab38599da4f8f1545083fa4 (patch) | |
tree | 6c392b53a0d66e0ec1d1bb5a344073754eb999b5 /archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src | |
parent | d19a30234450201cb36c4ae475299329f467b996 (diff) | |
download | archiva-c230bdbe4102ad02eab38599da4f8f1545083fa4.tar.gz archiva-c230bdbe4102ad02eab38599da4f8f1545083fa4.zip |
add a service to know repositories ids running a remote download
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1541794 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src')
3 files changed, 17 insertions, 5 deletions
diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java index d2405c66c..b4c2a633d 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DefaultDownloadRemoteIndexScheduler.java @@ -236,4 +236,9 @@ public class DefaultDownloadRemoteIndexScheduler { this.taskScheduler = taskScheduler; } + + public List<String> getRunningRemoteDownloadIds() + { + return runningRemoteDownloadIds; + } } diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexScheduler.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexScheduler.java index 39da82728..ce91e803d 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexScheduler.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexScheduler.java @@ -18,6 +18,8 @@ package org.apache.archiva.scheduler.indexing; * under the License. */ +import java.util.List; + /** * @author Olivier Lamy * @since 1.4-M1 @@ -26,4 +28,6 @@ public interface DownloadRemoteIndexScheduler { void scheduleDownloadRemote( String repositoryId, boolean now, boolean fullDownload ) throws DownloadRemoteIndexException; + + List<String> getRunningRemoteDownloadIds(); } diff --git a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java index 665860d9c..e634195bc 100644 --- a/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java +++ b/archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/main/java/org/apache/archiva/scheduler/indexing/DownloadRemoteIndexTask.java @@ -232,16 +232,19 @@ public class DownloadRemoteIndexTask request.setLocalIndexCacheDir( indexCacheDirectory ); this.indexUpdater.fetchAndUpdateIndex( request ); - stopWatch.stop(); - log.info( "time update index from remote for repository {}: {} s", this.remoteRepository.getId(), - ( stopWatch.getTime() / 1000 ) ); // index packing optionnal ?? //IndexPackingRequest indexPackingRequest = // new IndexPackingRequest( indexingContext, indexingContext.getIndexDirectoryFile() ); //indexPacker.packIndex( indexPackingRequest ); + indexingContext.updateTimestamp( true ); + stopWatch.stop(); + log.info( "time update index from remote for repository {}: {} s", this.remoteRepository.getId(), + ( stopWatch.getTime() / 1000 ) ); + + } catch ( MalformedURLException e ) { @@ -263,7 +266,7 @@ public class DownloadRemoteIndexTask deleteDirectoryQuiet( tempIndexDirectory ); this.runningRemoteDownloadIds.remove( this.remoteRepository.getId() ); } - log.info( "end download remote index for remote repository " + this.remoteRepository.getId() ); + log.info( "end download remote index for remote repository {}", this.remoteRepository.getId() ); } private void deleteDirectoryQuiet( File f ) @@ -304,7 +307,7 @@ public class DownloadRemoteIndexTask { if ( response.getStatusLine().getStatusCode() != HttpStatus.SC_OK ) { - throw new ClientProtocolException( "Upload failed: " + response.getStatusLine() ); + throw new ClientProtocolException( "Download failed: " + response.getStatusLine() ); } long endTime = System.currentTimeMillis(); log.info( "end of transfer file {} {} kb: {}s", resourceName, this.totalLength / 1024, |