Return-Path: Delivered-To: apmail-maven-archiva-dev-archive@locus.apache.org Received: (qmail 37128 invoked from network); 16 Oct 2007 03:10:22 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (140.211.11.2) by minotaur.apache.org with SMTP; 16 Oct 2007 03:10:22 -0000 Received: (qmail 97859 invoked by uid 500); 16 Oct 2007 03:10:10 -0000 Delivered-To: apmail-maven-archiva-dev-archive@maven.apache.org Received: (qmail 97821 invoked by uid 500); 16 Oct 2007 03:10:10 -0000 Mailing-List: contact archiva-dev-help@maven.apache.org; run by ezmlm Precedence: bulk List-Help: List-Unsubscribe: List-Post: List-Id: Reply-To: archiva-dev@maven.apache.org Delivered-To: mailing list archiva-dev@maven.apache.org Received: (qmail 97812 invoked by uid 99); 16 Oct 2007 03:10:09 -0000 Received: from athena.apache.org (HELO athena.apache.org) (140.211.11.136) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 15 Oct 2007 20:10:09 -0700 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (athena.apache.org: domain of oching@exist.com designates 209.85.146.183 as permitted sender) Received: from [209.85.146.183] (HELO wa-out-1112.google.com) (209.85.146.183) by apache.org (qpsmtpd/0.29) with ESMTP; Tue, 16 Oct 2007 03:10:05 +0000 Received: by wa-out-1112.google.com with SMTP id v33so2125068wah for ; Mon, 15 Oct 2007 20:09:21 -0700 (PDT) Received: by 10.114.174.2 with SMTP id w2mr7843442wae.1192504160563; Mon, 15 Oct 2007 20:09:20 -0700 (PDT) Received: from ?192.168.241.218? ( [58.71.13.205]) by mx.google.com with ESMTPS id a8sm6274581poa.2007.10.15.20.09.17 (version=TLSv1/SSLv3 cipher=RC4-MD5); Mon, 15 Oct 2007 20:09:19 -0700 (PDT) Message-ID: <47142B5D.3020206@exist.com> Date: Tue, 16 Oct 2007 11:09:17 +0800 From: Maria Odea Ching User-Agent: Thunderbird 1.5.0.13 (X11/20070824) MIME-Version: 1.0 To: archiva-dev@maven.apache.org Subject: Re: svn commit: r584735 - in /maven/archiva/trunk: archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/ archiva-base/archiva-consumers/archiva-database-consumers/src/test/java/ archiva-base/ar... References: <20071015111645.1E5921A9832@eris.apache.org> <48010347-841C-4B14-AE06-D13F7896714B@apache.org> In-Reply-To: <48010347-841C-4B14-AE06-D13F7896714B@apache.org> Content-Type: text/plain; charset=US-ASCII; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Checked: Checked by ClamAV on apache.org Brett Porter wrote: > Hi Deng, > > On 15/10/2007, at 7:16 PM, oching@apache.org wrote: > >> [MRM-37 and MRM-527] >> - added code for cleaning up the database of artifacts that are no >> longer existing in the repository >> (DatabaseCleanupRemoveArtifactConsumer and >> DatabaseCleanupRemoveProjectConsumer) >> - created tests for database cleanup of removed artifacts >> - updated some of the test cases (in archiva-database and >> archiva-scheduled modules) to reflect the changes in thedb cleanup >> consumers > > Cool - looks good. A couple of quick questions :) > >> + /** >> + * @plexus.requirement >> + */ >> + private BidirectionalRepositoryLayoutFactory layoutFactory; >> + >> + /** >> + * @plexus.requirement >> + */ >> + private RepositoryContentFactory repositoryFactory; >> + > > I'm probably wrong, but I understood the content factory should be > used instead of the layoutFactory - does it provide a way to do this > instead, or did I misunderstand? > I think the content factory only provides the repository configuration while the layout factory provides a means of getting the layout (BidirectionalRepositoryLayout) of the repository where the artifact is located and converting the path from the given artifact. I needed the content factory to get the repository url and the layout factory for the artifact path so I could get the absolute path to the actual artifact and check if it still exists. :) > >> >> Modified: >> maven/archiva/trunk/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveProjectConsumer.java >> >> URL: >> http://svn.apache.org/viewvc/maven/archiva/trunk/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveProjectConsumer.java?rev=584735&r1=584734&r2=584735&view=diff >> >> ============================================================================== >> >> --- >> maven/archiva/trunk/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveProjectConsumer.java >> (original) >> +++ >> maven/archiva/trunk/archiva-base/archiva-consumers/archiva-database-consumers/src/main/java/org/apache/maven/archiva/consumers/database/DatabaseCleanupRemoveProjectConsumer.java >> Mon Oct 15 04:16:38 2007 >> @@ -19,17 +19,31 @@ >> * under the License. >> */ >> > > ... > >> + catch ( RepositoryException re ) >> + { >> + re.printStackTrace(); >> + throw new ConsumerException( "Can't run database cleanup remove >> artifact consumer: " + >> + re.getMessage() ); >> + } >> + catch ( ArchivaDatabaseException e ) >> + { >> + e.printStackTrace(); >> + throw new ConsumerException( e.getMessage() ); >> + } >> + >> } > > Couple of printStackTraces got left behind :) Ooops, sorry about that :) I forgot to remove them. > > Cheers, > Brett > > -- > Brett Porter - brett@apache.org > Blog: http://www.devzuz.org/blogs/bporter/ > Thanks, Deng