From 506abf01c8fb0fb97f452bce46c1b073c6a72be3 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 26 Sep 2011 20:34:24 +0000 Subject: [PATCH] [MRM-1524] downloading (optionnaly) remote index to display remote artifacts in search results : add a download remote time out field as file are more important and can take more time. git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1176036 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/mdo/configuration.mdo | 9 +++++++++ .../archiva/admin/model/beans/RemoteRepository.java | 13 +++++++++++++ .../remote/DefaultRemoteRepositoryAdmin.java | 2 ++ .../jsp/admin/include/remoteRepositoryForm.jspf | 1 + 4 files changed, 25 insertions(+) diff --git a/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo b/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo index 3e09cc077..9dd0dc679 100644 --- a/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo +++ b/archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo @@ -518,6 +518,15 @@ Id of the networkProxy to use when downloading remote index. + + remoteDownloadTimeout + 1.4.0+ + int + + Timeout in seconds for download remote index. Default is more long than artifact download. + + 300 + 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 60b72d612..1c251a7a9 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 @@ -57,6 +57,8 @@ public class RemoteRepository */ private String cronExpression = "0 0 08 ? * SUN"; + private int remoteDownloadTimeout = 300; + public RemoteRepository() { @@ -159,6 +161,16 @@ public class RemoteRepository this.cronExpression = cronExpression; } + public int getRemoteDownloadTimeout() + { + return remoteDownloadTimeout; + } + + public void setRemoteDownloadTimeout( int remoteDownloadTimeout ) + { + this.remoteDownloadTimeout = remoteDownloadTimeout; + } + @Override public String toString() { @@ -173,6 +185,7 @@ public class RemoteRepository sb.append( ", remoteIndexUrl='" ).append( remoteIndexUrl ).append( '\'' ); sb.append( ", remoteDownloadNetworkProxyId='" ).append( remoteDownloadNetworkProxyId ).append( '\'' ); sb.append( ", cronExpression='" ).append( cronExpression ).append( '\'' ); + sb.append( ", remoteDownloadTimeout=" ).append( remoteDownloadTimeout ); 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 0fa646110..e68c9d954 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 @@ -63,6 +63,7 @@ public class DefaultRemoteRepositoryAdmin remoteRepository.setIndexDirectory( repositoryConfiguration.getIndexDir() ); remoteRepository.setRemoteDownloadNetworkProxyId( repositoryConfiguration.getRemoteDownloadNetworkProxyId() ); + remoteRepository.setRemoteDownloadTimeout( repositoryConfiguration.getRemoteDownloadTimeout() ); remoteRepositories.add( remoteRepository ); } return remoteRepositories; @@ -199,6 +200,7 @@ public class DefaultRemoteRepositoryAdmin remoteRepositoryConfiguration.setIndexDir( remoteRepository.getIndexDirectory() ); remoteRepositoryConfiguration.setRemoteDownloadNetworkProxyId( remoteRepository.getRemoteDownloadNetworkProxyId() ); + remoteRepositoryConfiguration.setRemoteDownloadTimeout( remoteRepository.getRemoteDownloadTimeout() ); return remoteRepositoryConfiguration; } diff --git a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/remoteRepositoryForm.jspf b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/remoteRepositoryForm.jspf index 248fe987a..f5943f2c9 100644 --- a/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/remoteRepositoryForm.jspf +++ b/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/include/remoteRepositoryForm.jspf @@ -32,6 +32,7 @@ + -- 2.39.5