]> source.dussan.org Git - archiva.git/commitdiff
git-svn-id: https://svn.apache.org/repos/asf/archiva/branches/archiva-MRM-1756@148853...
authorskygo <skygo@unknown>
Sat, 1 Jun 2013 14:40:42 +0000 (14:40 +0000)
committerskygo <skygo@unknown>
Sat, 1 Jun 2013 14:40:42 +0000 (14:40 +0000)
104 files changed:
archiva-modules/archiva-base/archiva-artifact-converter/pom.xml
archiva-modules/archiva-base/archiva-checksum/pom.xml
archiva-modules/archiva-base/archiva-common/pom.xml
archiva-modules/archiva-base/archiva-configuration/pom.xml
archiva-modules/archiva-base/archiva-configuration/src/main/mdo/configuration.mdo
archiva-modules/archiva-base/archiva-consumers/archiva-consumer-api/pom.xml
archiva-modules/archiva-base/archiva-consumers/archiva-consumer-archetype/pom.xml
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml
archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java
archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/pom.xml
archiva-modules/archiva-base/archiva-consumers/archiva-metadata-consumer/pom.xml
archiva-modules/archiva-base/archiva-consumers/archiva-signature-consumers/pom.xml
archiva-modules/archiva-base/archiva-consumers/pom.xml
archiva-modules/archiva-base/archiva-converter/pom.xml
archiva-modules/archiva-base/archiva-indexer/pom.xml
archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/DefaultIndexMerger.java
archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/IndexMerger.java
archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/IndexMergerRequest.java
archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/TemporaryGroupIndex.java
archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/archiva/indexer/merger/TemporaryGroupIndexCleaner.java
archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/archiva/indexer/search/mock/MockRepositorySessionFactory.java
archiva-modules/archiva-base/archiva-maven2-metadata/pom.xml
archiva-modules/archiva-base/archiva-maven2-model/pom.xml
archiva-modules/archiva-base/archiva-model/pom.xml
archiva-modules/archiva-base/archiva-plexus-bridge/pom.xml
archiva-modules/archiva-base/archiva-policies/pom.xml
archiva-modules/archiva-base/archiva-proxy-api/pom.xml
archiva-modules/archiva-base/archiva-proxy-common/pom.xml
archiva-modules/archiva-base/archiva-proxy/pom.xml
archiva-modules/archiva-base/archiva-proxy/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/pom.xml
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-api/src/main/java/org/apache/archiva/admin/model/beans/RepositoryGroup.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/pom.xml
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/main/java/org/apache/archiva/admin/repository/group/DefaultRepositoryGroupAdmin.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/mock/MockRepositorySessionFactory.java
archiva-modules/archiva-base/archiva-repository-admin/archiva-repository-admin-default/src/test/java/org/apache/archiva/admin/repository/group/RepositoryGroupAdminTest.java
archiva-modules/archiva-base/archiva-repository-admin/pom.xml
archiva-modules/archiva-base/archiva-repository-layer/pom.xml
archiva-modules/archiva-base/archiva-repository-scanner/pom.xml
archiva-modules/archiva-base/archiva-security-common/pom.xml
archiva-modules/archiva-base/archiva-test-utils/pom.xml
archiva-modules/archiva-base/archiva-transaction/pom.xml
archiva-modules/archiva-base/archiva-xml-tools/pom.xml
archiva-modules/archiva-base/pom.xml
archiva-modules/archiva-karaf/archiva-features/pom.xml
archiva-modules/archiva-karaf/pom.xml
archiva-modules/archiva-scheduler/archiva-scheduler-api/pom.xml
archiva-modules/archiva-scheduler/archiva-scheduler-indexing/pom.xml
archiva-modules/archiva-scheduler/archiva-scheduler-indexing/src/test/java/org/apache/archiva/scheduler/indexing/mock/MockRepositorySessionFactory.java
archiva-modules/archiva-scheduler/archiva-scheduler-repository-api/pom.xml
archiva-modules/archiva-scheduler/archiva-scheduler-repository/pom.xml
archiva-modules/archiva-scheduler/pom.xml
archiva-modules/archiva-web/archiva-rest/archiva-rest-api/pom.xml
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/pom.xml
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/main/java/org/apache/archiva/rest/services/DefaultRepositoryGroupService.java
archiva-modules/archiva-web/archiva-rest/archiva-rest-services/src/test/java/org/apache/archiva/rest/services/RepositoryGroupServiceTest.java
archiva-modules/archiva-web/archiva-rest/pom.xml
archiva-modules/archiva-web/archiva-rss/pom.xml
archiva-modules/archiva-web/archiva-rss/src/test/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessorTest.java
archiva-modules/archiva-web/archiva-security/pom.xml
archiva-modules/archiva-web/archiva-test-mocks/pom.xml
archiva-modules/archiva-web/archiva-web-common/pom.xml
archiva-modules/archiva-web/archiva-web-common/src/main/resources/org/apache/archiva/i18n/default.properties
archiva-modules/archiva-web/archiva-web-common/src/test/java/org/apache/archiva/webtest/memory/TestMetadataRepository.java
archiva-modules/archiva-web/archiva-webapp-test/pom.xml
archiva-modules/archiva-web/archiva-webapp/pom.xml
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/css/jqueryFileTree.css [changed mode: 0755->0644]
archiva-modules/archiva-web/archiva-webapp/src/main/webapp/js/templates/archiva/repositories.html
archiva-modules/archiva-web/archiva-webdav/pom.xml
archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/archiva/webdav/ArchivaDavResourceFactory.java
archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java
archiva-modules/archiva-web/pom.xml
archiva-modules/metadata/metadata-model-maven2/pom.xml
archiva-modules/metadata/metadata-model/pom.xml
archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/CiManagement.java
archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/Dependency.java
archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/IssueManagement.java
archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/License.java
archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/MailingList.java
archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/Organization.java
archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectMetadata.java
archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/ProjectVersionMetadata.java
archiva-modules/metadata/metadata-model/src/main/java/org/apache/archiva/metadata/model/Scm.java
archiva-modules/metadata/metadata-repository-api/pom.xml
archiva-modules/metadata/metadata-repository-api/src/main/java/org/apache/archiva/metadata/repository/MetadataRepository.java
archiva-modules/metadata/metadata-repository-api/src/test/java/org/apache/archiva/metadata/repository/AbstractMetadataRepositoryTest.java
archiva-modules/metadata/pom.xml
archiva-modules/metadata/test-repository/pom.xml
archiva-modules/plugins/audit/pom.xml
archiva-modules/plugins/generic-metadata-support/pom.xml
archiva-modules/plugins/maven1-repository/pom.xml
archiva-modules/plugins/maven2-repository/pom.xml
archiva-modules/plugins/maven2-repository/src/test/java/org/apache/archiva/metadata/repository/TestMetadataRepository.java
archiva-modules/plugins/metadata-store-file/pom.xml
archiva-modules/plugins/metadata-store-file/src/main/java/org/apache/archiva/metadata/repository/file/FileMetadataRepository.java
archiva-modules/plugins/metadata-store-jcr/pom.xml
archiva-modules/plugins/metadata-store-jcr/src/main/java/org/apache/archiva/metadata/repository/jcr/JcrMetadataRepository.java
archiva-modules/plugins/npanday-support/pom.xml
archiva-modules/plugins/pom.xml
archiva-modules/plugins/problem-reports/pom.xml
archiva-modules/plugins/repository-statistics/pom.xml
archiva-modules/plugins/repository-statistics/src/main/java/org/apache/archiva/metadata/repository/stats/DefaultRepositoryStatisticsManager.java
archiva-modules/plugins/stage-repository-merge/pom.xml
archiva-modules/pom.xml

index b1ce59a8553ce86c8f01477c38896ed19f1bf416..9268570f0a52403c685d2e948b7e2e845a91f540 100644 (file)
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-base</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-artifact-converter</artifactId>
   <packaging>bundle</packaging>
index 2d481976ab4ebdc7cfbbd8c1661e3e91b0fc327b..a85ccb0a255e1ab5d3f7e40b76831027286effb0 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-base</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-checksum</artifactId>
   <packaging>bundle</packaging>
index b9d57c26385935b290a10c01eda35b48b88d0b4e..ddfb44350a36ea764947efe81ed1c9301f872372 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-base</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>archiva-common</artifactId>
index 3068537d9decf5839480148a217ad3f77104c7b0..d253c77e48d743c6b46e62e40809275923f91be8 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-base</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>archiva-configuration</artifactId>
index 43b3838193fff2dc47b72f23390619f7ddd8d1ad..209e62b58a9c4f0b13548b3f4b664d4c26b2490c 100644 (file)
           <defaultValue>/.indexer</defaultValue>
           <description>The path of the merged index.</description>
         </field>
+        <field>
+          <name>mergedIndexTtl</name>
+          <version>1.4.0+</version>
+          <type>int</type>
+          <required>false</required>
+          <defaultValue>30</defaultValue>
+          <description>The time to live of the merged index of the repository group.</description>
+        </field>
         <field>
           <name>repositories</name>
           <version>1.2.0+</version>
index bdceddfa2d1ca22984476b2965c661cc05172729..92f8d12d9c7acf54ebb7b543b06cff4a5399ee45 100644 (file)
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-consumers</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-consumer-api</artifactId>
   <packaging>bundle</packaging>
index dd8cbd0e6fc9260a2367e4cebd3b589a82cee9a3..0e86f826394465a8de925200797d73def6345092 100644 (file)
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-consumers</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-consumer-archetype</artifactId>
   <packaging>maven-archetype</packaging>
index 5f3c2f63f599937c8cf749192197ccf5368f2668..03e67507778b1102bf618ce0c1997634be41ba56 100644 (file)
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-consumers</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-core-consumers</artifactId>
   <packaging>bundle</packaging>
index c07595bf9a57217bb55f414917db594d7cd24daa..c66af5f2df071fd7dd7b0a6e1e5cfbcf22ac9bdb 100644 (file)
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-consumers</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-lucene-consumers</artifactId>
   <packaging>bundle</packaging>
index 9b7d1bc025d81c435f94bd46d5d8c8d67a8df43c..6a2fab9f1f12802e8020c0a44d86584a58b562dc 100644 (file)
@@ -23,7 +23,7 @@
   <parent>
     <artifactId>archiva-consumers</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-metadata-consumer</artifactId>
   <packaging>bundle</packaging>
index b11a0e0a686624798c93c0d2b88bc3d1c081e1e3..97d2da29899b0c63322b18b7d047e7e31a0ced78 100644 (file)
@@ -20,7 +20,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-consumers</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
 
   <artifactId>archiva-signature-consumers</artifactId>
index 2de964ed6e4ccbf95644130dc0f3064ecc383259..de25d15e6d1bc2019c953107a488bb3a46ce1a34 100644 (file)
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-base</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
 
   <artifactId>archiva-consumers</artifactId>
index 180955a9ee46f318a1b84f1238d4e3a9d6fc74f4..098a46f9f0b358704f14d5de0f2075014f9d9227 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-base</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>archiva-converter</artifactId>
index 4070eb73cebb2ba4d4522b04e2b459f858fc7580..f5e34fe98832f23cb339d7748821698127842f29 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-base</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>archiva-indexer</artifactId>
index 77618be8bc19d0c3daed348c362c2db8e36cd2b7..4a53182f8f6ba8bc9c8c4aa2bd98cf97e3f050de 100644 (file)
@@ -19,6 +19,7 @@ package org.apache.archiva.indexer.merger;
  */
 
 import com.google.common.io.Files;
+
 import org.apache.archiva.admin.model.managed.ManagedRepositoryAdmin;
 import org.apache.archiva.common.plexusbridge.MavenIndexerUtils;
 import org.apache.archiva.common.plexusbridge.PlexusSisuBridge;
@@ -35,7 +36,6 @@ import org.slf4j.LoggerFactory;
 import org.springframework.scheduling.annotation.Async;
 import org.springframework.stereotype.Service;
 
-import javax.annotation.PostConstruct;
 import javax.inject.Inject;
 import java.io.File;
 import java.io.IOException;
@@ -70,8 +70,6 @@ public class DefaultIndexMerger
 
     private List<TemporaryGroupIndex> temporaryGroupIndexes = new CopyOnWriteArrayList<TemporaryGroupIndex>();
 
-    private int groupMergedIndexTtl;
-
     @Inject
     public DefaultIndexMerger( PlexusSisuBridge plexusSisuBridge, MavenIndexerUtils mavenIndexerUtils )
         throws PlexusSisuBridgeException
@@ -81,12 +79,6 @@ public class DefaultIndexMerger
         indexPacker = plexusSisuBridge.lookup( IndexPacker.class, "default" );
     }
 
-    @PostConstruct
-    public void intialize()
-    {
-        this.groupMergedIndexTtl = Integer.getInteger( IndexMerger.TMP_GROUP_INDEX_SYS_KEY, DEFAULT_GROUP_INDEX_TTL );
-    }
-
     public IndexingContext buildMergedIndex( IndexMergerRequest indexMergerRequest )
         throws IndexMergerException
     {
@@ -122,7 +114,7 @@ public class DefaultIndexMerger
                 indexPacker.packIndex( request );
             }
             temporaryGroupIndexes.add(
-                new TemporaryGroupIndex( tempRepoFile, tempRepoId, indexMergerRequest.getGroupId() ) );
+                new TemporaryGroupIndex( tempRepoFile, tempRepoId, indexMergerRequest.getGroupId(), indexMergerRequest.getMergedIndexTtl() ) );
             stopWatch.stop();
             log.info( "merged index for repos {} in {} s", indexMergerRequest.getRepositoriesIds(),
                       stopWatch.getTime() );
@@ -170,9 +162,4 @@ public class DefaultIndexMerger
     {
         return this.temporaryGroupIndexes;
     }
-
-    public int getGroupMergedIndexTtl()
-    {
-        return this.groupMergedIndexTtl;
-    }
 }
index 462c3e4a1837233fe7978757464c61a5c7d1ab0f..756819e4f7d0735aebde790470c31f57bd005146 100644 (file)
@@ -28,12 +28,6 @@ import java.util.Collection;
  */
 public interface IndexMerger
 {
-
-    /**
-     * system property which contains the value in s for ttl of temporary index groups
-     */
-    String TMP_GROUP_INDEX_SYS_KEY = "archiva.tmp.group.index.ttl";
-
     /**
      * @param indexMergerRequest
      * @return a temporary directory with a merge index (directory marked deleteOnExit)
@@ -45,10 +39,4 @@ public interface IndexMerger
     void cleanTemporaryGroupIndex( TemporaryGroupIndex temporaryGroupIndex );
 
     Collection<TemporaryGroupIndex> getTemporaryGroupIndexes();
-
-    /**
-     * @return ttl of temporay group index
-     */
-    int getGroupMergedIndexTtl();
-
 }
index 76d238fd2885646f8fced76750250a16c543ed3c..a7a3b656f6692209035f038620cd56ab9bd39376 100644 (file)
@@ -42,6 +42,8 @@ public class IndexMergerRequest
 
     private String mergedIndexPath = "/.indexer";
 
+    private int mergedIndexTtl;
+
     public IndexMergerRequest( Collection<String> repositoriesIds, boolean packIndex, String groupId )
     {
         this.repositoriesIds = repositoriesIds;
@@ -52,13 +54,14 @@ public class IndexMergerRequest
     /**
      * @since 1.4-M4
      */
-    public IndexMergerRequest( Collection<String> repositoriesIds, boolean packIndex, String groupId,
-                               String mergedIndexPath )
+    public IndexMergerRequest(Collection<String> repositoriesIds, boolean packIndex, String groupId,
+                              String mergedIndexPath, int mergedIndexTtl)
     {
         this.repositoriesIds = repositoriesIds;
         this.packIndex = packIndex;
         this.groupId = groupId;
         this.mergedIndexPath = mergedIndexPath;
+        this.mergedIndexTtl = mergedIndexTtl;
     }
 
     public Collection<String> getRepositoriesIds()
@@ -101,6 +104,14 @@ public class IndexMergerRequest
         this.mergedIndexPath = mergedIndexPath;
     }
 
+    public int getMergedIndexTtl() {
+        return mergedIndexTtl;
+    }
+
+    public void setMergedIndexTtl(int mergedIndexTtl) {
+        this.mergedIndexTtl = mergedIndexTtl;
+    }
+
     @Override
     public String toString()
     {
@@ -109,6 +120,7 @@ public class IndexMergerRequest
         sb.append( ", packIndex=" ).append( packIndex );
         sb.append( ", groupId='" ).append( groupId ).append( '\'' );
         sb.append( ", mergedIndexPath='" ).append( mergedIndexPath ).append( '\'' );
+        sb.append( ", mergedIndexTtl='" ).append( mergedIndexTtl ).append( '\'' );
         sb.append( '}' );
         return sb.toString();
     }
index 9152160b0f82f69283c09ee3e893e79a11bb7c94..9ab06d6478c8f13eae5402ed9c46b855016086b4 100644 (file)
@@ -36,11 +36,14 @@ public class TemporaryGroupIndex
 
     private String groupId;
 
-    public TemporaryGroupIndex( File directory, String indexId, String groupId )
+    private int mergedIndexTtl;
+
+    public TemporaryGroupIndex(File directory, String indexId, String groupId, int mergedIndexTtl)
     {
         this.directory = directory;
         this.indexId = indexId;
         this.groupId = groupId;
+        this.mergedIndexTtl = mergedIndexTtl;
     }
 
     public long getCreationTime()
@@ -86,6 +89,14 @@ public class TemporaryGroupIndex
         this.groupId = groupId;
     }
 
+    public int getMergedIndexTtl() {
+        return mergedIndexTtl;
+    }
+
+    public void setMergedIndexTtl(int mergedIndexTtl) {
+        this.mergedIndexTtl = mergedIndexTtl;
+    }
+
     @Override
     public int hashCode()
     {
index e34b24991992496956b617ecc13a545b23f3f1d2..322d82e06102229539d7e8f833d528d3cfa39601 100644 (file)
@@ -58,7 +58,7 @@ public class TemporaryGroupIndexCleaner
         for ( TemporaryGroupIndex temporaryGroupIndex : indexMerger.getTemporaryGroupIndexes() )
         {
             // cleanup files older than the ttl
-            if ( new Date().getTime() - temporaryGroupIndex.getCreationTime() > indexMerger.getGroupMergedIndexTtl() )
+            if ( new Date().getTime() - temporaryGroupIndex.getCreationTime() > temporaryGroupIndex.getMergedIndexTtl() )
             {
                 log.info( "cleanTemporaryIndex for groupId {}", temporaryGroupIndex.getGroupId() );
                 indexMerger.cleanTemporaryGroupIndex( temporaryGroupIndex );
index 66838594bd81cb1a132d37e456eb65f5b0f540c7..2acbcb57c5ad88680dcd4da6e1ead23f2d72309a 100644 (file)
@@ -256,7 +256,7 @@ public class MockRepositorySessionFactory
                         return false;  //To change body of implemented methods use File | Settings | File Templates.
                     }
 
-                    public Object obtainAccess( Class<?> aClass )
+                    public <T>T obtainAccess( Class<T> aClass )
                     {
                         return null;  //To change body of implemented methods use File | Settings | File Templates.
                     }
index 5584d802d51e0f0693eb22457abdbe99da6e969e..bc322bc035618bbefa466cfceb305150c3fccaa0 100644 (file)
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-base</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
 
   <artifactId>archiva-maven2-metadata</artifactId>
-  <version>1.4-M4-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <name>Archiva Base :: Maven 2 Metadata</name>
index 6c5e176625ef685761477952861955b7f779ed7e..f97271731e6b79ad99ddc7f8506ff2f9df5572e5 100644 (file)
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-base</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
 
   <artifactId>archiva-maven2-model</artifactId>
-  <version>1.4-M4-SNAPSHOT</version>
   <packaging>bundle</packaging>
 
   <name>Archiva Base :: Maven 2 Model</name>
index a13aec64258538d3d52350b4cb518c7bdc4de381..dad15c4b85ec72a927f59afb37a5b0969d502322 100755 (executable)
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-base</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>archiva-model</artifactId>
index 339c95c706a8980348202d568c190f469988d0b6..8acffe4cc6f09416bdd3d21d808f0a3722cf64a9 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-base</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>archiva-plexus-bridge</artifactId>
index 4716fb244f5718049c33528574fac11e02711bad..919b140acaf51ea1129b00ed87e92d3beaa24d15 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-base</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>archiva-policies</artifactId>
index f729a39463674177f3ac7f398039c021b20643e2..52ee68c2ee5c3ea8001954c1d6ba2c9986cf8bb6 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>archiva-base</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-proxy-api</artifactId>
   <packaging>bundle</packaging>
index cc3285a0e7aca8743ab243296b76c401c5cb7a04..62c9573993467ee23b59aa4723f65040c5536093 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>archiva-base</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-proxy-common</artifactId>
   <packaging>bundle</packaging>
index 2c0b469981f514d9e19199fe9e734e3ea814f561..fd661ac1cfcbac5a4c2226fa95c9704b3ab13a4a 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-base</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>archiva-proxy</artifactId>
index d7c52cea3a5c8d021cbb99532969bc3ba42a2f8b..533951968c53005e95458caee590bd39e057dee3 100644 (file)
@@ -178,7 +178,7 @@ public class TestMetadataRepository
         return false;
     }
 
-    public Object obtainAccess( Class<?> aClass )
+    public <T>T obtainAccess( Class<T> aClass )
     {
         return null;  //To change body of implemented methods use File | Settings | File Templates.
     }
index 8ecfc6ffd1ff38df9e822a0c58518c561ddad0de..66a0b7fda4bae7a6403dd93996ad04a0b815e129 100644 (file)
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-repository-admin</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-repository-admin-api</artifactId>
   <packaging>bundle</packaging>
index 371e7d488f8bed11223297d76970699fa3837f01..047724dbeb6f04cb42f62b67ff65b969b83521c3 100644 (file)
@@ -46,6 +46,11 @@ public class RepositoryGroup
      */
     private String mergedIndexPath = "/.indexer";
 
+    /**
+     * The TTL (time to live) of the repo group's merged index.
+     */
+    private int mergedIndexTtl = 30;
+
     public RepositoryGroup()
     {
         // no op
@@ -132,12 +137,29 @@ public class RepositoryGroup
         this.mergedIndexPath = mergedIndexPath;
     }
 
-    public RepositoryGroup mergedIndexPath( String mergedIndexPath )
-    {
+    public int getMergedIndexTtl() {
+        return mergedIndexTtl;
+    }
+
+    /**
+     * Set the TTL of the repo group's merged index.
+     *
+     * @param mergedIndexTtl
+     */
+    public void setMergedIndexTtl(int mergedIndexTtl) {
+        this.mergedIndexTtl = mergedIndexTtl;
+    }
+
+    public RepositoryGroup mergedIndexPath( String mergedIndexPath ) {
         this.mergedIndexPath = mergedIndexPath;
         return this;
     }
 
+    public RepositoryGroup mergedIndexTtl( int mergedIndexTtl ) {
+        this.mergedIndexTtl = mergedIndexTtl;
+        return this;
+    }
+
     public boolean equals( Object other )
     {
         if ( this == other )
index 168b02209ce8f10c1ec7ab41af76597224ca6aaa..ee4b42c67bf7c2c6d75e3a92b7d6b40f3153431b 100644 (file)
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-repository-admin</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-repository-admin-default</artifactId>
   <packaging>bundle</packaging>
index 047b8494b19a583c656048d5584411c7afadc99f..ef43c104233260a629c83e78ff0e833863fcb3e4 100644 (file)
@@ -68,7 +68,7 @@ public class DefaultRepositoryGroupAdmin
         {
             repositoriesGroups.add( new RepositoryGroup( repositoryGroupConfiguration.getId(), new ArrayList<String>(
                 repositoryGroupConfiguration.getRepositories() ) ).mergedIndexPath(
-                repositoryGroupConfiguration.getMergedIndexPath() ) );
+                repositoryGroupConfiguration.getMergedIndexPath() ).mergedIndexTtl( repositoryGroupConfiguration.getMergedIndexTtl() ) );
         }
 
         return repositoriesGroups;
@@ -93,10 +93,12 @@ public class DefaultRepositoryGroupAdmin
     {
         validateRepositoryGroup( repositoryGroup, false );
         validateManagedRepositoriesExists( repositoryGroup.getRepositories() );
+
         RepositoryGroupConfiguration repositoryGroupConfiguration = new RepositoryGroupConfiguration();
         repositoryGroupConfiguration.setId( repositoryGroup.getId() );
         repositoryGroupConfiguration.setRepositories( repositoryGroup.getRepositories() );
         repositoryGroupConfiguration.setMergedIndexPath( repositoryGroup.getMergedIndexPath() );
+        repositoryGroupConfiguration.setMergedIndexTtl( repositoryGroup.getMergedIndexTtl() );
         Configuration configuration = getArchivaConfiguration().getConfiguration();
         configuration.addRepositoryGroup( repositoryGroupConfiguration );
         saveConfiguration( configuration );
@@ -141,6 +143,7 @@ public class DefaultRepositoryGroupAdmin
 
         repositoryGroupConfiguration.setRepositories( repositoryGroup.getRepositories() );
         repositoryGroupConfiguration.setMergedIndexPath( repositoryGroup.getMergedIndexPath() );
+        repositoryGroupConfiguration.setMergedIndexTtl( repositoryGroup.getMergedIndexTtl() );
         configuration.addRepositoryGroup( repositoryGroupConfiguration );
 
         saveConfiguration( configuration );
@@ -282,6 +285,11 @@ public class DefaultRepositoryGroupAdmin
                 "Invalid character(s) found in identifier. Only the following characters are allowed: alphanumeric, '.', '-' and '_'" );
         }
 
+        if ( repositoryGroup.getMergedIndexTtl() <= 0)
+        {
+            throw new RepositoryAdminException( "Merged Index TTL must be greater than 0." );
+        }
+
         Configuration configuration = getArchivaConfiguration().getConfiguration();
 
         if ( configuration.getRepositoryGroupsAsMap().containsKey( repoGroupId ) )
index c594a9e75bbc3dc5d65c980e67bce14bead7ab67..7be9d6cb7ca7b8eec881ea593967f8312589b005 100644 (file)
@@ -256,7 +256,7 @@ public class MockRepositorySessionFactory
                         return false;  //To change body of implemented methods use File | Settings | File Templates.
                     }
 
-                    public Object obtainAccess( Class<?> aClass )
+                    public <T>T obtainAccess( Class<T> aClass )
                     {
                         return null;  //To change body of implemented methods use File | Settings | File Templates.
                     }
index 84135d4d84f0367be2d923f655aa4fd4276843d0..a79d724d08d3cdea386d45141b0baeb084d70701 100644 (file)
@@ -18,6 +18,7 @@ package org.apache.archiva.admin.repository.group;
  * under the License.
  */
 
+import org.apache.archiva.admin.model.RepositoryAdminException;
 import org.apache.archiva.admin.model.beans.ManagedRepository;
 import org.apache.archiva.admin.model.beans.RepositoryGroup;
 import org.apache.archiva.admin.model.group.RepositoryGroupAdmin;
@@ -67,6 +68,10 @@ public class RepositoryGroupAdminTest
             assertEquals( Arrays.asList( "test-new-one", "test-new-two" ),
                           repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories() );
 
+            // verify if default values were saved
+            assertEquals(30, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getMergedIndexTtl() );
+            assertEquals("/.indexer", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getMergedIndexPath() );
+
             repositoryGroupAdmin.deleteRepositoryGroup( "repo-group-one", getFakeAuditInformation() );
 
             assertEquals( 0, repositoryGroupAdmin.getRepositoriesGroups().size() );
@@ -100,7 +105,8 @@ public class RepositoryGroupAdminTest
 
             managedRepositoryAdmin.addManagedRepository( managedRepositoryTwo, false, getFakeAuditInformation() );
 
-            RepositoryGroup repositoryGroup = new RepositoryGroup( "repo-group-one", Arrays.asList( "test-new-one" ) );
+            RepositoryGroup repositoryGroup = new RepositoryGroup( "repo-group-one", Arrays.asList( "test-new-one" ) )
+                    .mergedIndexTtl( 20 ).mergedIndexPath( "/.nonDefaultPath" );
 
             mockAuditListener.clearEvents();
 
@@ -111,6 +117,8 @@ public class RepositoryGroupAdminTest
             assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories().size() );
             assertEquals( Arrays.asList( "test-new-one" ),
                           repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories() );
+            assertEquals( 20, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getMergedIndexTtl() );
+            assertEquals( "/.nonDefaultPath", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getMergedIndexPath() );
 
             repositoryGroup = repositoryGroupAdmin.getRepositoryGroup( "repo-group-one" );
             assertNotNull( repositoryGroup );
@@ -143,9 +151,8 @@ public class RepositoryGroupAdminTest
         }
     }
 
-
     @Test
-    public void addAndDeleteGroupWithRemowingManagedRepo()
+    public void addAndDeleteGroupWithRemovedManagedRepo()
         throws Exception
     {
         try
@@ -199,4 +206,78 @@ public class RepositoryGroupAdminTest
             managedRepositoryAdmin.deleteManagedRepository( "test-new-two", getFakeAuditInformation(), true );
         }
     }
+
+    @Test( expected = RepositoryAdminException.class )
+    public void testAddGroupWithInvalidMergedIndexTtl() throws Exception {
+        try {
+            ManagedRepository managedRepositoryOne =
+                    getTestManagedRepository( "test-new-one", APPSERVER_BASE_PATH + File.separator + "test-new-one" );
+
+            ManagedRepository managedRepositoryTwo =
+                    getTestManagedRepository( "test-new-two", APPSERVER_BASE_PATH + File.separator + "test-new-two" );
+
+            managedRepositoryAdmin.addManagedRepository( managedRepositoryOne, false, getFakeAuditInformation() );
+
+            managedRepositoryAdmin.addManagedRepository( managedRepositoryTwo, false, getFakeAuditInformation() );
+
+            RepositoryGroup repositoryGroup =
+                    new RepositoryGroup( "repo-group-one", Arrays.asList( "test-new-one", "test-new-two" ) )
+                    .mergedIndexTtl( -1 );
+
+            mockAuditListener.clearEvents();
+
+            repositoryGroupAdmin.addRepositoryGroup( repositoryGroup, getFakeAuditInformation() );
+        }
+        finally
+        {
+            mockAuditListener.clearEvents();
+            managedRepositoryAdmin.deleteManagedRepository( "test-new-one", getFakeAuditInformation(), true );
+            managedRepositoryAdmin.deleteManagedRepository( "test-new-two", getFakeAuditInformation(), true );
+        }
+    }
+
+    @Test( expected = RepositoryAdminException.class )
+    public void testAddAndUpdateGroupWithInvalidMergedIndexTtl() throws Exception {
+        try {
+            ManagedRepository managedRepositoryOne =
+                    getTestManagedRepository( "test-new-one", APPSERVER_BASE_PATH + File.separator + "test-new-one" );
+
+            ManagedRepository managedRepositoryTwo =
+                    getTestManagedRepository( "test-new-two", APPSERVER_BASE_PATH + File.separator + "test-new-two" );
+
+            managedRepositoryAdmin.addManagedRepository( managedRepositoryOne, false, getFakeAuditInformation() );
+
+            managedRepositoryAdmin.addManagedRepository( managedRepositoryTwo, false, getFakeAuditInformation() );
+
+            RepositoryGroup repositoryGroup =
+                    new RepositoryGroup( "repo-group-one", Arrays.asList( "test-new-one", "test-new-two" ) );
+
+            mockAuditListener.clearEvents();
+
+            repositoryGroupAdmin.addRepositoryGroup( repositoryGroup, getFakeAuditInformation() );
+
+            assertEquals( 1, repositoryGroupAdmin.getRepositoriesGroups().size() );
+            assertEquals( "repo-group-one", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getId() );
+            assertEquals( 2, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories().size() );
+            assertEquals( Arrays.asList( "test-new-one", "test-new-two" ),
+                    repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getRepositories() );
+
+            // verify if default values were saved
+            assertEquals(30, repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getMergedIndexTtl() );
+            assertEquals("/.indexer", repositoryGroupAdmin.getRepositoriesGroups().get( 0 ).getMergedIndexPath() );
+
+            repositoryGroup = repositoryGroupAdmin.getRepositoryGroup( "repo-group-one" );
+            assertNotNull( repositoryGroup );
+
+            repositoryGroup.mergedIndexTtl( -1 );
+
+            repositoryGroupAdmin.updateRepositoryGroup( repositoryGroup, getFakeAuditInformation() );
+        }
+        finally
+        {
+            mockAuditListener.clearEvents();
+            managedRepositoryAdmin.deleteManagedRepository( "test-new-one", getFakeAuditInformation(), true );
+            managedRepositoryAdmin.deleteManagedRepository( "test-new-two", getFakeAuditInformation(), true );
+        }
+    }
 }
index c92cae4e6f5f76fc150519df30a4337acb6de259..c531fd05bcb2acbad43953b8e8f4e15aada92f60 100644 (file)
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-base</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-repository-admin</artifactId>
   <name>Archiva Base :: Repository Admin</name>
index 7571ad42cf0e220b1e2ec6148b7c20b58836df55..46c6dc6c7fb63aa8d038374cdee6111dceed9a14 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-base</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>archiva-repository-layer</artifactId>
index 48c45607c6e9dbc2f62c0c29dc6c570ea74f3ceb..a33e050cad22849d2b865152b3dc03da3528d492 100644 (file)
@@ -23,7 +23,7 @@
   <parent>
     <artifactId>archiva-base</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-repository-scanner</artifactId>
   <packaging>bundle</packaging>
index 5381565c30001a56b34617627a355a5323dcf416..b5428aaf1d239abd10308fa3c36d13db48be7592 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>archiva-base</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <groupId>org.apache.archiva</groupId>
   <artifactId>archiva-security-common</artifactId>
index 5f8b149b2a1b44774b4c4107aa374b3a572a7d1b..78f221ee454097913d2a9c90a8ef434434e0b3dd 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>archiva-base</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>archiva-test-utils</artifactId>
index 832b7610b8b63a944d1be2385152028e011a3480..6b40cb60df0c21081638cbd255e3ede9e0c7c69b 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-base</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-transaction</artifactId>
   <packaging>bundle</packaging>
index 1b726e4e63195facd64c9a918e241829f3bc9146..67ffd959c54db0a750008f6d2da28d5a7fea48d0 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-base</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>archiva-xml-tools</artifactId>
index 10b001b7c7975dcaeb30e6acde815000510add56..a9ce3f587a0d78ef003c7da1f6135244fe318fbe 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-modules</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
 
   <artifactId>archiva-base</artifactId>
index e27bbe35078cab090c11643acbcaa96ecf789859..f3b0b115545f6137f9cd849654b1863909b15125 100644 (file)
@@ -21,7 +21,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-karaf</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <groupId>org.apache.archiva.karaf</groupId>
index 754ad00a9ebc612f38c923e957a2564db5653c23..81bcd589fe9e007b430780e6a3721342b52144ab 100644 (file)
@@ -21,7 +21,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-modules</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>archiva-karaf</artifactId>
index 2208c09205fa0cc4fd94746b625c2badd0147c2c..13befbf6e51d60f49cdd79a6dad60f8e642fd805 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>archiva-scheduler</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-scheduler-api</artifactId>
   <packaging>bundle</packaging>
index 986217a750a0975eab07b74e86e3094432988dc1..4cbdfb7a442beb8b17721468b89ee9ff62bece04 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>archiva-scheduler</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-scheduler-indexing</artifactId>
   <packaging>bundle</packaging>
index a42b6aedad15a6fc42a3621ae067f8bece17e186..85c01299aba69b9c2161bbbe0093987f031f535c 100644 (file)
@@ -256,7 +256,7 @@ public class MockRepositorySessionFactory
                         return false;  //To change body of implemented methods use File | Settings | File Templates.
                     }
 
-                    public Object obtainAccess( Class<?> aClass )
+                    public <T>T obtainAccess( Class<T> aClass )
                     {
                         return null;  //To change body of implemented methods use File | Settings | File Templates.
                     }
index 989c4d180443297a78fffaee208ec135c3b0653b..eee6c41707cbb7ea12ad3eb81371dcda82f25a81 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>archiva-scheduler</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-scheduler-repository-api</artifactId>
   <packaging>bundle</packaging>
index 4ddd92dd062e3b44569291e09039542a6a3c9ebf..e93e553a02d49ce4fa9c36e5a46ee42f5ba39e60 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>archiva-scheduler</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-scheduler-repository</artifactId>
   <packaging>bundle</packaging>
index df0fe72890c46a0252b32291d10f86f1d47ddce8..95ea815ddd9af8150daea5415293f64b89023041 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-modules</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>archiva-scheduler</artifactId>
index effc430c06b2b421842e8b56f6265eddc02fd9aa..84091a80c931b51528965c15e137c867a16c4713 100644 (file)
   ~ specific language governing permissions and limitations
   ~ under the License.
   -->
-<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
-         xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
+<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
   <modelVersion>4.0.0</modelVersion>
   <parent>
     <artifactId>archiva-rest</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-rest-api</artifactId>
   <!-- DO NOT USE bundle packaging generated documentation is not included in the jar !!! -->
index a89d66cbe6fcada4dd98f203234e8e35daa8bdd9..9c47799b23ae9a6b770733134fc54bca87a0ba99 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-rest</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-rest-services</artifactId>
   <packaging>bundle</packaging>
index 4b1882bb49c032f3da355bc597f970b66c884c57..1b57591014d6d7bec9ba8e2f7514fa53a8376f34 100644 (file)
@@ -52,7 +52,8 @@ public class DefaultRepositoryGroupService
             for ( org.apache.archiva.admin.model.beans.RepositoryGroup repoGroup : repositoryGroupAdmin.getRepositoriesGroups() )
             {
                 repositoriesGroups.add( new RepositoryGroup( repoGroup.getId(), new ArrayList<String>(
-                    repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() ) );
+                    repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() )
+                        .mergedIndexTtl( repoGroup.getMergedIndexTtl() ) );
             }
             return repositoriesGroups;
         }
@@ -82,8 +83,8 @@ public class DefaultRepositoryGroupService
         {
             return repositoryGroupAdmin.addRepositoryGroup(
                 new org.apache.archiva.admin.model.beans.RepositoryGroup( repoGroup.getId(), new ArrayList<String>(
-                    repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() ),
-                getAuditInformation() );
+                    repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() )
+                    .mergedIndexTtl( repoGroup.getMergedIndexTtl() ), getAuditInformation() );
         }
         catch ( RepositoryAdminException e )
         {
@@ -98,8 +99,8 @@ public class DefaultRepositoryGroupService
         {
             return repositoryGroupAdmin.updateRepositoryGroup(
                 new org.apache.archiva.admin.model.beans.RepositoryGroup( repoGroup.getId(), new ArrayList<String>(
-                    repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() ),
-                getAuditInformation() );
+                    repoGroup.getRepositories() ) ).mergedIndexPath( repoGroup.getMergedIndexPath() )
+                    .mergedIndexTtl( repoGroup.getMergedIndexTtl() ), getAuditInformation() );
         }
         catch ( RepositoryAdminException e )
         {
index c872d82682ee760bd5e9a7eaf0e1003ce0400208..0175058596e5641015991d118ba210151e8383ca 100644 (file)
@@ -51,11 +51,13 @@ public class RepositoryGroupServiceTest
 
         managedRepositoriesService.addManagedRepository( managedRepository );
 
-        RepositoryGroup repositoryGroup = new RepositoryGroup( "one", Arrays.asList( managedRepository.getId() ) );
+        RepositoryGroup repositoryGroup = new RepositoryGroup( "one", Arrays.asList( managedRepository.getId() ) )
+                .mergedIndexTtl( 40 );
 
         service.addRepositoryGroup( repositoryGroup );
         assertFalse( service.getRepositoriesGroups().isEmpty() );
         assertEquals( 1, service.getRepositoriesGroups().size() );
+        assertEquals( 40, service.getRepositoriesGroups().get(0).getMergedIndexTtl() );
 
         service.deleteRepositoryGroup( "one" );
 
index 42a2ad366a9286178038955d9dbd86052fad900f..d442f3c974e35aa7b8b3cc2d298f42fa170ad057 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-web</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-rest</artifactId>
   <name>Archiva Web :: REST support</name>
index c5381d5241acefedfe60d30095d69093ce97ac91..cb020f532da1de20f8de726c037c3d92fd695a55 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>archiva-web</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>archiva-rss</artifactId>
index b6f25bec574a0d5713519692670dd9419fdfcd91..a83f383019f117b557f880d28cfc8d25e09697e8 100644 (file)
@@ -250,7 +250,7 @@ public class NewArtifactsRssFeedProcessorTest
             return false;
         }
 
-        public Object obtainAccess( Class<?> aClass )
+        public <T>T obtainAccess( Class<T> aClass )
         {
             throw new UnsupportedOperationException();
         }
index 7e7ecfe1e37702cd611b96771f6587a8c03eaf18..ccb2f31d2d0dca9149b69660877b73fb6953735f 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-web</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>archiva-security</artifactId>
index 47efd89f9d59e41828d463d10135c956b0164c43..41e92218c303e2f457334bc37d0680588ba46083 100644 (file)
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-web</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
 
   <artifactId>archiva-test-mocks</artifactId>
-  <version>1.4-M4-SNAPSHOT</version>
 
   <name>Archiva Web :: Tests Mocks</name>
 
index 5ef279dd28a948c01c59ccfa0ade48f548e384a5..aff3b8f712e48b7b3ae708a5f5a24573a6d7ff82 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-web</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
 
   <artifactId>archiva-web-common</artifactId>
index c528c028b8c55c0737c1576d1f5b86c2bac60159..c2f9f35b7911e4c1cc5c84fc00f5d8a617e89a79 100644 (file)
@@ -312,6 +312,7 @@ repository.groups.list=Repository Groups
 repository-groups.grid.tab.title=Repository Groups
 repository.group.delete.confirm=Are you sure to delete Repository Group {0} ?
 repository.group.mergedIndexPath=Merged Index Path
+repository.group.mergedIndexTtl=Merged Index Time to Live (in Minutes)
 
 #roles
 roles.bulk.save.confirm=Are you sure to update {0} Role(s)
index 02d428515719726a32d22f2f492bd97f6f9f93fa..8f9fc13bdba2e7c07604f508f8a23893de8e2f5f 100644 (file)
@@ -220,7 +220,7 @@ public class TestMetadataRepository
         return false;
     }
 
-    public Object obtainAccess( Class<?> aClass )
+    public <T>T obtainAccess( Class<T> aClass )
     {
         return null;
     }
index a4a54e996f8a92e3b615dde39036898f507287c8..4e6192d4af84073c45f67ddbb86f773c19969be1 100644 (file)
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-web</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-webapp-test</artifactId>
   <packaging>pom</packaging>
index 7707630fe2c1f25193d414591fed0f134b2ad56e..614ad32a1ebb09ef219be978899cabdc0707e3a2 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-web</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>archiva-webapp</artifactId>
   <packaging>war</packaging>
             <archiva.devMode>${archiva.devMode}</archiva.devMode>
             <archiva.javascriptLog>${archiva.javascriptLog}</archiva.javascriptLog>
             <archiva.logMissingI18n>${archiva.logMissingI18n}</archiva.logMissingI18n>
-            <archiva.tmp.group.index.ttl>${archiva.groupIndexTtl}</archiva.tmp.group.index.ttl>
             <!--
             not needed as we use asyncLogger in configuration
             <Log4jContextSelector>org.apache.logging.log4j.core.async.AsyncLoggerContextSelector</Log4jContextSelector>
old mode 100755 (executable)
new mode 100644 (file)
index 073d1fd..b28dfc0
@@ -1,91 +1,91 @@
-UL.jqueryFileTree {\r
-       font-family: Verdana, sans-serif;\r
-       font-size: 11px;\r
-       line-height: 18px;\r
-       padding: 0px;\r
-       margin: 0px;\r
-}\r
-\r
-UL.jqueryFileTree LI {\r
-       list-style: none;\r
-       padding: 0px;\r
-       padding-left: 20px;\r
-       margin: 0px;\r
-       white-space: nowrap;\r
-}\r
-\r
-UL.jqueryFileTree A {\r
-       color: #333;\r
-       text-decoration: none;\r
-       display: block;\r
-       padding: 0px 2px;\r
-}\r
-\r
-UL.jqueryFileTree A:hover {\r
-       background: #BDF;\r
-}\r
-\r
-/* Core Styles */\r
-.jqueryFileTree LI.directory { background: url(images/folder-closed.gif) left top no-repeat; }\r
-.jqueryFileTree LI.expanded { background: url(images/folder.gif) left top no-repeat; }\r
-.jqueryFileTree LI.file { background: url(images/file.png) left top no-repeat; }\r
-.jqueryFileTree LI.wait { background: url(images/spinner.gif) left top no-repeat; }\r
-/* File Extensions*/\r
-.jqueryFileTree LI.ext_3gp { background: url(images/film.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_afp { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_afpa { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_asp { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_aspx { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_avi { background: url(images/film.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_bat { background: url(images/application.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_bmp { background: url(images/picture.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_c { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_cfm { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_cgi { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_com { background: url(images/application.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_cpp { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_css { background: url(images/css.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_doc { background: url(images/doc.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_exe { background: url(images/application.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_gif { background: url(images/picture.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_fla { background: url(images/flash.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_h { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_htm { background: url(images/html.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_html { background: url(images/html.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_jar { background: url(images/java.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_jpg { background: url(images/picture.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_jpeg { background: url(images/picture.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_js { background: url(images/script.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_lasso { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_log { background: url(images/txt.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_m4p { background: url(images/music.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_mov { background: url(images/film.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_mp3 { background: url(images/music.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_mp4 { background: url(images/film.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_mpg { background: url(images/film.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_mpeg { background: url(images/film.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_ogg { background: url(images/music.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_pcx { background: url(images/picture.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_pdf { background: url(images/pdf.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_php { background: url(images/php.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_png { background: url(images/picture.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_ppt { background: url(images/ppt.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_psd { background: url(images/psd.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_pl { background: url(images/script.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_py { background: url(images/script.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_rb { background: url(images/ruby.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_rbx { background: url(images/ruby.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_rhtml { background: url(images/ruby.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_rpm { background: url(images/linux.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_ruby { background: url(images/ruby.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_sql { background: url(images/db.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_swf { background: url(images/flash.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_tif { background: url(images/picture.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_tiff { background: url(images/picture.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_txt { background: url(images/txt.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_vb { background: url(images/code.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_wav { background: url(images/music.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_wmv { background: url(images/film.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_xls { background: url(images/xls.png) left top no-repeat; }\r
-.jqueryFileTree LI.ext_xml { background: url(images/code.png) left top no-repeat; }\r
+UL.jqueryFileTree {
+       font-family: Verdana, sans-serif;
+       font-size: 11px;
+       line-height: 18px;
+       padding: 0px;
+       margin: 0px;
+}
+
+UL.jqueryFileTree LI {
+       list-style: none;
+       padding: 0px;
+       padding-left: 20px;
+       margin: 0px;
+       white-space: nowrap;
+}
+
+UL.jqueryFileTree A {
+       color: #333;
+       text-decoration: none;
+       display: block;
+       padding: 0px 2px;
+}
+
+UL.jqueryFileTree A:hover {
+       background: #BDF;
+}
+
+/* Core Styles */
+.jqueryFileTree LI.directory { background: url(images/folder-closed.gif) left top no-repeat; }
+.jqueryFileTree LI.expanded { background: url(images/folder.gif) left top no-repeat; }
+.jqueryFileTree LI.file { background: url(images/file.png) left top no-repeat; }
+.jqueryFileTree LI.wait { background: url(images/spinner.gif) left top no-repeat; }
+/* File Extensions*/
+.jqueryFileTree LI.ext_3gp { background: url(images/film.png) left top no-repeat; }
+.jqueryFileTree LI.ext_afp { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_afpa { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_asp { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_aspx { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_avi { background: url(images/film.png) left top no-repeat; }
+.jqueryFileTree LI.ext_bat { background: url(images/application.png) left top no-repeat; }
+.jqueryFileTree LI.ext_bmp { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_c { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_cfm { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_cgi { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_com { background: url(images/application.png) left top no-repeat; }
+.jqueryFileTree LI.ext_cpp { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_css { background: url(images/css.png) left top no-repeat; }
+.jqueryFileTree LI.ext_doc { background: url(images/doc.png) left top no-repeat; }
+.jqueryFileTree LI.ext_exe { background: url(images/application.png) left top no-repeat; }
+.jqueryFileTree LI.ext_gif { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_fla { background: url(images/flash.png) left top no-repeat; }
+.jqueryFileTree LI.ext_h { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_htm { background: url(images/html.png) left top no-repeat; }
+.jqueryFileTree LI.ext_html { background: url(images/html.png) left top no-repeat; }
+.jqueryFileTree LI.ext_jar { background: url(images/java.png) left top no-repeat; }
+.jqueryFileTree LI.ext_jpg { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_jpeg { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_js { background: url(images/script.png) left top no-repeat; }
+.jqueryFileTree LI.ext_lasso { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_log { background: url(images/txt.png) left top no-repeat; }
+.jqueryFileTree LI.ext_m4p { background: url(images/music.png) left top no-repeat; }
+.jqueryFileTree LI.ext_mov { background: url(images/film.png) left top no-repeat; }
+.jqueryFileTree LI.ext_mp3 { background: url(images/music.png) left top no-repeat; }
+.jqueryFileTree LI.ext_mp4 { background: url(images/film.png) left top no-repeat; }
+.jqueryFileTree LI.ext_mpg { background: url(images/film.png) left top no-repeat; }
+.jqueryFileTree LI.ext_mpeg { background: url(images/film.png) left top no-repeat; }
+.jqueryFileTree LI.ext_ogg { background: url(images/music.png) left top no-repeat; }
+.jqueryFileTree LI.ext_pcx { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_pdf { background: url(images/pdf.png) left top no-repeat; }
+.jqueryFileTree LI.ext_php { background: url(images/php.png) left top no-repeat; }
+.jqueryFileTree LI.ext_png { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_ppt { background: url(images/ppt.png) left top no-repeat; }
+.jqueryFileTree LI.ext_psd { background: url(images/psd.png) left top no-repeat; }
+.jqueryFileTree LI.ext_pl { background: url(images/script.png) left top no-repeat; }
+.jqueryFileTree LI.ext_py { background: url(images/script.png) left top no-repeat; }
+.jqueryFileTree LI.ext_rb { background: url(images/ruby.png) left top no-repeat; }
+.jqueryFileTree LI.ext_rbx { background: url(images/ruby.png) left top no-repeat; }
+.jqueryFileTree LI.ext_rhtml { background: url(images/ruby.png) left top no-repeat; }
+.jqueryFileTree LI.ext_rpm { background: url(images/linux.png) left top no-repeat; }
+.jqueryFileTree LI.ext_ruby { background: url(images/ruby.png) left top no-repeat; }
+.jqueryFileTree LI.ext_sql { background: url(images/db.png) left top no-repeat; }
+.jqueryFileTree LI.ext_swf { background: url(images/flash.png) left top no-repeat; }
+.jqueryFileTree LI.ext_tif { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_tiff { background: url(images/picture.png) left top no-repeat; }
+.jqueryFileTree LI.ext_txt { background: url(images/txt.png) left top no-repeat; }
+.jqueryFileTree LI.ext_vb { background: url(images/code.png) left top no-repeat; }
+.jqueryFileTree LI.ext_wav { background: url(images/music.png) left top no-repeat; }
+.jqueryFileTree LI.ext_wmv { background: url(images/film.png) left top no-repeat; }
+.jqueryFileTree LI.ext_xls { background: url(images/xls.png) left top no-repeat; }
+.jqueryFileTree LI.ext_xml { background: url(images/code.png) left top no-repeat; }
 .jqueryFileTree LI.ext_zip { background: url(images/zip.png) left top no-repeat; }
\ No newline at end of file
index 9435f207b9c517456cda1b073442cbb7a059e926..1f73a0dca3af276dbe5c065814b4855c4d858f3a 100644 (file)
                        data-bind="value: repositoryGroup.mergedIndexPath"/>
               </div>
           </div>
+          <div class="control-group">
+            <label class="control-label" for="mergedIndexPath">${$.i18n.prop('repository.group.mergedIndexTtl')}</label>
+            <div class="controls">
+                <input type="text" class="input-large required" id="mergedIndexTtl" name="mergedIndexTtl"
+                       data-bind="value: repositoryGroup.mergedIndexTtl"/>
+            </div>
+          </div>
           <div>
             <a href="${window.archivaRuntimeInfo.baseUrl}/repository/${repositoryGroup.id()}" target="_blank">
             {{if repositoryGroup.id()}}
index 8477ed45ce589e7476676ff843a59502b0cd6e68..d5df9742a857ae09b82a6f1a01c55fbb110ba11c 100644 (file)
@@ -23,7 +23,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-web</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
 
   <artifactId>archiva-webdav</artifactId>
index 954e8039cbe07422d7fd40fbc6eef5d5f6ed10fc..d9d1754e87a5289a078db181abb90c8482fe93e8 100644 (file)
@@ -1202,8 +1202,7 @@ public class ArchivaDavResourceFactory
 
             if ( tmp != null && tmp.getDirectory() != null && tmp.getDirectory().exists() )
             {
-                if ( System.currentTimeMillis() - tmp.getCreationTime() > ( indexMerger.getGroupMergedIndexTtl() * 60
-                    * 1000 ) )
+                if ( System.currentTimeMillis() - tmp.getCreationTime() > ( repositoryGroupConfiguration.getMergedIndexTtl() * 60 * 1000 ) )
                 {
                     log.debug( MarkerFactory.getMarker( "group.merged.index" ),
                                "tmp group index '{}' is too old so delete it", repositoryGroupConfiguration.getId() );
@@ -1241,11 +1240,11 @@ public class ArchivaDavResourceFactory
                       repositoryGroupConfiguration.getId(), authzRepos );
             IndexingContext indexingContext = indexMerger.buildMergedIndex(
                 new IndexMergerRequest( authzRepos, true, repositoryGroupConfiguration.getId(),
-                                        repositoryGroupConfiguration.getMergedIndexPath() ) );
+                                        repositoryGroupConfiguration.getMergedIndexPath(), repositoryGroupConfiguration.getMergedIndexTtl() ) );
             File mergedRepoDir = indexingContext.getIndexDirectoryFile();
             TemporaryGroupIndex temporaryGroupIndex = new TemporaryGroupIndex( mergedRepoDir, indexingContext.getId(),
-                                                                               repositoryGroupConfiguration.getId() ).setCreationTime(
-                new Date().getTime() );
+                    repositoryGroupConfiguration.getId(),repositoryGroupConfiguration.getMergedIndexTtl() )
+                    .setCreationTime(new Date().getTime() );
             temporaryGroupIndexMap.put( repositoryGroupConfiguration.getId(), temporaryGroupIndex );
             session.setAttribute( TemporaryGroupIndexSessionCleaner.TEMPORARY_INDEX_SESSION_KEY,
                                   temporaryGroupIndexMap );
index b07884a74b96bd7051f505aad9bc3625db4ba8ea..8fe7a6c2993f8af48b8ecca45ea9b9e8de042994 100644 (file)
@@ -174,7 +174,7 @@ public class TestMetadataRepository
         return false;
     }
 
-    public Object obtainAccess( Class<?> aClass )
+    public <T>T obtainAccess( Class<T> aClass )
     {
         return null;
     }
index d644536ca4a311ed60e40a2bd1addc2393db9b0b..46bbbd090a38e76c6b686be082c66c63742aeaf1 100644 (file)
@@ -19,7 +19,7 @@
   <parent>
     <groupId>org.apache.archiva</groupId>
     <artifactId>archiva-modules</artifactId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
 
   <artifactId>archiva-web</artifactId>
index 6c47c1a698857d5d91afdb05ba843125e5245c32..ba5b79c398a93bcc80b789af6ee3193bb9bc8f8e 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>metadata</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>metadata-model-maven2</artifactId>
   <packaging>bundle</packaging>
@@ -53,7 +53,8 @@
             </Export-Package>
             <Import-Package>
               javax.xml.bind.annotation,
-              org.apache.commons.lang
+              org.apache.commons.lang,
+              javax.persistence
             </Import-Package>
           </instructions>
         </configuration>
index dbaa8eb7f2b1bbf08c410421c7881dc1dfcb987e..8c6fee91544883137fcc8fef16a97c4ab39cdaa7 100644 (file)
   <parent>
     <artifactId>metadata</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>metadata-model</artifactId>
   <packaging>bundle</packaging>
   <name>Archiva Metadata :: Model</name>
 
+  <dependencies>
+    <dependency>
+      <groupId>org.apache.geronimo.specs</groupId>
+      <artifactId>geronimo-jpa_2.0_spec</artifactId>
+    </dependency>
+  </dependencies>
+
   <build>
     <plugins>
       <plugin>
@@ -41,7 +48,7 @@
               org.apache.archiva.metadata.model;version=${project.version};-split-package:=merge-first
             </Export-Package>
             <Import-Package>
-              javax.xml.bind.annotation
+              javax.xml.bind.annotation,javax.persistence
             </Import-Package>
           </instructions>
         </configuration>
index d58936d77de7cd6086a9464b8448328cadfaf9e5..c52d6c2581d35cee3812db8d3cea62270234393f 100644 (file)
@@ -19,15 +19,19 @@ package org.apache.archiva.metadata.model;
  * under the License.
  */
 
+import javax.persistence.Entity;
 import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
 
 /**
  * Information about the CI system used by the project.
  *
  * @todo considering moving this to a facet - avoid referring to it externally
  */
-@XmlRootElement( name = "ciManagement" )
+@XmlRootElement(name = "ciManagement")
+@Entity
 public class CiManagement
+    implements Serializable
 {
     /**
      * A simple identifier for the type of CI server used, eg <tt>continuum</tt>, <tt>bamboo</tt>, <tt>hudson</tt>, etc.
index 14f9defe2c3902ffdd7ed7ea27f6b831000ef08b..bf2a5b80ee1d969f33fa7048cec7e316f53c6b15 100644 (file)
@@ -20,14 +20,16 @@ package org.apache.archiva.metadata.model;
  */
 
 import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
 
 /**
  * Information about a dependency that this project has on another project or artifact.
  *
  * @todo will be reviewing what is appropriate for the base here - rest should be in a maven dependency facet - avoid details on it externally
  */
-@XmlRootElement( name = "dependency" )
+@XmlRootElement(name = "dependency")
 public class Dependency
+    implements Serializable
 {
     /**
      * The Maven classifier of the dependency.
index 12137ba43a4e27b2982f439d0de3ce7bb7e27815..4d304afaabdb70099f72ce55628a0636743ae360 100644 (file)
@@ -19,15 +19,19 @@ package org.apache.archiva.metadata.model;
  * under the License.
  */
 
+import javax.persistence.Entity;
 import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
 
 /**
  * Information about the issue management system used by the project.
  *
  * @todo considering moving this to a facet - avoid referring to it externally
  */
-@XmlRootElement( name = "issueManagement" )
+@XmlRootElement(name = "issueManagement")
+@Entity
 public class IssueManagement
+    implements Serializable
 {
     /**
      * A simple identifier for the type of issue management server used, eg <tt>jira</tt>, <tt>bugzilla</tt>, etc.
index 5fbb28015c2290416c29ffe517d3c8d634a3c294..e079690ad109c5b32109f5a4f2a565440d4838af 100644 (file)
@@ -20,12 +20,14 @@ package org.apache.archiva.metadata.model;
  */
 
 import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
 
 /**
  * A description of a particular license used by a project.
  */
-@XmlRootElement( name = "license" )
+@XmlRootElement(name = "license")
 public class License
+    implements Serializable
 {
     /**
      * The name of the license.
index 922e2d5d867d17f140ade5aae43e77c5173f687e..ee35302d216cad81c4231cf3b89fcd7f6fa89e4b 100644 (file)
@@ -1,6 +1,7 @@
 package org.apache.archiva.metadata.model;
 
 import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
 import java.util.List;
 
 /*
@@ -27,8 +28,9 @@ import java.util.List;
  *
  * @todo considering moving this to a facet - avoid referring to it externally
  */
-@XmlRootElement( name = "mailingList" )
+@XmlRootElement(name = "mailingList")
 public class MailingList
+    implements Serializable
 {
     /**
      * The primary archive URL for this mailing list.
index 23048cbedf946c4c8585c7c04b917786b5e38b0a..9b89613990ada003f9588f138daeb861ee80796c 100644 (file)
@@ -19,10 +19,14 @@ package org.apache.archiva.metadata.model;
  * under the License.
  */
 
+import javax.persistence.Entity;
 import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
 
-@XmlRootElement( name = "organization" )
+@XmlRootElement(name = "organization")
+@Entity
 public class Organization
+    implements Serializable
 {
     private String name;
 
index 8db1f0116749ff97ede14e3ad751b4491fdc092c..c795bb5db0ab95474de248a1cdb5a2ef528e76a3 100644 (file)
@@ -44,4 +44,14 @@ public class ProjectMetadata
     {
         this.namespace = namespace;
     }
+
+    @Override
+    public String toString()
+    {
+        final StringBuilder sb = new StringBuilder( "ProjectMetadata{" );
+        sb.append( "namespace='" ).append( namespace ).append( '\'' );
+        sb.append( ", id='" ).append( id ).append( '\'' );
+        sb.append( '}' );
+        return sb.toString();
+    }
 }
index d614bc9907dd64d76812c7e53758fad1d8f210ff..015c10d0586f5852880e9ea49696933210f80ff5 100644 (file)
@@ -27,6 +27,9 @@ import java.util.List;
 public class ProjectVersionMetadata
     extends FacetedMetadata
 {
+    /**
+     * id is the version
+     */
     private String id;
 
     private String url;
index 5e45e931fe848f070ff7614bed43f9e91c874d4d..ff9f704cdaf09fe06c9e8d1065e2ca0fa677db94 100644 (file)
@@ -19,10 +19,14 @@ package org.apache.archiva.metadata.model;
  * under the License.
  */
 
+import javax.persistence.Entity;
 import javax.xml.bind.annotation.XmlRootElement;
+import java.io.Serializable;
 
-@XmlRootElement( name = "scm" )
+@XmlRootElement(name = "scm")
+@Entity
 public class Scm
+    implements Serializable
 {
     private String connection;
 
index f6a3623150949331e968ee0939c35b176d61653f..370c9e6beb25c1a4b56fd993886f0cab13f3e20e 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>metadata</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>metadata-repository-api</artifactId>
   <packaging>bundle</packaging>
index 0a913c4bba0a0ef08b3b31a2ddf3ee108b5452d7..c4696f7e26f5e6a655f75e071e1861cdf4a41814 100644 (file)
@@ -48,6 +48,12 @@ public interface MetadataRepository
                                ProjectVersionMetadata versionMetadata )
         throws MetadataRepositoryException;
 
+    /**
+     * create the namespace in the repository. (if not exist)
+     * @param repositoryId
+     * @param namespace
+     * @throws MetadataRepositoryException
+     */
     void updateNamespace( String repositoryId, String namespace )
         throws MetadataRepositoryException;
 
@@ -77,6 +83,14 @@ public interface MetadataRepository
     void removeMetadataFacet( String repositoryId, String facetId, String name )
         throws MetadataRepositoryException;
 
+    /**
+     * if startTime or endTime are <code>null</code> they are not used for search
+     * @param repositoryId
+     * @param startTime can be <code>null</code>
+     * @param endTime can be <code>null</code>
+     * @return
+     * @throws MetadataRepositoryException
+     */
     List<ArtifactMetadata> getArtifactsByDateRange( String repositoryId, Date startTime, Date endTime )
         throws MetadataRepositoryException;
 
@@ -102,11 +116,12 @@ public interface MetadataRepository
         throws MetadataRepositoryException;
 
     /**
+     * Only remove {@link MetadataFacet} for the artifact
      * @param repositoryId
      * @param namespace
      * @param project
      * @param version
-     * @param metadataFacet will remove artifacts which have this {@link MetadataFacet} using equals
+     * @param metadataFacet
      * @throws MetadataRepositoryException
      * @since 1.4-M3
      */
@@ -134,6 +149,14 @@ public interface MetadataRepository
     List<ArtifactMetadata> getArtifacts( String repositoryId )
         throws MetadataRepositoryException;
 
+    /**
+     * basically just checking it exists not complete data returned
+     * @param repoId
+     * @param namespace
+     * @param projectId
+     * @return
+     * @throws MetadataResolutionException
+     */
     ProjectMetadata getProject( String repoId, String namespace, String projectId )
         throws MetadataResolutionException;
 
@@ -213,6 +236,6 @@ public interface MetadataRepository
 
     boolean canObtainAccess( Class<?> aClass );
 
-    Object obtainAccess( Class<?> aClass )
+    <T>T obtainAccess( Class<T> aClass )
         throws MetadataRepositoryException;
 }
index 285548d4e529d9bea4804cc0f919982d63abbe5a..201a8fe82f317fdc152152f47363e3fd1531bb9b 100644 (file)
@@ -164,8 +164,9 @@ public abstract class AbstractMetadataRepositoryTest
 
         // test that namespace is also constructed
 
-        Assertions.assertThat( repository.getRootNamespaces( TEST_REPO_ID ) ).isNotNull().isNotEmpty().contains(
-            TEST_NAMESPACE ).hasSize( 1 );
+        Collection<String> namespaces = repository.getRootNamespaces( TEST_REPO_ID );
+
+        Assertions.assertThat( namespaces ).isNotNull().isNotEmpty().contains( TEST_NAMESPACE ).hasSize( 1 );
     }
 
     @Test
@@ -187,6 +188,7 @@ public abstract class AbstractMetadataRepositoryTest
         // test that namespace and project is also constructed
         assertEquals( Collections.singletonList( TEST_NAMESPACE ), repository.getRootNamespaces( TEST_REPO_ID ) );
         ProjectMetadata projectMetadata = repository.getProject( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT );
+        assertNotNull( projectMetadata );
         assertEquals( TEST_PROJECT, projectMetadata.getId() );
         assertEquals( TEST_NAMESPACE, projectMetadata.getNamespace() );
     }
@@ -348,9 +350,10 @@ public abstract class AbstractMetadataRepositoryTest
         repository.updateNamespace( TEST_REPO_ID, "namespace" );
         repository.updateNamespace( OTHER_REPO_ID, "namespace" );
 
-        assertEquals( "repository.getRepositories() -> " + repository.getRepositories(),
-                      Arrays.asList( TEST_REPO_ID, OTHER_REPO_ID ),
-                      new ArrayList<String>( repository.getRepositories() ) );
+        Collection<String> repositories = repository.getRepositories();
+
+        assertEquals( "repository.getRepositories() -> " + repositories, Arrays.asList( TEST_REPO_ID, OTHER_REPO_ID ),
+                      new ArrayList<String>( repositories ) );
     }
 
     @Test
@@ -573,8 +576,10 @@ public abstract class AbstractMetadataRepositoryTest
     {
         repository.addMetadataFacet( TEST_REPO_ID, new TestMetadataFacet( TEST_VALUE ) );
 
-        assertEquals( new TestMetadataFacet( TEST_VALUE ),
-                      repository.getMetadataFacet( TEST_REPO_ID, TEST_FACET_ID, TEST_NAME ) );
+        TestMetadataFacet test =
+            (TestMetadataFacet) repository.getMetadataFacet( TEST_REPO_ID, TEST_FACET_ID, TEST_NAME );
+
+        assertEquals( new TestMetadataFacet( TEST_VALUE ), test );
     }
 
     @Test
@@ -806,9 +811,10 @@ public abstract class AbstractMetadataRepositoryTest
         repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact1 );
         repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact2 );
 
-        assertEquals( Collections.singleton( TEST_PROJECT_VERSION ),
-                      repository.getArtifactVersions( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT,
-                                                      TEST_PROJECT_VERSION ) );
+        Collection<String> versions =
+            repository.getArtifactVersions( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION );
+
+        assertEquals( Collections.singleton( TEST_PROJECT_VERSION ), versions );
     }
 
     @Test
@@ -819,8 +825,9 @@ public abstract class AbstractMetadataRepositoryTest
         repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact );
         repository.save();
 
-        assertEquals( Collections.singletonList( artifact ),
-                      repository.getArtifactsByDateRange( TEST_REPO_ID, null, null ) );
+        List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, null, null );
+
+        assertEquals( Collections.singletonList( artifact ), artifacts );
     }
 
     @Test
@@ -833,8 +840,9 @@ public abstract class AbstractMetadataRepositoryTest
         repository.updateArtifact( TEST_REPO_ID, namespace, TEST_PROJECT, TEST_PROJECT_VERSION, artifact );
         repository.save();
 
-        assertEquals( Collections.singletonList( artifact ),
-                      repository.getArtifactsByDateRange( TEST_REPO_ID, null, null ) );
+        List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, null, null );
+
+        assertEquals( Collections.singletonList( artifact ), artifacts );
     }
 
     @Test
@@ -846,8 +854,10 @@ public abstract class AbstractMetadataRepositoryTest
         repository.save();
 
         Date date = new Date( artifact.getWhenGathered().getTime() - 10000 );
-        assertEquals( Collections.singletonList( artifact ),
-                      repository.getArtifactsByDateRange( TEST_REPO_ID, date, null ) );
+
+        List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, date, null );
+
+        assertEquals( Collections.singletonList( artifact ), artifacts );
     }
 
     @Test
@@ -858,7 +868,10 @@ public abstract class AbstractMetadataRepositoryTest
         repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact );
 
         Date date = new Date( artifact.getWhenGathered().getTime() + 10000 );
-        assertTrue( repository.getArtifactsByDateRange( TEST_REPO_ID, date, null ).isEmpty() );
+
+        List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, date, null );
+
+        Assertions.assertThat( artifacts ).isNotNull().isEmpty();
     }
 
     @Test
@@ -871,8 +884,10 @@ public abstract class AbstractMetadataRepositoryTest
 
         Date lower = new Date( artifact.getWhenGathered().getTime() - 10000 );
         Date upper = new Date( artifact.getWhenGathered().getTime() + 10000 );
-        assertEquals( Collections.singletonList( artifact ),
-                      repository.getArtifactsByDateRange( TEST_REPO_ID, lower, upper ) );
+
+        List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, lower, upper );
+
+        assertEquals( Collections.singletonList( artifact ), artifacts );
     }
 
     @Test
@@ -884,8 +899,10 @@ public abstract class AbstractMetadataRepositoryTest
         repository.save();
 
         Date upper = new Date( artifact.getWhenGathered().getTime() + 10000 );
-        assertEquals( Collections.singletonList( artifact ),
-                      repository.getArtifactsByDateRange( TEST_REPO_ID, null, upper ) );
+
+        List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, null, upper );
+
+        assertEquals( Collections.singletonList( artifact ), artifacts );
     }
 
     @Test
@@ -897,7 +914,12 @@ public abstract class AbstractMetadataRepositoryTest
         repository.save();
 
         Date upper = new Date( artifact.getWhenGathered().getTime() - 10000 );
-        assertTrue( repository.getArtifactsByDateRange( TEST_REPO_ID, null, upper ).isEmpty() );
+
+        List<ArtifactMetadata> artifacts = repository.getArtifactsByDateRange( TEST_REPO_ID, null, upper );
+
+        //assertTrue( .isEmpty() );
+
+        Assertions.assertThat( artifacts ).isNotNull().isEmpty();
     }
 
     @Test
@@ -908,7 +930,9 @@ public abstract class AbstractMetadataRepositoryTest
         repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact );
         repository.save();
 
-        assertEquals( Collections.singletonList( artifact ), repository.getArtifacts( TEST_REPO_ID ) );
+        List<ArtifactMetadata> artifacts = repository.getArtifacts( TEST_REPO_ID );
+
+        assertEquals( Collections.singletonList( artifact ), artifacts );
     }
 
     @Test
@@ -1191,13 +1215,17 @@ public abstract class AbstractMetadataRepositoryTest
 
         repository.updateArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact );
 
-        assertEquals( Collections.singletonList( artifact ), new ArrayList<ArtifactMetadata>(
-            repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ) ) );
+        Collection<ArtifactMetadata> artifacts =
+            repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION );
+
+        assertEquals( Collections.singletonList( artifact ), new ArrayList<ArtifactMetadata>( artifacts ) );
 
         repository.removeArtifact( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION, artifact.getId() );
 
-        assertTrue(
-            repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION ).isEmpty() );
+        artifacts =
+            repository.getArtifacts( TEST_REPO_ID, TEST_NAMESPACE, TEST_PROJECT, TEST_PROJECT_VERSION );
+
+        Assertions.assertThat( artifacts ).isNotNull().isEmpty();
     }
 
     @Test
index f6f41c9b4528c8052eb60706cd584be17c423129..12162d584b352054157a5a62d38adc540f8301f6 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>archiva-modules</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>metadata</artifactId>
   <name>Archiva :: Metadata</name>
index 0e476ec6d41e9c17b5956eb140f3d29679d0cc2d..7e7ab4f5849d6473e972623098de9c3cee4538d5 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>metadata</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>test-repository</artifactId>
   <name>Archiva Metadata :: Repository for Testing</name>
index 99f131d1a29d69714ac71f59076079ad1849d964..83ba0f3f6f1ff7fcb5a6ec9c335a0967d6437be3 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>plugins</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>audit</artifactId>
   <packaging>bundle</packaging>
index e3fb3368fac19659d79b3d2a3e791cdcd4f3505d..83a839dd300a992803555fbdea27f9bb93f752bb 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>plugins</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>generic-metadata-support</artifactId>
   <packaging>bundle</packaging>
index 71075b3c50875dcc897fca9bf4ae286da26c1e9b..29911ce7f0b14eef7edc9f9eaf98aa37823281ad 100644 (file)
@@ -23,7 +23,7 @@
   <parent>
     <artifactId>plugins</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>maven1-repository</artifactId>
   <name>Archiva Core Plugins :: Maven 1.x Repository Support</name>
index 94384eb85e45aebc42a5516f76bfd8c1a09f87be..f04751d443aa813b0183a4192052790dbbddf1f5 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>plugins</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>maven2-repository</artifactId>
   <packaging>bundle</packaging>
index ba4cc69523e736ccbb0e6eb56540e8a98d17ca56..251232738357cfd156e69dff43c51da16a8ad573 100644 (file)
@@ -176,27 +176,27 @@ public class TestMetadataRepository
 
     public void save()
     {
-        //To change body of implemented methods use File | Settings | File Templates.
+        //
     }
 
     public void close()
     {
-        //To change body of implemented methods use File | Settings | File Templates.
+        //
     }
 
     public void revert()
     {
-        //To change body of implemented methods use File | Settings | File Templates.
+        //
     }
 
     public boolean canObtainAccess( Class<?> aClass )
     {
-        return false;  //To change body of implemented methods use File | Settings | File Templates.
+        return false;
     }
 
-    public Object obtainAccess( Class<?> aClass )
+    public <T>T obtainAccess( Class<T> aClass )
     {
-        return null;  //To change body of implemented methods use File | Settings | File Templates.
+        return null;
     }
 
     public void removeArtifact( String repositoryId, String namespace, String project, String version,
index 1d4f1b5721b1bf8e28449700566c89311a199c9d..def7ddb9e72deede3e969701935f5033e8678ee0 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>plugins</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>metadata-store-file</artifactId>
   <packaging>bundle</packaging>
index f0a3abc335a7b2bc06096a9205c5929a0a0b8d18..7bc605f67850aa004fab23933a432142c1ef0b20 100644 (file)
@@ -559,7 +559,7 @@ public class FileMetadataRepository
         return false;
     }
 
-    public Object obtainAccess( Class<?> aClass )
+    public <T>T obtainAccess( Class<T> aClass )
     {
         throw new IllegalArgumentException(
             "Access using " + aClass + " is not supported on the file metadata storage" );
index a359bd35b2e5933cdfb6e0519e471153f7a6dac6..e24916fceb4bb45161292ef7b7ef3cc06188036e 100644 (file)
@@ -23,7 +23,7 @@
   <parent>
     <artifactId>plugins</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>metadata-store-jcr</artifactId>
   <packaging>bundle</packaging>
index 764387ee717009ae81e0cc6b99101733c2990b51..9336a0fcc20c42105f097bfe088eabd985769321 100644 (file)
@@ -1256,14 +1256,14 @@ public class JcrMetadataRepository
         return aClass == Session.class;
     }
 
-    public Object obtainAccess( Class<?> aClass )
+    public <T>T obtainAccess( Class<T> aClass )
         throws MetadataRepositoryException
     {
         if ( aClass == Session.class )
         {
             try
             {
-                return getJcrSession();
+                return (T) getJcrSession();
             }
             catch ( RepositoryException e )
             {
index 67aa3bbafc0bac89dcc28d9df7f0da6258357998..8bb1b13cb52d18ad606c2a40ee32715b47c69655 100644 (file)
@@ -23,7 +23,7 @@
   <parent>
     <artifactId>plugins</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>npanday-support</artifactId>
   <packaging>bundle</packaging>
index 3e8dd4698d79e5e7caaec59c704c11b313b49086..cfe0c2c0dd9d5d16c1fd0e53d18da02b53ceb239 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>archiva-modules</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>plugins</artifactId>
   <name>Archiva :: Core Plugins</name>
index d649292d8a39da89dc6583158b65ef1d375e3c90..b51b72cf0540a9d342f10a57f5970b2b9c5d66ca 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>plugins</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>problem-reports</artifactId>
   <packaging>bundle</packaging>
index 000cdb411e56fa91e9e2122da2bc38fab03bae3c..11c6ceba6c8724026c0a4ce5739947b965b4ef9d 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>plugins</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <artifactId>repository-statistics</artifactId>
   <packaging>bundle</packaging>
index c0ed85a16009f0fbfdc81e3433a9e51327df1f1d..e93405b555e84a5f390fdf31ed64ea62d4fd79a8 100644 (file)
@@ -151,6 +151,8 @@ public class DefaultRepositoryStatisticsManager
 
         long startGather = System.currentTimeMillis();
 
+        // FIXME what about other implementations ?
+
         if ( metadataRepository.canObtainAccess( Session.class ) )
         {
             // TODO: this is currently very raw and susceptible to changes in content structure. Should we instead
@@ -168,7 +170,7 @@ public class DefaultRepositoryStatisticsManager
             populateStatisticsFromRepositoryWalk( metadataRepository, repositoryId, repositoryStatistics );
         }
 
-        log.info( "Gathering statistics executed in " + ( System.currentTimeMillis() - startGather ) + "ms" );
+        log.info( "Gathering statistics executed in {} ms",  ( System.currentTimeMillis() - startGather ) );
 
         metadataRepository.addMetadataFacet( repositoryId, repositoryStatistics );
     }
index a649a6b1f175738c203b1ebe3609adc86e6ae743..38607efc29aa21b81b36c99e3eb55a45d0d05f8d 100644 (file)
@@ -22,7 +22,7 @@
   <parent>
     <artifactId>plugins</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <groupId>org.apache.archiva</groupId>
   <artifactId>stage-repository-merge</artifactId>
index d6ac479912a20354e543615cb5616d7417f1c6e5..a7997bd7e6ee7cf143175905ea56324810b7d937 100644 (file)
@@ -21,7 +21,7 @@
   <parent>
     <artifactId>archiva</artifactId>
     <groupId>org.apache.archiva</groupId>
-    <version>1.4-M4-SNAPSHOT</version>
+    <version>1.4-M5-SNAPSHOT</version>
   </parent>
   <modelVersion>4.0.0</modelVersion>
   <artifactId>archiva-modules</artifactId>