archiva-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From och...@apache.org
Subject svn commit: r702347 [1/4] - in /archiva/branches/MRM-124: ./ archiva-docs/src/site/apt/userguide/ archiva-jetty/ archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/ archiva-modules/archiva-base/archiva-consumers/archiva-core-consumer...
Date Tue, 07 Oct 2008 05:12:37 GMT
Author: oching
Date: Mon Oct  6 22:12:33 2008
New Revision: 702347

URL: http://svn.apache.org/viewvc?rev=702347&view=rev
Log:
merged/updated from trunk -r702027 to get the latest changes

Added:
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryContentIndexEventListener.java
      - copied unchanged from r702334, archiva/trunk/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/RepositoryContentIndexEventListener.java
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/RepositoryContentIndexEventListenerTest.java
      - copied unchanged from r702334, archiva/trunk/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/RepositoryContentIndexEventListenerTest.java
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-indexer/src/test/resources/org/apache/maven/archiva/indexer/RepositoryContentIndexEventListenerTest.xml
      - copied unchanged from r702334, archiva/trunk/archiva-modules/archiva-base/archiva-indexer/src/test/resources/org/apache/maven/archiva/indexer/RepositoryContentIndexEventListenerTest.xml
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/events/
      - copied from r702334, archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/events/
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/events/RepositoryListener.java
      - copied unchanged from r702334, archiva/trunk/archiva-modules/archiva-base/archiva-repository-layer/src/main/java/org/apache/maven/archiva/repository/events/RepositoryListener.java
    archiva/branches/MRM-124/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/RepositoryDatabaseEventListener.java
      - copied unchanged from r702334, archiva/trunk/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/RepositoryDatabaseEventListener.java
    archiva/branches/MRM-124/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/RepositoryDatabaseEventListenerTest.java
      - copied unchanged from r702334, archiva/trunk/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/RepositoryDatabaseEventListenerTest.java
    archiva/branches/MRM-124/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/ArchivaReportException.java
      - copied unchanged from r702334, archiva/trunk/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/ArchivaReportException.java
    archiva/branches/MRM-124/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/RepositoryStatistics.java
      - copied unchanged from r702334, archiva/trunk/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/RepositoryStatistics.java
    archiva/branches/MRM-124/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/RepositoryStatisticsReportGenerator.java
      - copied unchanged from r702334, archiva/trunk/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/RepositoryStatisticsReportGenerator.java
    archiva/branches/MRM-124/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/SimpleRepositoryStatisticsReportGenerator.java
      - copied unchanged from r702334, archiva/trunk/archiva-modules/archiva-reporting/archiva-report-manager/src/main/java/org/apache/maven/archiva/reporting/SimpleRepositoryStatisticsReportGenerator.java
    archiva/branches/MRM-124/archiva-modules/archiva-reporting/archiva-report-manager/src/test/java/org/apache/maven/archiva/reporting/SimpleRepositoryStatisticsReportGeneratorTest.java
      - copied unchanged from r702334, archiva/trunk/archiva-modules/archiva-reporting/archiva-report-manager/src/test/java/org/apache/maven/archiva/reporting/SimpleRepositoryStatisticsReportGeneratorTest.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/maven/archiva/security/AbstractSecurityTest.java
      - copied unchanged from r702334, archiva/trunk/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/maven/archiva/security/AbstractSecurityTest.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/maven/archiva/security/ArchivaServletAuthenticatorTest.java
      - copied unchanged from r702334, archiva/trunk/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/maven/archiva/security/ArchivaServletAuthenticatorTest.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-security/src/test/resources/org/apache/maven/archiva/security/ArchivaServletAuthenticatorTest.xml
      - copied unchanged from r702334, archiva/trunk/archiva-modules/archiva-web/archiva-security/src/test/resources/org/apache/maven/archiva/security/ArchivaServletAuthenticatorTest.xml
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/SearchAction-filteredSearch-validation.xml
      - copied unchanged from r702334, archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/SearchAction-filteredSearch-validation.xml
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/advancedSearch.jsp
      - copied unchanged from r702334, archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/advancedSearch.jsp
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/statisticsReport.jsp
      - copied unchanged from r702334, archiva/trunk/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/statisticsReport.jsp
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webdav/src/test/resources/WEB-INF/repository-servlet-security-test/
      - copied from r702334, archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/resources/WEB-INF/repository-servlet-security-test/
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webdav/src/test/resources/WEB-INF/repository-servlet-security-test/web.xml
      - copied unchanged from r702334, archiva/trunk/archiva-modules/archiva-web/archiva-webdav/src/test/resources/WEB-INF/repository-servlet-security-test/web.xml
Removed:
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/stubs/
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/resources/org/apache/maven/archiva/web/action/reports/GenerateReportAction-validation.xml
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/quickSearchForm.jspf
    archiva/branches/MRM-124/pom-4.1.0.xml
Modified:
    archiva/branches/MRM-124/archiva-docs/src/site/apt/userguide/rss.apt
    archiva/branches/MRM-124/archiva-jetty/pom.xml
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRemoveConsumer.java
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurge.java
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurge.java
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumer.java
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.java
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurgeTest.java
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/resources/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.xml
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-lucene-consumers/src/main/java/org/apache/maven/archiva/consumers/lucene/IndexContentConsumer.java
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/CrossRepositorySearch.java
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearch.java
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-indexer/src/main/java/org/apache/maven/archiva/indexer/search/SearchResults.java
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-indexer/src/test/java/org/apache/maven/archiva/indexer/search/DefaultCrossRepositorySearchTest.java
    archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-model/src/main/mdo/archiva-base.xml
    archiva/branches/MRM-124/archiva-modules/archiva-database/pom.xml
    archiva/branches/MRM-124/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/AbstractDeclarativeConstraint.java
    archiva/branches/MRM-124/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/ArtifactsByRepositoryConstraint.java
    archiva/branches/MRM-124/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/RepositoryContentStatisticsByRepositoryConstraint.java
    archiva/branches/MRM-124/archiva-modules/archiva-database/src/main/java/org/apache/maven/archiva/database/constraints/UniqueArtifactIdConstraint.java
    archiva/branches/MRM-124/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/ArtifactsByRepositoryConstraintTest.java
    archiva/branches/MRM-124/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/RepositoryContentStatisticsByRepositoryConstraintTest.java
    archiva/branches/MRM-124/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/UniqueArtifactIdConstraintTest.java
    archiva/branches/MRM-124/archiva-modules/archiva-database/src/test/java/org/apache/maven/archiva/database/constraints/UniqueGroupIdConstraintTest.java
    archiva/branches/MRM-124/archiva-modules/archiva-reporting/archiva-report-manager/pom.xml
    archiva/branches/MRM-124/archiva-modules/archiva-scheduled/src/main/java/org/apache/maven/archiva/scheduled/executors/ArchivaRepositoryScanningTaskExecutor.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-rss/pom.xml
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-rss/src/main/java/org/apache/archiva/rss/processor/NewArtifactsRssFeedProcessor.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-security/pom.xml
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaServletAuthenticator.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ArchivaXworkUser.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-security/src/main/java/org/apache/maven/archiva/security/ServletAuthenticator.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-security/src/test/java/org/apache/maven/archiva/security/DefaultUserRepositoriesTest.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/pom.xml
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/BrowseAction.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/SearchAction.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/ShowArtifactAction.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/UploadAction.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/connectors/proxy/ProxyConnectorsAction.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/admin/repositories/AbstractManagedRepositoriesAction.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/action/reports/GenerateReportAction.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/rss/RssFeedServlet.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/java/org/apache/maven/archiva/web/util/ContextUtils.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/resources/log4j.xml
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/resources/xwork.xml
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/applicationContext.xml
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/addRepository.jsp
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/proxyConnectors.jsp
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositories.jsp
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/admin/repositoryGroups.jsp
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/browse.jsp
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/decorators/default.jsp
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/include/artifactInfo.jspf
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/quickSearch.jsp
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/reports/pickReport.jsp
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/jsp/results.jsp
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/WEB-INF/web.xml
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/css/maven-theme.css
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/main/webapp/images/archiva-splat-32.gif
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/test/java/org/apache/maven/archiva/web/rss/RssFeedServletTest.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webapp/src/test/webapp/WEB-INF/feedServletTest-web.xml
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webdav/pom.xml
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResource.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavResourceFactory.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProvider.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webdav/src/main/java/org/apache/maven/archiva/webdav/RepositoryServlet.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/ArchivaDavSessionProviderTest.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/DavResourceTest.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webdav/src/test/java/org/apache/maven/archiva/webdav/UnauthenticatedDavSessionProvider.java
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletSecurityTest.xml
    archiva/branches/MRM-124/archiva-modules/archiva-web/archiva-webdav/src/test/resources/org/apache/maven/archiva/webdav/RepositoryServletTest.xml
    archiva/branches/MRM-124/archiva-modules/archiva-web/pom.xml
    archiva/branches/MRM-124/pom.xml

Modified: archiva/branches/MRM-124/archiva-docs/src/site/apt/userguide/rss.apt
URL: http://svn.apache.org/viewvc/archiva/branches/MRM-124/archiva-docs/src/site/apt/userguide/rss.apt?rev=702347&r1=702346&r2=702347&view=diff
==============================================================================
--- archiva/branches/MRM-124/archiva-docs/src/site/apt/userguide/rss.apt (original)
+++ archiva/branches/MRM-124/archiva-docs/src/site/apt/userguide/rss.apt Mon Oct  6 22:12:33 2008
@@ -33,7 +33,8 @@
 
 * New Artifacts In Repository
 
-  The default url for this feed is: <<<http://[hostname]:[port]/archiva/rss/rss_feeds?repoId=[repositoryId]>>>
+  For  versions 1.1 and 1.1.1, the default url for this feed is <<<http://[hostname]:[port]/archiva/rss/rss_feeds?repoId=[repositoryId]>>>.
+  But since version 1.1.2, this has been changed to <<<http://[hostname]:[port]/archiva/feeds/[repositoryId]>>>
 
   There are two ways to subscribe to this feed:
 
@@ -45,7 +46,8 @@
 
 * New Versions of an Artifact
 
-  The default url for this feed is: <<<http://[hostname]:[port]/archiva/rss/rss_feeds?groupId=[groupId]&artifactId=[artifactId]>>>
+  The default url for this feed for versions 1.1 and 1.1.1 is <<<http://[hostname]:[port]/archiva/rss/rss_feeds?groupId=[groupId]&artifactId=[artifactId]>>>
+  but was changed to <<<http://[hostname]:[port]/archiva/feeds/[groupId]/[artifactId]>>> since version 1.1.2 for consistency purposes.
 
   You could subscribe to the feed the same way as specified in the New Artifacts In Repository section except that in #1, you
   need to specify the <<<groupId>>> and <<<artifactId>>> instead of the <<<repositoryId>>>. And in #2, you need to go to the
@@ -58,4 +60,5 @@
   note that only users with an Observer role for the specific repository would be able to subscribe to this feed.
 
   If the 'guest' account is enabled for the repository, you would no longer be asked for the username and password when you
-  subscribe to the feed.
\ No newline at end of file
+  subscribe to the feed.
+

Modified: archiva/branches/MRM-124/archiva-jetty/pom.xml
URL: http://svn.apache.org/viewvc/archiva/branches/MRM-124/archiva-jetty/pom.xml?rev=702347&r1=702346&r2=702347&view=diff
==============================================================================
--- archiva/branches/MRM-124/archiva-jetty/pom.xml (original)
+++ archiva/branches/MRM-124/archiva-jetty/pom.xml Mon Oct  6 22:12:33 2008
@@ -142,7 +142,7 @@
        <plugin>
         <groupId>org.codehaus.mojo</groupId>
         <artifactId>appassembler-maven-plugin</artifactId>
-        <version>1.0-SNAPSHOT</version>
+        <version>1.0-beta-2</version>
         <configuration>
           <daemons>
             <daemon>

Modified: archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml
URL: http://svn.apache.org/viewvc/archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml?rev=702347&r1=702346&r2=702347&view=diff
==============================================================================
--- archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml (original)
+++ archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/pom.xml Mon Oct  6 22:12:33 2008
@@ -30,14 +30,6 @@
   <dependencies>
     <dependency>
       <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-database</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.archiva</groupId>
-      <artifactId>archiva-indexer</artifactId>
-    </dependency>
-    <dependency>
-      <groupId>org.apache.archiva</groupId>
       <artifactId>archiva-configuration</artifactId>
     </dependency>
     <dependency>

Modified: archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java
URL: http://svn.apache.org/viewvc/archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java?rev=702347&r1=702346&r2=702347&view=diff
==============================================================================
--- archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java (original)
+++ archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/ArtifactMissingChecksumsConsumer.java Mon Oct  6 22:12:33 2008
@@ -19,7 +19,10 @@
  * under the License.
  */
 
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.configuration.ConfigurationNames;
 import org.apache.maven.archiva.configuration.FileTypes;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
@@ -94,9 +97,7 @@
     private static final String TYPE_CHECKSUM_CANNOT_CREATE = "checksum-create-failure";
 
     private File repositoryDir;
-
-    private List<String> propertyNameTriggers = new ArrayList<String>();
-
+    
     private List<String> includes = new ArrayList<String>();
 
     public String getId()
@@ -172,8 +173,8 @@
     }
 
     public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
-    {
-        if ( propertyNameTriggers.contains( propertyName ) )
+    {             
+        if ( ConfigurationNames.isRepositoryScanning( propertyName ) )
         {
             initIncludes();
         }
@@ -194,15 +195,8 @@
     public void initialize()
         throws InitializationException
     {
-        propertyNameTriggers = new ArrayList<String>();
-        propertyNameTriggers.add( "repositoryScanning" );
-        propertyNameTriggers.add( "fileTypes" );
-        propertyNameTriggers.add( "fileType" );
-        propertyNameTriggers.add( "patterns" );
-        propertyNameTriggers.add( "pattern" );
-
         configuration.addChangeListener( this );
-
+        
         initIncludes();
     }
 }

Modified: archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRemoveConsumer.java
URL: http://svn.apache.org/viewvc/archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRemoveConsumer.java?rev=702347&r1=702346&r2=702347&view=diff
==============================================================================
--- archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRemoveConsumer.java (original)
+++ archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/AutoRemoveConsumer.java Mon Oct  6 22:12:33 2008
@@ -19,7 +19,10 @@
  * under the License.
  */
 
+import org.apache.commons.collections.CollectionUtils;
+import org.apache.commons.lang.StringUtils;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.configuration.ConfigurationNames;
 import org.apache.maven.archiva.configuration.FileTypes;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
@@ -69,9 +72,7 @@
     private FileTypes filetypes;
 
     private File repositoryDir;
-
-    private List<String> propertyNameTriggers = new ArrayList<String>();
-
+    
     private List<String> includes = new ArrayList<String>();
 
     public String getId()
@@ -122,8 +123,8 @@
     }
 
     public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
-    {
-        if ( propertyNameTriggers.contains( propertyName ) )
+    {                
+        if ( ConfigurationNames.isRepositoryScanning( propertyName ) )
         {
             initIncludes();
         }
@@ -143,14 +144,7 @@
 
     public void initialize()
         throws InitializationException
-    {
-        propertyNameTriggers = new ArrayList<String>();
-        propertyNameTriggers.add( "repositoryScanning" );
-        propertyNameTriggers.add( "fileTypes" );
-        propertyNameTriggers.add( "fileType" );
-        propertyNameTriggers.add( "patterns" );
-        propertyNameTriggers.add( "pattern" );
-
+    {     
         configuration.addChangeListener( this );
 
         initIncludes();

Modified: archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurge.java
URL: http://svn.apache.org/viewvc/archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurge.java?rev=702347&r1=702346&r2=702347&view=diff
==============================================================================
--- archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurge.java (original)
+++ archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurge.java Mon Oct  6 22:12:33 2008
@@ -19,26 +19,16 @@
  * under the License.
  */
 
-import org.apache.maven.archiva.database.ArchivaDatabaseException;
-import org.apache.maven.archiva.database.ArtifactDAO;
-import org.apache.maven.archiva.indexer.RepositoryContentIndex;
-import org.apache.maven.archiva.indexer.RepositoryIndexException;
-import org.apache.maven.archiva.indexer.bytecode.BytecodeRecord;
-import org.apache.maven.archiva.indexer.filecontent.FileContentRecord;
-import org.apache.maven.archiva.indexer.hashcodes.HashcodesRecord;
-import org.apache.maven.archiva.indexer.lucene.LuceneRepositoryContentRecord;
-import org.apache.maven.archiva.model.ArchivaArtifact;
-import org.apache.maven.archiva.model.ArtifactReference;
-import org.apache.maven.archiva.repository.ManagedRepositoryContent;
-import org.apache.maven.archiva.repository.layout.LayoutException;
-
 import java.io.File;
 import java.io.FilenameFilter;
-import java.util.ArrayList;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 
+import org.apache.maven.archiva.model.ArchivaArtifact;
+import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.maven.archiva.repository.ManagedRepositoryContent;
+import org.apache.maven.archiva.repository.events.RepositoryListener;
+
 /**
  * Base class for all repository purge tasks.
  * 
@@ -47,18 +37,14 @@
 public abstract class AbstractRepositoryPurge
     implements RepositoryPurge
 {
-    protected ManagedRepositoryContent repository;
-
-    protected ArtifactDAO artifactDao;
-
-    private Map<String, RepositoryContentIndex> indices;
+    protected final ManagedRepositoryContent repository;
+    
+	protected final List<RepositoryListener> listeners;
 
-    public AbstractRepositoryPurge( ManagedRepositoryContent repository, ArtifactDAO artifactDao,
-                                    Map<String, RepositoryContentIndex> indices )
+    public AbstractRepositoryPurge( ManagedRepositoryContent repository, List<RepositoryListener> listeners )
     {
         this.repository = repository;
-        this.artifactDao = artifactDao;
-        this.indices = indices;
+        this.listeners = listeners;
     }
 
     /**
@@ -98,10 +84,6 @@
     {        
         if( references != null && !references.isEmpty() )
         {
-            List<LuceneRepositoryContentRecord> fileContentRecords = new ArrayList<LuceneRepositoryContentRecord>();
-            List<LuceneRepositoryContentRecord> hashcodeRecords = new ArrayList<LuceneRepositoryContentRecord>();
-            List<LuceneRepositoryContentRecord> bytecodeRecords = new ArrayList<LuceneRepositoryContentRecord>();
-            
             for ( ArtifactReference reference : references )
             {   
                 File artifactFile = repository.toFile( reference );
@@ -110,46 +92,14 @@
                     new ArchivaArtifact( reference.getGroupId(), reference.getArtifactId(), reference.getVersion(),
                                          reference.getClassifier(), reference.getType() );
     
-                FileContentRecord fileContentRecord = new FileContentRecord();
-                fileContentRecord.setFilename( repository.toPath( artifact ) );
-                fileContentRecords.add( fileContentRecord );
-    
-                HashcodesRecord hashcodesRecord = new HashcodesRecord();
-                hashcodesRecord.setArtifact( artifact );
-                hashcodeRecords.add( hashcodesRecord );
-    
-                BytecodeRecord bytecodeRecord = new BytecodeRecord();
-                bytecodeRecord.setArtifact( artifact );
-                bytecodeRecords.add( bytecodeRecord );
-    
+                for ( RepositoryListener listener : listeners )
+                {
+                    listener.deleteArtifact( repository, artifact );
+                }
+                
                 // TODO: this needs to be logged
                 artifactFile.delete();
                 purgeSupportFiles( artifactFile );
-    
-                // intended to be swallowed
-                // continue updating the database for all artifacts
-                try
-                {
-                    String artifactPath = toRelativePath( artifactFile );
-                    updateDatabase( artifactPath );
-                }
-                catch ( ArchivaDatabaseException ae )
-                {
-                    // TODO: determine logging to be used
-                }
-                catch ( LayoutException le )
-                {
-                    // Ignore
-                }
-            }
-    
-            try
-            {
-                updateIndices( fileContentRecords, hashcodeRecords, bytecodeRecords );
-            }
-            catch ( RepositoryIndexException e )
-            {
-                // Ignore
             }
         }
     }
@@ -186,32 +136,4 @@
             }
         }
     }
-
-    private void updateDatabase( String path )
-        throws ArchivaDatabaseException, LayoutException
-    {
-        ArtifactReference artifact = repository.toArtifactReference( path );
-        ArchivaArtifact queriedArtifact =
-            artifactDao.getArtifact( artifact.getGroupId(), artifact.getArtifactId(), artifact.getVersion(),
-                                     artifact.getClassifier(), artifact.getType() );
-
-        artifactDao.deleteArtifact( queriedArtifact );
-
-        // TODO [MRM-37]: re-run the database consumers to clean up
-    }
-    
-    private void updateIndices( List<LuceneRepositoryContentRecord> fileContentRecords,
-                                List<LuceneRepositoryContentRecord> hashcodeRecords,
-                                List<LuceneRepositoryContentRecord> bytecodeRecords )
-        throws RepositoryIndexException
-    {        
-        RepositoryContentIndex index = indices.get( "filecontent" );
-        index.deleteRecords( fileContentRecords );
-        
-        index = indices.get( "hashcodes" );
-        index.deleteRecords( hashcodeRecords );
-        
-        index = indices.get( "bytecode" );
-        index.deleteRecords( bytecodeRecords );
-    }
 }

Modified: archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java
URL: http://svn.apache.org/viewvc/archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java?rev=702347&r1=702346&r2=702347&view=diff
==============================================================================
--- archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java (original)
+++ archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurge.java Mon Oct  6 22:12:33 2008
@@ -19,12 +19,17 @@
  * under the License.
  */
 
+import java.io.File;
+import java.io.IOException;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+
 import org.apache.maven.archiva.common.utils.VersionComparator;
 import org.apache.maven.archiva.common.utils.VersionUtil;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.maven.archiva.database.ArtifactDAO;
-import org.apache.maven.archiva.indexer.RepositoryContentIndex;
+import org.apache.maven.archiva.model.ArchivaArtifact;
 import org.apache.maven.archiva.model.ArtifactReference;
 import org.apache.maven.archiva.model.ProjectReference;
 import org.apache.maven.archiva.model.VersionedReference;
@@ -33,17 +38,11 @@
 import org.apache.maven.archiva.repository.RepositoryContentFactory;
 import org.apache.maven.archiva.repository.RepositoryException;
 import org.apache.maven.archiva.repository.RepositoryNotFoundException;
+import org.apache.maven.archiva.repository.events.RepositoryListener;
 import org.apache.maven.archiva.repository.layout.LayoutException;
 import org.apache.maven.archiva.repository.metadata.MetadataTools;
 import org.apache.maven.archiva.repository.metadata.RepositoryMetadataException;
 
-import java.io.File;
-import java.io.IOException;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-
 /**
  * <p>
  * This will look in a single managed repository, and purge any snapshots that are present
@@ -78,11 +77,12 @@
     
     private RepositoryContentFactory repoContentFactory;
 
-    public CleanupReleasedSnapshotsRepositoryPurge( ManagedRepositoryContent repository, ArtifactDAO artifactDao,
-                    MetadataTools metadataTools, Map<String, RepositoryContentIndex> indices, 
-                    ArchivaConfiguration archivaConfig, RepositoryContentFactory repoContentFactory )
+    public CleanupReleasedSnapshotsRepositoryPurge( ManagedRepositoryContent repository, MetadataTools metadataTools,
+                                                    ArchivaConfiguration archivaConfig,
+                                                    RepositoryContentFactory repoContentFactory,
+                                                    List<RepositoryListener> listeners )
     {
-        super( repository, artifactDao, indices );
+        super( repository, listeners );
         this.metadataTools = metadataTools;
         this.archivaConfig = archivaConfig;
         this.repoContentFactory = repoContentFactory;
@@ -101,17 +101,17 @@
                 return;
             }
 
-            ArtifactReference artifact = repository.toArtifactReference( path );
+            ArtifactReference artifactRef = repository.toArtifactReference( path );
 
-            if ( !VersionUtil.isSnapshot( artifact.getVersion() ) )
+            if ( !VersionUtil.isSnapshot( artifactRef.getVersion() ) )
             {
                 // Nothing to do here, not a snapshot, skip it.
                 return;
             }
 
             ProjectReference reference = new ProjectReference();
-            reference.setGroupId( artifact.getGroupId() );
-            reference.setArtifactId( artifact.getArtifactId() );
+            reference.setGroupId( artifactRef.getGroupId() );
+            reference.setArtifactId( artifactRef.getArtifactId() );
             
             // Gather up all of the versions.
             List<String> allVersions = new ArrayList<String>( repository.getVersions( reference ) );
@@ -161,8 +161,12 @@
             boolean needsMetadataUpdate = false;
 
             VersionedReference versionRef = new VersionedReference();
-            versionRef.setGroupId( artifact.getGroupId() );
-            versionRef.setArtifactId( artifact.getArtifactId() );
+            versionRef.setGroupId( artifactRef.getGroupId() );
+            versionRef.setArtifactId( artifactRef.getArtifactId() );
+            
+            ArchivaArtifact artifact =
+                new ArchivaArtifact( artifactRef.getGroupId(), artifactRef.getArtifactId(), artifactRef.getVersion(),
+                                     artifactRef.getClassifier(), artifactRef.getType() );
             
             for ( String version : snapshotVersions )
             {   
@@ -170,13 +174,19 @@
                 {                    
                     versionRef.setVersion( version );
                     repository.deleteVersion( versionRef );
+                    
+                    for ( RepositoryListener listener : listeners )
+                    {
+                        listener.deleteArtifact( repository, artifact );
+                    }
+                    
                     needsMetadataUpdate = true;
                 }
             }           
                         
             if ( needsMetadataUpdate )
             {
-                updateMetadata( artifact );
+                updateMetadata( artifactRef );
             }
         }
         catch ( LayoutException e )

Modified: archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurge.java
URL: http://svn.apache.org/viewvc/archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurge.java?rev=702347&r1=702346&r2=702347&view=diff
==============================================================================
--- archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurge.java (original)
+++ archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurge.java Mon Oct  6 22:12:33 2008
@@ -19,17 +19,6 @@
  * under the License.
  */
 
-import org.apache.commons.lang.time.DateUtils;
-import org.apache.maven.archiva.common.utils.VersionComparator;
-import org.apache.maven.archiva.common.utils.VersionUtil;
-import org.apache.maven.archiva.database.ArtifactDAO;
-import org.apache.maven.archiva.indexer.RepositoryContentIndex;
-import org.apache.maven.archiva.model.ArtifactReference;
-import org.apache.maven.archiva.model.VersionedReference;
-import org.apache.maven.archiva.repository.ContentNotFoundException;
-import org.apache.maven.archiva.repository.ManagedRepositoryContent;
-import org.apache.maven.archiva.repository.layout.LayoutException;
-
 import java.io.File;
 import java.text.ParseException;
 import java.text.SimpleDateFormat;
@@ -38,10 +27,19 @@
 import java.util.Collections;
 import java.util.Date;
 import java.util.List;
-import java.util.Map;
 import java.util.Set;
 import java.util.regex.Matcher;
 
+import org.apache.commons.lang.time.DateUtils;
+import org.apache.maven.archiva.common.utils.VersionComparator;
+import org.apache.maven.archiva.common.utils.VersionUtil;
+import org.apache.maven.archiva.model.ArtifactReference;
+import org.apache.maven.archiva.model.VersionedReference;
+import org.apache.maven.archiva.repository.ContentNotFoundException;
+import org.apache.maven.archiva.repository.ManagedRepositoryContent;
+import org.apache.maven.archiva.repository.events.RepositoryListener;
+import org.apache.maven.archiva.repository.layout.LayoutException;
+
 /**
  * Purge from repository all snapshots older than the specified days in the repository configuration.
  * 
@@ -56,10 +54,10 @@
 
     private int retentionCount;
 
-    public DaysOldRepositoryPurge( ManagedRepositoryContent repository, ArtifactDAO artifactDao, int daysOlder,
-                                   int retentionCount, Map<String, RepositoryContentIndex> indices )
+    public DaysOldRepositoryPurge( ManagedRepositoryContent repository, int daysOlder,
+                                   int retentionCount, List<RepositoryListener> listeners )
     {
-        super( repository, artifactDao, indices );
+        super( repository, listeners );
         this.daysOlder = daysOlder;
         this.retentionCount = retentionCount;
         timestampParser = new SimpleDateFormat( "yyyyMMdd.HHmmss" );

Modified: archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumer.java
URL: http://svn.apache.org/viewvc/archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumer.java?rev=702347&r1=702346&r2=702347&view=diff
==============================================================================
--- archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumer.java (original)
+++ archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumer.java Mon Oct  6 22:12:33 2008
@@ -19,30 +19,29 @@
  * under the License.
  */
 
+import java.util.ArrayList;
+import java.util.Date;
+import java.util.List;
+
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
+import org.apache.maven.archiva.configuration.ConfigurationNames;
 import org.apache.maven.archiva.configuration.FileTypes;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.AbstractMonitoredConsumer;
 import org.apache.maven.archiva.consumers.ConsumerException;
 import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
-import org.apache.maven.archiva.database.ArchivaDAO;
-import org.apache.maven.archiva.indexer.RepositoryContentIndex;
-import org.apache.maven.archiva.indexer.RepositoryContentIndexFactory;
 import org.apache.maven.archiva.repository.ManagedRepositoryContent;
 import org.apache.maven.archiva.repository.RepositoryContentFactory;
 import org.apache.maven.archiva.repository.RepositoryException;
 import org.apache.maven.archiva.repository.RepositoryNotFoundException;
+import org.apache.maven.archiva.repository.events.RepositoryListener;
 import org.apache.maven.archiva.repository.metadata.MetadataTools;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.Initializable;
 import org.codehaus.plexus.personality.plexus.lifecycle.phase.InitializationException;
 import org.codehaus.plexus.registry.Registry;
 import org.codehaus.plexus.registry.RegistryListener;
 
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
+import edu.emory.mathcs.backport.java.util.Collections;
 
 /**
  * Consumer for removing old snapshots in the repository based on the criteria
@@ -75,11 +74,6 @@
     private ArchivaConfiguration configuration;
 
     /**
-     * @plexus.requirement role-hint="jdo"
-     */
-    private ArchivaDAO dao;
-
-    /**
      * @plexus.requirement
      */
     private RepositoryContentFactory repositoryFactory;
@@ -96,19 +90,15 @@
 
     private List<String> includes = new ArrayList<String>();
 
-    private List<String> propertyNameTriggers = new ArrayList<String>();
-
     private RepositoryPurge repoPurge;
 
     private RepositoryPurge cleanUp;
 
     private boolean deleteReleasedSnapshots;
-    
-    /**
-     * @plexus.requirement role-hint="lucene"
-     */
-    private RepositoryContentIndexFactory indexFactory;
 
+    /** @plexus.requirement role="org.apache.maven.archiva.repository.events.RepositoryListener" */
+    private List<RepositoryListener> listeners = Collections.emptyList();
+    
     public String getId()
     {
         return this.id;
@@ -139,27 +129,23 @@
     {
         try
         {
-            Map<String, RepositoryContentIndex> indices = new HashMap<String, RepositoryContentIndex>();
-            indices.put( "bytecode", indexFactory.createBytecodeIndex( repository ) );
-            indices.put( "hashcodes", indexFactory.createHashcodeIndex( repository ) );
-            indices.put( "filecontent", indexFactory.createFileContentIndex( repository ) );
-            
             ManagedRepositoryContent repositoryContent = repositoryFactory.getManagedRepositoryContent( repository
                 .getId() );
 
             if ( repository.getDaysOlder() != 0 )
             {
-                repoPurge = new DaysOldRepositoryPurge( repositoryContent, dao.getArtifactDAO(), repository
-                    .getDaysOlder(), repository.getRetentionCount(), indices );
+                repoPurge = new DaysOldRepositoryPurge( repositoryContent, repository.getDaysOlder(), 
+                                                        repository.getRetentionCount(), listeners );
             }
             else
             {
-                repoPurge = new RetentionCountRepositoryPurge( repositoryContent, dao.getArtifactDAO(), repository
-                    .getRetentionCount(), indices );
+                repoPurge = new RetentionCountRepositoryPurge( repositoryContent, repository.getRetentionCount(), 
+                                                               listeners );
             }
             
-            cleanUp = new CleanupReleasedSnapshotsRepositoryPurge( repositoryContent, dao.getArtifactDAO(),
-                                   metadataTools, indices, configuration, repositoryFactory );
+            cleanUp =
+                new CleanupReleasedSnapshotsRepositoryPurge( repositoryContent, metadataTools, configuration,
+                                                             repositoryFactory, listeners );
 
             deleteReleasedSnapshots = repository.isDeleteReleasedSnapshots();
         }
@@ -198,7 +184,7 @@
 
     public void afterConfigurationChange( Registry registry, String propertyName, Object propertyValue )
     {
-        if ( propertyNameTriggers.contains( propertyName ) )
+        if ( ConfigurationNames.isRepositoryScanning( propertyName ) )
         {
             initIncludes();
         }
@@ -219,13 +205,6 @@
     public void initialize()
         throws InitializationException
     {
-        propertyNameTriggers = new ArrayList<String>();
-        propertyNameTriggers.add( "repositoryScanning" );
-        propertyNameTriggers.add( "fileTypes" );
-        propertyNameTriggers.add( "fileType" );
-        propertyNameTriggers.add( "patterns" );
-        propertyNameTriggers.add( "pattern" );
-
         configuration.addChangeListener( this );
 
         initIncludes();
@@ -236,9 +215,4 @@
         // we need to check all files for deletion, especially if not modified
         return true;
     }
-    
-    public void setRepositoryContentIndexFactory( RepositoryContentIndexFactory indexFactory )
-    {
-        this.indexFactory = indexFactory;
-    }
 }

Modified: archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java
URL: http://svn.apache.org/viewvc/archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java?rev=702347&r1=702346&r2=702347&view=diff
==============================================================================
--- archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java (original)
+++ archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/main/java/org/apache/maven/archiva/consumers/core/repository/RetentionCountRepositoryPurge.java Mon Oct  6 22:12:33 2008
@@ -19,23 +19,21 @@
  * under the License.
  */
 
+import java.io.File;
+import java.util.ArrayList;
+import java.util.Collections;
+import java.util.List;
+import java.util.Set;
+
 import org.apache.maven.archiva.common.utils.VersionComparator;
 import org.apache.maven.archiva.common.utils.VersionUtil;
-import org.apache.maven.archiva.database.ArtifactDAO;
-import org.apache.maven.archiva.indexer.RepositoryContentIndex;
 import org.apache.maven.archiva.model.ArtifactReference;
 import org.apache.maven.archiva.model.VersionedReference;
 import org.apache.maven.archiva.repository.ContentNotFoundException;
 import org.apache.maven.archiva.repository.ManagedRepositoryContent;
+import org.apache.maven.archiva.repository.events.RepositoryListener;
 import org.apache.maven.archiva.repository.layout.LayoutException;
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.Collections;
-import java.util.List;
-import java.util.Map;
-import java.util.Set;
-
 /**
  * Purge the repository by retention count. Retain only the specified number of snapshots.
  *
@@ -46,10 +44,10 @@
 {
     private int retentionCount;
 
-    public RetentionCountRepositoryPurge( ManagedRepositoryContent repository, ArtifactDAO artifactDao,
-                                          int retentionCount, Map<String, RepositoryContentIndex> indices )
+    public RetentionCountRepositoryPurge( ManagedRepositoryContent repository, 
+                                          int retentionCount, List<RepositoryListener> listeners )
     {
-        super( repository, artifactDao, indices );
+        super( repository, listeners );
         this.retentionCount = retentionCount;
     }
 

Modified: archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java
URL: http://svn.apache.org/viewvc/archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java?rev=702347&r1=702346&r2=702347&view=diff
==============================================================================
--- archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java (original)
+++ archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/AbstractRepositoryPurgeTest.java Mon Oct  6 22:12:33 2008
@@ -19,28 +19,16 @@
  * under the License.
  */
 
+import java.io.File;
+import java.io.IOException;
+
 import org.apache.commons.io.FileUtils;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
-import org.apache.maven.archiva.database.ArchivaDatabaseException;
-import org.apache.maven.archiva.database.ArtifactDAO;
 import org.apache.maven.archiva.model.ArchivaArtifact;
 import org.apache.maven.archiva.repository.ManagedRepositoryContent;
-import org.codehaus.plexus.jdo.DefaultConfigurableJdoFactory;
-import org.codehaus.plexus.jdo.JdoFactory;
+import org.apache.maven.archiva.repository.events.RepositoryListener;
 import org.codehaus.plexus.spring.PlexusInSpringTestCase;
-import org.jpox.SchemaTool;
-
-import java.io.File;
-import java.io.IOException;
-import java.net.URL;
-import java.util.ArrayList;
-import java.util.Date;
-import java.util.List;
-import java.util.Properties;
-import java.util.Map.Entry;
-
-import javax.jdo.PersistenceManager;
-import javax.jdo.PersistenceManagerFactory;
+import org.easymock.MockControl;
 
 /**
  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
@@ -74,74 +62,21 @@
 
     private ManagedRepositoryContent repo;
 
-    protected ArtifactDAO dao;
-
     protected RepositoryPurge repoPurge;
 
+    protected MockControl listenerControl;
+
+    protected RepositoryListener listener;
+
+    @Override
     protected void setUp()
         throws Exception
     {
         super.setUp();
+        
+        listenerControl = MockControl.createControl( RepositoryListener.class );
 
-        DefaultConfigurableJdoFactory jdoFactory = (DefaultConfigurableJdoFactory) lookup( JdoFactory.ROLE, "archiva" );
-        assertEquals( DefaultConfigurableJdoFactory.class.getName(), jdoFactory.getClass().getName() );
-
-        jdoFactory.setPersistenceManagerFactoryClass( "org.jpox.PersistenceManagerFactoryImpl" );
-
-        jdoFactory.setDriverName( System.getProperty( "jdo.test.driver", "org.hsqldb.jdbcDriver" ) );
-        jdoFactory.setUrl( System.getProperty( "jdo.test.url", "jdbc:hsqldb:mem:testdb" ) );
-
-        jdoFactory.setUserName( System.getProperty( "jdo.test.user", "sa" ) );
-
-        jdoFactory.setPassword( System.getProperty( "jdo.test.pass", "" ) );
-
-        jdoFactory.setProperty( "org.jpox.transactionIsolation", "READ_COMMITTED" );
-
-        jdoFactory.setProperty( "org.jpox.poid.transactionIsolation", "READ_COMMITTED" );
-
-        jdoFactory.setProperty( "org.jpox.autoCreateSchema", "true" );
-
-        jdoFactory.setProperty( "javax.jdo.option.RetainValues", "true" );
-
-        jdoFactory.setProperty( "javax.jdo.option.RestoreValues", "true" );
-
-        // jdoFactory.setProperty( "org.jpox.autoCreateColumns", "true" );
-
-        jdoFactory.setProperty( "org.jpox.validateTables", "true" );
-
-        jdoFactory.setProperty( "org.jpox.validateColumns", "true" );
-
-        jdoFactory.setProperty( "org.jpox.validateConstraints", "true" );
-
-        Properties properties = jdoFactory.getProperties();
-
-        for ( Entry<Object, Object> entry : properties.entrySet() )
-        {
-            System.setProperty( (String) entry.getKey(), (String) entry.getValue() );
-        }
-
-        URL jdoFileUrls[] = new URL[] { getClass().getResource( "/org/apache/maven/archiva/model/package.jdo" ) };
-
-        if ( ( jdoFileUrls == null ) || ( jdoFileUrls[0] == null ) )
-        {
-            fail( "Unable to process test " + getName() + " - missing package.jdo." );
-        }
-
-        File propsFile = null; // intentional
-        boolean verbose = true;
-
-        SchemaTool.deleteSchemaTables( jdoFileUrls, new URL[] {}, propsFile, verbose );
-        SchemaTool.createSchemaTables( jdoFileUrls, new URL[] {}, propsFile, verbose, null );
-
-        PersistenceManagerFactory pmf = jdoFactory.getPersistenceManagerFactory();
-
-        assertNotNull( pmf );
-
-        PersistenceManager pm = pmf.getPersistenceManager();
-
-        pm.close();
-
-        dao = (ArtifactDAO) lookup( ArtifactDAO.class.getName(), "jdo" );
+        listener = (RepositoryListener) listenerControl.getMock();
     }
     
     @Override
@@ -180,28 +115,6 @@
         return repo;
     }
 
-    protected void populateDb( String groupId, String artifactId, List<String> versions )
-        throws ArchivaDatabaseException
-    {
-        for ( String version : versions )
-        {
-            ArchivaArtifact artifact = dao.createArtifact( groupId, artifactId, version, "", "jar" );
-            assertNotNull( artifact );
-            artifact.getModel().setLastModified( new Date() );
-            artifact.getModel().setOrigin( "test" );
-            ArchivaArtifact savedArtifact = dao.saveArtifact( artifact );
-            assertNotNull( savedArtifact );
-
-            //POM
-            artifact = dao.createArtifact( groupId, artifactId, version, "", "pom" );
-            assertNotNull( artifact );
-            artifact.getModel().setLastModified( new Date() );
-            artifact.getModel().setOrigin( "test" );
-            savedArtifact = dao.saveArtifact( artifact );
-            assertNotNull( savedArtifact );
-        }
-    }
-
     protected void assertDeleted( String path )
     {
         assertFalse( "File should have been deleted: " + path, new File( path ).exists() );
@@ -230,15 +143,9 @@
         
         return testDir.getAbsolutePath();
     }
-    
-    protected void populateDbForTestOrderOfDeletion()
-        throws Exception
+
+    protected ArchivaArtifact createArtifact( String groupId, String artifactId, String version, String type )
     {
-        List<String> versions = new ArrayList<String>();
-        versions.add( "1.1.2-20070427.065136-1" );
-        versions.add( "1.1.2-20070506.163513-2" );
-        versions.add( "1.1.2-20070615.105019-3" );
-    
-        populateDb( "org.apache.maven.plugins", "maven-assembly-plugin", versions );
+        return new ArchivaArtifact( groupId, artifactId, version, null, type );
     }
 }

Modified: archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java
URL: http://svn.apache.org/viewvc/archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java?rev=702347&r1=702346&r2=702347&view=diff
==============================================================================
--- archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java (original)
+++ archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/CleanupReleasedSnapshotsRepositoryPurgeTest.java Mon Oct  6 22:12:33 2008
@@ -19,21 +19,18 @@
  * under the License.
  */
 
+import java.io.File;
+import java.util.Collections;
+
 import org.apache.commons.io.FileUtils;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
 import org.apache.maven.archiva.configuration.Configuration;
-import org.apache.maven.archiva.consumers.core.repository.stubs.LuceneRepositoryContentIndexStub;
-import org.apache.maven.archiva.database.ArchivaDatabaseException;
-import org.apache.maven.archiva.indexer.RepositoryContentIndex;
 import org.apache.maven.archiva.repository.RepositoryContentFactory;
+import org.apache.maven.archiva.repository.events.RepositoryListener;
 import org.apache.maven.archiva.repository.metadata.MetadataTools;
 import org.custommonkey.xmlunit.XMLAssert;
+import org.easymock.MockControl;
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.HashMap;
-import java.util.List;
-import java.util.Map;
 
 /**
  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
@@ -42,6 +39,8 @@
     extends AbstractRepositoryPurgeTest
 {  
     private ArchivaConfiguration archivaConfiguration;
+
+    private MockControl listenerControl;
     
     public static final String PATH_TO_RELEASED_SNAPSHOT_IN_DIFF_REPO =
         "org/apache/archiva/released-artifact-in-diff-repo/1.0-SNAPSHOT/released-artifact-in-diff-repo-1.0-SNAPSHOT.jar";
@@ -49,40 +48,45 @@
     public static final String PATH_TO_HIGHER_SNAPSHOT_EXISTS_IN_SAME_REPO = "org/apache/maven/plugins/maven-source-plugin/2.0.3-SNAPSHOT/maven-source-plugin-2.0.3-SNAPSHOT.jar";
 
     public static final String PATH_TO_RELEASED_SNAPSHOT_IN_SAME_REPO = "org/apache/maven/plugins/maven-plugin-plugin/2.3-SNAPSHOT/maven-plugin-plugin-2.3-SNAPSHOT.jar";
+
+    private RepositoryListener listener;
     
     protected void setUp()
         throws Exception
     {
-        super.setUp(); 
-
-        Map<String, RepositoryContentIndex> map = new HashMap<String, RepositoryContentIndex>();
-        map.put( "filecontent", new LuceneRepositoryContentIndexStub() );
-        map.put( "hashcodes", new LuceneRepositoryContentIndexStub() );
-        map.put( "bytecode", new LuceneRepositoryContentIndexStub() );
+        super.setUp();
         
         MetadataTools metadataTools = (MetadataTools) lookup( MetadataTools.class );
         RepositoryContentFactory factory = (RepositoryContentFactory) lookup( RepositoryContentFactory.class, "cleanup-released-snapshots");
         
         archivaConfiguration =
             (ArchivaConfiguration) lookup( ArchivaConfiguration.class, "cleanup-released-snapshots" );
-                
+
+        listenerControl = MockControl.createControl( RepositoryListener.class );
+        
+        listener = (RepositoryListener) listenerControl.getMock();
         repoPurge =
-            new CleanupReleasedSnapshotsRepositoryPurge( getRepository(), dao, metadataTools, map, archivaConfiguration, factory );
+            new CleanupReleasedSnapshotsRepositoryPurge( getRepository(), metadataTools, archivaConfiguration, factory,
+                                                         Collections.singletonList( listener ) );
     }
 
     public void testReleasedSnapshotsExistsInSameRepo()
         throws Exception
     {
-        
         Configuration config = archivaConfiguration.getConfiguration();
         config.removeManagedRepository( config.findManagedRepositoryById( TEST_REPO_ID ) );
         config.addManagedRepository( getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ) );
       
-        populateReleasedSnapshotsTest();
-
         String repoRoot = prepareTestRepos();        
 
+        // test listeners for the correct artifacts
+        listener.deleteArtifact( getRepository(), createArtifact( "org.apache.maven.plugins", "maven-plugin-plugin",
+                                                                  "2.3-SNAPSHOT", "maven-plugin" ) );
+        listenerControl.replay();
+        
         repoPurge.process( CleanupReleasedSnapshotsRepositoryPurgeTest.PATH_TO_RELEASED_SNAPSHOT_IN_SAME_REPO );
+        
+        listenerControl.verify();
 
         String projectRoot = repoRoot + "/org/apache/maven/plugins/maven-plugin-plugin";
         
@@ -130,12 +134,18 @@
         config.addManagedRepository( getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ) );
         config.addManagedRepository( getRepoConfiguration( RELEASES_TEST_REPO_ID, RELEASES_TEST_REPO_NAME ) );
         
-        populateReleasedSnapshotsTestInDiffRepo();
-
         String repoRoot = prepareTestRepos();        
 
+        // test listeners for the correct artifacts
+        listener.deleteArtifact( getRepository(), createArtifact( "org.apache.archiva",
+                                                                  "released-artifact-in-diff-repo", "1.0-SNAPSHOT",
+                                                                  "jar" ) );
+        listenerControl.replay();
+        
         repoPurge.process( PATH_TO_RELEASED_SNAPSHOT_IN_DIFF_REPO );
 
+        listenerControl.verify();
+        
         String projectRoot = repoRoot + "/org/apache/archiva/released-artifact-in-diff-repo";
         
         // check if the snapshot was removed
@@ -168,11 +178,14 @@
         config.removeManagedRepository( config.findManagedRepositoryById( TEST_REPO_ID ) );
         config.addManagedRepository( getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ) );
         
-        populateHigherSnapshotExistsTest();
-
         String repoRoot = prepareTestRepos();
 
+        // test listeners for the correct artifacts - no deletions
+        listenerControl.replay();
+        
         repoPurge.process( CleanupReleasedSnapshotsRepositoryPurgeTest.PATH_TO_HIGHER_SNAPSHOT_EXISTS_IN_SAME_REPO );
+
+        listenerControl.verify();
         
         String projectRoot = repoRoot + "/org/apache/maven/plugins/maven-source-plugin";
         
@@ -207,32 +220,4 @@
                                      "//metadata/versioning/versions/version", metadataXml );
         XMLAssert.assertXpathEvaluatesTo( "20070427033345", "//metadata/versioning/lastUpdated", metadataXml );
     }
-   
-    private void populateReleasedSnapshotsTest()
-        throws ArchivaDatabaseException
-    {
-        List<String> versions = new ArrayList<String>();
-        versions.add( "2.3-SNAPSHOT" );
-
-        populateDb( "org.apache.maven.plugins", "maven-plugin-plugin", versions );
-    }
-
-    private void populateHigherSnapshotExistsTest()
-        throws Exception
-    {
-        List<String> versions = new ArrayList<String>();
-        versions.add( "2.0.3-SNAPSHOT" );
-
-        populateDb( "org.apache.maven.plugins", "maven-source-plugin", versions );
-    }
-    
-    private void populateReleasedSnapshotsTestInDiffRepo()
-        throws ArchivaDatabaseException
-    {
-        List<String> versions = new ArrayList<String>();
-        versions.add( "1.0-SNAPSHOT" );
-        
-        populateDb( "org.apache.archiva", "released-artifact-in-diff-repo", versions );
-    }
-
 }

Modified: archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java
URL: http://svn.apache.org/viewvc/archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java?rev=702347&r1=702346&r2=702347&view=diff
==============================================================================
--- archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java (original)
+++ archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/DaysOldRepositoryPurgeTest.java Mon Oct  6 22:12:33 2008
@@ -19,17 +19,14 @@
  * under the License.
  */
 
-import org.apache.commons.lang.time.DateUtils;
-import org.apache.maven.archiva.consumers.core.repository.stubs.LuceneRepositoryContentIndexStub;
-import org.apache.maven.archiva.indexer.RepositoryContentIndex;
-
 import java.io.File;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Calendar;
-import java.util.HashMap;
+import java.util.Collections;
 import java.util.List;
-import java.util.Map;
+
+import org.apache.commons.lang.time.DateUtils;
 
 /**
  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
@@ -37,9 +34,6 @@
 public class DaysOldRepositoryPurgeTest
     extends AbstractRepositoryPurgeTest
 {
-
-    private Map<String, RepositoryContentIndex> map;
-
     private static final String[] extensions =
         new String[] { "-5.jar", "-5.pom", "-6.jar", "-6.pom", "-7.jar", "-7.pom" };
 
@@ -55,12 +49,6 @@
 
     private String sec;
 
-    protected void setUp()
-        throws Exception
-    {
-        super.setUp();
-    }
-
     private void setLastModified( String dirPath, long lastModified )
     {
         File dir = new File( dirPath );
@@ -74,14 +62,11 @@
     public void testByLastModified()
         throws Exception
     {
-        map = new HashMap<String, RepositoryContentIndex>();
-        map.put( "filecontent", new LuceneRepositoryContentIndexStub( 2 ) );
-        map.put( "hashcodes", new LuceneRepositoryContentIndexStub( 2 ) );
-        map.put( "bytecode", new LuceneRepositoryContentIndexStub( 2 ) );
-
         repoPurge =
-            new DaysOldRepositoryPurge( getRepository(), dao, getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ).getDaysOlder(),
-                                        getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ).getRetentionCount(), map );
+            new DaysOldRepositoryPurge( getRepository(),
+                                        getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ).getDaysOlder(),
+                                        getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ).getRetentionCount(),
+                                        Collections.singletonList( listener ) );
 
         String repoRoot = prepareTestRepos();
 
@@ -89,9 +74,16 @@
 
         setLastModified( projectRoot + "/2.2-SNAPSHOT/", 1179382029 );
 
-        populateDbForTestByLastModified();
-
+        // test listeners for the correct artifacts
+        listener.deleteArtifact( getRepository(), createArtifact( "org.apache.maven.plugins", "maven-install-plugin",
+                                                                  "2.2-SNAPSHOT", "maven-plugin" ) );
+        listener.deleteArtifact( getRepository(), createArtifact( "org.apache.maven.plugins", "maven-install-plugin",
+                                                                  "2.2-SNAPSHOT", "pom" ) );
+        listenerControl.replay();
+        
         repoPurge.process( PATH_TO_BY_DAYS_OLD_ARTIFACT );
+        
+        listenerControl.verify();
 
         assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.jar" );
         assertDeleted( projectRoot + "/2.2-SNAPSHOT/maven-install-plugin-2.2-SNAPSHOT.jar.md5" );
@@ -119,14 +111,10 @@
     public void testOrderOfDeletion()
         throws Exception
     {
-        map = new HashMap<String, RepositoryContentIndex>();
-        map.put( "filecontent", new LuceneRepositoryContentIndexStub( 2 ) );
-        map.put( "hashcodes", new LuceneRepositoryContentIndexStub( 2 ) );
-        map.put( "bytecode", new LuceneRepositoryContentIndexStub( 2 ) );
-
         repoPurge =
-            new DaysOldRepositoryPurge( getRepository(), dao, getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ).getDaysOlder(),
-                                        getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ).getRetentionCount(), map );
+            new DaysOldRepositoryPurge( getRepository(), getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ).getDaysOlder(),
+                                        getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ).getRetentionCount(), 
+                                        Collections.singletonList( listener ) );
 
         String repoRoot = prepareTestRepos();
 
@@ -134,10 +122,17 @@
 
         setLastModified( projectRoot + "/1.1.2-SNAPSHOT/", 1179382029 );
 
-        populateDbForTestOrderOfDeletion();
-
+        // test listeners for the correct artifacts
+        listener.deleteArtifact( getRepository(), createArtifact( "org.apache.maven.plugins", "maven-assembly-plugin",
+                                                                  "1.1.2-20070427.065136-1", "maven-plugin" ) );
+        listener.deleteArtifact( getRepository(), createArtifact( "org.apache.maven.plugins", "maven-assembly-plugin",
+                                                                  "1.1.2-20070427.065136-1", "pom" ) );
+        listenerControl.replay();
+        
         repoPurge.process( PATH_TO_TEST_ORDER_OF_DELETION );
 
+        listenerControl.verify();
+
         assertDeleted( projectRoot + "/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070427.065136-1.jar" );
         assertDeleted( projectRoot + "/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070427.065136-1.jar.sha1" );
         assertDeleted( projectRoot + "/1.1.2-SNAPSHOT/maven-assembly-plugin-1.1.2-20070427.065136-1.jar.md5" );
@@ -164,14 +159,11 @@
     public void testMetadataDrivenSnapshots()
         throws Exception
     {
-        map = new HashMap<String, RepositoryContentIndex>();
-        map.put( "filecontent", new LuceneRepositoryContentIndexStub( 2 ) );
-        map.put( "hashcodes", new LuceneRepositoryContentIndexStub( 2 ) );
-        map.put( "bytecode", new LuceneRepositoryContentIndexStub( 2 ) );
-
         repoPurge =
-            new DaysOldRepositoryPurge( getRepository(), dao, getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ).getDaysOlder(),
-                                        getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ).getRetentionCount(), map );
+            new DaysOldRepositoryPurge( getRepository(),
+                                        getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ).getDaysOlder(),
+                                        getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME ).getRetentionCount(),
+                                        Collections.singletonList( listener ) );
 
         String repoRoot = prepareTestRepos();
 
@@ -221,10 +213,17 @@
         versions.add( "1.4.3-" + year + mon + day + "." + hr + min + sec + "-7" );
         versions.add( "1.4.3-SNAPSHOT" );
 
-        populateDb( "org.codehaus.plexus", "plexus-utils", versions );
-
+        // test listeners for the correct artifacts
+        listener.deleteArtifact( getRepository(), createArtifact( "org.codehaus.plexus", "plexus-utils",
+                                                                  "1.4.3-20070113.163208-4", "jar" ) );
+        listener.deleteArtifact( getRepository(), createArtifact( "org.codehaus.plexus", "plexus-utils",
+                                                                  "1.4.3-20070113.163208-4", "pom" ) );
+        listenerControl.replay();
+        
         repoPurge.process( PATH_TO_BY_DAYS_OLD_METADATA_DRIVEN_ARTIFACT );
 
+        listenerControl.verify();
+
         // this should be deleted since the filename version (timestamp) is older than
         // 100 days even if the last modified date was <100 days ago
         assertDeleted( versionRoot + "/plexus-utils-1.4.3-20070113.163208-4.jar" );
@@ -260,15 +259,4 @@
         super.tearDown();
         repoPurge = null;
     }
-
-    private void populateDbForTestByLastModified()
-        throws Exception
-    {
-        List<String> versions = new ArrayList<String>();
-        versions.add( "2.2-20061118.060401-2" );
-        versions.add( "2.2-20070513.034619-5" );
-        versions.add( "2.2-SNAPSHOT" );
-
-        populateDb( "org.apache.maven.plugins", "maven-install-plugin", versions );
-    }
 }

Modified: archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.java
URL: http://svn.apache.org/viewvc/archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.java?rev=702347&r1=702346&r2=702347&view=diff
==============================================================================
--- archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.java (original)
+++ archiva/branches/MRM-124/archiva-modules/archiva-base/archiva-consumers/archiva-core-consumers/src/test/java/org/apache/maven/archiva/consumers/core/repository/RepositoryPurgeConsumerTest.java Mon Oct  6 22:12:33 2008
@@ -19,6 +19,8 @@
  * under the License.
  */
 
+import java.io.File;
+
 import org.apache.commons.io.FileUtils;
 import org.apache.maven.archiva.common.utils.BaseFile;
 import org.apache.maven.archiva.configuration.ArchivaConfiguration;
@@ -27,15 +29,9 @@
 import org.apache.maven.archiva.configuration.FileTypes;
 import org.apache.maven.archiva.configuration.ManagedRepositoryConfiguration;
 import org.apache.maven.archiva.consumers.KnownRepositoryContentConsumer;
-import org.apache.maven.archiva.consumers.core.repository.stubs.LuceneRepositoryContentIndexFactoryStub;
-import org.apache.maven.archiva.database.ArchivaDatabaseException;
 import org.apache.maven.archiva.repository.scanner.functors.ConsumerWantsFilePredicate;
 import org.custommonkey.xmlunit.XMLAssert;
 
-import java.io.File;
-import java.util.ArrayList;
-import java.util.List;
-
 /**
  * @author <a href="mailto:oching@apache.org">Maria Odea Ching</a>
  */
@@ -99,13 +95,6 @@
             (KnownRepositoryContentConsumer) lookup( KnownRepositoryContentConsumer.class,
                                                      "repo-purge-consumer-by-retention-count" );
 
-        LuceneRepositoryContentIndexFactoryStub indexFactory = new LuceneRepositoryContentIndexFactoryStub();
-        indexFactory.setExpectedRecordsSize( 2 );
-
-        ( (RepositoryPurgeConsumer) repoPurgeConsumer ).setRepositoryContentIndexFactory( indexFactory );
-
-        populateDbForRetentionCountTest();
-
         ManagedRepositoryConfiguration repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
         repoConfiguration.setDaysOlder( 0 ); // force days older off to allow retention count purge to execute.
         repoConfiguration.setRetentionCount( TEST_RETENTION_COUNT );
@@ -163,17 +152,10 @@
     public void testConsumerByDaysOld()
         throws Exception
     {
-        populateDbForDaysOldTest();
-
         KnownRepositoryContentConsumer repoPurgeConsumer =
             (KnownRepositoryContentConsumer) lookup( KnownRepositoryContentConsumer.class,
                                                      "repo-purge-consumer-by-days-old" );
 
-        LuceneRepositoryContentIndexFactoryStub indexFactory = new LuceneRepositoryContentIndexFactoryStub();
-        indexFactory.setExpectedRecordsSize( 2 );
-
-        ( (RepositoryPurgeConsumer) repoPurgeConsumer ).setRepositoryContentIndexFactory( indexFactory );
-
         ManagedRepositoryConfiguration repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
         repoConfiguration.setDaysOlder( TEST_DAYS_OLDER );
         addRepoToConfiguration( "days-old", repoConfiguration );
@@ -222,8 +204,6 @@
             (KnownRepositoryContentConsumer) lookup( KnownRepositoryContentConsumer.class,
                                                      "repo-purge-consumer-by-retention-count" );
 
-        populateDbForReleasedSnapshotsTest();
-
         ManagedRepositoryConfiguration repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
         repoConfiguration.setDeleteReleasedSnapshots( false ); // Set to NOT delete released snapshots.
         addRepoToConfiguration( "retention-count", repoConfiguration );
@@ -265,8 +245,6 @@
             (KnownRepositoryContentConsumer) lookup( KnownRepositoryContentConsumer.class,
                                                      "repo-purge-consumer-by-days-old" );
 
-        populateDbForReleasedSnapshotsTest();
-
         ManagedRepositoryConfiguration repoConfiguration = getRepoConfiguration( TEST_REPO_ID, TEST_REPO_NAME );
         repoConfiguration.setDeleteReleasedSnapshots( true );
         addRepoToConfiguration( "days-old", repoConfiguration );
@@ -301,34 +279,4 @@
                                      "//metadata/versioning/versions/version", metadataXml );
         XMLAssert.assertXpathEvaluatesTo( "20070315032817", "//metadata/versioning/lastUpdated", metadataXml );
     }
-
-    public void populateDbForRetentionCountTest()
-        throws ArchivaDatabaseException
-    {
-        List<String> versions = new ArrayList<String>();
-        versions.add( "1.0RC1-20070504.153317-1" );
-        versions.add( "1.0RC1-20070504.160758-2" ); 
-        versions.add( "1.0RC1-20070505.090015-3" );
-        versions.add( "1.0RC1-20070506.090132-4" );
-
-        populateDb( "org.jruby.plugins", "jruby-rake-plugin", versions );
-    }
-
-    private void populateDbForDaysOldTest()
-        throws ArchivaDatabaseException
-    {
-        List<String> versions = new ArrayList<String>();
-        versions.add( "2.2-SNAPSHOT" );
-
-        populateDb( "org.apache.maven.plugins", "maven-install-plugin", versions );
-    }
-
-    public void populateDbForReleasedSnapshotsTest()
-        throws ArchivaDatabaseException
-    {
-        List<String> versions = new ArrayList<String>();
-        versions.add( "2.3-SNAPSHOT" );
-
-        populateDb( "org.apache.maven.plugins", "maven-plugin-plugin", versions );
-    }
 }



Mime
View raw message