aboutsummaryrefslogtreecommitdiffstats
path: root/archiva-modules/archiva-base/archiva-repository-admin
diff options
context:
space:
mode:
authorOlivier Lamy <olamy@apache.org>2011-11-17 22:50:21 +0000
committerOlivier Lamy <olamy@apache.org>2011-11-17 22:50:21 +0000
commit67b0a5a62a072fb991039d6fef9a5ba34d7c77a2 (patch)
treef5f5f703f4ffbf16ef1f0cd7ae8352b1cd3379d8 /archiva-modules/archiva-base/archiva-repository-admin
parent83dfa790b36dfb71716859add23ee8115a22ef2c (diff)
downloadarchiva-67b0a5a62a072fb991039d6fef9a5ba34d7c77a2.tar.gz
archiva-67b0a5a62a072fb991039d6fef9a5ba34d7c77a2.zip
[MRM-1560] Add the possibility to schedule retrieve remote indexes when application startup
git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1203406 13f79535-47bb-0310-9956-ffa450edef68
Diffstat (limited to 'archiva-modules/archiva-base/archiva-repository-admin')
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RemoteRepository.java17
-rw-r--r--archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java4
2 files changed, 20 insertions, 1 deletions
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RemoteRepository.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RemoteRepository.java
index 5e9575811..8c0febeaf 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RemoteRepository.java
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RemoteRepository.java
@@ -59,6 +59,11 @@ public class RemoteRepository
private int remoteDownloadTimeout = 300;
+ /**
+ * @since 1.4-M2
+ */
+ private boolean downloadRemoteIndexOnStartup = false;
+
public RemoteRepository()
{
@@ -171,11 +176,20 @@ public class RemoteRepository
this.remoteDownloadTimeout = remoteDownloadTimeout;
}
+ public boolean isDownloadRemoteIndexOnStartup()
+ {
+ return downloadRemoteIndexOnStartup;
+ }
+
+ public void setDownloadRemoteIndexOnStartup( boolean downloadRemoteIndexOnStartup )
+ {
+ this.downloadRemoteIndexOnStartup = downloadRemoteIndexOnStartup;
+ }
+
@Override
public String toString()
{
final StringBuilder sb = new StringBuilder();
- sb.append( super.toString() );
sb.append( "RemoteRepository" );
sb.append( "{url='" ).append( url ).append( '\'' );
sb.append( ", userName='" ).append( userName ).append( '\'' );
@@ -186,6 +200,7 @@ public class RemoteRepository
sb.append( ", remoteDownloadNetworkProxyId='" ).append( remoteDownloadNetworkProxyId ).append( '\'' );
sb.append( ", cronExpression='" ).append( cronExpression ).append( '\'' );
sb.append( ", remoteDownloadTimeout=" ).append( remoteDownloadTimeout );
+ sb.append( ", downloadRemoteIndexOnStartup=" ).append( downloadRemoteIndexOnStartup );
sb.append( '}' );
return sb.toString();
}
diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java
index 17871f098..e1bf5d46f 100644
--- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java
+++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/remote/DefaultRemoteRepositoryAdmin.java
@@ -129,6 +129,8 @@ public class DefaultRemoteRepositoryAdmin
remoteRepository.setRemoteDownloadNetworkProxyId(
repositoryConfiguration.getRemoteDownloadNetworkProxyId() );
remoteRepository.setRemoteDownloadTimeout( repositoryConfiguration.getRemoteDownloadTimeout() );
+ remoteRepository.setDownloadRemoteIndexOnStartup(
+ repositoryConfiguration.isDownloadRemoteIndexOnStartup() );
remoteRepositories.add( remoteRepository );
}
return remoteRepositories;
@@ -327,6 +329,8 @@ public class DefaultRemoteRepositoryAdmin
remoteRepositoryConfiguration.setRemoteDownloadNetworkProxyId(
remoteRepository.getRemoteDownloadNetworkProxyId() );
remoteRepositoryConfiguration.setRemoteDownloadTimeout( remoteRepository.getRemoteDownloadTimeout() );
+ remoteRepositoryConfiguration.setDownloadRemoteIndexOnStartup(
+ remoteRepository.isDownloadRemoteIndexOnStartup() );
return remoteRepositoryConfiguration;
}