From ff06852acdea7695d44b926df0ee796197dfcda9 Mon Sep 17 00:00:00 2001 From: Olivier Lamy Date: Mon, 26 Sep 2011 20:33:46 +0000 Subject: [PATCH] [MRM-1524] downloading (optionnaly) remote index to display remote artifacts in search results : setup a default weekly schedule for download remote index git-svn-id: https://svn.apache.org/repos/asf/archiva/trunk@1176035 13f79535-47bb-0310-9956-ffa450edef68 --- .../src/main/mdo/configuration.mdo | 30 ++++++++++++------- .../admin/model/beans/AbstractRepository.java | 14 +-------- .../admin/model/beans/ManagedRepository.java | 17 ++++++++++- .../admin/model/beans/RemoteRepository.java | 16 ++++++++++ 4 files changed, 53 insertions(+), 24 deletions(-) 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 e312889e2..3e09cc077 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 @@ -403,16 +403,6 @@ default - - refreshCronExpression - 1.0.0+ - String - - When to run the refresh task. - Default is every hour - - 0 0 * * * ? - indexDir 1.0.0+ @@ -493,6 +483,16 @@ 60 + + refreshCronExpression + 1.4.0+ + String + + When to run the refresh task. + Default is every sunday at 8H00. + + 0 0 08 ? * SUN + downloadRemoteIndex 1.4.0+ @@ -562,6 +562,16 @@ True if this repository should be scanned and processed. true + + refreshCronExpression + 1.0.0+ + String + + When to run the refresh task. + Default is every hour + + 0 0 * * * ? + retentionCount 1.0.0+ diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/AbstractRepository.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/AbstractRepository.java index 4f7ab3656..ac48d5685 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/AbstractRepository.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/AbstractRepository.java @@ -34,10 +34,7 @@ public class AbstractRepository private String layout = "default"; - /** - * default model value - */ - private String cronExpression = "0 0 * * * ?"; + private String indexDirectory; @@ -83,15 +80,7 @@ public class AbstractRepository this.layout = layout; } - public String getCronExpression() - { - return cronExpression; - } - public void setCronExpression( String cronExpression ) - { - this.cronExpression = cronExpression; - } public String getIndexDirectory() { @@ -136,7 +125,6 @@ public class AbstractRepository sb.append( "{id='" ).append( id ).append( '\'' ); sb.append( ", name='" ).append( name ).append( '\'' ); sb.append( ", layout='" ).append( layout ).append( '\'' ); - sb.append( ", cronExpression='" ).append( cronExpression ).append( '\'' ); sb.append( ", indexDirectory='" ).append( indexDirectory ).append( '\'' ); sb.append( '}' ); return sb.toString(); diff --git a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/ManagedRepository.java b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/ManagedRepository.java index a399660c4..60ffc9bb5 100644 --- a/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/ManagedRepository.java +++ b/archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/ManagedRepository.java @@ -40,6 +40,11 @@ public class ManagedRepository private boolean blockRedeployments = false; + /** + * default model value hourly + */ + private String cronExpression = "0 0 * * * ?"; + /** * not need when creating the repo : only available when reading @@ -91,6 +96,16 @@ public class ManagedRepository this.resetStats = resetStats; } + public String getCronExpression() + { + return cronExpression; + } + + public void setCronExpression( String cronExpression ) + { + this.cronExpression = cronExpression; + } + public String getLocation() { return this.location; @@ -159,7 +174,6 @@ public class ManagedRepository } - public int getDaysOlder() { return daysOlder; @@ -220,6 +234,7 @@ public class ManagedRepository sb.append( ", snapshots=" ).append( snapshots ); sb.append( ", releases=" ).append( releases ); sb.append( ", blockRedeployments=" ).append( blockRedeployments ); + sb.append( ", cronExpression='" ).append( cronExpression ).append( '\'' ); sb.append( ", stagingRepository=" ).append( stagingRepository ); sb.append( ", scanned=" ).append( scanned ); sb.append( ", daysOlder=" ).append( daysOlder ); 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 668e07cde..60b72d612 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 @@ -52,6 +52,11 @@ public class RemoteRepository private String remoteDownloadNetworkProxyId; + /** + * default model value daily : every sunday at 8H00 + */ + private String cronExpression = "0 0 08 ? * SUN"; + public RemoteRepository() { @@ -144,6 +149,16 @@ public class RemoteRepository this.remoteDownloadNetworkProxyId = remoteDownloadNetworkProxyId; } + public String getCronExpression() + { + return cronExpression; + } + + public void setCronExpression( String cronExpression ) + { + this.cronExpression = cronExpression; + } + @Override public String toString() { @@ -157,6 +172,7 @@ public class RemoteRepository sb.append( ", downloadRemoteIndex=" ).append( downloadRemoteIndex ); sb.append( ", remoteIndexUrl='" ).append( remoteIndexUrl ).append( '\'' ); sb.append( ", remoteDownloadNetworkProxyId='" ).append( remoteDownloadNetworkProxyId ).append( '\'' ); + sb.append( ", cronExpression='" ).append( cronExpression ).append( '\'' ); sb.append( '}' ); return sb.toString(); } -- 2.39.5