From server-devlaurawalker@example.com Sun Nov 01 08:35:18 2009 Return-Path: <server-devlaurawalker@example.com> Delivered-To: laurawalker@example.com Received: (qmail 83682 invoked from network); 1 Nov 2009 08:35:18 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Nov 2009 08:35:18 -0000 Received: (qmail 65791 invoked by uid 500); 1 Nov 2009 08:35:18 -0000 Delivered-To: laurawalker@example.com Received: (qmail 65697 invoked by uid 500); 1 Nov 2009 08:35:17 -0000 Mailing-List: contact laurawalker@example.com; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:laurawalker@example.com> List-Help: <mailto:laurawalker@example.com> List-Post: <mailto:laurawalker@example.com> List-Id: "James Developers List" <server-dev.james.apache.org> Reply-To: "James Developers List" <laurawalker@example.com> Delivered-To: mailing list laurawalker@example.com Received: (qmail 65686 invoked by uid 99); 1 Nov 2009 08:35:16 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Nov 2009 08:35:16 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=MSGID_FROM_MTA_HEADER,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO mail.devtech.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Nov 2009 08:35:07 +0000 Message-ID: <laurawalker@example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-MessageIsInfected: false Received: from cpe-024-168-243-113.sc.res.rr.com. ([83.161.120.155]) by mail.devtech.com (JAMES SMTP Server 2.3.1-dev) with SMTP ID 34 for <laurawalker@example.com>; Sun, 1 Nov 2009 03:34:46 -0500 (EST) Date: Sun, 1 Nov 2009 03:34:46 -0500 (EST) Sender: laurawalker@example.com To: JAMES Server Development <laurawalker@example.com> From: JAMES Nightly Build System <laurawalker@example.com> Subject: JAMES Server Nightly Build Report X-Virus-Checked: Checked by ClamAV on apache.org An automated nightly build of JAMES has been posted to http://people.apache.org/builds/james/nightly/ -------------------------------------------------------------------- Any unit test errors from the build should be reported below: -------------------------------------------------------------------- BUILD SUCCESSFUL Total time: 4 minutes 33 seconds -------------------------------------------------------------------- Done. Packages Will Be Uploaded To The Nightly Repository. -------------------------------------------------------------------- Please review http://people.apache.org/builds/james/nightly/BUILD.log. --------------------------------------------------------------------- To unsubscribe, e-mail: laurawalker@example.com For additional commands, e-mail: laurawalker@example.com From server-devlaurawalker@example.com Sun Nov 01 10:06:27 2009 Return-Path: <server-devlaurawalker@example.com> Delivered-To: laurawalker@example.com Received: (qmail 94156 invoked from network); 1 Nov 2009 10:06:27 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 1 Nov 2009 10:06:27 -0000 Received: (qmail 83968 invoked by uid 500); 1 Nov 2009 10:06:26 -0000 Delivered-To: laurawalker@example.com Received: (qmail 83878 invoked by uid 500); 1 Nov 2009 10:06:26 -0000 Mailing-List: contact laurawalker@example.com; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:laurawalker@example.com> List-Help: <mailto:laurawalker@example.com> List-Post: <mailto:laurawalker@example.com> List-Id: "James Developers List" <server-dev.james.apache.org> Reply-To: "James Developers List" <laurawalker@example.com> Delivered-To: mailing list laurawalker@example.com Received: (qmail 83868 invoked by uid 99); 1 Nov 2009 10:06:26 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Nov 2009 10:06:26 +0000 X-ASF-Spam-Status: No, hits=-0.0 required=10.0 tests=SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: domain of laurawalker@example.com designates 83.161.120.155 as permitted sender) Received: from [83.161.120.155] (HELO ey-out-1920.google.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Sun, 01 Nov 2009 10:06:15 +0000 Received: by ey-out-1920.google.com with SMTP id 5so784935eyb.44 for <laurawalker@example.com>; Sun, 01 Nov 2009 02:05:55 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=googlemail.com; s=gamma; h=domainkey-signature:mime-version:sender:received:in-reply-to :references:date:x-google-sender-auth:message-id:subject:from:to:cc :content-type; bh=QcjEdgSdrvQ4BgAZ0jN/M+NJvJ+zcFnvaTqbUl3KI/8=; b=JzqJeYuI8EWQHN2c3cEZZ98Rksq+FblOg8cE28dwDQlUxxZyghXRIioJ/+qJbyWIZN L/YhECWANkDp88ICLNhL0Fmw+4izsNVesCtiIJwWuYoM/LsUBQNOxmIcXSMnN3/80VDZ pYTcXrwBIq1D5Zc2wLUEs9h0mcpw4CnHdzm5w= DomainKey-Signature: a=rsa-sha1; c=nofws; d=googlemail.com; s=gamma; h=mime-version:sender:in-reply-to:references:date :x-google-sender-auth:message-id:subject:from:to:cc:content-type; b=QCbJ3jIA02mrl97qddlWMHyCizf4e9UULVaI8lBiShhwyFStPbwMDc3e8y9YleXiP8 Zl7WoeCXlWfQcSePsp+fsPM3eW0hIWHftCOE8yIl/QwSkGlHaqcepxK69+LT/LtLe+jC mpPDHTuY1AO3fhPJtwWzlf2xrfRl6rUkjSGlo= MIME-Version: 1.0 Sender: laurawalker@example.com Received: by 83.161.120.155 with SMTP id w14mr2966777wee.74.1257069955061; Sun, 01 Nov 2009 02:05:55 -0800 (PST) In-Reply-To: <laurawalker@example.com> References: <laurawalker@example.com> <laurawalker@example.com> <laurawalker@example.com> <laurawalker@example.com> <laurawalker@example.com> Date: Sun, 1 Nov 2009 11:05:55 +0100 X-Google-Sender-Auth: 2970b8630f9baf03 Message-ID: <laurawalker@example.com> Subject: Re: [HUPA]Re: Hupa build issue From: Norman Maurer <laurawalker@example.com> To: mohan chinnappan <laurawalker@example.com> Cc: James Developers List <laurawalker@example.com> Content-Type: text/plain; charset=ISO-8859-1 X-Virus-Checked: Checked by ClamAV on apache.org Hi Mohan, The count reflect the number of "unread" messages. The same is done for example in googlemail. Bye Norman 2009/10/31, mohan chinnappan <laurawalker@example.com>: > Dear Norman, > > Today I checked the build with Linux (ubuntu), the build had no issues. > > I found a bug. The *Sent* messages count does not reflect correct number of > messages in the sent folder. > > I have attached the screenshot for this. > > -- > Regards, > Mohan > > On Thu, Oct 29, 2009 at 1:54 PM, Norman Maurer <laurawalker@example.com> wrote: > >> Sure.. Contributions are always welcome :) >> >> Bye, >> Norman >> >> >> 2009/10/29 mohan chinnappan <laurawalker@example.com>: >> > Dear Norman, >> > >> > Thanks for the quick reply. >> > >> > Yes, I use Windows ( I will check this on my Linux box later). The >> command >> > that I used: clean package. >> > >> > You are correct. I also think it is Windows-specific problem. We need >> > to >> > use OS independent path separators. >> > >> > Do you want me look and fix this problem? Please let me know. >> > >> > With Best Regards, >> > Mohan >> > >> > On Thu, Oct 29, 2009 at 1:46 PM, Norman Maurer <laurawalker@example.com> >> wrote: >> >> >> >> Hi Mohan, >> >> >> >> the project compiles without a problem here. >> >> >> >> What mvn command did you run ? Using "mvn clean package" works without >> >> problems here (I'm on a mac so maybe its related to windows). >> >> >> >> Thx, >> >> Norman >> >> >> >> Ps: I send the message to server-dev too, because thats the >> >> mailinglist used for hupa. >> >> >> >> 2009/10/29 mohan chinnappan <laurawalker@example.com>: >> >> > Dear Norman Maurer, >> >> > >> >> > Greetings! >> >> > >> >> > I just checked Hupa code from SVN and when I complied today with >> >> > Maven >> >> > build, I get the following error: >> >> > >> >> > ------- >> >> > ... >> >> > at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method) >> >> > at >> >> > >> >> > >> sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39) >> >> > at >> >> > >> >> > >> sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25) >> >> > at java.lang.reflect.Method.invoke(Method.java:597) >> >> > at >> >> > >> >> > >> org.apache.maven.surefire.booter.SurefireBooter.runSuitesInProcess(SurefireBooter.java:345) >> >> > at >> >> > >> >> > >> org.apache.maven.surefire.booter.SurefireBooter.main(SurefireBooter.java:1009) >> >> > java.io.FileNotFoundException: >> >> > C:\Users\mohan\workspace\hupa\server\war\WEB-INF\classes\mime%5c3.msg >> >> > (The >> >> > system cannot find the file specified) >> >> > at java.io.FileInputStream.open(Native Method) >> >> > .... >> >> > >> >> > -- >> >> > Here is the list of msg files under my eclipse's workspace: >> >> > >> >> > mohan@mohan-PC ~/workspace/hupa >> >> > $ find . -name *msg -print >> >> > ./client/war/WEB-INF/classes/mime/0.msg >> >> > ./client/war/WEB-INF/classes/mime/1.msg >> >> > ./client/war/WEB-INF/classes/mime/2.msg >> >> > ./client/war/WEB-INF/classes/mime/3.msg >> >> > ./client/war/WEB-INF/classes/mime/4.msg >> >> > ./client/war/WEB-INF/classes/mime/5.msg >> >> > ./client/war/WEB-INF/classes/mime/6.msg >> >> > ./client/war/WEB-INF/classes/mime/7.msg >> >> > ./server/src/main/resources/mime/0.msg >> >> > ./server/src/main/resources/mime/1.msg >> >> > ./server/src/main/resources/mime/2.msg >> >> > ./server/src/main/resources/mime/3.msg >> >> > ./server/src/main/resources/mime/4.msg >> >> > ./server/src/main/resources/mime/5.msg >> >> > ./server/src/main/resources/mime/6.msg >> >> > ./server/src/main/resources/mime/7.msg >> >> > ./server/war/WEB-INF/classes/mime/0.msg >> >> > ./server/war/WEB-INF/classes/mime/1.msg >> >> > ./server/war/WEB-INF/classes/mime/2.msg >> >> > ./server/war/WEB-INF/classes/mime/3.msg >> >> > ./server/war/WEB-INF/classes/mime/4.msg >> >> > ./server/war/WEB-INF/classes/mime/5.msg >> >> > ./server/war/WEB-INF/classes/mime/6.msg >> >> > ./server/war/WEB-INF/classes/mime/7.msg >> >> > >> >> > Looks like mime file path is mangled. Any input is appreciated. >> >> > >> >> > Also, I like to contribute to Hupa development, please let me know >> how. >> >> > >> >> > >> >> > Regards, >> >> > Mohan >> >> > >> > >> > >> > >> > --------------------------------------------------------------------- To unsubscribe, e-mail: laurawalker@example.com For additional commands, e-mail: laurawalker@example.com From server-devlaurawalker@example.com Mon Nov 02 08:35:24 2009 Return-Path: <server-devlaurawalker@example.com> Delivered-To: laurawalker@example.com Received: (qmail 41919 invoked from network); 2 Nov 2009 08:35:24 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Nov 2009 08:35:24 -0000 Received: (qmail 15282 invoked by uid 500); 2 Nov 2009 08:35:24 -0000 Delivered-To: laurawalker@example.com Received: (qmail 15190 invoked by uid 500); 2 Nov 2009 08:35:23 -0000 Mailing-List: contact laurawalker@example.com; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:laurawalker@example.com> List-Help: <mailto:laurawalker@example.com> List-Post: <mailto:laurawalker@example.com> List-Id: "James Developers List" <server-dev.james.apache.org> Reply-To: "James Developers List" <laurawalker@example.com> Delivered-To: mailing list laurawalker@example.com Received: (qmail 15180 invoked by uid 99); 2 Nov 2009 08:35:23 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Nov 2009 08:35:23 +0000 X-ASF-Spam-Status: No, hits=1.5 required=10.0 tests=MSGID_FROM_MTA_HEADER,SPF_PASS X-Spam-Check-By: apache.org Received-SPF: pass (nike.apache.org: local policy) Received: from [83.161.120.155] (HELO mail.devtech.com) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Nov 2009 08:35:14 +0000 Message-ID: <laurawalker@example.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-MessageIsInfected: false Received: from cpe-024-168-243-113.sc.res.rr.com. ([83.161.120.155]) by mail.devtech.com (JAMES SMTP Server 2.3.1-dev) with SMTP ID 364 for <laurawalker@example.com>; Mon, 2 Nov 2009 03:34:52 -0500 (EST) Date: Mon, 2 Nov 2009 03:34:52 -0500 (EST) Sender: laurawalker@example.com To: JAMES Server Development <laurawalker@example.com> From: JAMES Nightly Build System <laurawalker@example.com> Subject: JAMES Server Nightly Build Report X-Virus-Checked: Checked by ClamAV on apache.org An automated nightly build of JAMES has been posted to http://people.apache.org/builds/james/nightly/ -------------------------------------------------------------------- Any unit test errors from the build should be reported below: -------------------------------------------------------------------- BUILD SUCCESSFUL Total time: 4 minutes 35 seconds -------------------------------------------------------------------- Done. Packages Will Be Uploaded To The Nightly Repository. -------------------------------------------------------------------- Please review http://people.apache.org/builds/james/nightly/BUILD.log. --------------------------------------------------------------------- To unsubscribe, e-mail: laurawalker@example.com For additional commands, e-mail: laurawalker@example.com From server-devlaurawalker@example.com Mon Nov 02 08:42:23 2009 Return-Path: <server-devlaurawalker@example.com> Delivered-To: laurawalker@example.com Received: (qmail 43184 invoked from network); 2 Nov 2009 08:42:23 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Nov 2009 08:42:23 -0000 Received: (qmail 20181 invoked by uid 500); 2 Nov 2009 08:42:22 -0000 Delivered-To: laurawalker@example.com Received: (qmail 20102 invoked by uid 500); 2 Nov 2009 08:42:22 -0000 Mailing-List: contact laurawalker@example.com; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:laurawalker@example.com> List-Help: <mailto:laurawalker@example.com> List-Post: <mailto:laurawalker@example.com> List-Id: "James Developers List" <server-dev.james.apache.org> Reply-To: "James Developers List" <laurawalker@example.com> Delivered-To: mailing list laurawalker@example.com Received: (qmail 20092 invoked by uid 99); 2 Nov 2009 08:42:22 -0000 Received: from athena.apache.org (HELO athena.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Nov 2009 08:42:22 +0000 X-ASF-Spam-Status: No, hits=-10.4 required=5.0 tests=AWL,BAYES_00,RCVD_IN_DNSWL_HI X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO brutus.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Nov 2009 08:42:19 +0000 Received: from brutus (localhost [83.161.120.155]) by brutus.apache.org (Postfix) with ESMTP id 93811234C4AC for <laurawalker@example.com>; Mon, 2 Nov 2009 00:41:59 -0800 (PST) Message-ID: <1670716348.1257151319602.JavaMail.jira@brutus> Date: Mon, 2 Nov 2009 08:41:59 +0000 (UTC) From: "Stefano Bagnara (JIRA)" <laurawalker@example.com> To: laurawalker@example.com Subject: [jira] Created: (JSPF-85) Upgrade test suite to rfc4408-tests-2009.10.yml MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit X-JIRA-FingerPrint: 30527f35849b9dde25b450d4833f0394 Upgrade test suite to rfc4408-tests-2009.10.yml ----------------------------------------------- Key: JSPF-85 URL: https://issues.apache.org/jira/browse/JSPF-85 Project: JAMES jSPF Issue Type: Improvement Components: Tester Reporter: Stefano Bagnara Fix For: 0.9.8 The 2009.10 test has just been released. http://www.openspf.org/source/project/test-suite/ -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: laurawalker@example.com For additional commands, e-mail: laurawalker@example.com From server-devlaurawalker@example.com Mon Nov 02 10:08:53 2009 Return-Path: <server-devlaurawalker@example.com> Delivered-To: laurawalker@example.com Received: (qmail 64948 invoked from network); 2 Nov 2009 10:08:53 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Nov 2009 10:08:53 -0000 Received: (qmail 28120 invoked by uid 500); 2 Nov 2009 10:08:52 -0000 Delivered-To: laurawalker@example.com Received: (qmail 28049 invoked by uid 500); 2 Nov 2009 10:08:52 -0000 Mailing-List: contact laurawalker@example.com; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:laurawalker@example.com> List-Help: <mailto:laurawalker@example.com> List-Post: <mailto:laurawalker@example.com> List-Id: "James Developers List" <server-dev.james.apache.org> Reply-To: "James Developers List" <laurawalker@example.com> Delivered-To: mailing list laurawalker@example.com Received: (qmail 28039 invoked by uid 500); 2 Nov 2009 10:08:51 -0000 Received: (qmail 28036 invoked by uid 99); 2 Nov 2009 10:08:51 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Nov 2009 10:08:51 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Nov 2009 10:08:47 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 8FD1023888A6; Mon, 2 Nov 2009 10:08:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r831840 - in /james/server/trunk: management-library/src/main/java/org/apache/james/management/ management-library/src/test/java/org/ management-library/src/test/java/org/apache/ management-library/src/test/java/org/apache/james/ management... Date: Mon, 02 Nov 2009 10:08:25 -0000 To: laurawalker@example.com From: laurawalker@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <laurawalker@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: norman Date: Mon Nov 2 10:08:24 2009 New Revision: 831840 URL: http://svn.apache.org/viewvc?rev=831840&view=rev Log: Add AvalonRemoteManager(JAMES-893) Added: james/server/trunk/management-library/src/test/java/org/ james/server/trunk/management-library/src/test/java/org/apache/ james/server/trunk/management-library/src/test/java/org/apache/james/ james/server/trunk/management-library/src/test/java/org/apache/james/management/ james/server/trunk/management-library/src/test/java/org/apache/james/management/mock/ james/server/trunk/management-library/src/test/java/org/apache/james/management/mock/MockVirtualUserTableManagementService.java james/server/trunk/remotemanager-function/src/main/java/org/apache/james/remotemanager/AvalonRemoteManager.java james/server/trunk/remotemanager-function/src/main/resources/org/apache/james/remotemanager/AvalonRemoteManager.xinfo - copied unchanged from r829709, james/server/trunk/remotemanager-function/src/main/resources/org/apache/james/remotemanager/RemoteManager.xinfo james/server/trunk/remotemanager-function/src/test/java/org/apache/james/remotemanager/AvalonRemoteManagerTest.java Removed: james/server/trunk/remotemanager-function/src/main/resources/org/apache/james/remotemanager/RemoteManager.xinfo Modified: james/server/trunk/management-library/src/main/java/org/apache/james/management/SpoolManagementService.java james/server/trunk/phoenix-deployment/src/conf/james-assembly.xml james/server/trunk/remotemanager-function/src/test/java/org/apache/james/remotemanager/RemoteManagerTest.java Modified: james/server/trunk/management-library/src/main/java/org/apache/james/management/SpoolManagementService.java URL: http://svn.apache.org/viewvc/james/server/trunk/management-library/src/main/java/org/apache/james/management/SpoolManagementService.java?rev=831840&r1=831839&r2=831840&view=diff ============================================================================== --- james/server/trunk/management-library/src/main/java/org/apache/james/management/SpoolManagementService.java (original) +++ james/server/trunk/management-library/src/main/java/org/apache/james/management/SpoolManagementService.java Mon Nov 2 10:08:24 2009 @@ -54,7 +54,7 @@ * @throws MessagingException * @throws SpoolManagementException */ - public int removeSpoolItems(String spoolRepositoryURL, String key, List lockingFailures, SpoolFilter filter) + public int removeSpoolItems(String spoolRepositoryURL, String key, List<String> lockingFailures, SpoolFilter filter) throws MessagingException, SpoolManagementException; /** @@ -69,7 +69,7 @@ * @throws MessagingException * @throws SpoolManagementException */ - public int resendSpoolItems(String spoolRepositoryURL, String key, List lockingFailures, SpoolFilter filter) + public int resendSpoolItems(String spoolRepositoryURL, String key, List<String> lockingFailures, SpoolFilter filter) throws MessagingException, SpoolManagementException; /** @@ -82,6 +82,6 @@ * @throws MessagingException * @throws SpoolManagementException */ - public List getSpoolItems(String spoolRepositoryURL, SpoolFilter filter) + public List<String> getSpoolItems(String spoolRepositoryURL, SpoolFilter filter) throws MessagingException, SpoolManagementException; } Added: james/server/trunk/management-library/src/test/java/org/apache/james/management/mock/MockVirtualUserTableManagementService.java URL: http://svn.apache.org/viewvc/james/server/trunk/management-library/src/test/java/org/apache/james/management/mock/MockVirtualUserTableManagementService.java?rev=831840&view=auto ============================================================================== --- james/server/trunk/management-library/src/test/java/org/apache/james/management/mock/MockVirtualUserTableManagementService.java (added) +++ james/server/trunk/management-library/src/test/java/org/apache/james/management/mock/MockVirtualUserTableManagementService.java Mon Nov 2 10:08:24 2009 @@ -0,0 +1,181 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ +package org.apache.james.management.mock; + +import java.util.ArrayList; +import java.util.Collection; +import java.util.HashMap; +import java.util.Iterator; +import java.util.Map; + +import org.apache.james.api.vut.management.VirtualUserTableManagementException; +import org.apache.james.api.vut.management.VirtualUserTableManagementService; + +public class MockVirtualUserTableManagementService implements VirtualUserTableManagementService{ + private Map<String,Collection<String>> mappings = new HashMap<String, Collection<String>>(); + + public boolean addAddressMapping(String virtualUserTable, String user, + String domain, String address) + throws VirtualUserTableManagementException { + Collection<String> map = mappings.get(user + "@" + domain); + if (map == null) { + map = new ArrayList<String>(); + mappings.put(user + "@" + domain, map); + + } else { + if (map.contains(address)) return false; + } + return map.add(address); + } + + public boolean addAliasDomainMapping(String virtualUserTable, + String aliasDomain, String realDomain) + throws VirtualUserTableManagementException { + Collection<String> map = mappings.get(realDomain); + if (map == null) { + map = new ArrayList<String>(); + mappings.put(realDomain, map); + + } else { + if (map.contains(aliasDomain)) return false; + } + return map.add(aliasDomain); + } + + public boolean addErrorMapping(String virtualUserTable, String user, + String domain, String error) + throws VirtualUserTableManagementException { + Collection<String> map = mappings.get(user + "@" + domain); + if (map == null) { + map = new ArrayList<String>(); + mappings.put(user + "@" + domain, map); + } else { + if (map.contains(error)) return false; + } + return map.add(error); + } + + public boolean addMapping(String virtualUserTable, String user, + String domain, String mapping) + throws VirtualUserTableManagementException { + Collection<String> map = mappings.get(user + "@" + domain); + if (map == null) { + map = new ArrayList<String>(); + mappings.put(user + "@" + domain, map); + } else { + if (map.contains(mapping)) return false; + } + return map.add(mapping); + } + + public boolean addRegexMapping(String virtualUserTable, String user, + String domain, String regex) + throws VirtualUserTableManagementException { + Collection<String> map = mappings.get(user + "@" + domain); + if (map == null) { + map = new ArrayList<String>(); + mappings.put(user + "@" + domain, map); + } else { + if (map.contains(regex)) return false; + } + return map.add(regex); + } + + public Map<String, Collection<String>> getAllMappings( + String virtualUserTable) throws VirtualUserTableManagementException { + return mappings; + } + + public Collection<String> getUserDomainMappings(String virtualUserTable, + String user, String domain) + throws VirtualUserTableManagementException { + return mappings.get(user + "@" + domain); + } + + public boolean removeAddressMapping(String virtualUserTable, String user, + String domain, String address) + throws VirtualUserTableManagementException { + Collection<String> col = mappings.get(user + "@" + domain); + Iterator<String> it = col.iterator(); + while (it.hasNext()) { + String mapping = it.next(); + if (mapping.equalsIgnoreCase(address)) { + return col.remove(address); + } + } + return false; + } + + public boolean removeAliasDomainMapping(String virtualUserTable, + String aliasDomain, String realDomain) + throws VirtualUserTableManagementException { + Collection<String> col = mappings.get(realDomain); + Iterator<String> it = col.iterator(); + while (it.hasNext()) { + String mapping = it.next(); + if (mapping.equalsIgnoreCase(aliasDomain)) { + return col.remove(aliasDomain); + } + } + return false; + } + + public boolean removeErrorMapping(String virtualUserTable, String user, + String domain, String error) + throws VirtualUserTableManagementException { + Collection<String> col = mappings.get(user + "@" + domain); + Iterator<String> it = col.iterator(); + while (it.hasNext()) { + String mapping = it.next(); + if (mapping.equalsIgnoreCase(error)) { + return col.remove(error); + } + } + return false; + } + + public boolean removeMapping(String virtualUserTable, String user, + String domain, String rawmapping) + throws VirtualUserTableManagementException { + Collection<String> col = mappings.get(user + "@" + domain); + Iterator<String> it = col.iterator(); + while (it.hasNext()) { + String mapping = it.next(); + if (mapping.equalsIgnoreCase(rawmapping)) { + return col.remove(rawmapping); + } + } + return false; + } + + public boolean removeRegexMapping(String virtualUserTable, String user, + String domain, String regex) + throws VirtualUserTableManagementException { + Collection<String> col = mappings.get(user + "@" + domain); + Iterator<String> it = col.iterator(); + while (it.hasNext()) { + String mapping = it.next(); + if (mapping.equalsIgnoreCase(regex)) { + return col.remove(regex); + } + } + return false; + } + +} Modified: james/server/trunk/phoenix-deployment/src/conf/james-assembly.xml URL: http://svn.apache.org/viewvc/james/server/trunk/phoenix-deployment/src/conf/james-assembly.xml?rev=831840&r1=831839&r2=831840&view=diff ============================================================================== --- james/server/trunk/phoenix-deployment/src/conf/james-assembly.xml (original) +++ james/server/trunk/phoenix-deployment/src/conf/james-assembly.xml Mon Nov 2 10:08:24 2009 @@ -95,7 +95,7 @@ <proxy disable='true'/> </block> - <block name="remotemanager" class="org.apache.james.remotemanager.RemoteManager" > + <block name="remotemanager" class="org.apache.james.remotemanager.AvalonRemoteManager" > <provide name="mailstore" role="org.apache.avalon.cornerstone.services.store.Store"/> <provide name="users-store" role="org.apache.james.api.user.UsersStore"/> <provide name="localusersrepository" role="org.apache.james.api.user.UsersRepository"/> Added: james/server/trunk/remotemanager-function/src/main/java/org/apache/james/remotemanager/AvalonRemoteManager.java URL: http://svn.apache.org/viewvc/james/server/trunk/remotemanager-function/src/main/java/org/apache/james/remotemanager/AvalonRemoteManager.java?rev=831840&view=auto ============================================================================== --- james/server/trunk/remotemanager-function/src/main/java/org/apache/james/remotemanager/AvalonRemoteManager.java (added) +++ james/server/trunk/remotemanager-function/src/main/java/org/apache/james/remotemanager/AvalonRemoteManager.java Mon Nov 2 10:08:24 2009 @@ -0,0 +1,187 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ +package org.apache.james.remotemanager; + +import org.apache.avalon.cornerstone.services.sockets.SocketManager; +import org.apache.avalon.cornerstone.services.store.Store; +import org.apache.avalon.cornerstone.services.threads.ThreadManager; +import org.apache.avalon.framework.activity.Initializable; +import org.apache.avalon.framework.configuration.Configurable; +import org.apache.avalon.framework.configuration.Configuration; +import org.apache.avalon.framework.configuration.ConfigurationException; +import org.apache.avalon.framework.logger.LogEnabled; +import org.apache.avalon.framework.logger.Logger; +import org.apache.avalon.framework.service.ServiceException; +import org.apache.avalon.framework.service.ServiceManager; +import org.apache.avalon.framework.service.Serviceable; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.impl.AvalonLogger; +import org.apache.james.api.dnsservice.DNSService; +import org.apache.james.api.kernel.LoaderService; +import org.apache.james.api.user.UsersStore; +import org.apache.james.api.vut.management.VirtualUserTableManagementService; +import org.apache.james.bridge.GuiceInjected; +import org.apache.james.management.BayesianAnalyzerManagementService; +import org.apache.james.management.DomainListManagementService; +import org.apache.james.management.ProcessorManagementService; +import org.apache.james.management.SpoolManagementService; +import org.apache.james.services.FileSystem; +import org.apache.james.services.MailServer; +import org.apache.james.socket.JamesConnectionManager; +import org.apache.james.socket.api.ProtocolHandlerFactory; +import org.apache.james.util.ConfigurationAdapter; +import org.guiceyfruit.jsr250.Jsr250Module; + +import com.google.inject.AbstractModule; +import com.google.inject.Guice; +import com.google.inject.Injector; +import com.google.inject.Provider; +import com.google.inject.name.Names; + +public class AvalonRemoteManager implements GuiceInjected, Initializable, Serviceable, Configurable, LogEnabled, RemoteManagerMBean { + + private FileSystem filesystem; + private MailServer mailserver; + private DNSService dns; + private Log logger; + private org.apache.commons.configuration.HierarchicalConfiguration config; + private Injector injector; + private JamesConnectionManager connectionManager; + private SocketManager socketManager; + private RemoteManager server = new RemoteManager(); + private ThreadManager threadManager; + private SpoolManagementService spoolService; + private BayesianAnalyzerManagementService bayesianServer; + private VirtualUserTableManagementService vutService; + private DomainListManagementService domainService; + private UsersStore usersStore; + private ProcessorManagementService processorService; + private Store store; + + public String getNetworkInterface() { + return server.getNetworkInterface(); + } + + public int getPort() { + return server.getPort(); + } + + public String getSocketType() { + return server.getSocketType(); + } + + public boolean isEnabled() { + return server.isEnabled(); + } + + /** + * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration) + */ + public void configure(Configuration config) throws ConfigurationException { + try { + this.config = new ConfigurationAdapter(config); + } catch (org.apache.commons.configuration.ConfigurationException e) { + throw new ConfigurationException("Unable to convert configuration", e); + } + } + + /** + * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager) + */ + public void service(ServiceManager manager) throws ServiceException { + dns = (DNSService) manager.lookup(DNSService.ROLE); + mailserver = (MailServer) manager.lookup(MailServer.ROLE); + filesystem = (FileSystem) manager.lookup(FileSystem.ROLE); + socketManager = (SocketManager) manager.lookup(SocketManager.ROLE); + connectionManager = (JamesConnectionManager) manager.lookup(JamesConnectionManager.ROLE); + threadManager = (ThreadManager) manager.lookup(ThreadManager.ROLE); + spoolService = (SpoolManagementService) manager.lookup(SpoolManagementService.ROLE); + bayesianServer = (BayesianAnalyzerManagementService) manager.lookup(BayesianAnalyzerManagementService.ROLE); + vutService = (VirtualUserTableManagementService) manager.lookup(VirtualUserTableManagementService.ROLE); + domainService = (DomainListManagementService) manager.lookup(DomainListManagementService.ROLE); + usersStore = (UsersStore) manager.lookup(UsersStore.ROLE); + processorService = (ProcessorManagementService) manager.lookup(ProcessorManagementService.ROLE); + store = (Store) manager.lookup(Store.ROLE); + // thats needed because of used excalibur socket components + server.service(manager); + } + + /** + * @see org.apache.avalon.framework.activity.Initializable#initialize() + */ + public void initialize() throws Exception { + injector = Guice.createInjector(new RemoteManagerModule(), new Jsr250Module()); + injector.injectMembers(server); + } + + /** + * @see org.apache.avalon.framework.logger.LogEnabled#enableLogging(org.apache.avalon.framework.logger.Logger) + */ + public void enableLogging(Logger logger) { + this.logger = new AvalonLogger(logger); + } + + private final class RemoteManagerModule extends AbstractModule { + + @Override + protected void configure() { + bind(DNSService.class).annotatedWith(Names.named("org.apache.james.api.dnsservice.DNSService")).toInstance(dns); + bind(MailServer.class).annotatedWith(Names.named("org.apache.james.services.MailServer")).toInstance(mailserver); + bind(org.apache.commons.configuration.HierarchicalConfiguration.class).annotatedWith(Names.named("org.apache.commons.configuration.Configuration")).toInstance(config); + bind(Log.class).annotatedWith(Names.named("org.apache.commons.logging.Log")).toInstance(logger); + bind(FileSystem.class).annotatedWith(Names.named("org.apache.james.services.FileSystem")).toInstance(filesystem); + bind(ProtocolHandlerFactory.class).annotatedWith(Names.named("org.apache.james.socket.api.ProtocolHandlerFactory")).toProvider(new Provider<ProtocolHandlerFactory>() { + + public ProtocolHandlerFactory get() { + return server; + } + + }); + bind(SocketManager.class).annotatedWith(Names.named("org.apache.avalon.cornerstone.services.sockets.SocketManager")).toInstance(socketManager); + bind(JamesConnectionManager.class).annotatedWith(Names.named("org.apache.james.socket.JamesConnectionManager")).toInstance(connectionManager); + bind(ThreadManager.class).annotatedWith(Names.named("org.apache.avalon.cornerstone.services.threads.ThreadManager")).toInstance(threadManager); + bind(SpoolManagementService.class).annotatedWith(Names.named("org.apache.james.management.SpoolManagementService")).toInstance(spoolService); + bind(BayesianAnalyzerManagementService.class).annotatedWith(Names.named("org.apache.james.management.BayesianAnalyzerManagementService")).toInstance(bayesianServer); + bind(UsersStore.class).annotatedWith(Names.named("org.apache.james.api.user.UsersStore")).toInstance(usersStore); + bind(ProcessorManagementService.class).annotatedWith(Names.named("org.apache.james.management.ProcessorManagementService")).toInstance(processorService); + bind(VirtualUserTableManagementService.class).annotatedWith(Names.named("org.apache.james.api.vut.management.VirtualUserTableManagementService")).toInstance(vutService); + bind(DomainListManagementService.class).annotatedWith(Names.named("org.apache.james.management.DomainListManagementService")).toInstance(domainService); + bind(Store.class).annotatedWith(Names.named("org.apache.avalon.cornerstone.services.store.Store")).toInstance(store); + // we bind the LoaderService to an Provider to get sure everything is there when the SMTPLoaderService get created. + bind(LoaderService.class).annotatedWith(Names.named("org.apache.james.LoaderService")).toProvider(new Provider<LoaderService>() { + + public LoaderService get() { + return new RemoteManagerLoaderService(); + } + + // Mimic the loaderservice + class RemoteManagerLoaderService implements LoaderService { + Injector injector = Guice.createInjector(new RemoteManagerModule(), new Jsr250Module()); + + public <T> T load(Class<T> type) { + return injector.getInstance(type); + } + + } + + }); + + } + } +} \ No newline at end of file Added: james/server/trunk/remotemanager-function/src/test/java/org/apache/james/remotemanager/AvalonRemoteManagerTest.java URL: http://svn.apache.org/viewvc/james/server/trunk/remotemanager-function/src/test/java/org/apache/james/remotemanager/AvalonRemoteManagerTest.java?rev=831840&view=auto ============================================================================== --- james/server/trunk/remotemanager-function/src/test/java/org/apache/james/remotemanager/AvalonRemoteManagerTest.java (added) +++ james/server/trunk/remotemanager-function/src/test/java/org/apache/james/remotemanager/AvalonRemoteManagerTest.java Mon Nov 2 10:08:24 2009 @@ -0,0 +1,43 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ +package org.apache.james.remotemanager; + +import org.apache.avalon.framework.container.ContainerUtil; +import org.apache.james.test.mock.avalon.MockLogger; + +public class AvalonRemoteManagerTest extends RemoteManagerTest{ + + private AvalonRemoteManager server; + @Override + protected void setUp() throws Exception { + server = new AvalonRemoteManager(); + setUpServiceManager(); + ContainerUtil.enableLogging(server, new MockLogger()); + ContainerUtil.service(server, serviceManager); + m_testConfiguration = new RemoteManagerTestConfiguration(m_remoteManagerListenerPort); + } + + @Override + protected void finishSetUp(RemoteManagerTestConfiguration testConfiguration) + throws Exception { + testConfiguration.init(); + ContainerUtil.configure(server, testConfiguration); + ContainerUtil.initialize(server); + } +} Modified: james/server/trunk/remotemanager-function/src/test/java/org/apache/james/remotemanager/RemoteManagerTest.java URL: http://svn.apache.org/viewvc/james/server/trunk/remotemanager-function/src/test/java/org/apache/james/remotemanager/RemoteManagerTest.java?rev=831840&r1=831839&r2=831840&view=diff ============================================================================== --- james/server/trunk/remotemanager-function/src/test/java/org/apache/james/remotemanager/RemoteManagerTest.java (original) +++ james/server/trunk/remotemanager-function/src/test/java/org/apache/james/remotemanager/RemoteManagerTest.java Mon Nov 2 10:08:24 2009 @@ -35,16 +35,21 @@ import org.apache.james.api.user.UsersRepository; import org.apache.james.api.user.UsersStore; import org.apache.james.api.vut.management.VirtualUserTableManagementService; -import org.apache.james.impl.vut.VirtualUserTableManagement; import org.apache.james.management.BayesianAnalyzerManagementException; import org.apache.james.management.BayesianAnalyzerManagementService; import org.apache.james.management.DomainListManagementException; import org.apache.james.management.DomainListManagementService; +import org.apache.james.management.ProcessorManagementService; +import org.apache.james.management.SpoolFilter; +import org.apache.james.management.SpoolManagementException; +import org.apache.james.management.SpoolManagementService; +import org.apache.james.management.mock.MockVirtualUserTableManagementService; import org.apache.james.services.MailServer; import org.apache.james.socket.JamesConnectionManager; import org.apache.james.socket.SimpleConnectionManager; import org.apache.james.test.mock.avalon.MockLogger; import org.apache.james.test.mock.avalon.MockSocketManager; +import org.apache.james.test.mock.avalon.MockStore; import org.apache.james.test.mock.avalon.MockThreadManager; import org.apache.james.test.mock.james.MockFileSystem; import org.apache.james.test.mock.james.MockMailServer; @@ -64,8 +69,12 @@ import java.net.InetAddress; import java.net.UnknownHostException; import java.util.ArrayList; +import java.util.Collection; import java.util.Iterator; import java.util.List; +import java.util.Map; + +import javax.mail.MessagingException; import junit.framework.TestCase; @@ -87,13 +96,14 @@ protected TelnetClient m_telnetClient; private MockUsersRepository m_mockUsersRepository; private MockMailServer mailServer; - private FakeLoader serviceManager; + protected FakeLoader serviceManager; private SimpleConnectionManager connectionManager; private MockUsersStore usersStore; private MockSocketManager socketManager; private MockThreadManager threadManager; private DNSService dnsservice; private MockFileSystem filesystem; + private MockVirtualUserTableManagementService vutManagement; protected void setUp() throws Exception { m_remoteManager = new RemoteManager(); @@ -116,7 +126,7 @@ super.tearDown(); } - protected void finishSetUp(RemoteManagerTestConfiguration testConfiguration) { + protected void finishSetUp(RemoteManagerTestConfiguration testConfiguration) throws Exception { testConfiguration.init(); try { m_remoteManager.setConfiguration(new ConfigurationAdapter(testConfiguration)); @@ -186,7 +196,7 @@ readAnswer(3); } - private void setUpServiceManager() throws ServiceException { + protected void setUpServiceManager() throws ServiceException { serviceManager = new FakeLoader(); connectionManager = new SimpleConnectionManager(); ContainerUtil.enableLogging(connectionManager, new MockLogger()); @@ -211,11 +221,13 @@ dnsservice = setUpDNSServer(); serviceManager.put(DNSService.ROLE, dnsservice); - MockVirtualUserTableStore vutStore = new MockVirtualUserTableStore(); - VirtualUserTableManagement vutManagement = new VirtualUserTableManagement(); - vutManagement.setVirtualUserTableStore(vutStore); - vutManagement.setVirtualUserTableManagement(new MockVirtualUserTableManagementImpl()); - serviceManager.put(VirtualUserTableManagementService.ROLE, vutManagement); + vutManagement = new MockVirtualUserTableManagementService(); + //VirtualUserTableManagementService vutManagement = new VirtualUserTableManagement(); + //vutManagement.setVirtualUserTableStore(vutStore); + //vutManagement.setVirtualUserTableManagement(new MockVirtualUserTableManagementImpl()); + serviceManager.put(VirtualUserTableManagementService.ROLE, new MockVirtualUserTableManagementService()); + + ManageableDomainList xml = new SimpleDomainList(); @@ -292,6 +304,64 @@ return 0; } }); + + serviceManager.put(SpoolManagementService.ROLE, new SpoolManagementService() { + + public int resendSpoolItems(String spoolRepositoryURL, String key, + List lockingFailures, SpoolFilter filter) + throws MessagingException, SpoolManagementException { + // TODO Auto-generated method stub + return 0; + } + + public int removeSpoolItems(String spoolRepositoryURL, String key, + List lockingFailures, SpoolFilter filter) + throws MessagingException, SpoolManagementException { + // TODO Auto-generated method stub + return 0; + } + + public int moveSpoolItems(String srcSpoolRepositoryURL, + String dstSpoolRepositoryURL, String dstState, SpoolFilter filter) + throws MessagingException, SpoolManagementException { + // TODO Auto-generated method stub + return 0; + } + + public List getSpoolItems(String spoolRepositoryURL, SpoolFilter filter) + throws MessagingException, SpoolManagementException { + // TODO Auto-generated method stub + return null; + } + }); + serviceManager.put(MockStore.ROLE,new MockStore()); + serviceManager.put(ProcessorManagementService.ROLE, new ProcessorManagementService() { + + public String[] getProcessorNames() { + // TODO Auto-generated method stub + return null; + } + + public String[] getMatcherParameters(String processorName, int matcherIndex) { + // TODO Auto-generated method stub + return null; + } + + public String[] getMatcherNames(String processorName) { + // TODO Auto-generated method stub + return null; + } + + public String[] getMailetParameters(String processorName, int mailetIndex) { + // TODO Auto-generated method stub + return null; + } + + public String[] getMailetNames(String processorName) { + // TODO Auto-generated method stub + return null; + } + }); } private DNSService setUpDNSServer() { @@ -323,14 +393,14 @@ assertEquals("Arguments echoed", "hsif eht lla rof sknaht", lastLine); } */ - public void testLogin() throws IOException { + public void testLogin() throws Exception { finishSetUp(m_testConfiguration); connect(); login(); } - public void testWrongLoginUser() throws IOException { + public void testWrongLoginUser() throws Exception { finishSetUp(m_testConfiguration); connect(); @@ -344,7 +414,7 @@ assertTrue("Last line does not start with 'Login id:' but with '"+last+"'",last.startsWith("Login id:")); // login failed, getting new login prompt } - public void testWrongLoginPassword() throws IOException { + public void testWrongLoginPassword() throws Exception { finishSetUp(m_testConfiguration); connect(); @@ -357,7 +427,7 @@ assertTrue("Line does not start with 'Login id:' but with '"+last+"'", last.startsWith("Login id:")); // login failed, getting new login prompt } - public void testUserCount() throws IOException { + public void testUserCount() throws Exception { finishSetUp(m_testConfiguration); connect(); login(); @@ -383,7 +453,7 @@ assertTrue(getLastLine(readAnswer()).endsWith(" 1")); // 1 total } - public void testAddUserAndVerify() throws IOException { + public void testAddUserAndVerify() throws Exception { finishSetUp(m_testConfiguration); connect(); login(); @@ -404,7 +474,7 @@ assertTrue(getLastLine(readAnswer()).endsWith(" does not exist")); } - public void testDelUser() throws IOException { + public void testDelUser() throws Exception { finishSetUp(m_testConfiguration); connect(); login(); @@ -425,7 +495,7 @@ assertTrue(getLastLine(readAnswer()).endsWith(" does not exist")); } - public void testQuit() throws IOException { + public void testQuit() throws Exception { finishSetUp(m_testConfiguration); connect(); @@ -445,7 +515,7 @@ } - public void testListUsers() throws IOException { + public void testListUsers() throws Exception { finishSetUp(m_testConfiguration); connect(); login(); @@ -487,7 +557,7 @@ } } - public void testCommandCaseInsensitive() throws IOException { + public void testCommandCaseInsensitive() throws Exception { finishSetUp(m_testConfiguration); connect(); login(); @@ -505,7 +575,7 @@ assertTrue(getLastLine(readAnswer()).endsWith(" exists")); } - public void testParameterCaseSensitive() throws IOException { + public void testParameterCaseSensitive() throws Exception { finishSetUp(m_testConfiguration); connect(); login(); @@ -523,7 +593,7 @@ assertTrue(getLastLine(readAnswer()).endsWith(" does not exist")); } - public void testAlias() throws IOException { + public void testAlias() throws Exception { m_mockUsersRepository.setForceUseJamesUser(); finishSetUp(m_testConfiguration); connect(); @@ -585,7 +655,7 @@ } - public void testForward() throws IOException { + public void testForward() throws Exception { m_mockUsersRepository.setForceUseJamesUser(); finishSetUp(m_testConfiguration); connect(); @@ -626,7 +696,7 @@ } - public void testSetPassword() throws IOException { + public void testSetPassword() throws Exception { finishSetUp(m_testConfiguration); connect(); login(); @@ -656,7 +726,7 @@ } - public void testAddMapping() throws IOException { + public void testAddMapping() throws Exception { String lastLine; finishSetUp(m_testConfiguration); connect(); @@ -671,7 +741,7 @@ assertTrue("Not add mapping... allready exists",lastLine.endsWith("false")); } - public void testRemoveMapping() throws IOException { + public void testRemoveMapping() throws Exception { String lastLine; finishSetUp(m_testConfiguration); connect(); @@ -690,7 +760,7 @@ assertTrue("Not remove mapping... mapping not exists",lastLine.endsWith("false")); } - public void testListAllMappings() throws IOException { + public void testListAllMappings() throws Exception { String lastLine; finishSetUp(m_testConfiguration); connect(); @@ -706,11 +776,11 @@ sendCommand("listallmappings"); List answer = readAnswer(3); - assertTrue("Read first mapping", answer.get(1).toString().endsWith("junit")); - assertTrue("Read second mapping line", answer.get(2).toString().endsWith("junit2")); + assertTrue("Read first mapping", answer.get(1).toString().contains("junit")); + assertTrue("Read second mapping line", answer.get(2).toString().contains("junit2")); } - public void testListMapping() throws IOException { + public void testListMapping() throws Exception { String lastLine; finishSetUp(m_testConfiguration); connect(); @@ -729,7 +799,7 @@ assertTrue("list mapping", lastLine.endsWith("junit")); } - public void testaddDomain() throws IOException { + public void testaddDomain() throws Exception { String lastLine; finishSetUp(m_testConfiguration); connect(); @@ -749,7 +819,7 @@ assertTrue("list domain", lastLine.endsWith("domain")); } - public void testremoveDomain() throws IOException { + public void testremoveDomain() throws Exception { String lastLine; finishSetUp(m_testConfiguration); connect(); @@ -768,7 +838,7 @@ assertTrue("Remove domain which not exist", lastLine.endsWith("fail")); } - public void testListDomains() throws IOException { + public void testListDomains() throws Exception { String lastLine; finishSetUp(m_testConfiguration); connect(); --------------------------------------------------------------------- To unsubscribe, e-mail: laurawalker@example.com For additional commands, e-mail: laurawalker@example.com From server-devlaurawalker@example.com Mon Nov 02 12:22:20 2009 Return-Path: <server-devlaurawalker@example.com> Delivered-To: laurawalker@example.com Received: (qmail 92349 invoked from network); 2 Nov 2009 12:22:20 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Nov 2009 12:22:20 -0000 Received: (qmail 88746 invoked by uid 500); 2 Nov 2009 12:22:20 -0000 Delivered-To: laurawalker@example.com Received: (qmail 88689 invoked by uid 500); 2 Nov 2009 12:22:19 -0000 Mailing-List: contact laurawalker@example.com; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:laurawalker@example.com> List-Help: <mailto:laurawalker@example.com> List-Post: <mailto:laurawalker@example.com> List-Id: "James Developers List" <server-dev.james.apache.org> Reply-To: "James Developers List" <laurawalker@example.com> Delivered-To: mailing list laurawalker@example.com Received: (qmail 88679 invoked by uid 500); 2 Nov 2009 12:22:19 -0000 Received: (qmail 88676 invoked by uid 99); 2 Nov 2009 12:22:19 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Nov 2009 12:22:19 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Nov 2009 12:22:15 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2051C23888D8; Mon, 2 Nov 2009 12:21:54 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r831874 - in /james/hupa/trunk: client/src/main/java/org/apache/hupa/client/gin/ client/src/main/java/org/apache/hupa/client/mvp/ server/src/main/java/org/apache/hupa/server/handler/ Date: Mon, 02 Nov 2009 12:21:53 -0000 To: laurawalker@example.com From: laurawalker@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <laurawalker@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: norman Date: Mon Nov 2 12:21:53 2009 New Revision: 831874 URL: http://svn.apache.org/viewvc?rev=831874&view=rev Log: Inject the TableModel. Thats better in terms of MVP. Added: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageTableModel.java Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaClientModule.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessagePresenter.java james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractFetchMessagesHandler.java Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaClientModule.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaClientModule.java?rev=831874&r1=831873&r2=831874&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaClientModule.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/gin/HupaClientModule.java Mon Nov 2 12:21:53 2009 @@ -38,6 +38,7 @@ import org.apache.hupa.client.mvp.LoginView; import org.apache.hupa.client.mvp.MainPresenter; import org.apache.hupa.client.mvp.MainView; +import org.apache.hupa.client.mvp.MessageTableModel; import com.google.inject.Singleton; @@ -55,6 +56,7 @@ bindPresenter(AppPresenter.class, AppPresenter.Display.class, AppView.class); bind(CachingDispatchAsync.class); bind(PagingScrollTableRowDragController.class).in(Singleton.class); + bind(MessageTableModel.class).in(Singleton.class); } } Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java?rev=831874&r1=831873&r2=831874&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListPresenter.java Mon Nov 2 12:21:53 2009 @@ -296,10 +296,9 @@ }); } - public void bind(User user, IMAPFolder folder, String searchValue) { + public void bind(User user, IMAPFolder folder) { this.user = user; this.folder = folder; - this.searchValue = searchValue; display.setPostFetchMessageCount(user.getSettings().getPostFetchMessageCount()); // workaround if (isBound == false) { @@ -371,5 +370,7 @@ } }; + + } Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java?rev=831874&r1=831873&r2=831874&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessageListView.java Mon Nov 2 12:21:53 2009 @@ -21,13 +21,8 @@ import java.util.ArrayList; import java.util.Date; -import java.util.Iterator; import java.util.List; -import net.customware.gwt.dispatch.client.DispatchAsync; -import net.customware.gwt.presenter.client.EventBus; - -import org.apache.hupa.client.HupaCallback; import org.apache.hupa.client.HupaConstants; import org.apache.hupa.client.HupaMessages; import org.apache.hupa.client.bundles.HupaImageBundle; @@ -43,9 +38,6 @@ import org.apache.hupa.shared.data.Message; import org.apache.hupa.shared.data.User; import org.apache.hupa.shared.data.Message.IMAPFlag; -import org.apache.hupa.shared.events.MessagesReceivedEvent; -import org.apache.hupa.shared.rpc.FetchMessages; -import org.apache.hupa.shared.rpc.FetchMessagesResult; import org.apache.hupa.widgets.ui.HasEnable; import org.cobogw.gwt.user.client.ui.Button; import org.cobogw.gwt.user.client.ui.ButtonBar; @@ -65,18 +57,18 @@ import com.google.gwt.gen2.table.client.FixedWidthGrid; import com.google.gwt.gen2.table.client.FixedWidthGridBulkRenderer; import com.google.gwt.gen2.table.client.MutableTableModel; -import com.google.gwt.gen2.table.client.TableModelHelper; import com.google.gwt.gen2.table.client.AbstractScrollTable.ColumnResizePolicy; import com.google.gwt.gen2.table.client.AbstractScrollTable.ResizePolicy; import com.google.gwt.gen2.table.client.AbstractScrollTable.ScrollPolicy; import com.google.gwt.gen2.table.client.AbstractScrollTable.SortPolicy; import com.google.gwt.gen2.table.client.SelectionGrid.SelectionPolicy; import com.google.gwt.gen2.table.client.TableDefinition.AbstractCellView; -import com.google.gwt.gen2.table.client.TableModelHelper.Request; import com.google.gwt.gen2.table.event.client.HasPageLoadHandlers; import com.google.gwt.gen2.table.event.client.HasRowSelectionHandlers; import com.google.gwt.gen2.table.event.client.PageLoadEvent; import com.google.gwt.gen2.table.event.client.PageLoadHandler; +import com.google.gwt.gen2.table.event.client.RowCountChangeEvent; +import com.google.gwt.gen2.table.event.client.RowCountChangeHandler; import com.google.gwt.i18n.client.DateTimeFormat; import com.google.gwt.user.client.Window; import com.google.gwt.user.client.ui.Composite; @@ -96,15 +88,11 @@ private HupaConstants constants = GWT.create(HupaConstants.class); private HupaMessages messages = GWT.create(HupaMessages.class); private HupaImageBundle imageBundle = GWT.create(HupaImageBundle.class); - private DispatchAsync dispatcher; - private User user; - private IMAPFolder folder; - private String searchValue; + private PagingOptions options; private DragRefetchPagingScrollTable<Message> mailTable; - private CachedTableModel<Message> cTableModel = new CachedTableModel<Message>(new IMAPMessageTableModel()); + private CachedTableModel<Message> cTableModel; - private EventBus eventBus; private FixedWidthGrid dataTable = createDataTable(); private MyButton deleteMailButton = new MyButton(constants.deleteMailButton()); private Button newMailButton = new Button(constants.newMailButton()); @@ -120,13 +108,16 @@ @Inject - public IMAPMessageListView(DispatchAsync dispatcher,EventBus bus, PagingScrollTableRowDragController controller) { - this.eventBus = bus; - this.dispatcher = dispatcher; - - VerticalPanel vPanel = new VerticalPanel(); - + public IMAPMessageListView(PagingScrollTableRowDragController controller, MessageTableModel mTableModel) { + this.cTableModel = new CachedTableModel<Message>(mTableModel); cTableModel.setRowCount(MutableTableModel.UNKNOWN_ROW_COUNT); + mTableModel.addRowCountChangeHandler(new RowCountChangeHandler() { + + public void onRowCountChange(RowCountChangeEvent event) { + cTableModel.setRowCount(event.getNewRowCount()); + } + }); + VerticalPanel vPanel = new VerticalPanel(); mailTable = new DragRefetchPagingScrollTable<Message>( cTableModel, dataTable, new FixedWidthFlexTable(), createTableDefinitation(),controller,1); @@ -351,64 +342,7 @@ return cList; } - /** - * TableModel which retrieve the messages for the user - * - */ - private final class IMAPMessageTableModel extends MutableTableModel<Message> { - - @Override - public void requestRows( - final Request request, - final com.google.gwt.gen2.table.client.TableModel.Callback<Message> callback) { - - // if the given user or folder is null, its safe to return an empty list - if (user == null || folder == null) { - callback.onRowsReady(request, new TableModelHelper.Response<Message>() { - - @Override - public Iterator<Message> getRowValues() { - return new ArrayList<Message>().iterator(); - } - - }); - } - - dispatcher.execute(new FetchMessages(folder, request.getStartRow(), request.getNumRows(),searchValue),new HupaCallback<FetchMessagesResult>(dispatcher, eventBus) { - public void callback(final FetchMessagesResult result) { - // Update folder information before notifying presenter - folder.setMessageCount(result.getRealCount()); - folder.setUnseenMessageCount(result.getRealUnreadCount()); - // Notify presenter to update folder tree view - eventBus.fireEvent(new MessagesReceivedEvent(folder, result.getMessages())); - TableModelHelper.Response<Message> response = new TableModelHelper.Response<Message>() { - @Override - public Iterator<Message> getRowValues() { - return result.getMessages().iterator(); - } - }; - cTableModel.setRowCount(result.getRealCount()); - callback.onRowsReady(request,response); - } - }); - } - - @Override - protected boolean onRowInserted(int beforeRow) { - return true; - } - - @Override - protected boolean onRowRemoved(int row) { - return true; - } - - @Override - protected boolean onSetRowValue(int row, Message rowValue) { - return true; - } - - } + /** @@ -497,9 +431,6 @@ * @see org.apache.hupa.client.mvp.IMAPMessageListPresenter.Display#reloadData(org.apache.hupa.shared.data.User, org.apache.hupa.shared.data.IMAPFolder, java.lang.String) */ public void reloadData(User user, IMAPFolder folder,String searchValue) { - this.user = user; - this.folder = folder; - this.searchValue = searchValue; cTableModel.clearCache(); mailTable.getTableModel().setRowCount(MutableTableModel.UNKNOWN_ROW_COUNT); mailTable.reloadPage(); @@ -510,8 +441,6 @@ * @see org.apache.hupa.client.mvp.IMAPMessageListPresenter.Display#reset() */ public void reset() { - this.user = null; - this.folder = null; pageBox.setSelectedIndex(0); cTableModel.clearCache(); cTableModel.setRowCount(0); Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessagePresenter.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessagePresenter.java?rev=831874&r1=831873&r2=831874&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessagePresenter.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/IMAPMessagePresenter.java Mon Nov 2 12:21:53 2009 @@ -48,7 +48,6 @@ import com.google.gwt.event.dom.client.ClickEvent; import com.google.gwt.event.dom.client.ClickHandler; import com.google.gwt.event.dom.client.HasClickHandlers; -import com.google.gwt.user.client.ui.Frame; import com.google.gwt.user.client.ui.HasHTML; import com.google.gwt.user.client.ui.HasText; import com.google.inject.Inject; Modified: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java?rev=831874&r1=831873&r2=831874&view=diff ============================================================================== --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java (original) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MainPresenter.java Mon Nov 2 12:21:53 2009 @@ -233,7 +233,7 @@ messagePresenter.unbind(); sendPresenter.unbind(); - messageListPresenter.bind(user, folder, searchValue); + messageListPresenter.bind(user, folder); if (refresh) { messageListPresenter.refreshDisplay(); } Added: james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageTableModel.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageTableModel.java?rev=831874&view=auto ============================================================================== --- james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageTableModel.java (added) +++ james/hupa/trunk/client/src/main/java/org/apache/hupa/client/mvp/MessageTableModel.java Mon Nov 2 12:21:53 2009 @@ -0,0 +1,152 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ +package org.apache.hupa.client.mvp; + +import java.util.ArrayList; +import java.util.Iterator; + +import net.customware.gwt.dispatch.client.DispatchAsync; +import net.customware.gwt.presenter.client.EventBus; + +import org.apache.hupa.client.HupaCallback; +import org.apache.hupa.shared.data.IMAPFolder; +import org.apache.hupa.shared.data.Message; +import org.apache.hupa.shared.data.User; +import org.apache.hupa.shared.events.FolderSelectionEvent; +import org.apache.hupa.shared.events.FolderSelectionEventHandler; +import org.apache.hupa.shared.events.LoadMessagesEvent; +import org.apache.hupa.shared.events.LoadMessagesEventHandler; +import org.apache.hupa.shared.events.LoginEvent; +import org.apache.hupa.shared.events.LoginEventHandler; +import org.apache.hupa.shared.events.LogoutEvent; +import org.apache.hupa.shared.events.LogoutEventHandler; +import org.apache.hupa.shared.events.MessagesReceivedEvent; +import org.apache.hupa.shared.rpc.FetchMessages; +import org.apache.hupa.shared.rpc.FetchMessagesResult; + +import com.google.gwt.gen2.table.client.MutableTableModel; +import com.google.gwt.gen2.table.client.TableModelHelper; +import com.google.gwt.gen2.table.client.TableModelHelper.Request; +import com.google.inject.Inject; + +/** + * TableModel which retrieve the messages for the user + * + */ +public class MessageTableModel extends MutableTableModel<Message> { + + private EventBus eventBus; + private DispatchAsync dispatcher; + private User user; + private IMAPFolder folder; + private String searchValue; + + @Inject + public MessageTableModel(EventBus eventBus, DispatchAsync dispatcher){ + + this.eventBus = eventBus; + this.dispatcher = dispatcher; + + eventBus.addHandler(LoadMessagesEvent.TYPE, new LoadMessagesEventHandler() { + + public void onLoadMessagesEvent(LoadMessagesEvent loadMessagesEvent) { + user = loadMessagesEvent.getUser(); + folder = loadMessagesEvent.getFolder(); + searchValue = loadMessagesEvent.getSearchValue(); + } + }); + eventBus.addHandler(FolderSelectionEvent.TYPE, new FolderSelectionEventHandler() { + + public void onFolderSelectionEvent(FolderSelectionEvent event) { + user = event.getUser(); + folder = event.getFolder(); + searchValue = null; + } + }); + eventBus.addHandler(LoginEvent.TYPE, new LoginEventHandler() { + + public void onLogin(LoginEvent event) { + user = event.getUser(); + folder = null; + searchValue = null; + } + }); + eventBus.addHandler(LogoutEvent.TYPE, new LogoutEventHandler() { + + public void onLogout(LogoutEvent logoutEvent) { + user = null; + folder = null; + searchValue = null; + } + }); + + + } + + @Override + public void requestRows( + final Request request, + final com.google.gwt.gen2.table.client.TableModel.Callback<Message> callback) { + + // if the given user or folder is null, its safe to return an empty list + if (user == null || folder == null) { + callback.onRowsReady(request, new TableModelHelper.Response<Message>() { + + @Override + public Iterator<Message> getRowValues() { + return new ArrayList<Message>().iterator(); + } + + }); + } + + dispatcher.execute(new FetchMessages(folder, request.getStartRow(), request.getNumRows(), searchValue),new HupaCallback<FetchMessagesResult>(dispatcher, eventBus) { + public void callback(final FetchMessagesResult result) { + // Update folder information before notifying presenter + folder.setMessageCount(result.getRealCount()); + folder.setUnseenMessageCount(result.getRealUnreadCount()); + // Notify presenter to update folder tree view + eventBus.fireEvent(new MessagesReceivedEvent(folder, result.getMessages())); + TableModelHelper.Response<Message> response = new TableModelHelper.Response<Message>() { + @Override + public Iterator<Message> getRowValues() { + return result.getMessages().iterator(); + } + }; + setRowCount(result.getRealCount()); + callback.onRowsReady(request,response); + } + }); + } + + @Override + protected boolean onRowInserted(int beforeRow) { + return true; + } + + @Override + protected boolean onRowRemoved(int row) { + return true; + } + + @Override + protected boolean onSetRowValue(int row, Message rowValue) { + return true; + } +} Modified: james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractFetchMessagesHandler.java URL: http://svn.apache.org/viewvc/james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractFetchMessagesHandler.java?rev=831874&r1=831873&r2=831874&view=diff ============================================================================== --- james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractFetchMessagesHandler.java (original) +++ james/hupa/trunk/server/src/main/java/org/apache/hupa/server/handler/AbstractFetchMessagesHandler.java Mon Nov 2 12:21:53 2009 @@ -60,6 +60,9 @@ ExecutionContext context) throws ActionException { User user = getUser(); IMAPFolder folder = action.getFolder(); + if (folder == null) { + folder = new IMAPFolder(user.getSettings().getInboxFolderName()); + } com.sun.mail.imap.IMAPFolder f = null; try { IMAPStore store = cache.get(user); --------------------------------------------------------------------- To unsubscribe, e-mail: laurawalker@example.com For additional commands, e-mail: laurawalker@example.com From server-devlaurawalker@example.com Mon Nov 02 13:38:54 2009 Return-Path: <server-devlaurawalker@example.com> Delivered-To: laurawalker@example.com Received: (qmail 18091 invoked from network); 2 Nov 2009 13:38:54 -0000 Received: from hermes.apache.org (HELO mail.apache.org) (83.161.120.155) by minotaur.apache.org with SMTP; 2 Nov 2009 13:38:54 -0000 Received: (qmail 74641 invoked by uid 500); 2 Nov 2009 13:38:53 -0000 Delivered-To: laurawalker@example.com Received: (qmail 74553 invoked by uid 500); 2 Nov 2009 13:38:53 -0000 Mailing-List: contact laurawalker@example.com; run by ezmlm Precedence: bulk List-Unsubscribe: <mailto:laurawalker@example.com> List-Help: <mailto:laurawalker@example.com> List-Post: <mailto:laurawalker@example.com> List-Id: "James Developers List" <server-dev.james.apache.org> Reply-To: "James Developers List" <laurawalker@example.com> Delivered-To: mailing list laurawalker@example.com Received: (qmail 74543 invoked by uid 500); 2 Nov 2009 13:38:53 -0000 Received: (qmail 74540 invoked by uid 99); 2 Nov 2009 13:38:52 -0000 Received: from nike.apache.org (HELO nike.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Nov 2009 13:38:52 +0000 X-ASF-Spam-Status: No, hits=-2000.0 required=10.0 tests=ALL_TRUSTED X-Spam-Check-By: apache.org Received: from [83.161.120.155] (HELO eris.apache.org) (83.161.120.155) by apache.org (qpsmtpd/0.29) with ESMTP; Mon, 02 Nov 2009 13:38:47 +0000 Received: by eris.apache.org (Postfix, from userid 65534) id 2013223888A6; Mon, 2 Nov 2009 13:38:25 +0000 (UTC) Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Subject: svn commit: r831895 - in /james/server/trunk: nntpserver-function/src/main/java/org/apache/james/nntpserver/ nntpserver-function/src/main/java/org/apache/james/nntpserver/repository/ nntpserver-function/src/main/resources/org/apache/james/nntpserver/ n... Date: Mon, 02 Nov 2009 13:38:24 -0000 To: laurawalker@example.com From: laurawalker@example.com X-Mailer: svnmailer-1.0.8 Message-Id: <laurawalker@example.com> X-Virus-Checked: Checked by ClamAV on apache.org Author: norman Date: Mon Nov 2 13:38:23 2009 New Revision: 831895 URL: http://svn.apache.org/viewvc?rev=831895&view=rev Log: Move NNTPServer components to guice injection (JAMES-893) Added: james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/AvalonNNTPServer.java james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/repository/AvalonNNTPRepository.java james/server/trunk/nntpserver-function/src/main/resources/org/apache/james/nntpserver/AvalonNNTPServer.xinfo - copied unchanged from r829709, james/server/trunk/nntpserver-function/src/main/resources/org/apache/james/nntpserver/NNTPServer.xinfo james/server/trunk/nntpserver-function/src/main/resources/org/apache/james/nntpserver/repository/AvalonNNTPRepository.xinfo - copied unchanged from r829709, james/server/trunk/nntpserver-function/src/main/resources/org/apache/james/nntpserver/repository/NNTPRepositoryImpl.xinfo james/server/trunk/nntpserver-function/src/test/java/org/apache/james/nntpserver/AvalonNNTPServerTest.java Removed: james/server/trunk/nntpserver-function/src/main/resources/org/apache/james/nntpserver/NNTPServer.xinfo james/server/trunk/nntpserver-function/src/main/resources/org/apache/james/nntpserver/repository/NNTPRepositoryImpl.xinfo Modified: james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/NNTPException.java james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/NNTPHandler.java james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/repository/NNTPArticleImpl.java james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/repository/NNTPGroupImpl.java james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/repository/NNTPRepositoryImpl.java james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/repository/NNTPSpooler.java james/server/trunk/nntpserver-function/src/test/java/org/apache/james/nntpserver/NNTPServerTest.java james/server/trunk/phoenix-deployment/src/conf/james-assembly.xml Added: james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/AvalonNNTPServer.java URL: http://svn.apache.org/viewvc/james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/AvalonNNTPServer.java?rev=831895&view=auto ============================================================================== --- james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/AvalonNNTPServer.java (added) +++ james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/AvalonNNTPServer.java Mon Nov 2 13:38:23 2009 @@ -0,0 +1,168 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ +package org.apache.james.nntpserver; + +import org.apache.avalon.cornerstone.services.sockets.SocketManager; +import org.apache.avalon.cornerstone.services.threads.ThreadManager; +import org.apache.avalon.framework.activity.Initializable; +import org.apache.avalon.framework.configuration.Configurable; +import org.apache.avalon.framework.configuration.Configuration; +import org.apache.avalon.framework.configuration.ConfigurationException; +import org.apache.avalon.framework.logger.LogEnabled; +import org.apache.avalon.framework.logger.Logger; +import org.apache.avalon.framework.service.ServiceException; +import org.apache.avalon.framework.service.ServiceManager; +import org.apache.avalon.framework.service.Serviceable; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.impl.AvalonLogger; +import org.apache.james.api.dnsservice.DNSService; +import org.apache.james.api.kernel.LoaderService; +import org.apache.james.api.user.UsersRepository; +import org.apache.james.bridge.GuiceInjected; +import org.apache.james.nntpserver.repository.NNTPRepository; +import org.apache.james.services.FileSystem; +import org.apache.james.services.MailServer; +import org.apache.james.socket.JamesConnectionManager; +import org.apache.james.socket.api.ProtocolHandlerFactory; +import org.apache.james.util.ConfigurationAdapter; +import org.guiceyfruit.jsr250.Jsr250Module; + +import com.google.inject.AbstractModule; +import com.google.inject.Guice; +import com.google.inject.Injector; +import com.google.inject.Provider; +import com.google.inject.name.Names; + +public class AvalonNNTPServer implements GuiceInjected, Initializable, Serviceable, Configurable, LogEnabled, NNTPServerMBean { + + private FileSystem filesystem; + private MailServer mailserver; + private DNSService dns; + private Log logger; + private org.apache.commons.configuration.HierarchicalConfiguration config; + private Injector injector; + private UsersRepository userRepos; + private JamesConnectionManager connectionManager; + private SocketManager socketManager; + private NNTPServer nntpserver = new NNTPServer(); + private NNTPRepository nntpRepos; + private ThreadManager threadManager; + + public String getNetworkInterface() { + return nntpserver.getNetworkInterface(); + } + + public int getPort() { + return nntpserver.getPort(); + } + + public String getSocketType() { + return nntpserver.getSocketType(); + } + + public boolean isEnabled() { + return nntpserver.isEnabled(); + } + + /** + * @see org.apache.avalon.framework.configuration.Configurable#configure(org.apache.avalon.framework.configuration.Configuration) + */ + public void configure(Configuration config) throws ConfigurationException { + try { + this.config = new ConfigurationAdapter(config); + } catch (org.apache.commons.configuration.ConfigurationException e) { + throw new ConfigurationException("Unable to convert configuration", e); + } + } + + /** + * @see org.apache.avalon.framework.service.Serviceable#service(org.apache.avalon.framework.service.ServiceManager) + */ + public void service(ServiceManager manager) throws ServiceException { + dns = (DNSService) manager.lookup(DNSService.ROLE); + mailserver = (MailServer) manager.lookup(MailServer.ROLE); + filesystem = (FileSystem) manager.lookup(FileSystem.ROLE); + userRepos = (UsersRepository) manager.lookup(UsersRepository.ROLE); + socketManager = (SocketManager) manager.lookup(SocketManager.ROLE); + connectionManager = (JamesConnectionManager) manager.lookup(JamesConnectionManager.ROLE); + threadManager = (ThreadManager) manager.lookup(ThreadManager.ROLE); + nntpRepos = (NNTPRepository) manager.lookup(NNTPRepository.ROLE); + // thats needed because of used excalibur socket components + nntpserver.service(manager); + } + + /** + * @see org.apache.avalon.framework.activity.Initializable#initialize() + */ + public void initialize() throws Exception { + injector = Guice.createInjector(new NNTPServerModule(), new Jsr250Module()); + injector.injectMembers(nntpserver); + } + + /** + * @see org.apache.avalon.framework.logger.LogEnabled#enableLogging(org.apache.avalon.framework.logger.Logger) + */ + public void enableLogging(Logger logger) { + this.logger = new AvalonLogger(logger); + } + + private final class NNTPServerModule extends AbstractModule { + + @Override + protected void configure() { + bind(DNSService.class).annotatedWith(Names.named("org.apache.james.api.dnsservice.DNSService")).toInstance(dns); + bind(MailServer.class).annotatedWith(Names.named("org.apache.james.services.MailServer")).toInstance(mailserver); + bind(org.apache.commons.configuration.HierarchicalConfiguration.class).annotatedWith(Names.named("org.apache.commons.configuration.Configuration")).toInstance(config); + bind(Log.class).annotatedWith(Names.named("org.apache.commons.logging.Log")).toInstance(logger); + bind(FileSystem.class).annotatedWith(Names.named("org.apache.james.services.FileSystem")).toInstance(filesystem); + bind(UsersRepository.class).annotatedWith(Names.named("org.apache.james.api.user.UsersRepository")).toInstance(userRepos); + bind(ProtocolHandlerFactory.class).annotatedWith(Names.named("org.apache.james.socket.api.ProtocolHandlerFactory")).toProvider(new Provider<ProtocolHandlerFactory>() { + + public ProtocolHandlerFactory get() { + return nntpserver; + } + + }); + bind(SocketManager.class).annotatedWith(Names.named("org.apache.avalon.cornerstone.services.sockets.SocketManager")).toInstance(socketManager); + bind(JamesConnectionManager.class).annotatedWith(Names.named("org.apache.james.socket.JamesConnectionManager")).toInstance(connectionManager); + bind(ThreadManager.class).annotatedWith(Names.named("org.apache.avalon.cornerstone.services.threads.ThreadManager")).toInstance(threadManager); + bind(NNTPRepository.class).annotatedWith(Names.named("org.apache.james.nntpserver.repository.NNTPRepository")).toInstance(nntpRepos); + // we bind the LoaderService to an Provider to get sure everything is there when the SMTPLoaderService get created. + bind(LoaderService.class).annotatedWith(Names.named("org.apache.james.LoaderService")).toProvider(new Provider<LoaderService>() { + + public LoaderService get() { + return new NNTPLoaderService(); + } + + // Mimic the loaderservice + class NNTPLoaderService implements LoaderService { + Injector injector = Guice.createInjector(new NNTPServerModule(), new Jsr250Module()); + + public <T> T load(Class<T> type) { + return injector.getInstance(type); + } + + } + + }); + + } + } +} + Modified: james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/NNTPException.java URL: http://svn.apache.org/viewvc/james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/NNTPException.java?rev=831895&r1=831894&r2=831895&view=diff ============================================================================== --- james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/NNTPException.java (original) +++ james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/NNTPException.java Mon Nov 2 13:38:23 2009 @@ -28,14 +28,10 @@ * Error Information is obtained by calling 'getMessage' * */ +@SuppressWarnings("serial") public class NNTPException extends RuntimeException { /** - * The encapsulated Throwable - */ - private final Throwable t; - - /** * Create an NNTPException with an error message and no * encapsulated <code>Throwable</code> * @@ -43,7 +39,6 @@ */ public NNTPException(String msg) { super(msg); - this.t = null; } /** @@ -55,7 +50,6 @@ */ public NNTPException(String msg,Throwable t) { super(msg+((t!=null)?": "+t.toString():"")); - this.t = t; } /** @@ -66,6 +60,5 @@ */ public NNTPException(Throwable t) { super(t.toString()); - this.t = t; } } Modified: james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/NNTPHandler.java URL: http://svn.apache.org/viewvc/james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/NNTPHandler.java?rev=831895&r1=831894&r2=831895&view=diff ============================================================================== --- james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/NNTPHandler.java (original) +++ james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/NNTPHandler.java Mon Nov 2 13:38:23 2009 @@ -536,13 +536,13 @@ } context.writeLoggedFlushedResponse("230 list of new articles by message-id follows"); - Iterator groupIter = theConfigData.getNNTPRepository().getMatchedGroups(wildmat); + Iterator<NNTPGroup> groupIter = theConfigData.getNNTPRepository().getMatchedGroups(wildmat); while ( groupIter.hasNext() ) { - Iterator articleIter = ((NNTPGroup)(groupIter.next())).getArticlesSince(theDate); + Iterator<NNTPArticle> articleIter = groupIter.next().getArticlesSince(theDate); while (articleIter.hasNext()) { StringBuilder iterBuffer = new StringBuilder(64) - .append(((NNTPArticle)articleIter.next()).getUniqueID()); + .append(articleIter.next().getUniqueID()); context.writeLoggedResponse(iterBuffer.toString()); } } @@ -575,7 +575,7 @@ context.writeLoggedFlushedResponse("501 Syntax error"); return; } - Iterator iter = theConfigData.getNNTPRepository().getGroupsSince(theDate); + Iterator<NNTPGroup> iter = theConfigData.getNNTPRepository().getGroupsSince(theDate); context.writeLoggedFlushedResponse("231 list of new newsgroups follows"); while ( iter.hasNext() ) { NNTPGroup currentGroup = (NNTPGroup)iter.next(); @@ -687,10 +687,10 @@ } } - Iterator iter = theConfigData.getNNTPRepository().getMatchedGroups(wildmat); + Iterator<NNTPGroup> iter = theConfigData.getNNTPRepository().getMatchedGroups(wildmat); context.writeLoggedFlushedResponse("215 list of newsgroups follows"); while ( iter.hasNext() ) { - NNTPGroup theGroup = (NNTPGroup)iter.next(); + NNTPGroup theGroup = iter.next(); if (isListNewsgroups) { context.writeLoggedResponse(theGroup.getListNewsgroupsFormat()); } else { @@ -1199,9 +1199,9 @@ context.writeLoggedFlushedResponse("211 list of article numbers follow"); - Iterator iter = group.getArticles(); + Iterator<NNTPArticle> iter = group.getArticles(); while (iter.hasNext()) { - NNTPArticle article = (NNTPArticle)iter.next(); + NNTPArticle article = iter.next(); context.writeLoggedResponse(article.getArticleNumber() + ""); } context.writeLoggedFlushedResponse("."); @@ -1472,7 +1472,7 @@ end = Integer.parseInt(range.substring(idx + 1)); } } - List list = new ArrayList(); + List<NNTPArticle> list = new ArrayList<NNTPArticle>(); for ( int i = start ; i <= end ; i++ ) { NNTPArticle article = group.getArticle(i); if ( article != null ) { Added: james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/repository/AvalonNNTPRepository.java URL: http://svn.apache.org/viewvc/james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/repository/AvalonNNTPRepository.java?rev=831895&view=auto ============================================================================== --- james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/repository/AvalonNNTPRepository.java (added) +++ james/server/trunk/nntpserver-function/src/main/java/org/apache/james/nntpserver/repository/AvalonNNTPRepository.java Mon Nov 2 13:38:23 2009 @@ -0,0 +1,115 @@ +/**************************************************************** + * Licensed to the Apache Software Foundation (ASF) under one * + * or more contributor license agreements. See the NOTICE file * + * distributed with this work for additional information * + * regarding copyright ownership. The ASF licenses this file * + * to you under the Apache License, Version 2.0 (the * + * "License"); you may not use this file except in compliance * + * with the License. You may obtain a copy of the License at * + * * + * http://www.apache.org/licenses/LICENSE-2.0 * + * * + * Unless required by applicable law or agreed to in writing, * + * software distributed under the License is distributed on an * + * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY * + * KIND, either express or implied. See the License for the * + * specific language governing permissions and limitations * + * under the License. * + ****************************************************************/ +package org.apache.james.nntpserver.repository; + +import java.io.InputStream; +import java.util.Date; +import java.util.Iterator; + +import org.apache.avalon.framework.activity.Initializable; +import org.apache.avalon.framework.configuration.Configurable; +import org.apache.avalon.framework.configuration.Configuration; +import org.apache.avalon.framework.configuration.ConfigurationException; +import org.apache.avalon.framework.logger.LogEnabled; +import org.apache.avalon.framework.logger.Logger; +import org.apache.avalon.framework.service.ServiceException; +import org.apache.avalon.framework.service.ServiceManager; +import org.apache.avalon.framework.service.Serviceable; +import org.apache.commons.logging.Log; +import org.apache.commons.logging.impl.AvalonLogger; +import org.apache.james.bridge.GuiceInjected; +import org.apache.james.services.FileSystem; +import org.apache.james.util.ConfigurationAdapter; +import org.guiceyfruit.jsr250.Jsr250Module; + +import com.google.inject.AbstractModule; +import com.google.inject.Guice; +import com.google.inject.name.Names; + +public class AvalonNNTPRepository implements NNTPRepository, GuiceInjected, Configurable, Serviceable, LogEnabled, Initializable{ + + private NNTPRepository repos; + private FileSystem fs; + private AvalonLogger logger; + private ConfigurationAdapter config; + + public void createArticle(InputStream in) { + repos.createArticle(in); + } + + public NNTPArticle getArticleFromID(String id) { + return repos.getArticleFromID(id); + } + + public Iterator<NNTPArticle> getArticlesSince(Date dt) { + return repos.getArticlesSince(dt); + } + + public NNTPGroup getGroup(String groupName) { + return repos.getGroup(groupName); + } + + public Iterator<NNTPGroup> getGroupsSince(Date dt) { + return repos.getGroupsSince(dt); + } + + public Iterator<NNTPGroup> getMatchedGroups(String wildmat) { + return repos.getMatchedGroups(wildmat); + } + + public
{'source': 'Apache Software Foundation Public Mail Archives'}