Build failed in Jenkins: james-server-trunk #5300

2015-06-29 Thread Apache Jenkins Server
See https://builds.apache.org/job/james-server-trunk/5300/

--
[...truncated 5486 lines...]
Sending artifact delta relative to james-server-trunk ? Apache James :: Karaf 
:: James Server #5296
Archived 1 artifacts
Archive block size is 32768
Received 0 blocks and 6663 bytes
Compression is 0.0%
Took 4.3 sec
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/queue/queue-jms/pom.xml
 to 
org.apache.james/james-server-queue-jms/3.0.0-beta5-SNAPSHOT/james-server-queue-jms-3.0.0-beta5-SNAPSHOT.pom
Sending artifact delta relative to james-server-trunk ? Apache James :: Server 
:: Mail Queue :: JMS #5296
Archived 1 artifacts
Archive block size is 32768
Received 0 blocks and 4524 bytes
Compression is 0.0%
Took 0.16 sec
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/filesystem-api/pom.xml
 to 
org.apache.james/james-server-filesystem-api/3.0.0-beta5-SNAPSHOT/james-server-filesystem-api-3.0.0-beta5-SNAPSHOT.pom
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/filesystem-api/target/james-server-filesystem-api-3.0.0-beta5-SNAPSHOT.jar
 to 
org.apache.james/james-server-filesystem-api/3.0.0-beta5-20150629.100711-1480/james-server-filesystem-api-3.0.0-beta5-20150629.100711-1480.jar
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/filesystem-api/target/james-server-filesystem-api-3.0.0-beta5-SNAPSHOT-tests.jar
 to 
org.apache.james/james-server-filesystem-api/3.0.0-beta5-20150629.100711-1480/james-server-filesystem-api-3.0.0-beta5-20150629.100711-1480-tests.jar
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/filesystem-api/target/james-server-filesystem-api-3.0.0-beta5-SNAPSHOT-sources.jar
 to 
org.apache.james/james-server-filesystem-api/3.0.0-beta5-20150629.100711-1480/james-server-filesystem-api-3.0.0-beta5-20150629.100711-1480-sources.jar
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/filesystem-api/target/james-server-filesystem-api-3.0.0-beta5-SNAPSHOT-test-sources.jar
 to 
org.apache.james/james-server-filesystem-api/3.0.0-beta5-20150629.100711-1480/james-server-filesystem-api-3.0.0-beta5-20150629.100711-1480-test-sources.jar
Sending artifact delta relative to james-server-trunk ? Apache James :: Server 
:: Filesystem API #5299
Archived 5 artifacts
Archive block size is 32768
Received 0 blocks and 55423 bytes
Compression is 0.0%
Took 0.19 sec
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/mailet/mailetcontainer-api/pom.xml
 to 
org.apache.james/james-server-mailetcontainer-api/3.0.0-beta5-SNAPSHOT/james-server-mailetcontainer-api-3.0.0-beta5-SNAPSHOT.pom
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/mailet/mailetcontainer-api/target/james-server-mailetcontainer-api-3.0.0-beta5-SNAPSHOT.jar
 to 
org.apache.james/james-server-mailetcontainer-api/3.0.0-beta5-20150629.100721-1475/james-server-mailetcontainer-api-3.0.0-beta5-20150629.100721-1475.jar
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/mailet/mailetcontainer-api/target/james-server-mailetcontainer-api-3.0.0-beta5-SNAPSHOT-tests.jar
 to 
org.apache.james/james-server-mailetcontainer-api/3.0.0-beta5-20150629.100721-1475/james-server-mailetcontainer-api-3.0.0-beta5-20150629.100721-1475-tests.jar
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/mailet/mailetcontainer-api/target/james-server-mailetcontainer-api-3.0.0-beta5-SNAPSHOT-sources.jar
 to 
org.apache.james/james-server-mailetcontainer-api/3.0.0-beta5-20150629.100721-1475/james-server-mailetcontainer-api-3.0.0-beta5-20150629.100721-1475-sources.jar
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/mailet/mailetcontainer-api/target/james-server-mailetcontainer-api-3.0.0-beta5-SNAPSHOT-test-sources.jar
 to 
org.apache.james/james-server-mailetcontainer-api/3.0.0-beta5-20150629.100721-1475/james-server-mailetcontainer-api-3.0.0-beta5-20150629.100721-1475-test-sources.jar
Sending artifact delta relative to james-server-trunk ? Apache James :: Server 
:: Mailetcontainer API #5299
Archived 5 artifacts
Archive block size is 32768
Received 0 blocks and 61415 bytes
Compression is 0.0%
Took 0.12 sec
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/mailet/mailets/pom.xml
 to 
org.apache.james/james-server-mailets/3.0.0-beta5-SNAPSHOT/james-server-mailets-3.0.0-beta5-SNAPSHOT.pom
Sending artifact delta relative to james-server-trunk ? Apache James :: Server 
:: Mailets #5296
Archived 1 artifacts
Archive block size is 32768
Received 0 blocks and 6589 bytes
Compression is 0.0%
Took 0.15 sec
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/protocols/protocols-lmtp/pom.xml
 to 

Build failed in Jenkins: james-server-trunk » Apache James :: Server :: POP3 #5300

2015-06-29 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/5300/

--
[INFO] 
[INFO] 
[INFO] Building Apache James :: Server :: POP3 3.0.0-beta5-SNAPSHOT
[INFO] 
Downloading: 
http://repository.apache.org/snapshots/org/apache/james/protocols/protocols-pop3/1.6.4-SNAPSHOT/maven-metadata.xml
Downloaded: 
http://repository.apache.org/snapshots/org/apache/james/protocols/protocols-pop3/1.6.4-SNAPSHOT/maven-metadata.xml
 (2 KB at 14.9 KB/sec)
Downloading: 
http://repository.apache.org/snapshots/org/apache/james/protocols/protocols-pop3/1.6.4-SNAPSHOT/protocols-pop3-1.6.4-20150617.121220-974.pom
Downloaded: 
http://repository.apache.org/snapshots/org/apache/james/protocols/protocols-pop3/1.6.4-SNAPSHOT/protocols-pop3-1.6.4-20150617.121220-974.pom
 (3 KB at 25.3 KB/sec)
Downloading: 
http://repository.apache.org/snapshots/org/apache/james/protocols/protocols-pop3/1.6.4-SNAPSHOT/protocols-pop3-1.6.4-20150617.121220-974.jar
Downloaded: 
http://repository.apache.org/snapshots/org/apache/james/protocols/protocols-pop3/1.6.4-SNAPSHOT/protocols-pop3-1.6.4-20150617.121220-974.jar
 (52 KB at 994.6 KB/sec)
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ 
james-server-protocols-pop3 ---
[INFO] Deleting 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/ws/target
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.4:process (default) @ 
james-server-protocols-pop3 ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 
james-server-protocols-pop3 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ 
james-server-protocols-pop3 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 14 source files to 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/ws/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ 
james-server-protocols-pop3 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/ws/src/test/resources
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ 
james-server-protocols-pop3 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/ws/target/test-classes
[INFO] -
[ERROR] COMPILATION ERROR : 
[INFO] -
[ERROR] 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/ws/src/test/java/org/apache/james/pop3server/POP3ServerTest.java:[47,41]
 cannot find symbol
  symbol:   class InMemoryId
  location: package org.apache.james.mailbox.inmemory
[ERROR] 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/ws/src/test/java/org/apache/james/pop3server/POP3ServerTest.java:[74,33]
 cannot find symbol
  symbol:   class InMemoryId
  location: class org.apache.james.pop3server.POP3ServerTest
[ERROR] 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/ws/src/test/java/org/apache/james/pop3server/POP3ServerTest.java:[713,50]
 cannot find symbol
  symbol:   class InMemoryId
  location: class org.apache.james.pop3server.POP3ServerTest
[INFO] 3 errors 
[INFO] -

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (MAILBOX-155) Add elasticsearch based search index

2015-06-29 Thread Eric Charles (JIRA)

 [ 
https://issues.apache.org/jira/browse/MAILBOX-155?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Eric Charles resolved MAILBOX-155.
--
   Resolution: Fixed
Fix Version/s: 0.6

 Add elasticsearch based search index
 

 Key: MAILBOX-155
 URL: https://issues.apache.org/jira/browse/MAILBOX-155
 Project: James Mailbox
  Issue Type: New Feature
Reporter: Norman Maurer
Assignee: Norman Maurer
 Fix For: 0.6

 Attachments: MAILBOX-155.patch






--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



Build failed in Jenkins: jdkim-trunk #2428

2015-06-29 Thread Apache Jenkins Server
See https://builds.apache.org/job/jdkim-trunk/2428/

--
Started by timer
Building remotely on ubuntu-6 (docker Ubuntu ubuntu) in workspace 
https://builds.apache.org/job/jdkim-trunk/ws/
Updating http://svn.apache.org/repos/asf/james/jdkim/trunk at revision 
'2015-06-29T11:23:00.337 +'
At revision 1688186
no change for http://svn.apache.org/repos/asf/james/jdkim/trunk since the 
previous build
[locks-and-latches] Checking to see if we really have the locks
[locks-and-latches] Have all the locks, build can start
Parsing POMs
Downloaded artifact 
http://repository.apache.org/snapshots/org/apache/james/james-project/1.8.3-SNAPSHOT/maven-metadata.xml
maven3-agent.jar already up to date
maven3-interceptor.jar already up to date
maven3-interceptor-commons.jar already up to date
[trunk] $ /home/jenkins/tools/java/latest1.6/bin/java -Xmx2g -Xms256m 
-XX:MaxPermSize=512m -cp 
/home/jenkins/jenkins-slave/maven3-agent.jar:/home/jenkins/tools/maven/apache-maven-3.0.4/boot/plexus-classworlds-2.4.jar
 org.jvnet.hudson.maven3.agent.Maven3Main 
/home/jenkins/tools/maven/apache-maven-3.0.4 
/home/jenkins/jenkins-slave/slave.jar 
/home/jenkins/jenkins-slave/maven3-interceptor.jar 
/home/jenkins/jenkins-slave/maven3-interceptor-commons.jar 55069
===[JENKINS REMOTING CAPACITY]===   channel started
Executing Maven:  -B -f 
https://builds.apache.org/job/jdkim-trunk/ws/trunk/pom.xml 
-Dmaven.repo.local=/home/jenkins/jenkins-slave/maven-repositories/0 -U clean 
deploy
[INFO] Scanning for projects...
[INFO] 
[INFO] Reactor Build Order:
[INFO] 
[INFO] Apache James :: jDKIM :: DomainKey Project
[INFO] Apache James :: jDKIM
[INFO] Apache James :: jDKIM :: Mailets
[INFO] Apache James :: jDKIM :: Assembly
[INFO] 
[INFO] 
[INFO] Building Apache James :: jDKIM :: DomainKey Project 0.3-SNAPSHOT
[INFO] 
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ apache-jdkim-project 
---
[INFO] Deleting https://builds.apache.org/job/jdkim-trunk/ws/trunk/target
[TASKS] Scanning folder 'https://builds.apache.org/job/jdkim-trunk/ws/trunk' 
for files matching the pattern '**/*.java' - excludes: main/**/*, mailets/**/*, 
assemble/**/*
[TASKS] Found 0 files to scan for tasks
Found 0 open tasks.
[TASKS] Computing warning deltas based on reference build #2416
log4j:WARN No appenders could be found for logger 
(org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.4:process (default) @ 
apache-jdkim-project ---
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (jar) @ apache-jdkim-project ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: 
https://builds.apache.org/job/jdkim-trunk/ws/trunk/target/apache-jdkim-project-0.3-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-jar-plugin:2.4:test-jar (test-jar) @ apache-jdkim-project ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: 
https://builds.apache.org/job/jdkim-trunk/ws/trunk/target/apache-jdkim-project-0.3-SNAPSHOT-tests.jar
[WARNING] Failed to getClass for org.apache.maven.plugin.source.SourceJarMojo
[INFO] 
[INFO] --- maven-source-plugin:2.2.1:jar (attach-sources) @ 
apache-jdkim-project ---
[WARNING] Failed to getClass for 
org.apache.maven.plugin.source.TestSourceJarMojo
[INFO] 
[INFO] --- maven-source-plugin:2.2.1:test-jar (attach-sources) @ 
apache-jdkim-project ---
[INFO] 
[INFO] --- maven-site-plugin:3.2:attach-descriptor (attach-descriptor) @ 
apache-jdkim-project ---
[INFO] 
[INFO] --- maven-install-plugin:2.5.1:install (default-install) @ 
apache-jdkim-project ---
[INFO] Installing https://builds.apache.org/job/jdkim-trunk/ws/trunk/pom.xml 
to 
/home/jenkins/jenkins-slave/maven-repositories/0/org/apache/james/jdkim/apache-jdkim-project/0.3-SNAPSHOT/apache-jdkim-project-0.3-SNAPSHOT.pom
[INFO] Installing 
https://builds.apache.org/job/jdkim-trunk/ws/trunk/target/apache-jdkim-project-0.3-SNAPSHOT-tests.jar
 to 
/home/jenkins/jenkins-slave/maven-repositories/0/org/apache/james/jdkim/apache-jdkim-project/0.3-SNAPSHOT/apache-jdkim-project-0.3-SNAPSHOT-tests.jar
[INFO] Installing 
https://builds.apache.org/job/jdkim-trunk/ws/trunk/target/apache-jdkim-project-0.3-SNAPSHOT-site.xml
 to 
/home/jenkins/jenkins-slave/maven-repositories/0/org/apache/james/jdkim/apache-jdkim-project/0.3-SNAPSHOT/apache-jdkim-project-0.3-SNAPSHOT-site.xml
[INFO] 
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ 
apache-jdkim-project ---
Downloading: 
https://repository.apache.org/content/repositories/snapshots/org/apache/james/jdkim/apache-jdkim-project/0.3-SNAPSHOT/maven-metadata.xml
[WARNING] 

Build failed in Jenkins: jdkim-trunk » Apache James :: jDKIM :: DomainKey Project #2428

2015-06-29 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/jdkim-trunk/org.apache.james.jdkim$apache-jdkim-project/2428/

--
maven3-agent.jar already up to date
maven3-interceptor.jar already up to date
maven3-interceptor-commons.jar already up to date
===[JENKINS REMOTING CAPACITY]===   channel started
Executing Maven:  -B -f 
https://builds.apache.org/job/jdkim-trunk/org.apache.james.jdkim$apache-jdkim-project/ws/pom.xml
 -Dmaven.repo.local=/home/jenkins/jenkins-slave/maven-repositories/0 -U clean 
deploy
[INFO] Scanning for projects...
[INFO] 
[INFO] Reactor Build Order:
[INFO] 
[INFO] Apache James :: jDKIM :: DomainKey Project
[INFO] Apache James :: jDKIM
[INFO] Apache James :: jDKIM :: Mailets
[INFO] Apache James :: jDKIM :: Assembly
[INFO] 
[INFO] 
[INFO] Building Apache James :: jDKIM :: DomainKey Project 0.3-SNAPSHOT
[INFO] 
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ apache-jdkim-project 
---
[INFO] Deleting 
https://builds.apache.org/job/jdkim-trunk/org.apache.james.jdkim$apache-jdkim-project/ws/target
[TASKS] Scanning folder 
'https://builds.apache.org/job/jdkim-trunk/org.apache.james.jdkim$apache-jdkim-project/ws/'
 for files matching the pattern '**/*.java' - excludes: main/**/*, 
mailets/**/*, assemble/**/*
[TASKS] Found 0 files to scan for tasks
Found 0 open tasks.
[TASKS] Computing warning deltas based on reference build #2416
log4j:WARN No appenders could be found for logger 
(org.apache.commons.beanutils.converters.BooleanConverter).
log4j:WARN Please initialize the log4j system properly.
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.4:process (default) @ 
apache-jdkim-project ---
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (jar) @ apache-jdkim-project ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: 
https://builds.apache.org/job/jdkim-trunk/org.apache.james.jdkim$apache-jdkim-project/ws/target/apache-jdkim-project-0.3-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-jar-plugin:2.4:test-jar (test-jar) @ apache-jdkim-project ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: 
https://builds.apache.org/job/jdkim-trunk/org.apache.james.jdkim$apache-jdkim-project/ws/target/apache-jdkim-project-0.3-SNAPSHOT-tests.jar
[WARNING] Failed to getClass for org.apache.maven.plugin.source.SourceJarMojo
[INFO] 
[INFO] --- maven-source-plugin:2.2.1:jar (attach-sources) @ 
apache-jdkim-project ---
[WARNING] Failed to getClass for 
org.apache.maven.plugin.source.TestSourceJarMojo
[INFO] 
[INFO] --- maven-source-plugin:2.2.1:test-jar (attach-sources) @ 
apache-jdkim-project ---
[INFO] 
[INFO] --- maven-site-plugin:3.2:attach-descriptor (attach-descriptor) @ 
apache-jdkim-project ---
[INFO] 
[INFO] --- maven-install-plugin:2.5.1:install (default-install) @ 
apache-jdkim-project ---
[INFO] Installing 
https://builds.apache.org/job/jdkim-trunk/org.apache.james.jdkim$apache-jdkim-project/ws/pom.xml
 to 
/home/jenkins/jenkins-slave/maven-repositories/0/org/apache/james/jdkim/apache-jdkim-project/0.3-SNAPSHOT/apache-jdkim-project-0.3-SNAPSHOT.pom
[INFO] Installing 
https://builds.apache.org/job/jdkim-trunk/org.apache.james.jdkim$apache-jdkim-project/ws/target/apache-jdkim-project-0.3-SNAPSHOT-tests.jar
 to 
/home/jenkins/jenkins-slave/maven-repositories/0/org/apache/james/jdkim/apache-jdkim-project/0.3-SNAPSHOT/apache-jdkim-project-0.3-SNAPSHOT-tests.jar
[INFO] Installing 
https://builds.apache.org/job/jdkim-trunk/org.apache.james.jdkim$apache-jdkim-project/ws/target/apache-jdkim-project-0.3-SNAPSHOT-site.xml
 to 
/home/jenkins/jenkins-slave/maven-repositories/0/org/apache/james/jdkim/apache-jdkim-project/0.3-SNAPSHOT/apache-jdkim-project-0.3-SNAPSHOT-site.xml
[INFO] 
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ 
apache-jdkim-project ---
Downloading: 
https://repository.apache.org/content/repositories/snapshots/org/apache/james/jdkim/apache-jdkim-project/0.3-SNAPSHOT/maven-metadata.xml
[WARNING] Could not transfer metadata 
org.apache.james.jdkim:apache-jdkim-project:0.3-SNAPSHOT/maven-metadata.xml 
from/to apache.snapshots.https 
(https://repository.apache.org/content/repositories/snapshots): 
java.lang.RuntimeException: Could not generate DH keypair
[INFO] 
[INFO] Reactor Summary:
[INFO] 
[INFO] Apache James :: jDKIM :: DomainKey Project  FAILURE [14.791s]
[INFO] Apache James :: jDKIM . SKIPPED
[INFO] Apache James :: jDKIM :: Mailets .. SKIPPED
[INFO] Apache James :: jDKIM :: Assembly . SKIPPED
[INFO] 

[jira] [Comment Edited] (JAMES-1581) update direct-msg-monitor porm.xml file for springform

2015-06-29 Thread Alina Sun (JIRA)

[ 
https://issues.apache.org/jira/browse/JAMES-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14606606#comment-14606606
 ] 

Alina Sun edited comment on JAMES-1581 at 6/29/15 10:59 PM:


The the patch file is attched as springform.diff. Please review. Thanks.


was (Author: alinasun):
The the patch file is attched as springform.diff

 update direct-msg-monitor porm.xml file for springform
 --

 Key: JAMES-1581
 URL: https://issues.apache.org/jira/browse/JAMES-1581
 Project: James Server
  Issue Type: Bug
Reporter: Alina Sun
 Attachments: springform.diff


 update direct-msg-monitor porm.xml file for springform 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Updated] (JAMES-1581) update direct-msg-monitor porm.xml file for springform

2015-06-29 Thread Alina Sun (JIRA)

 [ 
https://issues.apache.org/jira/browse/JAMES-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alina Sun updated JAMES-1581:
-
Attachment: springform

 update direct-msg-monitor porm.xml file for springform
 --

 Key: JAMES-1581
 URL: https://issues.apache.org/jira/browse/JAMES-1581
 Project: James Server
  Issue Type: Bug
Reporter: Alina Sun

 update direct-msg-monitor porm.xml file for springform 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Updated] (JAMES-1581) update direct-msg-monitor porm.xml file for springform

2015-06-29 Thread Alina Sun (JIRA)

 [ 
https://issues.apache.org/jira/browse/JAMES-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alina Sun updated JAMES-1581:
-
Attachment: (was: springform)

 update direct-msg-monitor porm.xml file for springform
 --

 Key: JAMES-1581
 URL: https://issues.apache.org/jira/browse/JAMES-1581
 Project: James Server
  Issue Type: Bug
Reporter: Alina Sun

 update direct-msg-monitor porm.xml file for springform 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Updated] (JAMES-1582) unnecessory log are printed our in production env

2015-06-29 Thread Alina Sun (JIRA)

 [ 
https://issues.apache.org/jira/browse/JAMES-1582?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alina Sun updated JAMES-1582:
-
Attachment: remove-logs.diff

 unnecessory log are printed our in production env
 -

 Key: JAMES-1582
 URL: https://issues.apache.org/jira/browse/JAMES-1582
 Project: James Server
  Issue Type: Bug
Reporter: Alina Sun
 Attachments: remove-logs.diff


 unnecessory log are printed our in production env. The patch files is 
 attached. Please reivew.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Created] (JAMES-1582) unnecessory log are printed our in production env

2015-06-29 Thread Alina Sun (JIRA)
Alina Sun created JAMES-1582:


 Summary: unnecessory log are printed our in production env
 Key: JAMES-1582
 URL: https://issues.apache.org/jira/browse/JAMES-1582
 Project: James Server
  Issue Type: Bug
Reporter: Alina Sun


unnecessory log are printed our in production env. The patch files is attached. 
Please reivew.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Created] (JAMES-1581) update direct-msg-monitor porm.xml file for springform

2015-06-29 Thread Alina Sun (JIRA)
Alina Sun created JAMES-1581:


 Summary: update direct-msg-monitor porm.xml file for springform
 Key: JAMES-1581
 URL: https://issues.apache.org/jira/browse/JAMES-1581
 Project: James Server
  Issue Type: Bug
Reporter: Alina Sun


update direct-msg-monitor porm.xml file for springform 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Created] (JAMES-1583) SRV weighting not correctly observed in certificate lookup

2015-06-29 Thread Alina Sun (JIRA)
Alina Sun created JAMES-1583:


 Summary: SRV weighting not correctly observed in certificate lookup
 Key: JAMES-1583
 URL: https://issues.apache.org/jira/browse/JAMES-1583
 Project: James Server
  Issue Type: Bug
Reporter: Alina Sun


The patch files is attached. Please review. Thanks.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Updated] (JAMES-1581) update direct-msg-monitor porm.xml file for springform

2015-06-29 Thread Alina Sun (JIRA)

 [ 
https://issues.apache.org/jira/browse/JAMES-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alina Sun updated JAMES-1581:
-
Attachment: springform.diff

 update direct-msg-monitor porm.xml file for springform
 --

 Key: JAMES-1581
 URL: https://issues.apache.org/jira/browse/JAMES-1581
 Project: James Server
  Issue Type: Bug
Reporter: Alina Sun
 Attachments: springform.diff


 update direct-msg-monitor porm.xml file for springform 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Commented] (JAMES-1581) update direct-msg-monitor porm.xml file for springform

2015-06-29 Thread Alina Sun (JIRA)

[ 
https://issues.apache.org/jira/browse/JAMES-1581?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14606606#comment-14606606
 ] 

Alina Sun commented on JAMES-1581:
--

The the patch file is attched as springform.diff

 update direct-msg-monitor porm.xml file for springform
 --

 Key: JAMES-1581
 URL: https://issues.apache.org/jira/browse/JAMES-1581
 Project: James Server
  Issue Type: Bug
Reporter: Alina Sun
 Attachments: springform.diff


 update direct-msg-monitor porm.xml file for springform 



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688119 - in /james/mailbox/trunk/elasticsearch/src: main/java/org/apache/james/mailbox/elasticsearch/query/ test/java/org/apache/james/mailbox/elasticsearch/query/

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:27:00 2015
New Revision: 1688119

URL: http://svn.apache.org/r1688119
Log:
MAILBOX-235 Round date based on James specified time units

Added:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/DateResolutionFormater.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/query/

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/query/DateResolutionFormaterTest.java

Added: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/DateResolutionFormater.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/DateResolutionFormater.java?rev=1688119view=auto
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/DateResolutionFormater.java
 (added)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/DateResolutionFormater.java
 Mon Jun 29 08:27:00 2015
@@ -0,0 +1,63 @@
+/
+ * 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.mailbox.elasticsearch.query;
+
+import org.apache.james.mailbox.model.SearchQuery;
+
+import java.time.Instant;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+import java.time.temporal.ChronoUnit;
+import java.time.temporal.TemporalUnit;
+import java.util.Date;
+
+public class DateResolutionFormater {
+
+public static ZonedDateTime computeUpperDate(ZonedDateTime date, 
SearchQuery.DateResolution resolution) {
+return 
date.truncatedTo(convertDateResolutionField(resolution)).plus(1,convertDateResolutionField(resolution));
+}
+
+public static ZonedDateTime computeLowerDate(ZonedDateTime date, 
SearchQuery.DateResolution resolution) {
+return date.truncatedTo(convertDateResolutionField(resolution));
+}
+
+private static TemporalUnit 
convertDateResolutionField(SearchQuery.DateResolution resolution) {
+switch(resolution) {
+case Year:
+return ChronoUnit.YEARS;
+case Month:
+return ChronoUnit.MONTHS;
+case Day:
+return ChronoUnit.DAYS;
+case Hour:
+return ChronoUnit.HOURS;
+case Minute:
+return ChronoUnit.MINUTES;
+case Second:
+return ChronoUnit.SECONDS;
+default:
+throw new RuntimeException(Unknown Date resolution used);
+}
+}
+
+public static ZonedDateTime convertDateToZonedDateTime(Date date) {
+return ZonedDateTime.ofInstant(Instant.ofEpochMilli(date.getTime()), 
ZoneId.systemDefault());
+}
+}
\ No newline at end of file

Added: 
james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/query/DateResolutionFormaterTest.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/query/DateResolutionFormaterTest.java?rev=1688119view=auto
==
--- 
james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/query/DateResolutionFormaterTest.java
 (added)
+++ 
james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/query/DateResolutionFormaterTest.java
 Mon Jun 29 08:27:00 2015
@@ -0,0 +1,72 @@
+/
+ * Licensed to the Apache Software Foundation 

svn commit: r1688127 - in /james/mailbox/trunk/elasticsearch: ./ src/main/java/org/apache/james/mailbox/elasticsearch/ src/main/java/org/apache/james/mailbox/elasticsearch/events/ src/main/resources/M

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:33:09 2015
New Revision: 1688127

URL: http://svn.apache.org/r1688127
Log:
MAILBOX-242 Add event listener on messages - patch contributed by Antoine Duprat

Added:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/events/

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndexTest.java
Modified:
james/mailbox/trunk/elasticsearch/pom.xml

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java

james/mailbox/trunk/elasticsearch/src/main/resources/META-INF/spring/mailbox-elasticsearch.xml

Modified: james/mailbox/trunk/elasticsearch/pom.xml
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/pom.xml?rev=1688127r1=1688126r2=1688127view=diff
==
--- james/mailbox/trunk/elasticsearch/pom.xml (original)
+++ james/mailbox/trunk/elasticsearch/pom.xml Mon Jun 29 08:33:09 2015
@@ -97,6 +97,10 @@
 scopetest/scope
 /dependency
 dependency
+groupIdorg.apache.james/groupId
+artifactIdapache-james-mailbox-store/artifactId
+/dependency
+dependency
 groupIdorg.apache.lucene/groupId
 artifactIdlucene-core/artifactId
 version4.10.4/version
@@ -109,6 +113,12 @@
 scopetest/scope
 /dependency
 dependency
+groupIdorg.easymock/groupId
+artifactIdeasymock/artifactId
+version3.3.1/version
+scopetest/scope
+/dependency
+dependency
 groupIdorg.elasticsearch/groupId
 artifactIdelasticsearch/artifactId
 version1.5.2/version

Modified: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java?rev=1688127r1=1688126r2=1688127view=diff
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java
 (original)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java
 Mon Jun 29 08:33:09 2015
@@ -33,7 +33,7 @@ public class NodeProvider {
 .clusterName(clusterName)
 .settings(ImmutableSettings.builder()
 .put(GLOBAL_NETWORK_HOST_SETTING, masterHost)
-.put(SCRIPT_DISABLE_DYNAMIC, true))
+.put(SCRIPT_DISABLE_DYNAMIC, false))
 .client(true)
 .node()
 .start();

Added: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java?rev=1688127view=auto
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java
 (added)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java
 Mon Jun 29 08:33:09 2015
@@ -0,0 +1,106 @@
+/
+ * 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  

svn commit: r1688129 - in /james/mailbox/trunk: elasticsearch/ elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ev

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:34:21 2015
New Revision: 1688129

URL: http://svn.apache.org/r1688129
Log:
MAILBOX-155 Update index content without reading messages in base

Added:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MessageUpdateJson.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/EmbeddedElasticSearch.java
Modified:
james/mailbox/trunk/elasticsearch/pom.xml

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexer.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MessageToElasticSearchJson.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexerTest.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndexTest.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/MessageToElasticSearchJsonTest.java

james/mailbox/trunk/lucene/src/main/java/org/apache/james/mailbox/lucene/search/LuceneMessageSearchIndex.java

james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/LazyMessageSearchIndex.java

james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/search/ListeningMessageSearchIndex.java

Modified: james/mailbox/trunk/elasticsearch/pom.xml
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/pom.xml?rev=1688129r1=1688128r2=1688129view=diff
==
--- james/mailbox/trunk/elasticsearch/pom.xml (original)
+++ james/mailbox/trunk/elasticsearch/pom.xml Mon Jun 29 08:34:21 2015
@@ -139,6 +139,11 @@
 artifactIdslf4j-simple/artifactId
 scopetest/scope
 /dependency
+dependency
+groupIdorg.codehaus.groovy/groupId
+artifactIdgroovy-all/artifactId
+version2.3.2/version
+/dependency
 /dependencies
 
 profiles

Modified: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexer.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexer.java?rev=1688129r1=1688128r2=1688129view=diff
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexer.java
 (original)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexer.java
 Mon Jun 29 08:34:21 2015
@@ -47,12 +47,12 @@ public class ElasticSearchIndexer {
 .get();
 }
 }
-
-public UpdateResponse updateMessage(String id, String content) {
-checkArgument(content);
+
+public UpdateResponse updateMessage(String id, String docUpdated) {
+checkArgument(docUpdated);
 try (Client client = node.client()) {
 return client.prepareUpdate(MAILBOX_INDEX, MESSAGE_TYPE, id)
-.setDoc(content)
+.setDoc(docUpdated)
 .get();
 }
 }

Modified: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java?rev=1688129r1=1688128r2=1688129view=diff
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java
 (original)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java
 Mon Jun 29 08:34:21 2015
@@ -33,7 +33,7 @@ public class NodeProvider {
 .clusterName(clusterName)
 .settings(ImmutableSettings.builder()
 .put(GLOBAL_NETWORK_HOST_SETTING, masterHost)
-.put(SCRIPT_DISABLE_DYNAMIC, false))
+.put(SCRIPT_DISABLE_DYNAMIC, true))
 .client(true)
 .node()
 .start();

Modified: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java
URL: 

svn commit: r1688128 - /james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/SortConverter.java

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:33:41 2015
New Revision: 1688128

URL: http://svn.apache.org/r1688128
Log:
MAILBOX-155 Convert James query sorts into ElasticSearch sorts

Added:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/SortConverter.java

Added: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/SortConverter.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/SortConverter.java?rev=1688128view=auto
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/SortConverter.java
 (added)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/SortConverter.java
 Mon Jun 29 08:33:41 2015
@@ -0,0 +1,69 @@
+/
+ * 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.mailbox.elasticsearch.query;
+
+import org.apache.james.mailbox.elasticsearch.json.JsonMessageConstants;
+import org.apache.james.mailbox.model.SearchQuery;
+import org.elasticsearch.search.sort.FieldSortBuilder;
+import org.elasticsearch.search.sort.SortBuilders;
+import org.elasticsearch.search.sort.SortOrder;
+
+public class SortConverter {
+
+public static FieldSortBuilder convertSort(SearchQuery.Sort sort) {
+return SortBuilders.fieldSort(getFieldFromClause(sort.getSortClause()))
+.order(getOrder(sort));
+}
+
+private static String getFieldFromClause(SearchQuery.Sort.SortClause 
clause) {
+switch (clause) {
+case Arrival :
+return JsonMessageConstants.DATE;
+case MailboxCc :
+return JsonMessageConstants.CC;
+case MailboxFrom :
+return JsonMessageConstants.FROM + . + 
JsonMessageConstants.EMailer.ADDRESS;
+case MailboxTo :
+return JsonMessageConstants.TO + . + 
JsonMessageConstants.EMailer.ADDRESS;
+case BaseSubject :
+return JsonMessageConstants.SUBJECT;
+case Size :
+return JsonMessageConstants.SIZE;
+case SentDate :
+return JsonMessageConstants.DATE;
+case Uid :
+return JsonMessageConstants.ID;
+case DisplayFrom:
+return JsonMessageConstants.FROM + . + 
JsonMessageConstants.EMailer.NAME;
+case DisplayTo:
+return JsonMessageConstants.TO + . + 
JsonMessageConstants.EMailer.NAME;
+default:
+throw new RuntimeException(Sort is not implemented);
+}
+}
+
+private static SortOrder getOrder(SearchQuery.Sort sort) {
+if( sort.isReverse() ) {
+return SortOrder.DESC;
+} else {
+return SortOrder.ASC;
+}
+}
+}



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688148 - in /james/mailbox/trunk/elasticsearch/src: main/java/org/apache/james/mailbox/elasticsearch/json/ test/java/org/apache/james/mailbox/elasticsearch/ test/java/org/apache/james/ma

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:47:29 2015
New Revision: 1688148

URL: http://svn.apache.org/r1688148
Log:
MAILBOX-234 Use specified time zone for tests

Modified:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessage.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MessageToElasticSearchJson.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/MessageToElasticSearchJsonTest.java

Modified: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessage.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessage.java?rev=1688148r1=1688147r2=1688148view=diff
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessage.java
 (original)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessage.java
 Mon Jun 29 08:47:29 2015
@@ -42,18 +42,18 @@ import java.util.stream.Collectors;
 
 public class IndexableMessage {
 
-public static IndexableMessage from(Message? extends MailboxId message, 
TextExtractor textExtractor) {
+public static IndexableMessage from(Message? extends MailboxId message, 
TextExtractor textExtractor, ZoneId zoneId) {
 Preconditions.checkNotNull(message.getMailboxId());
 IndexableMessage indexableMessage = new IndexableMessage();
 try {
 MimePart parsingResult = new MimePartParser(message, 
textExtractor).parse();
 indexableMessage.bodyText = parsingResult.locateFirstTextualBody();
 indexableMessage.setFlattenedAttachments(parsingResult);
-
indexableMessage.copyHeaderFields(parsingResult.getHeaderCollection(), 
getSanitizedInternalDate(message));
+
indexableMessage.copyHeaderFields(parsingResult.getHeaderCollection(), 
getSanitizedInternalDate(message, zoneId));
 } catch (IOException | MimeException e) {
 throw Throwables.propagate(e);
 }
-indexableMessage.copyMessageFields(message);
+indexableMessage.copyMessageFields(message, zoneId);
 return indexableMessage;
 }
 
@@ -72,12 +72,12 @@ public class IndexableMessage {
 this.sentDate = 
DateResolutionFormater.DATE_TIME_FOMATTER.format(headerCollection.getSentDate().orElse(internalDate));
 }
 
-private void copyMessageFields(Message? extends MailboxId message) {
+private void copyMessageFields(Message? extends MailboxId message, 
ZoneId zoneId) {
 this.id = message.getUid();
 this.mailboxId = message.getMailboxId().serialize();
 this.modSeq = message.getModSeq();
 this.size = message.getFullContentOctets();
-this.date = 
DateResolutionFormater.DATE_TIME_FOMATTER.format(getSanitizedInternalDate(message));
+this.date = 
DateResolutionFormater.DATE_TIME_FOMATTER.format(getSanitizedInternalDate(message,
 zoneId));
 this.mediaType = message.getMediaType();
 this.subType = message.getSubType();
 this.isAnswered = message.isAnswered();
@@ -90,13 +90,13 @@ public class IndexableMessage {
 this.properties = message.getProperties();
 }
 
-private static ZonedDateTime getSanitizedInternalDate(Message? extends 
MailboxId message) {
+private static ZonedDateTime getSanitizedInternalDate(Message? extends 
MailboxId message, ZoneId zoneId) {
 if (message.getInternalDate() == null) {
 return ZonedDateTime.now();
 }
 return ZonedDateTime.ofInstant(
 Instant.ofEpochMilli(message.getInternalDate().getTime()),
-ZoneId.systemDefault());
+zoneId);
 }
 
 private Long id;

Modified: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MessageToElasticSearchJson.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MessageToElasticSearchJson.java?rev=1688148r1=1688147r2=1688148view=diff
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MessageToElasticSearchJson.java
 (original)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MessageToElasticSearchJson.java
 Mon Jun 29 08:47:29 2015
@@ -21,6 +21,8 @@ package org.apache.james.mailbox.elastic
 
 import javax.mail.Flags;
 
+import java.time.ZoneId;
+
 import 

svn commit: r1688147 - in /james/mailbox/trunk: ./ elasticsearch/ elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/ elasticsearch/src/main/java/org/apache/james/mailbox/elastics

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:46:59 2015
New Revision: 1688147

URL: http://svn.apache.org/r1688147
Log:
MAILBOX-245 Profile to not load tika Jar

Added:

james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/extractor/

james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/extractor/DefaultTextExtractor.java

james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/extractor/ParsedContent.java

james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/extractor/TextExtractor.java

james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/extractor/

james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/extractor/DefaultTextExtractorTest.java
james/mailbox/trunk/store/src/test/resources/
james/mailbox/trunk/store/src/test/resources/documents/
james/mailbox/trunk/store/src/test/resources/documents/Text.txt
james/mailbox/trunk/store/src/test/resources/documents/writter.docx
james/mailbox/trunk/tika/
james/mailbox/trunk/tika/pom.xml
james/mailbox/trunk/tika/src/
james/mailbox/trunk/tika/src/main/
james/mailbox/trunk/tika/src/main/java/
james/mailbox/trunk/tika/src/main/java/org/
james/mailbox/trunk/tika/src/main/java/org/apache/
james/mailbox/trunk/tika/src/main/java/org/apache/james/
james/mailbox/trunk/tika/src/main/java/org/apache/james/mailbox/
james/mailbox/trunk/tika/src/main/java/org/apache/james/mailbox/tika/

james/mailbox/trunk/tika/src/main/java/org/apache/james/mailbox/tika/extractor/

james/mailbox/trunk/tika/src/main/java/org/apache/james/mailbox/tika/extractor/TikaTextExtractor.java
james/mailbox/trunk/tika/src/test/
james/mailbox/trunk/tika/src/test/java/
james/mailbox/trunk/tika/src/test/java/org/
james/mailbox/trunk/tika/src/test/java/org/apache/
james/mailbox/trunk/tika/src/test/java/org/apache/james/
james/mailbox/trunk/tika/src/test/java/org/apache/james/mailbox/
james/mailbox/trunk/tika/src/test/java/org/apache/james/mailbox/tika/

james/mailbox/trunk/tika/src/test/java/org/apache/james/mailbox/tika/extractor/

james/mailbox/trunk/tika/src/test/java/org/apache/james/mailbox/tika/extractor/TikaTextExtractorTest.java
james/mailbox/trunk/tika/src/test/resources/
james/mailbox/trunk/tika/src/test/resources/documents/
james/mailbox/trunk/tika/src/test/resources/documents/PDF.pdf
james/mailbox/trunk/tika/src/test/resources/documents/Text.txt
james/mailbox/trunk/tika/src/test/resources/documents/calc.ods
james/mailbox/trunk/tika/src/test/resources/documents/calc.xlsx
james/mailbox/trunk/tika/src/test/resources/documents/fake.txt
james/mailbox/trunk/tika/src/test/resources/documents/slides.odp
james/mailbox/trunk/tika/src/test/resources/documents/slides.pptx
james/mailbox/trunk/tika/src/test/resources/documents/writter.docx
james/mailbox/trunk/tika/src/test/resources/documents/writter.odt
Removed:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/extractor/

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/MessageToElasticSearchJsonUsingTika.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/extractor/
james/mailbox/trunk/elasticsearch/src/test/resources/documents/PDF.pdf
james/mailbox/trunk/elasticsearch/src/test/resources/documents/Text.txt
james/mailbox/trunk/elasticsearch/src/test/resources/documents/calc.ods
james/mailbox/trunk/elasticsearch/src/test/resources/documents/calc.xlsx
james/mailbox/trunk/elasticsearch/src/test/resources/documents/fake.txt
james/mailbox/trunk/elasticsearch/src/test/resources/documents/slides.odp
james/mailbox/trunk/elasticsearch/src/test/resources/documents/slides.pptx
james/mailbox/trunk/elasticsearch/src/test/resources/documents/writter.docx
james/mailbox/trunk/elasticsearch/src/test/resources/documents/writter.odt
Modified:
james/mailbox/trunk/elasticsearch/pom.xml

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessage.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MessageToElasticSearchJson.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MimePart.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MimePartContainerBuilder.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MimePartParser.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/RootMimePartContainerBuilder.java

james/mailbox/trunk/elasticsearch/src/main/resources/META-INF/spring/mailbox-elasticsearch.xml


svn commit: r1688163 - /james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:59:03 2015
New Revision: 1688163

URL: http://svn.apache.org/r1688163
Log:
MAILBOX-245 Adding text extractor - Contributed by Antoine Duprat

Modified:

james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java

Modified: 
james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java
URL: 
http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java?rev=1688163r1=1688162r2=1688163view=diff
==
--- 
james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java
 (original)
+++ 
james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java
 Mon Jun 29 08:59:03 2015
@@ -31,6 +31,7 @@ import org.apache.james.mailbox.acl.Grou
 import org.apache.james.mailbox.acl.MailboxACLResolver;
 import org.apache.james.mailbox.acl.SimpleGroupMembershipResolver;
 import org.apache.james.mailbox.acl.UnionMailboxACLResolver;
+import org.apache.james.mailbox.elasticsearch.ClientProvider;
 import org.apache.james.mailbox.elasticsearch.ElasticSearchIndexer;
 import org.apache.james.mailbox.elasticsearch.EmbeddedElasticSearch;
 import org.apache.james.mailbox.elasticsearch.IndexCreationFactory;
@@ -40,6 +41,7 @@ import org.apache.james.mailbox.elastics
 import org.apache.james.mailbox.elasticsearch.query.CriterionConverter;
 import org.apache.james.mailbox.elasticsearch.query.QueryConverter;
 import org.apache.james.mailbox.elasticsearch.search.ElasticSearchSearcher;
+import org.apache.james.mailbox.elasticsearch.utils.TestingClientProvider;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.inmemory.InMemoryId;
 import org.apache.james.mailbox.inmemory.InMemoryMailboxSessionMapperFactory;
@@ -47,6 +49,7 @@ import org.apache.james.mailbox.model.Ma
 import org.apache.james.mailbox.store.MockAuthenticator;
 import org.apache.james.mailbox.store.StoreMailboxManager;
 import org.apache.james.mailbox.store.StoreSubscriptionManager;
+import org.apache.james.mailbox.store.extractor.DefaultTextExtractor;
 import org.apache.james.mpt.host.JamesImapHostSystem;
 import org.apache.james.mpt.imapmailbox.MailboxCreationDelegate;
 
@@ -88,8 +91,8 @@ public class ElasticSearchHostSystem ext
 }
 
 private void initFields() {
-NodeMappingFactory.applyMapping(
-IndexCreationFactory.createIndex(embeddedElasticSearch.getNode())
+ClientProvider clientProvider = NodeMappingFactory.applyMapping(
+IndexCreationFactory.createIndex(new 
TestingClientProvider(embeddedElasticSearch.getNode()))
 );
 
 userManager = new MockAuthenticator();
@@ -97,14 +100,14 @@ public class ElasticSearchHostSystem ext
 
 ElasticSearchListeningMessageSearchIndexInMemoryId searchIndex = new 
ElasticSearchListeningMessageSearchIndex(
 factory,
-new ElasticSearchIndexer(embeddedElasticSearch.getNode()),
-new 
ElasticSearchSearcherInMemoryId(embeddedElasticSearch.getNode(), new 
QueryConverter(new CriterionConverter())),
-new MessageToElasticSearchJson());
+new ElasticSearchIndexer(clientProvider),
+new ElasticSearchSearcher(clientProvider, new QueryConverter(new 
CriterionConverter())),
+new MessageToElasticSearchJson(new DefaultTextExtractor()));
 
 MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
 GroupMembershipResolver groupMembershipResolver = new 
SimpleGroupMembershipResolver();
 
-mailboxManager = new StoreMailboxManagerInMemoryId(factory, 
userManager, aclResolver, groupMembershipResolver);
+mailboxManager = new StoreMailboxManager(factory, userManager, 
aclResolver, groupMembershipResolver);
 mailboxManager.setMessageSearchIndex(searchIndex);
 
 try {



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688162 [2/3] - in /james/mpt/trunk/impl/imap-mailbox: core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ core/src/main/resources/org/apache/james/imap/scripts/ elasticsearch/ ela

2015-06-29 Thread btellier
Added: 
james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/UidSearchAtomsIndexer.test
URL: 
http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/UidSearchAtomsIndexer.test?rev=1688162view=auto
==
--- 
james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/UidSearchAtomsIndexer.test
 (added)
+++ 
james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/UidSearchAtomsIndexer.test
 Mon Jun 29 08:58:24 2015
@@ -0,0 +1,2214 @@
+
+# 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.   #
+
+C: A2 CREATE testmailbox
+S: A2 OK CREATE completed\.
+
+C: A3 SELECT testmailbox
+S: \* FLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\Seen\)
+S: \* 0 EXISTS
+S: \* 0 RECENT
+S: \* OK \[UIDVALIDITY (.)*
+S: \* OK \[PERMANENTFLAGS \(\\Answered \\Deleted \\Draft \\Flagged \\\Seen( 
\\\*)?\)\](.)*
+S: \* OK \[HIGHESTMODSEQ \d+\].*
+S: \* OK \[UIDNEXT 1\].*
+S: A3 OK \[READ-WRITE\] SELECT completed\.
+
+C: A4 APPEND testmailbox {185+}
+C: From: Timothy Tayler timo...@example.org
+C: To: Samual Smith sam...@example.org
+C: Date: Thu, 14 Feb 2008 12:00:00 + (GMT)
+C: Subject: A Simple Email
+C: 
+C: This is a very simple email.
+C: 
+S: \* 1 EXISTS
+S: \* 1 RECENT
+S: A4 OK (\[.+\] )?APPEND completed\.
+
+C: A5 STORE 1  FLAGS (\DELETED)
+S: \* 1 FETCH \(FLAGS \(\\Deleted \\Recent\)\)
+S: A5 OK STORE completed\.
+
+C: A6 EXPUNGE
+S: \* 1 EXPUNGE
+S: \* 0 RECENT
+S: A6 OK EXPUNGE completed\.
+
+C: A7 APPEND testmailbox {185+}
+C: From: Timothy Tayler timo...@example.org
+C: To: Samual Smith sam...@example.org
+C: Date: Thu, 14 Feb 2008 12:00:00 + (GMT)
+C: Subject: A Simple Email
+C: 
+C: This is a very simple email.
+C: 
+S: \* 1 EXISTS
+S: \* 1 RECENT
+S: A7 OK (\[.+\] )?APPEND completed\.
+
+C: A8 STORE 1  FLAGS (\DELETED)
+S: \* 1 FETCH \(FLAGS \(\\Deleted \\Recent\)\)
+S: A8 OK STORE completed\.
+
+C: A9 EXPUNGE
+S: \* 1 EXPUNGE
+S: \* 0 RECENT
+S: A9 OK EXPUNGE completed\.
+
+C: A10 APPEND testmailbox {185+}
+C: From: Timothy Tayler timo...@example.org
+C: To: Samual Smith sam...@example.org
+C: Date: Thu, 14 Feb 2008 12:00:00 + (GMT)
+C: Subject: A Simple Email
+C: 
+C: This is a very simple email.
+C: 
+S: \* 1 EXISTS
+S: \* 1 RECENT
+S: A10 OK (\[.+\] )?APPEND completed\.
+
+C: A11 STORE 1  FLAGS (\DELETED)
+S: \* 1 FETCH \(FLAGS \(\\Deleted \\Recent\)\)
+S: A11 OK STORE completed\.
+
+C: A12 EXPUNGE
+S: \* 1 EXPUNGE
+S: \* 0 RECENT
+S: A12 OK EXPUNGE completed\.
+
+C: A13 APPEND testmailbox {185+}
+C: From: Timothy Tayler timo...@example.org
+C: To: Samual Smith sam...@example.org
+C: Date: Thu, 14 Feb 2008 12:00:00 + (GMT)
+C: Subject: A Simple Email
+C: 
+C: This is a very simple email.
+C: 
+S: \* 1 EXISTS
+S: \* 1 RECENT
+S: A13 OK (\[.+\] )?APPEND completed\.
+
+C: A14 STORE 1  FLAGS (\DELETED)
+S: \* 1 FETCH \(FLAGS \(\\Deleted \\Recent\)\)
+S: A14 OK STORE completed\.
+
+C: A15 EXPUNGE
+S: \* 1 EXPUNGE
+S: \* 0 RECENT
+S: A15 OK EXPUNGE completed\.
+
+C: A16 APPEND testmailbox {185+}
+C: From: Timothy Tayler timo...@example.org
+C: To: Samual Smith sam...@example.org
+C: Date: Thu, 14 Feb 2008 12:00:00 + (GMT)
+C: Subject: A Simple Email
+C: 
+C: This is a very simple email.
+C: 
+S: \* 1 EXISTS
+S: \* 1 RECENT
+S: A16 OK (\[.+\] )?APPEND completed\.
+
+C: A17 STORE 1  FLAGS (\DELETED)
+S: \* 1 FETCH \(FLAGS \(\\Deleted \\Recent\)\)
+S: A17 OK STORE completed\.
+
+C: A18 EXPUNGE
+S: \* 1 EXPUNGE
+S: \* 0 RECENT
+S: A18 OK EXPUNGE completed\.
+
+C: A19 APPEND testmailbox {185+}
+C: From: Timothy Tayler timo...@example.org
+C: To: Samual Smith sam...@example.org
+C: Date: Thu, 14 Feb 2008 12:00:00 + (GMT)
+C: Subject: A Simple Email
+C: 
+C: This is a very 

svn commit: r1688161 - in /james/mpt/trunk: ./ impl/imap-mailbox/ impl/imap-mailbox/elasticsearch/ impl/imap-mailbox/elasticsearch/src/ impl/imap-mailbox/elasticsearch/src/test/ impl/imap-mailbox/elas

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:57:55 2015
New Revision: 1688161

URL: http://svn.apache.org/r1688161
Log:
MAILBOX-155 Creating ElasticSearch module for MPT

Added:
james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/
james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/
james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/
james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/
james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/

james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/

james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/

james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/

james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/

james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/ElasticSearchMailboxTestModule.java

james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/

james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java
Modified:
james/mpt/trunk/impl/imap-mailbox/elasticsearch/pom.xml
james/mpt/trunk/impl/imap-mailbox/jcr/pom.xml
james/mpt/trunk/impl/imap-mailbox/pom.xml
james/mpt/trunk/pom.xml

Modified: james/mpt/trunk/impl/imap-mailbox/elasticsearch/pom.xml
URL: 
http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/elasticsearch/pom.xml?rev=1688161r1=1688160r2=1688161view=diff
==
--- james/mpt/trunk/impl/imap-mailbox/elasticsearch/pom.xml (original)
+++ james/mpt/trunk/impl/imap-mailbox/elasticsearch/pom.xml Mon Jun 29 08:57:55 
2015
@@ -53,10 +53,156 @@
 artifactIdapache-james-mailbox-store/artifactId
 /dependency
 dependency
+groupIdjunit/groupId
+artifactIdjunit/artifactId
+version${junit.version}/version
+/dependency
+dependency
 groupIdorg.apache.james/groupId
 artifactIdapache-james-mpt-imapmailbox-core/artifactId
 /dependency
 /dependencies
 
-
+profiles
+profile
+iddisable-build-for-older-jdk/id
+activation
+jdk(,1.8)/jdk
+/activation
+build
+plugins
+plugin
+artifactIdmaven-jar-plugin/artifactId
+executions
+execution
+iddefault-jar/id
+phasenone/phase
+/execution
+execution
+idjar/id
+phasenone/phase
+/execution
+execution
+idtest-jar/id
+phasenone/phase
+/execution
+/executions
+/plugin
+plugin
+artifactIdmaven-compiler-plugin/artifactId
+executions
+execution
+iddefault-compile/id
+phasenone/phase
+/execution
+execution
+iddefault-testCompile/id
+phasenone/phase
+/execution
+/executions
+/plugin
+plugin
+artifactIdmaven-surefire-plugin/artifactId
+executions
+execution
+iddefault-test/id
+phasenone/phase
+/execution
+/executions
+/plugin
+plugin
+artifactIdmaven-source-plugin/artifactId
+executions
+execution
+idattach-sources/id
+phasenone/phase
+/execution
+/executions
+/plugin
+plugin
+artifactIdmaven-install-plugin/artifactId
+executions
+execution
+iddefault-install/id
+phasenone/phase
+/execution
+/executions
+/plugin

svn commit: r1688162 [1/3] - in /james/mpt/trunk/impl/imap-mailbox: core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ core/src/main/resources/org/apache/james/imap/scripts/ elasticsearch/ ela

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:58:24 2015
New Revision: 1688162

URL: http://svn.apache.org/r1688162
Log:
MAILBOX-155 Run a subset of Search tests on ElasticSearch module

Added:

james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/UidSearchOnIndex.java

james/mpt/trunk/impl/imap-mailbox/core/src/main/resources/org/apache/james/imap/scripts/UidSearchAtomsIndexer.test

james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/ElasticSearchMailboxTest.java
Modified:
james/mpt/trunk/impl/imap-mailbox/elasticsearch/pom.xml

Added: 
james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/UidSearchOnIndex.java
URL: 
http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/UidSearchOnIndex.java?rev=1688162view=auto
==
--- 
james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/UidSearchOnIndex.java
 (added)
+++ 
james/mpt/trunk/impl/imap-mailbox/core/src/main/java/org/apache/james/mpt/imapmailbox/suite/UidSearchOnIndex.java
 Mon Jun 29 08:58:24 2015
@@ -0,0 +1,44 @@
+/
+ * 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.mpt.imapmailbox.suite;
+
+import org.apache.james.mpt.api.HostSystem;
+import org.apache.james.mpt.imapmailbox.suite.base.BaseAuthenticatedState;
+import org.junit.Test;
+
+import javax.inject.Inject;
+import java.util.Locale;
+
+public class UidSearchOnIndex extends BaseAuthenticatedState {
+
+@Inject
+private static HostSystem system;
+
+public UidSearchOnIndex() throws Exception {
+super(system);
+}
+
+@Test
+public void testSearchAtomsUS() throws Exception {
+scriptTest(UidSearchAtomsIndexer, Locale.US);
+}
+
+}
+



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688162 [3/3] - in /james/mpt/trunk/impl/imap-mailbox: core/src/main/java/org/apache/james/mpt/imapmailbox/suite/ core/src/main/resources/org/apache/james/imap/scripts/ elasticsearch/ ela

2015-06-29 Thread btellier
Modified: james/mpt/trunk/impl/imap-mailbox/elasticsearch/pom.xml
URL: 
http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/elasticsearch/pom.xml?rev=1688162r1=1688161r2=1688162view=diff
==
--- james/mpt/trunk/impl/imap-mailbox/elasticsearch/pom.xml (original)
+++ james/mpt/trunk/impl/imap-mailbox/elasticsearch/pom.xml Mon Jun 29 08:58:24 
2015
@@ -61,6 +61,17 @@
 groupIdorg.apache.james/groupId
 artifactIdapache-james-mpt-imapmailbox-core/artifactId
 /dependency
+dependency
+groupIdorg.apache.lucene/groupId
+artifactIdlucene-core/artifactId
+version4.10.4/version
+scopetest/scope
+/dependency
+dependency
+groupIdorg.codehaus.groovy/groupId
+artifactIdgroovy-all/artifactId
+version2.3.2/version
+/dependency
 /dependencies
 
 profiles

Added: 
james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/ElasticSearchMailboxTest.java
URL: 
http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/ElasticSearchMailboxTest.java?rev=1688162view=auto
==
--- 
james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/ElasticSearchMailboxTest.java
 (added)
+++ 
james/mpt/trunk/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/ElasticSearchMailboxTest.java
 Mon Jun 29 08:58:24 2015
@@ -0,0 +1,34 @@
+/
+ * 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.mpt.imapmailbox.elasticsearch;
+
+import org.apache.james.mpt.imapmailbox.suite.UidSearchOnIndex;
+import org.apache.onami.test.OnamiSuite;
+import org.apache.onami.test.annotation.GuiceModules;
+import org.junit.runner.RunWith;
+import org.junit.runners.Suite;
+
+@RunWith(OnamiSuite.class)
+@Suite.SuiteClasses({
+UidSearchOnIndex.class
+})
+@GuiceModules({ElasticSearchMailboxTestModule.class})
+public class ElasticSearchMailboxTest {
+}
\ No newline at end of file



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688109 [3/6] - in /james/mailbox/trunk: caching/src/main/java/org/apache/james/mailbox/caching/ caching/src/main/java/org/apache/james/mailbox/caching/guava/ cassandra/src/main/java/org/

2015-06-29 Thread btellier
Modified: 
james/mailbox/trunk/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapperTest.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapperTest.java?rev=1688109r1=1688108r2=1688109view=diff
==
--- 
james/mailbox/trunk/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapperTest.java
 (original)
+++ 
james/mailbox/trunk/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapperTest.java
 Mon Jun 29 08:21:12 2015
@@ -15,13 +15,31 @@
  */
 package org.apache.james.mailbox.hbase.mail;
 
+import static org.apache.james.mailbox.hbase.HBaseNames.MAILBOXES;
+import static org.apache.james.mailbox.hbase.HBaseNames.MAILBOXES_TABLE;
+import static org.apache.james.mailbox.hbase.HBaseNames.MAILBOX_CF;
+import static org.apache.james.mailbox.hbase.HBaseNames.MESSAGES;
+import static org.apache.james.mailbox.hbase.HBaseNames.MESSAGES_META_CF;
+import static org.apache.james.mailbox.hbase.HBaseNames.MESSAGES_TABLE;
+import static org.apache.james.mailbox.hbase.HBaseNames.MESSAGE_DATA_BODY_CF;
+import static 
org.apache.james.mailbox.hbase.HBaseNames.MESSAGE_DATA_HEADERS_CF;
+import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTIONS;
+import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTIONS_TABLE;
+import static org.apache.james.mailbox.hbase.HBaseNames.SUBSCRIPTION_CF;
+import static org.apache.james.mailbox.hbase.HBaseUtils.mailboxFromResult;
+import static org.junit.Assert.assertArrayEquals;
+import static org.junit.Assert.assertEquals;
+import static org.junit.Assert.assertFalse;
+import static org.junit.Assert.assertTrue;
+import static org.junit.Assert.fail;
+
 import java.io.ByteArrayInputStream;
 import java.io.ByteArrayOutputStream;
 import java.io.IOException;
 import java.util.ArrayList;
 import java.util.Iterator;
 import java.util.List;
-import java.util.UUID;
+
 import org.apache.hadoop.conf.Configuration;
 import org.apache.hadoop.hbase.client.Get;
 import org.apache.hadoop.hbase.client.HTable;
@@ -30,15 +48,12 @@ import org.apache.hadoop.hbase.util.Byte
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.exception.MailboxNotFoundException;
 import org.apache.james.mailbox.hbase.HBaseClusterSingleton;
-import static org.apache.james.mailbox.hbase.HBaseNames.*;
-import static org.apache.james.mailbox.hbase.HBaseUtils.mailboxFromResult;
-import static org.apache.james.mailbox.hbase.HBaseUtils.mailboxRowKey;
+import org.apache.james.mailbox.hbase.HBaseId;
 import org.apache.james.mailbox.hbase.io.ChunkInputStream;
 import org.apache.james.mailbox.hbase.io.ChunkOutputStream;
 import org.apache.james.mailbox.hbase.mail.model.HBaseMailbox;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
-import static org.junit.Assert.*;
 import org.junit.Before;
 import org.junit.Test;
 import org.slf4j.Logger;
@@ -125,7 +140,7 @@ public class HBaseMailboxMapperTest {
 LOG.info(findMailboxWithPathLike);
 MailboxPath path = pathsList.get(pathsList.size() / 2);
 
-ListMailboxUUID result = mapper.findMailboxWithPathLike(path);
+ListMailboxHBaseId result = mapper.findMailboxWithPathLike(path);
 assertEquals(1, result.size());
 
 int start = 3;
@@ -150,7 +165,7 @@ public class HBaseMailboxMapperTest {
  */
 private void testList() throws Exception {
 LOG.info(list);
-ListMailboxUUID result = mapper.list();
+ListMailboxHBaseId result = mapper.list();
 assertEquals(mailboxList.size(), result.size());
 
 }
@@ -164,7 +179,7 @@ public class HBaseMailboxMapperTest {
 
 final HBaseMailbox mlbx = mailboxList.get(mailboxList.size() / 2);
 
-final Get get = new Get(mailboxRowKey(mlbx.getMailboxId()));
+final Get get = new Get(mlbx.getMailboxId().toBytes());
 // get all columns for the DATA column family
 get.addFamily(MAILBOX_CF);
 
@@ -178,7 +193,7 @@ public class HBaseMailboxMapperTest {
 assertEquals(mlbx.getLastUid(), newValue.getLastUid());
 assertEquals(mlbx.getUidValidity(), newValue.getUidValidity());
 assertEquals(mlbx.getHighestModSeq(), newValue.getHighestModSeq());
-assertArrayEquals(mailboxRowKey(mlbx.getMailboxId()), 
mailboxRowKey(newValue.getMailboxId()));
+assertArrayEquals(mlbx.getMailboxId().toBytes(), 
newValue.getMailboxId().toBytes());
 }
 
 /**

Modified: 
james/mailbox/trunk/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMessageMapperTest.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/hbase/src/test/java/org/apache/james/mailbox/hbase/mail/HBaseMessageMapperTest.java?rev=1688109r1=1688108r2=1688109view=diff

svn commit: r1688109 [5/6] - in /james/mailbox/trunk: caching/src/main/java/org/apache/james/mailbox/caching/ caching/src/main/java/org/apache/james/mailbox/caching/guava/ cassandra/src/main/java/org/

2015-06-29 Thread btellier
Modified: 
james/mailbox/trunk/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryUidProvider.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryUidProvider.java?rev=1688109r1=1688108r2=1688109view=diff
==
--- 
james/mailbox/trunk/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryUidProvider.java
 (original)
+++ 
james/mailbox/trunk/memory/src/main/java/org/apache/james/mailbox/inmemory/mail/InMemoryUidProvider.java
 Mon Jun 29 08:21:12 2015
@@ -25,24 +25,25 @@ import java.util.concurrent.atomic.Atomi
 
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.inmemory.InMemoryId;
 import org.apache.james.mailbox.store.mail.UidProvider;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
-public class InMemoryUidProvider implements UidProviderLong{
+public class InMemoryUidProvider implements UidProviderInMemoryId{
 
-private final ConcurrentMapLong, AtomicLong map = new 
ConcurrentHashMapLong, AtomicLong();
+private final ConcurrentMapInMemoryId, AtomicLong map = new 
ConcurrentHashMapInMemoryId, AtomicLong();
 
 @Override
-public long nextUid(MailboxSession session, MailboxLong mailbox) throws 
MailboxException {
+public long nextUid(MailboxSession session, MailboxInMemoryId mailbox) 
throws MailboxException {
 return getLast(mailbox.getMailboxId()).incrementAndGet();
 }
 
 @Override
-public long lastUid(MailboxSession session, MailboxLong mailbox) throws 
MailboxException {
+public long lastUid(MailboxSession session, MailboxInMemoryId mailbox) 
throws MailboxException {
 return getLast(mailbox.getMailboxId()).get();
 }
 
-private AtomicLong getLast(Long id) {
+private AtomicLong getLast(InMemoryId id) {
 AtomicLong uid = map.get(id);
 if (uid == null) {
 uid = new AtomicLong(0);

Modified: 
james/mailbox/trunk/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManagerTest.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManagerTest.java?rev=1688109r1=1688108r2=1688109view=diff
==
--- 
james/mailbox/trunk/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManagerTest.java
 (original)
+++ 
james/mailbox/trunk/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxManagerTest.java
 Mon Jun 29 08:21:12 2015
@@ -83,7 +83,7 @@ public class InMemoryMailboxManagerTest
 MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
 GroupMembershipResolver groupMembershipResolver = new 
SimpleGroupMembershipResolver();
 
-StoreMailboxManagerLong mailboxManager = new 
StoreMailboxManagerLong(factory, new MockAuthenticator(), aclResolver, 
groupMembershipResolver);
+StoreMailboxManagerInMemoryId mailboxManager = new 
StoreMailboxManagerInMemoryId(factory, new MockAuthenticator(), aclResolver, 
groupMembershipResolver);
 mailboxManager.init();
 
 setMailboxManager(mailboxManager);

Modified: 
james/mailbox/trunk/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxMapperTest.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxMapperTest.java?rev=1688109r1=1688108r2=1688109view=diff
==
--- 
james/mailbox/trunk/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxMapperTest.java
 (original)
+++ 
james/mailbox/trunk/memory/src/test/java/org/apache/james/mailbox/inmemory/InMemoryMailboxMapperTest.java
 Mon Jun 29 08:21:12 2015
@@ -19,6 +19,8 @@
 
 package org.apache.james.mailbox.inmemory;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.mock.MockMailboxSession;
 import org.apache.james.mailbox.model.MailboxPath;
@@ -28,8 +30,6 @@ import org.apache.james.mailbox.store.ma
 import org.junit.Before;
 import org.junit.Test;
 
-import static org.assertj.core.api.Assertions.assertThat;
-
 public class InMemoryMailboxMapperTest {
 
 public static final int UID_VALIDITY = 10;
@@ -40,11 +40,11 @@ public class InMemoryMailboxMapperTest {
 private MailboxPath user2OtherBoxPath;
 private MailboxPath user1OtherNamespacePath;
 
-private MailboxLong user1Inbox;
-private MailboxLong user1SubMailbox1;
-private MailboxLong user1SubMailbox2;
+private MailboxInMemoryId user1Inbox;
+private MailboxInMemoryId user1SubMailbox1;
+private MailboxInMemoryId user1SubMailbox2;
 
-   

svn commit: r1688109 [2/6] - in /james/mailbox/trunk: caching/src/main/java/org/apache/james/mailbox/caching/ caching/src/main/java/org/apache/james/mailbox/caching/guava/ cassandra/src/main/java/org/

2015-06-29 Thread btellier
Modified: 
james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMapperProvider.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMapperProvider.java?rev=1688109r1=1688108r2=1688109view=diff
==
--- 
james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMapperProvider.java
 (original)
+++ 
james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMapperProvider.java
 Mon Jun 29 08:21:12 2015
@@ -1,23 +1,20 @@
 package org.apache.james.mailbox.cassandra.mail;
 
-import com.datastax.driver.core.utils.UUIDs;
 import org.apache.james.mailbox.cassandra.CassandraClusterSingleton;
+import org.apache.james.mailbox.cassandra.CassandraId;
 import org.apache.james.mailbox.cassandra.CassandraMailboxSessionMapperFactory;
-import org.apache.james.mailbox.cassandra.CassandraTypesProvider;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.mock.MockMailboxSession;
 import org.apache.james.mailbox.store.mail.MailboxMapper;
 import org.apache.james.mailbox.store.mail.MessageMapper;
 import org.apache.james.mailbox.store.mail.model.MapperProvider;
 
-import java.util.UUID;
-
-public class CassandraMapperProvider implements MapperProviderUUID {
+public class CassandraMapperProvider implements MapperProviderCassandraId {
 
 private static final CassandraClusterSingleton cassandra = 
CassandraClusterSingleton.build();
 
 @Override
-public MailboxMapperUUID createMailboxMapper() throws MailboxException {
+public MailboxMapperCassandraId createMailboxMapper() throws 
MailboxException {
 return new CassandraMailboxSessionMapperFactory(
 new CassandraUidProvider(cassandra.getConf()),
 new CassandraModSeqProvider(cassandra.getConf()),
@@ -27,7 +24,7 @@ public class CassandraMapperProvider imp
 }
 
 @Override
-public MessageMapperUUID createMessageMapper() throws MailboxException {
+public MessageMapperCassandraId createMessageMapper() throws 
MailboxException {
 return new CassandraMailboxSessionMapperFactory(
 new CassandraUidProvider(cassandra.getConf()),
 new CassandraModSeqProvider(cassandra.getConf()),
@@ -37,8 +34,8 @@ public class CassandraMapperProvider imp
 }
 
 @Override
-public UUID generateId() {
-return UUIDs.timeBased();
+public CassandraId generateId() {
+return CassandraId.timeBased();
 }
 
 @Override

Modified: 
james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapperTest.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapperTest.java?rev=1688109r1=1688108r2=1688109view=diff
==
--- 
james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapperTest.java
 (original)
+++ 
james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapperTest.java
 Mon Jun 29 08:21:12 2015
@@ -18,11 +18,10 @@
  /
 package org.apache.james.mailbox.cassandra.mail;
 
+import org.apache.james.mailbox.cassandra.CassandraId;
 import org.apache.james.mailbox.store.mail.model.AbstractMessageMapperTest;
 
-import java.util.UUID;
-
-public class CassandraMessageMapperTest extends 
AbstractMessageMapperTestUUID {
+public class CassandraMessageMapperTest extends 
AbstractMessageMapperTestCassandraId {
 public CassandraMessageMapperTest() {
 super(new CassandraMapperProvider());
 }

Modified: 
james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraUidAndModSeqProviderTest.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraUidAndModSeqProviderTest.java?rev=1688109r1=1688108r2=1688109view=diff
==
--- 
james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraUidAndModSeqProviderTest.java
 (original)
+++ 
james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraUidAndModSeqProviderTest.java
 Mon Jun 29 08:21:12 2015
@@ -23,12 +23,12 @@ import static org.junit.Assert.assertEqu
 
 import java.util.ArrayList;
 import java.util.List;
-import java.util.UUID;
 import java.util.concurrent.atomic.AtomicLong;
 import java.util.function.LongConsumer;
 import java.util.stream.LongStream;
 
 import org.apache.james.mailbox.cassandra.CassandraClusterSingleton;
+import 

svn commit: r1688109 [1/6] - in /james/mailbox/trunk: caching/src/main/java/org/apache/james/mailbox/caching/ caching/src/main/java/org/apache/james/mailbox/caching/guava/ cassandra/src/main/java/org/

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:21:12 2015
New Revision: 1688109

URL: http://svn.apache.org/r1688109
Log:
MAILBOX-236 use strong types for Mailbox Id - contributed by Matthieu Baechlor

Added:

james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraId.java

james/mailbox/trunk/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseId.java

james/mailbox/trunk/jcr/src/main/java/org/apache/james/mailbox/jcr/JCRId.java

james/mailbox/trunk/jpa/src/main/java/org/apache/james/mailbox/jpa/JPAId.java

james/mailbox/trunk/maildir/src/main/java/org/apache/james/mailbox/maildir/MaildirId.java

james/mailbox/trunk/memory/src/main/java/org/apache/james/mailbox/inmemory/InMemoryId.java

james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/MailboxId.java

james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/TestId.java
Modified:

james/mailbox/trunk/caching/src/main/java/org/apache/james/mailbox/caching/CacheInvalidatingMailboxListener.java

james/mailbox/trunk/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxMapper.java

james/mailbox/trunk/caching/src/main/java/org/apache/james/mailbox/caching/CachingMailboxSessionMapperFactory.java

james/mailbox/trunk/caching/src/main/java/org/apache/james/mailbox/caching/CachingMessageMapper.java

james/mailbox/trunk/caching/src/main/java/org/apache/james/mailbox/caching/MailboxByPathCache.java

james/mailbox/trunk/caching/src/main/java/org/apache/james/mailbox/caching/MailboxMetadataCache.java

james/mailbox/trunk/caching/src/main/java/org/apache/james/mailbox/caching/guava/GuavaMailboxByPathCache.java

james/mailbox/trunk/caching/src/main/java/org/apache/james/mailbox/caching/guava/GuavaMailboxMetadataCache.java

james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMailboxManager.java

james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMailboxSessionMapperFactory.java

james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/CassandraMessageManager.java

james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraACLMapper.java

james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapper.java

james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapper.java

james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraModSeqProvider.java

james/mailbox/trunk/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/CassandraUidProvider.java

james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/CassandraMailboxSessionMapperFactoryTest.java

james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraACLMapperTest.java

james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMailboxMapperTest.java

james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMapperProvider.java

james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraMessageMapperTest.java

james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/CassandraUidAndModSeqProviderTest.java

james/mailbox/trunk/cassandra/src/test/java/org/apache/james/mailbox/cassandra/mail/utils/SimpleMailboxACLJsonConverterTest.java

james/mailbox/trunk/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMailboxManager.java

james/mailbox/trunk/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMailboxSessionMapperFactory.java

james/mailbox/trunk/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseMessageManager.java

james/mailbox/trunk/hbase/src/main/java/org/apache/james/mailbox/hbase/HBaseUtils.java

james/mailbox/trunk/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMailboxMapper.java

james/mailbox/trunk/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMessage.java

james/mailbox/trunk/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseMessageMapper.java

james/mailbox/trunk/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseModSeqProvider.java

james/mailbox/trunk/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/HBaseUidProvider.java

james/mailbox/trunk/hbase/src/main/java/org/apache/james/mailbox/hbase/mail/model/HBaseMailbox.java

james/mailbox/trunk/hbase/src/main/java/org/apache/james/mailbox/hbase/user/HBaseSubscriptionMapper.java

james/mailbox/trunk/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseMailboxSessionMapperFactoryTest.java

james/mailbox/trunk/hbase/src/test/java/org/apache/james/mailbox/hbase/HBaseUtilsTest.java


svn commit: r1688109 [4/6] - in /james/mailbox/trunk: caching/src/main/java/org/apache/james/mailbox/caching/ caching/src/main/java/org/apache/james/mailbox/caching/guava/ cassandra/src/main/java/org/

2015-06-29 Thread btellier
Modified: 
james/mailbox/trunk/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAUidProvider.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAUidProvider.java?rev=1688109r1=1688108r2=1688109view=diff
==
--- 
james/mailbox/trunk/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAUidProvider.java
 (original)
+++ 
james/mailbox/trunk/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/JPAUidProvider.java
 Mon Jun 29 08:21:12 2015
@@ -25,11 +25,12 @@ import javax.persistence.PersistenceExce
 import org.apache.james.mailbox.MailboxPathLocker;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.jpa.JPAId;
 import org.apache.james.mailbox.jpa.mail.model.JPAMailbox;
 import org.apache.james.mailbox.store.mail.AbstractLockingUidProvider;
 import org.apache.james.mailbox.store.mail.model.Mailbox;
 
-public class JPAUidProvider extends AbstractLockingUidProviderLong{
+public class JPAUidProvider extends AbstractLockingUidProviderJPAId {
 
 private EntityManagerFactory factory;
 
@@ -40,12 +41,12 @@ public class JPAUidProvider extends Abst
 
 
 @Override
-public long lastUid(MailboxSession session, MailboxLong mailbox) throws 
MailboxException {
+public long lastUid(MailboxSession session, MailboxJPAId mailbox) throws 
MailboxException {
 EntityManager manager = null;
 try {
 manager = factory.createEntityManager();
 manager.getTransaction().begin();
-long uid = (Long) 
manager.createNamedQuery(findLastUid).setParameter(idParam, 
mailbox.getMailboxId()).getSingleResult();
+long uid = (Long) 
manager.createNamedQuery(findLastUid).setParameter(idParam, 
mailbox.getMailboxId().getRawId()).getSingleResult();
 manager.getTransaction().commit();
 return uid;
 } catch (PersistenceException e) {
@@ -61,12 +62,12 @@ public class JPAUidProvider extends Abst
 }
 
 @Override
-protected long lockedNextUid(MailboxSession session, MailboxLong 
mailbox) throws MailboxException {
+protected long lockedNextUid(MailboxSession session, MailboxJPAId 
mailbox) throws MailboxException {
 EntityManager manager = null;
 try {
 manager = factory.createEntityManager();
 manager.getTransaction().begin();
-JPAMailbox m = manager.find(JPAMailbox.class, 
mailbox.getMailboxId());
+JPAMailbox m = manager.find(JPAMailbox.class, 
mailbox.getMailboxId().getRawId());
 long uid = m.consumeUid();
 manager.persist(m);
 manager.getTransaction().commit();

Modified: 
james/mailbox/trunk/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/JPAMailbox.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/JPAMailbox.java?rev=1688109r1=1688108r2=1688109view=diff
==
--- 
james/mailbox/trunk/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/JPAMailbox.java
 (original)
+++ 
james/mailbox/trunk/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/JPAMailbox.java
 Mon Jun 29 08:21:12 2015
@@ -27,6 +27,7 @@ import javax.persistence.NamedQueries;
 import javax.persistence.NamedQuery;
 import javax.persistence.Table;
 
+import org.apache.james.mailbox.jpa.JPAId;
 import org.apache.james.mailbox.model.MailboxACL;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.model.SimpleMailboxACL;
@@ -58,7 +59,7 @@ import org.apache.james.mailbox.store.ma
 @NamedQuery(name=findLastUid,
 query=SELECT mailbox.lastUid FROM Mailbox mailbox WHERE 
mailbox.mailboxId = :idParam)
 })
-public class JPAMailbox implements MailboxLong {
+public class JPAMailbox implements MailboxJPAId {
 
 private static final String TAB =  ;
 
@@ -113,8 +114,8 @@ public class JPAMailbox implements Mailb
 /**
  * @see org.apache.james.mailbox.store.mail.model.Mailbox#getMailboxId()
  */
-public Long getMailboxId() {
-return mailboxId;
+public JPAId getMailboxId() {
+return JPAId.of(mailboxId);
 }
 
 /**

Modified: 
james/mailbox/trunk/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/AbstractJPAMessage.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/AbstractJPAMessage.java?rev=1688109r1=1688108r2=1688109view=diff
==
--- 
james/mailbox/trunk/jpa/src/main/java/org/apache/james/mailbox/jpa/mail/model/openjpa/AbstractJPAMessage.java
 (original)
+++ 

svn commit: r1688109 [6/6] - in /james/mailbox/trunk: caching/src/main/java/org/apache/james/mailbox/caching/ caching/src/main/java/org/apache/james/mailbox/caching/guava/ cassandra/src/main/java/org/

2015-06-29 Thread btellier
Modified: 
james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMessageMapperTest.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMessageMapperTest.java?rev=1688109r1=1688108r2=1688109view=diff
==
--- 
james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMessageMapperTest.java
 (original)
+++ 
james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMessageMapperTest.java
 Mon Jun 29 08:21:12 2015
@@ -19,6 +19,16 @@
 
 package org.apache.james.mailbox.store.mail.model;
 
+import static org.assertj.core.api.Assertions.assertThat;
+
+import java.io.IOException;
+import java.util.Date;
+import java.util.Iterator;
+import java.util.Map;
+
+import javax.mail.Flags;
+import javax.mail.util.SharedByteArrayInputStream;
+
 import org.apache.james.mailbox.FlagsBuilder;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.model.MailboxPath;
@@ -35,16 +45,7 @@ import org.junit.Before;
 import org.junit.Ignore;
 import org.junit.Test;
 
-import javax.mail.Flags;
-import javax.mail.util.SharedByteArrayInputStream;
-import java.io.IOException;
-import java.util.Date;
-import java.util.Iterator;
-import java.util.Map;
-
-import static org.assertj.core.api.Assertions.assertThat;
-
-public abstract class AbstractMessageMapperTestId {
+public abstract class AbstractMessageMapperTestId extends MailboxId {
 
 private final static char DELIMITER = ':';
 private static final int LIMIT = 10;

Modified: 
james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMessageTest.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMessageTest.java?rev=1688109r1=1688108r2=1688109view=diff
==
--- 
james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMessageTest.java
 (original)
+++ 
james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/AbstractMessageTest.java
 Mon Jun 29 08:21:12 2015
@@ -22,6 +22,7 @@ package org.apache.james.mailbox.store.m
 import static org.junit.Assert.*;
 
 import org.apache.james.mailbox.store.MessageBuilder;
+import org.apache.james.mailbox.store.TestId;
 import org.apache.james.mailbox.store.mail.model.Message;
 import org.junit.Test;
 
@@ -30,12 +31,12 @@ public class AbstractMessageTest {
 @Test
 public void testShouldReturnPositiveWhenFirstGreaterThanSecond()
 throws Exception {
-MessageLong one = buildMessage(100);
-MessageLong two = buildMessage(99);
+MessageTestId one = buildMessage(100);
+MessageTestId two = buildMessage(99);
 assertTrue( one.compareTo(two)  0);
 }
 
-private MessageLong buildMessage(int uid) throws Exception {
+private MessageTestId buildMessage(int uid) throws Exception {
 MessageBuilder builder = new MessageBuilder();
 builder.uid = uid;
 return builder.build();
@@ -44,15 +45,15 @@ public class AbstractMessageTest {
 @Test
 public void testShouldReturnNegativeWhenFirstLessThanSecond()
 throws Exception {
-MessageLong one = buildMessage(98);
-MessageLong two = buildMessage(99);
+MessageTestId one = buildMessage(98);
+MessageTestId two = buildMessage(99);
 assertTrue( one.compareTo(two)  0);
 }
 
 @Test
 public void testShouldReturnZeroWhenFirstEqualsSecond() throws Exception {
-MessageLong one = buildMessage(90);
-MessageLong two = buildMessage(90);
+MessageTestId one = buildMessage(90);
+MessageTestId two = buildMessage(90);
 assertEquals(0, one.compareTo(two));
 }
 }

Modified: 
james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/MailboxAssertTests.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/MailboxAssertTests.java?rev=1688109r1=1688108r2=1688109view=diff
==
--- 
james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/MailboxAssertTests.java
 (original)
+++ 
james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/MailboxAssertTests.java
 Mon Jun 29 08:21:12 2015
@@ -20,18 +20,19 @@
 package org.apache.james.mailbox.store.mail.model;
 
 import org.apache.james.mailbox.model.MailboxPath;
+import org.apache.james.mailbox.store.TestId;
 import org.apache.james.mailbox.store.mail.model.impl.SimpleMailbox;
 import org.junit.Test;
 
 public class MailboxAssertTests {
 
 private final static 

svn commit: r1688152 - in /james/server/trunk: app/pom.xml pom.xml

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:50:49 2015
New Revision: 1688152

URL: http://svn.apache.org/r1688152
Log:
MAILBOX-155 Load ElasticSearch module - contributed by Antoine Duprat

Modified:
james/server/trunk/app/pom.xml
james/server/trunk/pom.xml

Modified: james/server/trunk/app/pom.xml
URL: 
http://svn.apache.org/viewvc/james/server/trunk/app/pom.xml?rev=1688152r1=1688151r2=1688152view=diff
==
--- james/server/trunk/app/pom.xml (original)
+++ james/server/trunk/app/pom.xml Mon Jun 29 08:50:49 2015
@@ -461,6 +461,17 @@
 /dependency
 dependency
 groupIdorg.apache.james/groupId
+artifactIdapache-james-mailbox-elasticsearch/artifactId
+scoperuntime/scope
+exclusions
+exclusion
+artifactIdmail/artifactId
+groupIdjavax.mail/groupId
+/exclusion
+/exclusions
+/dependency
+dependency
+groupIdorg.apache.james/groupId
 artifactIdjames-server-data-file/artifactId
 scoperuntime/scope
 exclusions

Modified: james/server/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/james/server/trunk/pom.xml?rev=1688152r1=1688151r2=1688152view=diff
==
--- james/server/trunk/pom.xml (original)
+++ james/server/trunk/pom.xml Mon Jun 29 08:50:49 2015
@@ -513,6 +513,12 @@
 /dependency
 dependency
 groupIdorg.apache.james/groupId
+artifactIdapache-james-mailbox-elasticsearch/artifactId
+version${mailbox.version}/version
+scopetest/scope
+/dependency
+dependency
+groupIdorg.apache.james/groupId
 artifactIdapache-james-mailbox-spring/artifactId
 version${mailbox.version}/version
 /dependency



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688153 - /james/server/trunk/container/spring/src/main/java/org/apache/james/container/spring/bean/factorypostprocessor/MailboxConfigurationBeanFactoryPostProcessor.java

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:51:18 2015
New Revision: 1688153

URL: http://svn.apache.org/r1688153
Log:
MAILBOX-155 Add a messageMapperFactory alias in spring registry - contributed 
by Antoine Duprat

Modified:

james/server/trunk/container/spring/src/main/java/org/apache/james/container/spring/bean/factorypostprocessor/MailboxConfigurationBeanFactoryPostProcessor.java

Modified: 
james/server/trunk/container/spring/src/main/java/org/apache/james/container/spring/bean/factorypostprocessor/MailboxConfigurationBeanFactoryPostProcessor.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/container/spring/src/main/java/org/apache/james/container/spring/bean/factorypostprocessor/MailboxConfigurationBeanFactoryPostProcessor.java?rev=1688153r1=1688152r2=1688153view=diff
==
--- 
james/server/trunk/container/spring/src/main/java/org/apache/james/container/spring/bean/factorypostprocessor/MailboxConfigurationBeanFactoryPostProcessor.java
 (original)
+++ 
james/server/trunk/container/spring/src/main/java/org/apache/james/container/spring/bean/factorypostprocessor/MailboxConfigurationBeanFactoryPostProcessor.java
 Mon Jun 29 08:51:18 2015
@@ -50,30 +50,38 @@ public class MailboxConfigurationBeanFac
 BeanDefinitionRegistry registry = (BeanDefinitionRegistry) 
beanFactory;
 String mailbox = null;
 String subscription = null;
+String messageMapperFactory = null;
 if (provider.equalsIgnoreCase(jpa)) {
 mailbox = jpa-mailboxmanager;
 subscription = jpa-subscriptionManager;
+messageMapperFactory = jpa-sessionMapperFactory;
 } else if (provider.equalsIgnoreCase(memory)) {
 mailbox = memory-mailboxmanager;
 subscription = memory-subscriptionManager;
+messageMapperFactory = memory-sessionMapperFactory;
 } else if (provider.equalsIgnoreCase(jcr)) {
 mailbox = jcr-mailboxmanager;
 subscription = jcr-subscriptionManager;
+messageMapperFactory = jcr-sessionMapperFactory;
 } else if (provider.equalsIgnoreCase(maildir)) {
 mailbox = maildir-mailboxmanager;
 subscription = maildir-subscriptionManager;
+messageMapperFactory = maildir-sessionMapperFactory;
 } else if (provider.equalsIgnoreCase(hbase)) {
 mailbox = hbase-mailboxmanager;
 subscription = hbase-subscriptionManager;
+messageMapperFactory = hbase-sessionMapperFactory;
 } else if (provider.equalsIgnoreCase(cassandra)) {
 mailbox = cassandra-mailboxmanager;
 subscription = cassandra-subscriptionManager;
+messageMapperFactory = cassandra-sessionMapperFactory;
 }
 
 if (mailbox == null)
 throw new ConfigurationException(Mailboxmanager provider  + 
provider +  not supported!);
 registry.registerAlias(mailbox, mailboxmanager);
 registry.registerAlias(subscription, subscriptionManager);
+registry.registerAlias(messageMapperFactory, 
messageMapperFactory);
 
 } catch (ConfigurationException e) {
 throw new FatalBeanException(Unable to config the 
mailboxmanager, e);



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688154 - in /james/server/trunk: app/src/main/resources/ container/spring/src/main/java/org/apache/james/container/spring/bean/factorypostprocessor/ container/spring/src/main/resources/M

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:51:55 2015
New Revision: 1688154

URL: http://svn.apache.org/r1688154
Log:
MAILBOX-155 Add indexer configuration - contributed by Antoine Duprat

Added:
james/server/trunk/app/src/main/resources/elasticsearch-template.properties
james/server/trunk/app/src/main/resources/indexer-template.xml

james/server/trunk/container/spring/src/main/java/org/apache/james/container/spring/bean/factorypostprocessor/IndexerConfigurationBeanFactoryPostProcessor.java
Modified:

james/server/trunk/container/spring/src/main/resources/META-INF/org/apache/james/spring-server.xml

Added: 
james/server/trunk/app/src/main/resources/elasticsearch-template.properties
URL: 
http://svn.apache.org/viewvc/james/server/trunk/app/src/main/resources/elasticsearch-template.properties?rev=1688154view=auto
==
--- james/server/trunk/app/src/main/resources/elasticsearch-template.properties 
(added)
+++ james/server/trunk/app/src/main/resources/elasticsearch-template.properties 
Mon Jun 29 08:51:55 2015
@@ -0,0 +1,24 @@
+#  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.
+
+#  This template file can be used as example for James Server configuration
+#  DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+
+# Configuration file for ElasticSearch
+
+elasticsearch.clusterName=elasticsearch
+elasticsearch.masterHost=127.0.0.1

Added: james/server/trunk/app/src/main/resources/indexer-template.xml
URL: 
http://svn.apache.org/viewvc/james/server/trunk/app/src/main/resources/indexer-template.xml?rev=1688154view=auto
==
--- james/server/trunk/app/src/main/resources/indexer-template.xml (added)
+++ james/server/trunk/app/src/main/resources/indexer-template.xml Mon Jun 29 
08:51:55 2015
@@ -0,0 +1,33 @@
+?xml version=1.0?
+!--
+  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.   
+ --
+ 
+!--
+   This template file can be used as example for James Server configuration
+   DO NOT USE IT AS SUCH AND ADAPT IT TO YOUR NEEDS
+--
+ 
+!-- See http://james.apache.org/server/3/config.html for usage --
+ 
+indexer
+   !-- supported providers are: --
+   !-- lazyIndex, elasticsearch --
+   !--  --
+  providerlazyIndex/provider
+/indexer

Added: 
james/server/trunk/container/spring/src/main/java/org/apache/james/container/spring/bean/factorypostprocessor/IndexerConfigurationBeanFactoryPostProcessor.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/container/spring/src/main/java/org/apache/james/container/spring/bean/factorypostprocessor/IndexerConfigurationBeanFactoryPostProcessor.java?rev=1688154view=auto
==
--- 
james/server/trunk/container/spring/src/main/java/org/apache/james/container/spring/bean/factorypostprocessor/IndexerConfigurationBeanFactoryPostProcessor.java
 (added)
+++ 
james/server/trunk/container/spring/src/main/java/org/apache/james/container/spring/bean/factorypostprocessor/IndexerConfigurationBeanFactoryPostProcessor.java
 Mon Jun 29 08:51:55 2015
@@ -0,0 +1,68 @@
+/
+ * Licensed to the Apache 

[jira] [Commented] (MAILBOX-236) Strong type for Mailbox id

2015-06-29 Thread Tellier Benoit (JIRA)

[ 
https://issues.apache.org/jira/browse/MAILBOX-236?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14605309#comment-14605309
 ] 

Tellier Benoit commented on MAILBOX-236:


Patch commited.

Can someone resolve this issue ? ( I do not have rights for this... )

 Strong type for Mailbox id
 --

 Key: MAILBOX-236
 URL: https://issues.apache.org/jira/browse/MAILBOX-236
 Project: James Mailbox
  Issue Type: Improvement
Reporter: Matthieu Baechler

 I'd like to bring something that bothers me : whenever you get an Id from a 
 Mailbox, you can only call Object methods.
 It makes some code rely on toString() call in case of serialization.
 If you put aside some special types, toString is not supposed to return a 
 stable and meaningful value.
 I'd like to make Message and Mailbox use a bounded parameters. This parameter 
 would extend an Id interface, and this interface could have a serialize 
 method.
 Comments welcome (and patch is coming soon)



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (MAILBOX-225) Provide generic tests for message mapper and mailbox mapper

2015-06-29 Thread Tellier Benoit (JIRA)

 [ 
https://issues.apache.org/jira/browse/MAILBOX-225?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tellier Benoit resolved MAILBOX-225.

Resolution: Fixed

Eric Charles commited this long ago.

It seems like I forget to resolve the issue...

 Provide generic tests for message mapper and mailbox mapper
 ---

 Key: MAILBOX-225
 URL: https://issues.apache.org/jira/browse/MAILBOX-225
 Project: James Mailbox
  Issue Type: New Feature
Reporter: Tellier Benoit

 This will :
  - Validate common behaviour expected from these mappers
  - Avoid tests duplication
 Cassandra testing should rely on these tests.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (MAILBOX-231) Provide a tool to better integrate Github PR in our workflow.

2015-06-29 Thread Tellier Benoit (JIRA)

 [ 
https://issues.apache.org/jira/browse/MAILBOX-231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tellier Benoit resolved MAILBOX-231.

Resolution: Fixed

The attached gz works fine

 Provide a tool to better integrate Github PR in our workflow.
 -

 Key: MAILBOX-231
 URL: https://issues.apache.org/jira/browse/MAILBOX-231
 Project: James Mailbox
  Issue Type: Task
Reporter: Tellier Benoit
 Attachments: github_integration.tar.gz


 We want a set of scripts that extract and commit patchs from github PR.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688130 - in /james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch: ElasticSearchIndexerTest.java EmbeddedElasticSearch.java

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:34:40 2015
New Revision: 1688130

URL: http://svn.apache.org/r1688130
Log:
MAILBOX-155 Factorize test utils and increase Time out for tests

Modified:

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexerTest.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/EmbeddedElasticSearch.java

Modified: 
james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexerTest.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexerTest.java?rev=1688130r1=1688129r2=1688130view=diff
==
--- 
james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexerTest.java
 (original)
+++ 
james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexerTest.java
 Mon Jun 29 08:34:40 2015
@@ -16,16 +16,15 @@
  * specific language governing permissions and limitations  *
  * under the License.   *
  /
+
 package org.apache.james.mailbox.elasticsearch;
 
-import static com.jayway.awaitility.Awaitility.await;
 import static org.assertj.core.api.Assertions.assertThat;
-import static org.elasticsearch.node.NodeBuilder.nodeBuilder;
 
-import org.elasticsearch.action.admin.indices.flush.FlushRequestBuilder;
+import java.io.IOException;
+
 import org.elasticsearch.action.search.SearchResponse;
 import org.elasticsearch.client.Client;
-import org.elasticsearch.common.settings.ImmutableSettings;
 import org.elasticsearch.index.query.QueryBuilders;
 import org.elasticsearch.node.Node;
 import org.junit.After;
@@ -34,9 +33,6 @@ import org.junit.Rule;
 import org.junit.Test;
 import org.junit.rules.TemporaryFolder;
 
-import com.jayway.awaitility.Duration;
-
-
 public class ElasticSearchIndexerTest {
 
 @Rule public TemporaryFolder temporaryFolder = new TemporaryFolder();
@@ -45,22 +41,14 @@ public class ElasticSearchIndexerTest {
 private ElasticSearchIndexer testee;
 
 @Before
-public void setup() throws Exception {
-node = nodeBuilder().local(true)
-.settings(ImmutableSettings.builder()
-.put(path.data, 
temporaryFolder.newFolder().getAbsolutePath())
-.put(script.disable_dynamic,false)
-.build())
-.node();
-node.start();
-awaitForElasticSearch();
-
+public void setup() throws IOException {
+node = EmbeddedElasticSearch.provideNode(temporaryFolder);
 testee = new ElasticSearchIndexer(node);
 }
 
 @After
 public void tearDown() {
-node.close();
+EmbeddedElasticSearch.shutDown(node);
 }
 
 @Test
@@ -69,7 +57,7 @@ public class ElasticSearchIndexerTest {
 String content = {\message\: \trying out Elasticsearch\};
 
 testee.indexMessage(messageId, content);
-awaitForElasticSearch();
+EmbeddedElasticSearch.awaitForElasticSearch(node);
 
 try (Client client = node.client()) {
 SearchResponse searchResponse = 
client.prepareSearch(ElasticSearchIndexer.MAILBOX_INDEX)
@@ -91,7 +79,7 @@ public class ElasticSearchIndexerTest {
 String content = {\message\: \trying out 
Elasticsearch\,\field\:\Should be unchanged\};
 
 testee.indexMessage(messageId, content);
-awaitForElasticSearch();
+EmbeddedElasticSearch.awaitForElasticSearch(node);
 
 testee.updateMessage(messageId, {\message\: \mastering out 
Elasticsearch\});
 EmbeddedElasticSearch.awaitForElasticSearch(node);
@@ -115,6 +103,12 @@ public class ElasticSearchIndexerTest {
 
 @Test(expected=IllegalArgumentException.class)
 public void updateMessageShouldThrowWhenJsonIsNull() throws 
InterruptedException {
+String messageId = 1:2;
+String content = {\message\: \trying out Elasticsearch\};
+
+testee.indexMessage(messageId, content);
+EmbeddedElasticSearch.awaitForElasticSearch(node);
+
 testee.updateMessage(1, null);
 }
 
@@ -124,10 +118,10 @@ public class ElasticSearchIndexerTest {
 String content = {\message\: \trying out Elasticsearch\};
 
 testee.indexMessage(messageId, content);
-awaitForElasticSearch();
+EmbeddedElasticSearch.awaitForElasticSearch(node);
 
 testee.deleteAllWithIdStarting(1:);
-awaitForElasticSearch();
+EmbeddedElasticSearch.awaitForElasticSearch(node);
 
 try (Client client = node.client()) {
 SearchResponse searchResponse = 

svn commit: r1688132 - in /james/mailbox/trunk/elasticsearch/src/main: java/org/apache/james/mailbox/elasticsearch/ java/org/apache/james/mailbox/elasticsearch/json/ resources/META-INF/spring/

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:35:37 2015
New Revision: 1688132

URL: http://svn.apache.org/r1688132
Log:
MAILBOX-155 Using a Junit rule to launch embedded ElasticSearch

Added:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeMappingFactory.java
Modified:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/JsonMessageConstants.java

james/mailbox/trunk/elasticsearch/src/main/resources/META-INF/spring/mailbox-elasticsearch.xml

Added: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeMappingFactory.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeMappingFactory.java?rev=1688132view=auto
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeMappingFactory.java
 (added)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeMappingFactory.java
 Mon Jun 29 08:35:37 2015
@@ -0,0 +1,193 @@
+/
+ * 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.mailbox.elasticsearch;
+
+import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
+
+import java.io.IOException;
+
+import org.apache.james.mailbox.elasticsearch.json.JsonMessageConstants;
+import org.elasticsearch.client.Client;
+import org.elasticsearch.common.xcontent.XContentBuilder;
+import org.elasticsearch.node.Node;
+
+import com.google.common.base.Throwables;
+
+public class NodeMappingFactory {
+
+public static final String BOOLEAN = boolean;
+public static final String TYPE = type;
+public static final String LONG = long;
+public static final String INDEX = index;
+public static final String NOT_ANALYZED = not_analyzed;
+public static final String STRING = string;
+public static final String PROPERTIES = properties;
+public static final String DATE = date;
+public static final String FORMAT = format;
+public static final String NESTED = nested;
+
+public static Node applyMapping(Node node) {
+try (Client client = node.client()) {
+client.admin()
+.indices()
+.preparePutMapping(ElasticSearchIndexer.MAILBOX_INDEX)
+.setType(ElasticSearchIndexer.MESSAGE_TYPE)
+.setSource(getMappingContent())
+.execute()
+.actionGet();
+}
+return node;
+}
+
+private static XContentBuilder getMappingContent() {
+try {
+return jsonBuilder()
+.startObject()
+.startObject(ElasticSearchIndexer.MESSAGE_TYPE)
+.startObject(PROPERTIES)
+.startObject(JsonMessageConstants.ID)
+.field(TYPE, LONG)
+.endObject()
+.startObject(JsonMessageConstants.MODSEQ)
+.field(TYPE, LONG)
+.endObject()
+.startObject(JsonMessageConstants.SIZE)
+.field(TYPE, LONG)
+.endObject()
+.startObject(JsonMessageConstants.IS_ANSWERED)
+.field(TYPE, BOOLEAN)
+.endObject()
+.startObject(JsonMessageConstants.IS_DELETED)
+.field(TYPE, BOOLEAN)
+.endObject()
+.startObject(JsonMessageConstants.IS_DRAFT)
+.field(TYPE, 

svn commit: r1688131 - in /james/mailbox/trunk/elasticsearch/src: main/java/org/apache/james/mailbox/elasticsearch/IndexCreationFactory.java test/java/org/apache/james/mailbox/elasticsearch/EmbeddedEl

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:35:14 2015
New Revision: 1688131

URL: http://svn.apache.org/r1688131
Log:
MAILBOX-155 Adding Index creation and destruction in tests

Added:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/IndexCreationFactory.java
Modified:

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/EmbeddedElasticSearch.java

Added: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/IndexCreationFactory.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/IndexCreationFactory.java?rev=1688131view=auto
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/IndexCreationFactory.java
 (added)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/IndexCreationFactory.java
 Mon Jun 29 08:35:14 2015
@@ -0,0 +1,90 @@
+/
+ * 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.mailbox.elasticsearch;
+
+import org.elasticsearch.client.Client;
+import org.elasticsearch.common.xcontent.XContentBuilder;
+import org.elasticsearch.indices.IndexAlreadyExistsException;
+import org.elasticsearch.node.Node;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.util.Optional;
+
+import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
+
+public class IndexCreationFactory {
+
+private static Logger LOGGER = 
LoggerFactory.getLogger(IndexCreationFactory.class);
+
+public static Node createIndex(Node node, int nbShards, int nbReplica) {
+try {
+return createIndex(node, normalSettings(nbShards, nbReplica));
+} catch (IOException e) {
+LOGGER.error(Error while creating index : , e);
+return node;
+}
+}
+
+public static Node createIndex(Node node) {
+try {
+return createIndex(node, settingForInMemory());
+} catch (IOException e) {
+LOGGER.error(Error while creating index : , e);
+return node;
+}
+}
+
+private static Node createIndex(Node node, XContentBuilder settings) {
+try {
+try (Client client = node.client()) {
+client.admin()
+.indices()
+.prepareCreate(ElasticSearchIndexer.MAILBOX_INDEX)
+.setSettings(settings)
+.execute()
+.actionGet();
+}
+} catch (IndexAlreadyExistsException exception) {
+LOGGER.info(Index [ + ElasticSearchIndexer.MAILBOX_INDEX + ] 
already exist);
+}
+return node;
+}
+
+public static XContentBuilder settingForInMemory() throws IOException {
+return generateSetting(1, 0, 
Optional.of(jsonBuilder().startObject().field(type, memory).endObject()));
+}
+
+public static XContentBuilder normalSettings(int nbShards, int nbReplica) 
throws IOException{
+return generateSetting(nbShards, nbReplica, Optional.empty());
+}
+
+private static XContentBuilder generateSetting(int nbShards, int 
nbReplica, OptionalXContentBuilder store) throws IOException {
+XContentBuilder contentBuilder = jsonBuilder().startObject()
+.field(number_of_shards, nbShards)
+.field(number_of_replicas, nbReplica);
+if (store.isPresent()) {
+contentBuilder.field(store, store.get());
+}
+return contentBuilder.endObject();
+}
+
+}

Modified: 

svn commit: r1688139 - in /james/mailbox/trunk/elasticsearch/src: main/java/org/apache/james/mailbox/elasticsearch/json/ test/java/org/apache/james/mailbox/elasticsearch/json/ test/resources/documents

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:39:30 2015
New Revision: 1688139

URL: http://svn.apache.org/r1688139
Log:
MAILBOX-234 Dates extraction from headers

Modified:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/HeaderCollection.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/HeaderCollectionTest.java
james/mailbox/trunk/elasticsearch/src/test/resources/documents/mail1.eml
james/mailbox/trunk/elasticsearch/src/test/resources/documents/mail2.eml
james/mailbox/trunk/elasticsearch/src/test/resources/documents/mail3.eml
james/mailbox/trunk/elasticsearch/src/test/resources/documents/mail4.eml
james/mailbox/trunk/elasticsearch/src/test/resources/documents/spamMail.eml
james/mailbox/trunk/elasticsearch/src/test/resources/documents/spamMail.json

Modified: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/HeaderCollection.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/HeaderCollection.java?rev=1688139r1=1688138r2=1688139view=diff
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/HeaderCollection.java
 (original)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/HeaderCollection.java
 Mon Jun 29 08:39:30 2015
@@ -19,6 +19,7 @@
 
 package org.apache.james.mailbox.elasticsearch.json;
 
+import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Preconditions;
 import com.google.common.collect.ArrayListMultimap;
 import com.google.common.collect.ImmutableMultimap;
@@ -39,6 +40,8 @@ import java.time.format.DateTimeFormatte
 import java.util.HashSet;
 import java.util.Optional;
 import java.util.Set;
+import java.util.regex.Matcher;
+import java.util.regex.Pattern;
 import java.util.stream.Collectors;
 import java.util.stream.Stream;
 
@@ -46,6 +49,14 @@ public class HeaderCollection {
 
 public static class Builder {
 
+// Some sent e-mail have this form : Wed,  3 Jun 2015 09:05:46 + 
(UTC)
+// Java 8 Time library RFC_1123_DATE_TIME corresponds to Wed,  3 Jun 
2015 09:05:46 + only
+// This REGEXP is here to match ( in order to remove ) the possible 
invalid end of a header date
+// Example of matching patterns :
+//  (UTC)
+//  (CEST)
+private static final Pattern DATE_SANITIZING_PATTERN = 
Pattern.compile( *\\(.*\\) *);
+
 private final SetEMailer toAddressSet;
 private final SetEMailer fromAddressSet;
 private final SetEMailer ccAddressSet;
@@ -135,13 +146,26 @@ public class HeaderCollection {
 
 private OptionalZonedDateTime toISODate(String value) {
 try {
-return Optional.of(ZonedDateTime.parse(value, 
DateTimeFormatter.RFC_1123_DATE_TIME));
+return Optional.of(ZonedDateTime.parse(
+sanitizeDateStringHeaderValue(value),
+DateTimeFormatter.RFC_1123_DATE_TIME));
 } catch (Exception e) {
 LOGGER.info(Can not parse receive date  + value);
 return Optional.empty();
 }
 }
 
+@VisibleForTesting String sanitizeDateStringHeaderValue(String value) {
+// Some sent e-mail have this form : Wed,  3 Jun 2015 09:05:46 
+ (UTC)
+// Java 8 Time library RFC_1123_DATE_TIME corresponds to Wed,  3 
Jun 2015 09:05:46 + only
+// This method is here to convert the first date into something 
parsable by RFC_1123_DATE_TIME DateTimeFormatter
+Matcher sanitizerMatcher = DATE_SANITIZING_PATTERN.matcher(value);
+if (sanitizerMatcher.find()) {
+return value.substring(0 , sanitizerMatcher.start());
+}
+return value;
+}
+
 }
 
 public static final String TO = to;

Modified: 
james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/HeaderCollectionTest.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/HeaderCollectionTest.java?rev=1688139r1=1688138r2=1688139view=diff
==
--- 
james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/HeaderCollectionTest.java
 (original)
+++ 
james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/HeaderCollectionTest.java
 Mon Jun 29 08:39:30 2015
@@ -130,6 +130,13 @@ public class HeaderCollectionTest {
 }
 
 @Test
+public void nonStandardDatesShouldBeRetreived() {
+HeaderCollection headerCollection = 

svn commit: r1688141 - /james/mailbox/trunk/lucene/pom.xml

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:40:27 2015
New Revision: 1688141

URL: http://svn.apache.org/r1688141
Log:
MAILBOX-244 Adding a profile to produce an empty mailbox-lucene jar - patch 
contributed by Antoine Duprat

Modified:
james/mailbox/trunk/lucene/pom.xml

Modified: james/mailbox/trunk/lucene/pom.xml
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/lucene/pom.xml?rev=1688141r1=1688140r2=1688141view=diff
==
--- james/mailbox/trunk/lucene/pom.xml (original)
+++ james/mailbox/trunk/lucene/pom.xml Mon Jun 29 08:40:27 2015
@@ -49,14 +49,6 @@
 artifactIdapache-mime4j-dom/artifactId
 /dependency
 dependency
-groupIdorg.slf4j/groupId
-artifactIdslf4j-api/artifactId
-/dependency
-dependency
-groupId${javax.mail.groupId}/groupId
-artifactId${javax.mail.artifactId}/artifactId
-/dependency
-dependency
 groupIdorg.apache.lucene/groupId
 artifactIdlucene-core/artifactId
 version${lucene.version}/version
@@ -72,6 +64,14 @@
 version${lucene.version}/version
 /dependency
 dependency
+groupIdorg.slf4j/groupId
+artifactIdslf4j-api/artifactId
+/dependency
+dependency
+groupId${javax.mail.groupId}/groupId
+artifactId${javax.mail.artifactId}/artifactId
+/dependency
+dependency
 groupIdjunit/groupId
 artifactIdjunit/artifactId
 scopetest/scope
@@ -89,4 +89,28 @@
 scopetest/scope
 /dependency
 /dependencies
+profiles
+profile
+idlucene/id
+activation
+activeByDefaulttrue/activeByDefault
+/activation
+/profile
+profile
+idexclude-lucene/id
+build
+plugins
+plugin
+groupIdorg.apache.maven.plugins/groupId
+artifactIdmaven-jar-plugin/artifactId
+configuration
+excludes
+exclude**/**/exclude
+/excludes
+/configuration
+/plugin
+/plugins
+/build
+/profile
+/profiles
 /project



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688138 - /james/mailbox/trunk/elasticsearch/pom.xml

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:39:01 2015
New Revision: 1688138

URL: http://svn.apache.org/r1688138
Log:
MAILBOX-234 ElasticSearch project creation

Modified:
james/mailbox/trunk/elasticsearch/pom.xml

Modified: james/mailbox/trunk/elasticsearch/pom.xml
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/pom.xml?rev=1688138r1=1688137r2=1688138view=diff
==
--- james/mailbox/trunk/elasticsearch/pom.xml (original)
+++ james/mailbox/trunk/elasticsearch/pom.xml Mon Jun 29 08:39:01 2015
@@ -136,11 +136,6 @@
 scopetest/scope
 /dependency
 dependency
-groupIdorg.codehaus.groovy/groupId
-artifactIdgroovy-all/artifactId
-version2.3.2/version
-/dependency
-dependency
 groupIdorg.apache.james/groupId
 artifactIdapache-james-mailbox-memory/artifactId
 scopetest/scope



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688140 - in /james/mailbox/trunk: elasticsearch/src/main/resources/META-INF/spring/mailbox-elasticsearch.xml spring/src/main/resources/META-INF/spring/spring-mailbox.xml

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:39:56 2015
New Revision: 1688140

URL: http://svn.apache.org/r1688140
Log:
MAILBOX-155 Add cassandra mailbox to exposed Spring mailbox configuration - 
patch contributed by Antoine Duprat

Modified:

james/mailbox/trunk/elasticsearch/src/main/resources/META-INF/spring/mailbox-elasticsearch.xml

james/mailbox/trunk/spring/src/main/resources/META-INF/spring/spring-mailbox.xml

Modified: 
james/mailbox/trunk/elasticsearch/src/main/resources/META-INF/spring/mailbox-elasticsearch.xml
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/resources/META-INF/spring/mailbox-elasticsearch.xml?rev=1688140r1=1688139r2=1688140view=diff
==
--- 
james/mailbox/trunk/elasticsearch/src/main/resources/META-INF/spring/mailbox-elasticsearch.xml
 (original)
+++ 
james/mailbox/trunk/elasticsearch/src/main/resources/META-INF/spring/mailbox-elasticsearch.xml
 Mon Jun 29 08:39:56 2015
@@ -39,7 +39,7 @@
 constructor-arg index=0 ref=elasticsearch-node/
 /bean
 
-bean id=elasticsearch-json 
class=org.apache.james.mailbox.elasticsearch.json.MessageToElasticSearchJson
+bean id=elasticsearch-json 
class=org.apache.james.mailbox.elasticsearch.json.MessageToElasticSearchJson/
 
 bean id=elasticsearch-searcher 
class=org.apache.james.mailbox.elasticsearch.search.ElasticSearchSearcher
 constructor-arg index=0 ref=elasticsearch-node/

Modified: 
james/mailbox/trunk/spring/src/main/resources/META-INF/spring/spring-mailbox.xml
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/spring/src/main/resources/META-INF/spring/spring-mailbox.xml?rev=1688140r1=1688139r2=1688140view=diff
==
--- 
james/mailbox/trunk/spring/src/main/resources/META-INF/spring/spring-mailbox.xml
 (original)
+++ 
james/mailbox/trunk/spring/src/main/resources/META-INF/spring/spring-mailbox.xml
 Mon Jun 29 08:39:56 2015
@@ -33,7 +33,7 @@
 
 !-- TODO: update spring context creation to match new Jackrabbit version 
--
 !--import resource=classpath:META-INF/spring/mailbox-jcr.xml /--
-
+
 import resource=classpath:META-INF/spring/mailbox-maildir.xml/
 import resource=classpath:META-INF/spring/mailbox-memory.xml/
 !-- TODO: Fix hbase build and re-enable --



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688149 - /james/server/trunk/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:49:19 2015
New Revision: 1688149

URL: http://svn.apache.org/r1688149
Log:
MAILBOX-236 replace Long by a InMemoryId - contributed by Matthieu Baechler

Modified:

james/server/trunk/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java

Modified: 
james/server/trunk/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java
URL: 
http://svn.apache.org/viewvc/james/server/trunk/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java?rev=1688149r1=1688148r2=1688149view=diff
==
--- 
james/server/trunk/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java
 (original)
+++ 
james/server/trunk/protocols/protocols-pop3/src/test/java/org/apache/james/pop3server/POP3ServerTest.java
 Mon Jun 29 08:49:19 2015
@@ -44,6 +44,7 @@ import org.apache.james.mailbox.acl.Mail
 import org.apache.james.mailbox.acl.SimpleGroupMembershipResolver;
 import org.apache.james.mailbox.acl.UnionMailboxACLResolver;
 import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.inmemory.InMemoryId;
 import org.apache.james.mailbox.inmemory.InMemoryMailboxSessionMapperFactory;
 import org.apache.james.mailbox.model.MailboxConstants;
 import org.apache.james.mailbox.model.MailboxPath;
@@ -70,7 +71,7 @@ public class POP3ServerTest {
 private POP3Client pop3Client = null;
 protected MockFileSystem fileSystem;
 protected MockProtocolHandlerLoader protocolHandlerChain;
-private StoreMailboxManagerLong mailboxManager;
+private StoreMailboxManagerInMemoryId mailboxManager;
 private final byte[] content = (Return-path: ret...@test.com\r\n
 + Content-Transfer-Encoding: plain\r\n
 + Subject: test\r\n\r\n
@@ -709,7 +710,7 @@ public class POP3ServerTest {
 InMemoryMailboxSessionMapperFactory factory = new 
InMemoryMailboxSessionMapperFactory();
 MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
 GroupMembershipResolver groupMembershipResolver = new 
SimpleGroupMembershipResolver();
-mailboxManager = new StoreMailboxManagerLong(factory, new 
Authenticator() {
+mailboxManager = new StoreMailboxManagerInMemoryId(factory, new 
Authenticator() {
 
 @Override
 public boolean isAuthentic(String userid, CharSequence passwd) {



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688150 - /james/server/trunk/app/pom.xml

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:50:00 2015
New Revision: 1688150

URL: http://svn.apache.org/r1688150
Log:
MAILBOX-244 Adding a profile in order to exclude lucene stuffs - contributed by 
Antoine Duprat

Modified:
james/server/trunk/app/pom.xml

Modified: james/server/trunk/app/pom.xml
URL: 
http://svn.apache.org/viewvc/james/server/trunk/app/pom.xml?rev=1688150r1=1688149r2=1688150view=diff
==
--- james/server/trunk/app/pom.xml (original)
+++ james/server/trunk/app/pom.xml Mon Jun 29 08:50:00 2015
@@ -428,17 +428,6 @@
 /dependency
 dependency
 groupIdorg.apache.james/groupId
-artifactIdapache-james-mailbox-lucene/artifactId
-scoperuntime/scope
-exclusions
-exclusion
-artifactIdmail/artifactId
-groupIdjavax.mail/groupId
-/exclusion
-/exclusions
-/dependency
-dependency
-groupIdorg.apache.james/groupId
 artifactIdapache-james-mailbox-jcr/artifactId
 scoperuntime/scope
 exclusions
@@ -562,6 +551,53 @@
 /properties
 /profile
 profile
+idlucene/id
+activation
+  activeByDefaulttrue/activeByDefault
+/activation
+dependencies
+dependency
+groupIdorg.apache.james/groupId
+artifactIdapache-james-mailbox-lucene/artifactId
+scoperuntime/scope
+exclusions
+exclusion
+artifactIdmail/artifactId
+groupIdjavax.mail/groupId
+/exclusion
+/exclusions
+/dependency
+/dependencies
+/profile
+profile
+idexclude-lucene/id
+dependencies
+dependency
+groupIdorg.apache.james/groupId
+artifactIdapache-james-mailbox-lucene/artifactId
+scoperuntime/scope
+exclusions
+exclusion
+artifactIdmail/artifactId
+groupIdjavax.mail/groupId
+/exclusion
+exclusion
+groupIdorg.apache.lucene/groupId
+artifactIdlucene-core/artifactId
+/exclusion
+exclusion
+groupIdorg.apache.lucene/groupId
+artifactIdlucene-analyzers/artifactId
+/exclusion
+exclusion
+groupIdorg.apache.lucene/groupId
+artifactIdlucene-smartcn/artifactId
+/exclusion
+/exclusions
+/dependency
+/dependencies
+/profile
+profile
 idwith-assembly/id
 activation
   activeByDefaulttrue/activeByDefault



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



Build failed in Jenkins: james-server-trunk » Apache James :: Server :: POP3 #5299

2015-06-29 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/5299/

--
[INFO] 
[INFO] 
[INFO] Building Apache James :: Server :: POP3 3.0.0-beta5-SNAPSHOT
[INFO] 
Downloading: 
http://repository.apache.org/snapshots/org/apache/james/protocols/protocols-pop3/1.6.4-SNAPSHOT/maven-metadata.xml
Downloaded: 
http://repository.apache.org/snapshots/org/apache/james/protocols/protocols-pop3/1.6.4-SNAPSHOT/maven-metadata.xml
 (2 KB at 4.5 KB/sec)
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ 
james-server-protocols-pop3 ---
[INFO] Deleting 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/ws/target
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.4:process (default) @ 
james-server-protocols-pop3 ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 
james-server-protocols-pop3 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ 
james-server-protocols-pop3 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 14 source files to 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/ws/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ 
james-server-protocols-pop3 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/ws/src/test/resources
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ 
james-server-protocols-pop3 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/ws/target/test-classes
[INFO] -
[ERROR] COMPILATION ERROR : 
[INFO] -
[ERROR] 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/ws/src/test/java/org/apache/james/pop3server/POP3ServerTest.java:[47,41]
 cannot find symbol
  symbol:   class InMemoryId
  location: package org.apache.james.mailbox.inmemory
[ERROR] 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/ws/src/test/java/org/apache/james/pop3server/POP3ServerTest.java:[74,33]
 cannot find symbol
  symbol:   class InMemoryId
  location: class org.apache.james.pop3server.POP3ServerTest
[ERROR] 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/ws/src/test/java/org/apache/james/pop3server/POP3ServerTest.java:[713,50]
 cannot find symbol
  symbol:   class InMemoryId
  location: class org.apache.james.pop3server.POP3ServerTest
[INFO] 3 errors 
[INFO] -

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



Build failed in Jenkins: james-server-trunk #5299

2015-06-29 Thread Apache Jenkins Server
See https://builds.apache.org/job/james-server-trunk/5299/changes

Changes:

[btellier] MAILBOX-235 Include Tika dependency to Class Path

[btellier] MAILBOX-155 Add indexer configuration - contributed by Antoine Duprat

[btellier] MAILBOX-155 Add a messageMapperFactory alias in spring registry - 
contributed by Antoine Duprat

[btellier] MAILBOX-155 Load ElasticSearch module - contributed by Antoine Duprat

--
[...truncated 5424 lines...]
Sending artifact delta relative to james-server-trunk » Apache James :: Karaf 
:: James Server #5296
Archived 1 artifacts
Archive block size is 32768
Received 0 blocks and 6663 bytes
Compression is 0.0%
Took 0.14 sec
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/queue/queue-jms/pom.xml
 to 
org.apache.james/james-server-queue-jms/3.0.0-beta5-SNAPSHOT/james-server-queue-jms-3.0.0-beta5-SNAPSHOT.pom
Sending artifact delta relative to james-server-trunk » Apache James :: Server 
:: Mail Queue :: JMS #5296
Archived 1 artifacts
Archive block size is 32768
Received 0 blocks and 4524 bytes
Compression is 0.0%
Took 25 ms
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/filesystem-api/pom.xml
 to 
org.apache.james/james-server-filesystem-api/3.0.0-beta5-SNAPSHOT/james-server-filesystem-api-3.0.0-beta5-SNAPSHOT.pom
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/filesystem-api/target/james-server-filesystem-api-3.0.0-beta5-SNAPSHOT.jar
 to 
org.apache.james/james-server-filesystem-api/3.0.0-beta5-20150629.090603-1479/james-server-filesystem-api-3.0.0-beta5-20150629.090603-1479.jar
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/filesystem-api/target/james-server-filesystem-api-3.0.0-beta5-SNAPSHOT-tests.jar
 to 
org.apache.james/james-server-filesystem-api/3.0.0-beta5-20150629.090603-1479/james-server-filesystem-api-3.0.0-beta5-20150629.090603-1479-tests.jar
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/filesystem-api/target/james-server-filesystem-api-3.0.0-beta5-SNAPSHOT-sources.jar
 to 
org.apache.james/james-server-filesystem-api/3.0.0-beta5-20150629.090603-1479/james-server-filesystem-api-3.0.0-beta5-20150629.090603-1479-sources.jar
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/filesystem-api/target/james-server-filesystem-api-3.0.0-beta5-SNAPSHOT-test-sources.jar
 to 
org.apache.james/james-server-filesystem-api/3.0.0-beta5-20150629.090603-1479/james-server-filesystem-api-3.0.0-beta5-20150629.090603-1479-test-sources.jar
Sending artifact delta relative to james-server-trunk » Apache James :: Server 
:: Filesystem API #5298
Archived 5 artifacts
Archive block size is 32768
Received 0 blocks and 55423 bytes
Compression is 0.0%
Took 35 ms
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/mailet/mailetcontainer-api/pom.xml
 to 
org.apache.james/james-server-mailetcontainer-api/3.0.0-beta5-SNAPSHOT/james-server-mailetcontainer-api-3.0.0-beta5-SNAPSHOT.pom
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/mailet/mailetcontainer-api/target/james-server-mailetcontainer-api-3.0.0-beta5-SNAPSHOT.jar
 to 
org.apache.james/james-server-mailetcontainer-api/3.0.0-beta5-20150629.090614-1474/james-server-mailetcontainer-api-3.0.0-beta5-20150629.090614-1474.jar
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/mailet/mailetcontainer-api/target/james-server-mailetcontainer-api-3.0.0-beta5-SNAPSHOT-tests.jar
 to 
org.apache.james/james-server-mailetcontainer-api/3.0.0-beta5-20150629.090614-1474/james-server-mailetcontainer-api-3.0.0-beta5-20150629.090614-1474-tests.jar
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/mailet/mailetcontainer-api/target/james-server-mailetcontainer-api-3.0.0-beta5-SNAPSHOT-sources.jar
 to 
org.apache.james/james-server-mailetcontainer-api/3.0.0-beta5-20150629.090614-1474/james-server-mailetcontainer-api-3.0.0-beta5-20150629.090614-1474-sources.jar
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/mailet/mailetcontainer-api/target/james-server-mailetcontainer-api-3.0.0-beta5-SNAPSHOT-test-sources.jar
 to 
org.apache.james/james-server-mailetcontainer-api/3.0.0-beta5-20150629.090614-1474/james-server-mailetcontainer-api-3.0.0-beta5-20150629.090614-1474-test-sources.jar
Sending artifact delta relative to james-server-trunk » Apache James :: Server 
:: Mailetcontainer API #5298
Archived 5 artifacts
Archive block size is 32768
Received 0 blocks and 61416 bytes
Compression is 0.0%
Took 38 ms
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/mailet/mailets/pom.xml
 to 
org.apache.james/james-server-mailets/3.0.0-beta5-SNAPSHOT/james-server-mailets-3.0.0-beta5-SNAPSHOT.pom
Sending artifact delta relative to 

svn commit: r1688122 - in /james/mailbox/trunk/elasticsearch/src: main/java/org/apache/james/mailbox/elasticsearch/query/ test/java/org/apache/james/mailbox/elasticsearch/query/

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:30:14 2015
New Revision: 1688122

URL: http://svn.apache.org/r1688122
Log:
MAILBOX-235 rework Collector so that everything is immutable - patch 
contributed by Matthieu Baechlor

Modified:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/CriterionConverter.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/FilteredQueryCollector.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/FilteredQueryRepresentation.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/QueryConverter.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/query/FilteredQueryCollectorTest.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/query/QueryConverterTest.java

Modified: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/CriterionConverter.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/CriterionConverter.java?rev=1688122r1=1688121r2=1688122view=diff
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/CriterionConverter.java
 (original)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/CriterionConverter.java
 Mon Jun 29 08:30:14 2015
@@ -140,7 +140,7 @@ public class CriterionConverter {
 private FilteredQueryRepresentation 
convertConjunction(SearchQuery.ConjunctionCriterion criterion) {
 return criterion.getCriteria().stream()
 .map(this::convertCriterion)
-.collect(new FilteredQueryCollector(criterion.getType()));
+.collect(FilteredQueryCollector.collector(criterion.getType()));
 }
 
 private FilteredQueryRepresentation convertFlag(SearchQuery.FlagCriterion 
flagCriterion) {
@@ -192,7 +192,7 @@ public class CriterionConverter {
 }
 return Arrays.stream(uidCriterion.getOperator().getRange())
 .map(this::uidRangeFilter)
-.collect(new FilteredQueryCollector(SearchQuery.Conjunction.OR));
+
.collect(FilteredQueryCollector.collector(SearchQuery.Conjunction.OR));
 }
 
 private FilteredQueryRepresentation 
uidRangeFilter(SearchQuery.NumericRange numericRange) {

Modified: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/FilteredQueryCollector.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/FilteredQueryCollector.java?rev=1688122r1=1688121r2=1688122view=diff
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/FilteredQueryCollector.java
 (original)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/FilteredQueryCollector.java
 Mon Jun 29 08:30:14 2015
@@ -19,105 +19,19 @@
 
 package org.apache.james.mailbox.elasticsearch.query;
 
-import static org.elasticsearch.index.query.QueryBuilders.boolQuery;
-import static org.elasticsearch.index.query.FilterBuilders.boolFilter;
-
-import org.apache.james.mailbox.model.SearchQuery;
-import org.elasticsearch.index.query.BoolFilterBuilder;
-import org.elasticsearch.index.query.BoolQueryBuilder;
-
-import java.util.EnumSet;
-import java.util.Optional;
-import java.util.Set;
-import java.util.function.BiConsumer;
-import java.util.function.BinaryOperator;
-import java.util.function.Function;
-import java.util.function.Supplier;
 import java.util.stream.Collector;
+import java.util.stream.Collectors;
 
-public class FilteredQueryCollector implements 
CollectorFilteredQueryRepresentation, FilteredQueryRepresentation, 
FilteredQueryRepresentation {
-
-private final SearchQuery.Conjunction type;
-
-public FilteredQueryCollector(SearchQuery.Conjunction type) {
-this.type = type;
-}
-
-@Override
-public SupplierFilteredQueryRepresentation supplier() {
-return FilteredQueryRepresentation::empty;
-}
-
-@Override
-public BiConsumerFilteredQueryRepresentation, 
FilteredQueryRepresentation accumulator() {
-return this::apply;
-}
-
-@Override
-public BinaryOperatorFilteredQueryRepresentation combiner() {
-return this::apply;
-}
-
-@Override
-public FunctionFilteredQueryRepresentation, FilteredQueryRepresentation 
finisher() {
-return (accumulator)-accumulator;
-}
-
-@Override
-public SetCharacteristics characteristics() {
-return EnumSet.of(Characteristics.UNORDERED);

svn commit: r1688146 - in /james/mailbox/trunk/elasticsearch/src: main/java/org/apache/james/mailbox/elasticsearch/json/ test/java/org/apache/james/mailbox/elasticsearch/ test/java/org/apache/james/ma

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:45:43 2015
New Revision: 1688146

URL: http://svn.apache.org/r1688146
Log:
 MAILBOX-245 Use text extractor on JSON generation

Added:

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/MessageToElasticSearchJsonUsingTika.java

james/mailbox/trunk/elasticsearch/src/test/resources/documents/nonTextual.eml

james/mailbox/trunk/elasticsearch/src/test/resources/documents/nonTextual.json
Modified:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessage.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/JsonMessageConstants.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MessageToElasticSearchJson.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MimePart.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MimePartContainerBuilder.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MimePartParser.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/RootMimePartContainerBuilder.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/MessageToElasticSearchJsonTest.java
james/mailbox/trunk/elasticsearch/src/test/resources/documents/htmlMail.json

james/mailbox/trunk/elasticsearch/src/test/resources/documents/recursiveMail.json
james/mailbox/trunk/elasticsearch/src/test/resources/documents/spamMail.json

Modified: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessage.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessage.java?rev=1688146r1=1688145r2=1688146view=diff
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessage.java
 (original)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessage.java
 Mon Jun 29 08:45:43 2015
@@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.
 import com.google.common.base.Preconditions;
 import com.google.common.base.Throwables;
 import com.google.common.collect.Multimap;
+import org.apache.james.mailbox.elasticsearch.json.extractor.TextExtractor;
 import org.apache.james.mailbox.elasticsearch.query.DateResolutionFormater;
 import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Message;
@@ -41,11 +42,11 @@ import java.util.stream.Collectors;
 
 public class IndexableMessage {
 
-public static IndexableMessage from(Message? extends MailboxId message) {
+public static IndexableMessage from(Message? extends MailboxId message, 
TextExtractor textExtractor) {
 Preconditions.checkNotNull(message.getMailboxId());
 IndexableMessage indexableMessage = new IndexableMessage();
 try {
-MimePart parsingResult = new MimePartParser(message).parse();
+MimePart parsingResult = new MimePartParser(message, 
textExtractor).parse();
 indexableMessage.bodyText = parsingResult.locateFirstTextualBody();
 indexableMessage.setFlattenedAttachments(parsingResult);
 
indexableMessage.copyHeaderFields(parsingResult.getHeaderCollection(), 
getSanitizedInternalDate(message));

Modified: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/JsonMessageConstants.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/JsonMessageConstants.java?rev=1688146r1=1688145r2=1688146view=diff
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/JsonMessageConstants.java
 (original)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/JsonMessageConstants.java
 Mon Jun 29 08:45:43 2015
@@ -66,6 +66,7 @@ public interface JsonMessageConstants {
 String CONTENT_DISPOSITION = contentDisposition;
 String FILENAME = fileName;
 String FILE_EXTENSION = fileExtension;
+String FILE_METADATA = fileMetadata;
 }
 
 interface Property {

Modified: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MessageToElasticSearchJson.java
URL: 

svn commit: r1688145 - in /james/mailbox/trunk/elasticsearch: ./ src/main/java/org/apache/james/mailbox/elasticsearch/json/extractor/ src/test/java/org/apache/james/mailbox/elasticsearch/json/extracto

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:45:01 2015
New Revision: 1688145

URL: http://svn.apache.org/r1688145
Log:
MAILBOX-245 Adding text extractors

Added:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/extractor/

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/extractor/DefaultTextExtractor.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/extractor/ParsedContent.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/extractor/TextExtractor.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/extractor/TikaTextExtractor.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/extractor/

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/extractor/DefaultTextExtractorTest.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/extractor/TikaTextExtractorTest.java
james/mailbox/trunk/elasticsearch/src/test/resources/documents/PDF.pdf
james/mailbox/trunk/elasticsearch/src/test/resources/documents/Text.txt
james/mailbox/trunk/elasticsearch/src/test/resources/documents/calc.ods
james/mailbox/trunk/elasticsearch/src/test/resources/documents/calc.xlsx
james/mailbox/trunk/elasticsearch/src/test/resources/documents/fake.txt
james/mailbox/trunk/elasticsearch/src/test/resources/documents/slides.odp
james/mailbox/trunk/elasticsearch/src/test/resources/documents/slides.pptx
james/mailbox/trunk/elasticsearch/src/test/resources/documents/writter.docx
james/mailbox/trunk/elasticsearch/src/test/resources/documents/writter.odt
Modified:
james/mailbox/trunk/elasticsearch/pom.xml

Modified: james/mailbox/trunk/elasticsearch/pom.xml
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/pom.xml?rev=1688145r1=1688144r2=1688145view=diff
==
--- james/mailbox/trunk/elasticsearch/pom.xml (original)
+++ james/mailbox/trunk/elasticsearch/pom.xml Mon Jun 29 08:45:01 2015
@@ -103,6 +103,16 @@
 scopetest/scope
 /dependency
 dependency
+groupIdorg.apache.tika/groupId
+artifactIdtika-core/artifactId
+version1.7/version
+/dependency
+dependency
+groupIdorg.apache.tika/groupId
+artifactIdtika-parsers/artifactId
+version1.7/version
+/dependency
+dependency
 groupIdorg.assertj/groupId
 artifactIdassertj-core/artifactId
 version3.0.0/version

Added: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/extractor/DefaultTextExtractor.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/extractor/DefaultTextExtractor.java?rev=1688145view=auto
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/extractor/DefaultTextExtractor.java
 (added)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/extractor/DefaultTextExtractor.java
 Mon Jun 29 08:45:01 2015
@@ -0,0 +1,44 @@
+/
+ * 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.mailbox.elasticsearch.json.extractor;
+
+import java.io.InputStream;
+import java.util.Optional;
+
+import com.google.common.collect.ArrayListMultimap;
+import com.google.common.collect.ImmutableMultimap;
+import 

Build failed in Jenkins: james-server-trunk » Apache James :: Server :: POP3 #5298

2015-06-29 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/5298/changes

Changes:

[btellier] MAILBOX-236 replace Long by a InMemoryId - contributed by Matthieu 
Baechler

--
[INFO] 
[INFO] 
[INFO] Building Apache James :: Server :: POP3 3.0.0-beta5-SNAPSHOT
[INFO] 
Downloading: 
http://repository.apache.org/snapshots/org/apache/james/protocols/protocols-pop3/1.6.4-SNAPSHOT/maven-metadata.xml
Downloaded: 
http://repository.apache.org/snapshots/org/apache/james/protocols/protocols-pop3/1.6.4-SNAPSHOT/maven-metadata.xml
 (2 KB at 3.8 KB/sec)
Downloading: 
http://repository.apache.org/snapshots/org/apache/james/protocols/protocols-pop3/1.6.4-SNAPSHOT/protocols-pop3-1.6.4-20150617.121220-974.pom
Downloaded: 
http://repository.apache.org/snapshots/org/apache/james/protocols/protocols-pop3/1.6.4-SNAPSHOT/protocols-pop3-1.6.4-20150617.121220-974.pom
 (3 KB at 15.5 KB/sec)
Downloading: 
http://repository.apache.org/snapshots/org/apache/james/protocols/protocols-pop3/1.6.4-SNAPSHOT/protocols-pop3-1.6.4-20150617.121220-974.jar
Downloaded: 
http://repository.apache.org/snapshots/org/apache/james/protocols/protocols-pop3/1.6.4-SNAPSHOT/protocols-pop3-1.6.4-20150617.121220-974.jar
 (52 KB at 261.2 KB/sec)
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ 
james-server-protocols-pop3 ---
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.4:process (default) @ 
james-server-protocols-pop3 ---
[INFO] 
[INFO] --- maven-resources-plugin:2.6:resources (default-resources) @ 
james-server-protocols-pop3 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] Copying 3 resources
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.0:compile (default-compile) @ 
james-server-protocols-pop3 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 14 source files to 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/ws/target/classes
[INFO] 
[INFO] --- maven-resources-plugin:2.6:testResources (default-testResources) @ 
james-server-protocols-pop3 ---
[INFO] Using 'UTF-8' encoding to copy filtered resources.
[INFO] skip non existing resourceDirectory 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/ws/src/test/resources
[INFO] Copying 3 resources
[INFO] 
[INFO] --- maven-compiler-plugin:3.0:testCompile (default-testCompile) @ 
james-server-protocols-pop3 ---
[INFO] Changes detected - recompiling the module!
[INFO] Compiling 3 source files to 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/ws/target/test-classes
[INFO] -
[ERROR] COMPILATION ERROR : 
[INFO] -
[ERROR] 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/ws/src/test/java/org/apache/james/pop3server/POP3ServerTest.java:[47,41]
 cannot find symbol
  symbol:   class InMemoryId
  location: package org.apache.james.mailbox.inmemory
[ERROR] 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/ws/src/test/java/org/apache/james/pop3server/POP3ServerTest.java:[74,33]
 cannot find symbol
  symbol:   class InMemoryId
  location: class org.apache.james.pop3server.POP3ServerTest
[ERROR] 
https://builds.apache.org/job/james-server-trunk/org.apache.james$james-server-protocols-pop3/ws/src/test/java/org/apache/james/pop3server/POP3ServerTest.java:[713,50]
 cannot find symbol
  symbol:   class InMemoryId
  location: class org.apache.james.pop3server.POP3ServerTest
[INFO] 3 errors 
[INFO] -

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688158 - in /james/mpt/trunk: impl/imap-mailbox/elasticsearch/ impl/imap-mailbox/elasticsearch/.gitignore impl/imap-mailbox/elasticsearch/pom.xml impl/imap-mailbox/pom.xml pom.xml

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:56:18 2015
New Revision: 1688158

URL: http://svn.apache.org/r1688158
Log:
MAILBOX-155 Adding project ElasticSearch to MPT

Added:
james/mpt/trunk/impl/imap-mailbox/elasticsearch/
james/mpt/trunk/impl/imap-mailbox/elasticsearch/.gitignore
james/mpt/trunk/impl/imap-mailbox/elasticsearch/pom.xml
Modified:
james/mpt/trunk/impl/imap-mailbox/pom.xml
james/mpt/trunk/pom.xml

Added: james/mpt/trunk/impl/imap-mailbox/elasticsearch/.gitignore
URL: 
http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/elasticsearch/.gitignore?rev=1688158view=auto
==
--- james/mpt/trunk/impl/imap-mailbox/elasticsearch/.gitignore (added)
+++ james/mpt/trunk/impl/imap-mailbox/elasticsearch/.gitignore Mon Jun 29 
08:56:18 2015
@@ -0,0 +1,3 @@
+target
+data
+*.iml

Added: james/mpt/trunk/impl/imap-mailbox/elasticsearch/pom.xml
URL: 
http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/elasticsearch/pom.xml?rev=1688158view=auto
==
--- james/mpt/trunk/impl/imap-mailbox/elasticsearch/pom.xml (added)
+++ james/mpt/trunk/impl/imap-mailbox/elasticsearch/pom.xml Mon Jun 29 08:56:18 
2015
@@ -0,0 +1,62 @@
+?xml version=1.0 encoding=UTF-8?
+!--
+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.
+--
+project xmlns=http://maven.apache.org/POM/4.0.0; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;
+
+modelVersion4.0.0/modelVersion
+
+parent
+artifactIdapache-james-mpt-imapmailbox/artifactId
+groupIdorg.apache.james/groupId
+version0.2-SNAPSHOT/version
+/parent
+
+artifactIdapache-james-mpt-imapmailbox-elasticsearch/artifactId
+nameApache James MPT Imap Mailbox - ElasticSearch/name
+
+dependencies
+dependency
+groupIdorg.apache.james/groupId
+artifactIdapache-james-mailbox-api/artifactId
+/dependency
+dependency
+groupIdorg.apache.james/groupId
+artifactIdapache-james-mailbox-elasticsearch/artifactId
+/dependency
+dependency
+groupIdorg.apache.james/groupId
+artifactIdapache-james-mailbox-elasticsearch/artifactId
+typetest-jar/type
+/dependency
+dependency
+groupIdorg.apache.james/groupId
+artifactIdapache-james-mailbox-memory/artifactId
+/dependency
+dependency
+groupIdorg.apache.james/groupId
+artifactIdapache-james-mailbox-store/artifactId
+/dependency
+dependency
+groupIdorg.apache.james/groupId
+artifactIdapache-james-mpt-imapmailbox-core/artifactId
+/dependency
+/dependencies
+
+
+/project
\ No newline at end of file

Modified: james/mpt/trunk/impl/imap-mailbox/pom.xml
URL: 
http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/pom.xml?rev=1688158r1=1688157r2=1688158view=diff
==
--- james/mpt/trunk/impl/imap-mailbox/pom.xml (original)
+++ james/mpt/trunk/impl/imap-mailbox/pom.xml Mon Jun 29 08:56:18 2015
@@ -44,6 +44,7 @@
 modulejpa/module
 modulemaildir/module
 modulecyrus/module
+moduleelasticsearch/module
 /modules
 
 dependencyManagement
@@ -96,6 +97,12 @@
 version${project.version}/version
 scopetest/scope
 /dependency
+dependency
+groupId${project.groupId}/groupId
+
artifactIdapache-james-mpt-imapmailbox-elasticsearch/artifactId
+version${project.version}/version
+scopetest/scope
+/dependency
 /dependencies
 /dependencyManagement
 
@@ -250,6 +257,26 @@
 /configuration
 /plugin
 /plugins
+/build
+/profile
+profile
+idelasticsearch/id
+build
+plugins
+  

Build failed in Jenkins: james-server-trunk #5298

2015-06-29 Thread Apache Jenkins Server
See https://builds.apache.org/job/james-server-trunk/5298/changes

Changes:

[btellier] MAILBOX-244 Adding a profile in order to exclude lucene stuffs - 
contributed by Antoine Duprat

[btellier] MAILBOX-236 replace Long by a InMemoryId - contributed by Matthieu 
Baechler

--
[...truncated 6981 lines...]
[ERROR] After correcting the problems, you can resume the build with the command
[ERROR]   mvn goals -rf :james-server-protocols-pop3
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/spring/pom.xml
 to 
org.apache.james/james-server-spring/3.0.0-beta5-SNAPSHOT/james-server-spring-3.0.0-beta5-SNAPSHOT.pom
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/spring/target/james-server-spring-3.0.0-beta5-SNAPSHOT.jar
 to 
org.apache.james/james-server-spring/3.0.0-beta5-20150629.085305-1452/james-server-spring-3.0.0-beta5-20150629.085305-1452.jar
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/spring/target/james-server-spring-3.0.0-beta5-SNAPSHOT-tests.jar
 to 
org.apache.james/james-server-spring/3.0.0-beta5-20150629.085305-1452/james-server-spring-3.0.0-beta5-20150629.085305-1452-tests.jar
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/spring/target/james-server-spring-3.0.0-beta5-SNAPSHOT-sources.jar
 to 
org.apache.james/james-server-spring/3.0.0-beta5-20150629.085305-1452/james-server-spring-3.0.0-beta5-20150629.085305-1452-sources.jar
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/spring/target/james-server-spring-3.0.0-beta5-SNAPSHOT-test-sources.jar
 to 
org.apache.james/james-server-spring/3.0.0-beta5-20150629.085305-1452/james-server-spring-3.0.0-beta5-20150629.085305-1452-test-sources.jar
No artifacts from james-server-trunk » Apache James :: Server :: Container 
Spring #5297 to compare, so performing full copy of artifacts
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/lifecycle-api/pom.xml
 to 
org.apache.james/james-server-lifecycle-api/3.0.0-beta5-SNAPSHOT/james-server-lifecycle-api-3.0.0-beta5-SNAPSHOT.pom
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/lifecycle-api/target/james-server-lifecycle-api-3.0.0-beta5-SNAPSHOT.jar
 to 
org.apache.james/james-server-lifecycle-api/3.0.0-beta5-20150629.085112-1490/james-server-lifecycle-api-3.0.0-beta5-20150629.085112-1490.jar
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/lifecycle-api/target/james-server-lifecycle-api-3.0.0-beta5-SNAPSHOT-tests.jar
 to 
org.apache.james/james-server-lifecycle-api/3.0.0-beta5-20150629.085112-1490/james-server-lifecycle-api-3.0.0-beta5-20150629.085112-1490-tests.jar
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/lifecycle-api/target/james-server-lifecycle-api-3.0.0-beta5-SNAPSHOT-sources.jar
 to 
org.apache.james/james-server-lifecycle-api/3.0.0-beta5-20150629.085112-1490/james-server-lifecycle-api-3.0.0-beta5-20150629.085112-1490-sources.jar
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/lifecycle-api/target/james-server-lifecycle-api-3.0.0-beta5-SNAPSHOT-test-sources.jar
 to 
org.apache.james/james-server-lifecycle-api/3.0.0-beta5-20150629.085112-1490/james-server-lifecycle-api-3.0.0-beta5-20150629.085112-1490-test-sources.jar
No artifacts from james-server-trunk » Apache James :: Server :: Lifecycle API 
#5297 to compare, so performing full copy of artifacts
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/cli/pom.xml
 to 
org.apache.james/james-server-cli/3.0.0-beta5-SNAPSHOT/james-server-cli-3.0.0-beta5-SNAPSHOT.pom
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/cli/target/james-server-cli-3.0.0-beta5-SNAPSHOT.jar
 to 
org.apache.james/james-server-cli/3.0.0-beta5-20150629.085318-1451/james-server-cli-3.0.0-beta5-20150629.085318-1451.jar
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/cli/target/james-server-cli-3.0.0-beta5-SNAPSHOT-tests.jar
 to 
org.apache.james/james-server-cli/3.0.0-beta5-20150629.085318-1451/james-server-cli-3.0.0-beta5-20150629.085318-1451-tests.jar
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/cli/target/james-server-cli-3.0.0-beta5-SNAPSHOT-sources.jar
 to 
org.apache.james/james-server-cli/3.0.0-beta5-20150629.085318-1451/james-server-cli-3.0.0-beta5-20150629.085318-1451-sources.jar
[JENKINS] Archiving 
https://builds.apache.org/job/james-server-trunk/ws/trunk/container/cli/target/james-server-cli-3.0.0-beta5-SNAPSHOT-test-sources.jar
 to 
org.apache.james/james-server-cli/3.0.0-beta5-20150629.085318-1451/james-server-cli-3.0.0-beta5-20150629.085318-1451-test-sources.jar
No 

svn commit: r1688160 - in /james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol: FileProtocolSessionBuilder.java ProtocolSession.java ProtocolSessionBuilder.java

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:57:11 2015
New Revision: 1688160

URL: http://svn.apache.org/r1688160
Log:
MAILBOX-155 Adding LOG instruction to MPT, for debug purposes

Modified:

james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/FileProtocolSessionBuilder.java

james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/ProtocolSession.java

james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/ProtocolSessionBuilder.java

Modified: 
james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/FileProtocolSessionBuilder.java
URL: 
http://svn.apache.org/viewvc/james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/FileProtocolSessionBuilder.java?rev=1688160r1=1688159r2=1688160view=diff
==
--- 
james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/FileProtocolSessionBuilder.java
 (original)
+++ 
james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/FileProtocolSessionBuilder.java
 Mon Jun 29 08:57:11 2015
@@ -35,7 +35,12 @@ import org.apache.commons.io.IOUtils;
  * @version $Revision$
  */
 public class FileProtocolSessionBuilder extends ProtocolSessionBuilder {
-
+
+public static final String DEBUG = DEBUG;
+public static final String INFO = INFO;
+public static final String WARN = WARN;
+public static final String ERR = ERR;
+
 /**
  * Builds a ProtocolSession by reading lines from the test file with the
  * supplied name.
@@ -119,6 +124,20 @@ public class FileProtocolSessionBuilder
 throw new Exception(Invalid line length on WAIT 
instruction :  + next);
 }
 }
+else if (next.startsWith(LOG)) {
+String logInstruction = next.substring(4);
+if (logInstruction.startsWith(DEBUG)) {
+session.LOG(sessionNumber, 
ProtocolSession.LolLevel.Debug, logInstruction.substring(6));
+} else if (logInstruction.startsWith(INFO)) {
+session.LOG(sessionNumber, 
ProtocolSession.LolLevel.Info, logInstruction.substring(5));
+} else if (logInstruction.startsWith(WARN)) {
+session.LOG(sessionNumber, 
ProtocolSession.LolLevel.Warn, logInstruction.substring(5));
+} else if (logInstruction.startsWith(ERR)) {
+session.LOG(sessionNumber, 
ProtocolSession.LolLevel.Err, logInstruction.substring(4));
+} else {
+throw new Exception(Unrecognized log level for  + 
next);
+}
+}
 else if (next.startsWith(OPEN_UNORDERED_BLOCK_TAG)) {
 ListString unorderedLines = new ArrayListString(5);
 next = reader.readLine();

Modified: 
james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/ProtocolSession.java
URL: 
http://svn.apache.org/viewvc/james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/ProtocolSession.java?rev=1688160r1=1688159r2=1688160view=diff
==
--- 
james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/ProtocolSession.java
 (original)
+++ 
james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/ProtocolSession.java
 Mon Jun 29 08:57:11 2015
@@ -27,6 +27,8 @@ import java.util.regex.Pattern;
 
 import org.apache.james.mpt.api.ProtocolInteractor;
 import org.apache.james.mpt.api.Session;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
 
 /**
  * A protocol session which can be run against a reader and writer, which 
checks
@@ -38,6 +40,8 @@ import org.apache.james.mpt.api.Session;
  */
 public class ProtocolSession implements ProtocolInteractor {
 
+private static final Logger LOGGER = 
LoggerFactory.getLogger(ProtocolSession.class);
+
 private boolean continued = false;
 
 private boolean continuationExpected = false;
@@ -58,6 +62,13 @@ public class ProtocolSession implements
 return continueAfterFailure;
 }
 
+enum LolLevel {
+Debug,
+Info,
+Warn,
+Err
+}
+
 public final void setContinueAfterFailure(boolean continueAfterFailure) {
 this.continueAfterFailure = continueAfterFailure;
 }
@@ -186,6 +197,11 @@ public class ProtocolSession implements
 testElements.add(new WaitElement(timeToWaitInMs));
 }
 
+public void LOG(int sessionNumber, LolLevel level, String message) {
+this.maxSessionNumber = Math.max(this.maxSessionNumber, sessionNumber);
+testElements.add(new LogElement(level, message));
+}
+
 /**
  * A client request, which write the specified message to a Writer.
  */
@@ -501,6 +517,43 @@ public class ProtocolSession implements
 }
 
 @Override
+public boolean isClient() 

svn commit: r1688159 - in /james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol: FileProtocolSessionBuilder.java ProtocolSession.java ProtocolSessionBuilder.java

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:56:41 2015
New Revision: 1688159

URL: http://svn.apache.org/r1688159
Log:
MAILBOX-155 Adding WAIT instruction to MPT, requested by ElasticSearch 
indexation

Modified:

james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/FileProtocolSessionBuilder.java

james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/ProtocolSession.java

james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/ProtocolSessionBuilder.java

Modified: 
james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/FileProtocolSessionBuilder.java
URL: 
http://svn.apache.org/viewvc/james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/FileProtocolSessionBuilder.java?rev=1688159r1=1688158r2=1688159view=diff
==
--- 
james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/FileProtocolSessionBuilder.java
 (original)
+++ 
james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/FileProtocolSessionBuilder.java
 Mon Jun 29 08:56:41 2015
@@ -112,6 +112,13 @@ public class FileProtocolSessionBuilder
 }
 session.SL(sessionNumber, serverMsg, location, 
lastClientMsg);
 }
+else if (next.startsWith(WAIT)) {
+if (next.length()  5) {
+session.WAIT(sessionNumber, 
Long.valueOf(next.substring(5)));
+} else {
+throw new Exception(Invalid line length on WAIT 
instruction :  + next);
+}
+}
 else if (next.startsWith(OPEN_UNORDERED_BLOCK_TAG)) {
 ListString unorderedLines = new ArrayListString(5);
 next = reader.readLine();

Modified: 
james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/ProtocolSession.java
URL: 
http://svn.apache.org/viewvc/james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/ProtocolSession.java?rev=1688159r1=1688158r2=1688159view=diff
==
--- 
james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/ProtocolSession.java
 (original)
+++ 
james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/ProtocolSession.java
 Mon Jun 29 08:56:41 2015
@@ -179,6 +179,14 @@ public class ProtocolSession implements
 }
 
 /**
+ * adds a Wait condition
+ */
+public void WAIT(int sessionNumber, long timeToWaitInMs) {
+this.maxSessionNumber = Math.max(this.maxSessionNumber, sessionNumber);
+testElements.add(new WaitElement(timeToWaitInMs));
+}
+
+/**
  * A client request, which write the specified message to a Writer.
  */
 private static class ClientRequest implements ProtocolElement {
@@ -474,6 +482,28 @@ public class ProtocolSession implements
 public boolean isClient() {
 return false;
 }
+}
+
+/**
+ * Allow you to wait a given time at a given point of the test script
+ */
+private class WaitElement implements ProtocolElement {
+
+private final long timeToWaitInMs;
+
+public WaitElement(long timeToWaitInMs) {
+this.timeToWaitInMs = timeToWaitInMs;
+}
+
+@Override
+public void testProtocol(Session[] sessions, boolean 
continueAfterFailure) throws Exception {
+Thread.sleep(timeToWaitInMs);
+}
+
+@Override
+public boolean isClient() {
+return false;
+}
 }
 
 /**

Modified: 
james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/ProtocolSessionBuilder.java
URL: 
http://svn.apache.org/viewvc/james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/ProtocolSessionBuilder.java?rev=1688159r1=1688158r2=1688159view=diff
==
--- 
james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/ProtocolSessionBuilder.java
 (original)
+++ 
james/mpt/trunk/core/src/main/java/org/apache/james/mpt/protocol/ProtocolSessionBuilder.java
 Mon Jun 29 08:56:41 2015
@@ -38,7 +38,9 @@ import org.apache.james.mpt.api.Protocol
  * @version $Revision$
  */
 public class ProtocolSessionBuilder {
-
+
+public static final String WAIT = WAIT;
+
 public static final String SERVER_CONTINUATION_TAG = S: \\+;
 
 public static final String CLIENT_TAG = C:;



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (MAILBOX-245) Offer possibility to index non textual attachment in ElasticSearch

2015-06-29 Thread Tellier Benoit (JIRA)

 [ 
https://issues.apache.org/jira/browse/MAILBOX-245?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tellier Benoit resolved MAILBOX-245.

Resolution: Fixed

I just commited changes about this functionality

 Offer possibility to index non textual attachment in ElasticSearch
 --

 Key: MAILBOX-245
 URL: https://issues.apache.org/jira/browse/MAILBOX-245
 Project: James Mailbox
  Issue Type: Improvement
Reporter: Tellier Benoit

 Text can be extracted via apache Tika.
 This dependency should be optional ( in a separate module, with a profile to 
 produce an empty JAR ).
 Acceptance criteria :
  - We should be able to index PDF, libreoffice documents and Office 
 documents, and to make searches on their content.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Created] (MAILBOX-244) Create a profile to produce an empty Lucene Jar

2015-06-29 Thread Tellier Benoit (JIRA)
Tellier Benoit created MAILBOX-244:
--

 Summary: Create a profile to produce an empty Lucene Jar
 Key: MAILBOX-244
 URL: https://issues.apache.org/jira/browse/MAILBOX-244
 Project: James Mailbox
  Issue Type: Improvement
Reporter: Tellier Benoit


This allow us to avoid having conflicted Lucene dependency when using 
ElasticSearch at runtime.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688120 - in /james/mailbox/trunk/elasticsearch: ./ src/main/java/org/apache/james/mailbox/elasticsearch/query/ src/test/java/org/apache/james/mailbox/elasticsearch/query/

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:28:36 2015
New Revision: 1688120

URL: http://svn.apache.org/r1688120
Log:
MAILBOX-235 Conversions between James queries and ElasticSearch queries - many 
thanks to Matthieu Baechlor and Antoine Duprat for their reviews

Added:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/CriterionConverter.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/FilteredQueryCollector.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/FilteredQueryRepresentation.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/QueryConverter.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/query/FilteredQueryCollectorTest.java
Modified:
james/mailbox/trunk/elasticsearch/pom.xml

Modified: james/mailbox/trunk/elasticsearch/pom.xml
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/pom.xml?rev=1688120r1=1688119r2=1688120view=diff
==
--- james/mailbox/trunk/elasticsearch/pom.xml (original)
+++ james/mailbox/trunk/elasticsearch/pom.xml Mon Jun 29 08:28:36 2015
@@ -95,6 +95,7 @@
 dependency
 groupIdorg.assertj/groupId
 artifactIdassertj-core/artifactId
+version3.0.0/version
 scopetest/scope
 /dependency
 dependency

Added: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/CriterionConverter.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/CriterionConverter.java?rev=1688120view=auto
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/CriterionConverter.java
 (added)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/CriterionConverter.java
 Mon Jun 29 08:28:36 2015
@@ -0,0 +1,246 @@
+/
+ * 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.mailbox.elasticsearch.query;
+
+import org.apache.james.mailbox.elasticsearch.json.HeaderCollection;
+import org.apache.james.mailbox.elasticsearch.json.JsonMessageConstants;
+import org.apache.james.mailbox.model.SearchQuery;
+import org.apache.james.mailbox.model.SearchQuery.Criterion;
+import org.apache.james.mailbox.model.SearchQuery.HeaderOperator;
+
+import javax.mail.Flags;
+
+import java.util.Arrays;
+import java.util.HashMap;
+import java.util.Map;
+import java.util.function.BiFunction;
+import java.util.function.Function;
+
+import static org.elasticsearch.index.query.FilterBuilders.existsFilter;
+import static org.elasticsearch.index.query.FilterBuilders.rangeFilter;
+import static org.elasticsearch.index.query.FilterBuilders.termFilter;
+import static org.elasticsearch.index.query.QueryBuilders.boolQuery;
+import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;
+import static org.elasticsearch.index.query.QueryBuilders.matchQuery;
+import static org.elasticsearch.index.query.QueryBuilders.nestedQuery;
+import static java.time.format.DateTimeFormatter.ISO_OFFSET_DATE_TIME;
+
+public class CriterionConverter {
+
+private MapClass?, FunctionSearchQuery.Criterion, 
FilteredQueryRepresentation criterionConverterMap;
+private MapClass?, BiFunctionString, SearchQuery.HeaderOperator, 
FilteredQueryRepresentation headerOperatorConverterMap;
+
+public CriterionConverter() {
+criterionConverterMap = new HashMap();
+headerOperatorConverterMap = new HashMap();
+

svn commit: r1688121 - /james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/query/QueryConverterTest.java

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:29:02 2015
New Revision: 1688121

URL: http://svn.apache.org/r1688121
Log:
MAILBOX-235 Some tests for queries convertion

Added:

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/query/QueryConverterTest.java

Added: 
james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/query/QueryConverterTest.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/query/QueryConverterTest.java?rev=1688121view=auto
==
--- 
james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/query/QueryConverterTest.java
 (added)
+++ 
james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/query/QueryConverterTest.java
 Mon Jun 29 08:29:02 2015
@@ -0,0 +1,313 @@
+/
+ * 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.mailbox.elasticsearch.query;
+
+import org.apache.james.mailbox.model.SearchQuery;
+import org.elasticsearch.index.query.QueryBuilder;
+import org.junit.Before;
+import org.junit.Test;
+
+import java.text.SimpleDateFormat;
+
+import static net.javacrumbs.jsonunit.core.Option.IGNORING_ARRAY_ORDER;
+import static net.javacrumbs.jsonunit.core.Option.IGNORING_VALUES;
+import static net.javacrumbs.jsonunit.fluent.JsonFluentAssert.assertThatJson;
+
+import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
+
+public class QueryConverterTest {
+
+public static final String MAILBOX_UUID = 12345;
+
+private QueryConverter queryConverter;
+
+@Before
+public void setUp() {
+queryConverter = new QueryConverter(new CriterionConverter());
+}
+
+@Test
+public void allCriterionShouldBeWellConverted()throws Exception{
+SearchQuery searchQuery = new SearchQuery();
+searchQuery.andCriteria(SearchQuery.all());
+assertThatJson(queryConverter.from(searchQuery, 
MAILBOX_UUID).toXContent(jsonBuilder(), QueryBuilder.EMPTY_PARAMS).string())
+.isEqualTo({ +
+\filtered\: { +
+\query\: { +
+\bool\: { +
+\must\: { +
+\match_all\: {} +
+} +
+} +
+}, +
+\filter\: { +
+\bool\: { +
+\must\: { +
+\term\: { +
+\mailboxId\: \12345\ +
+} +
+} +
+} +
+} +
+} +
+})
+.when(IGNORING_ARRAY_ORDER);
+}
+
+@Test
+public void textCriterionShouldBeWellConverted() throws Exception {
+SearchQuery searchQuery = new SearchQuery();
+searchQuery.andCriteria(SearchQuery.bodyContains(awesome Linagora 
team));
+assertThatJson(queryConverter.from(searchQuery, 
MAILBOX_UUID).toXContent(jsonBuilder(), QueryBuilder.EMPTY_PARAMS).string())
+.isEqualTo({ +
+\filtered\: { +
+\query\: { +
+\bool\: { +
+\must\: { +
+\match\: { +
+\textBody\: { +
+\query\: \awesome Linagora 
team\, +
+\type\: \boolean\ +
+} +
+   

svn commit: r1688142 - in /james/mailbox/trunk: cassandra/src/main/resources/META-INF/spring/ elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ elasticsearch/src/main/java/org/apache

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:41:10 2015
New Revision: 1688142

URL: http://svn.apache.org/r1688142
Log:
MAILBOX-155 Replace NodeProvider by a ClientProvider - patch contributed by 
Antoine Duprat

Added:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ClientProvider.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ClientProviderImpl.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/utils/

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/utils/TestingClientProvider.java
Removed:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java
Modified:

james/mailbox/trunk/cassandra/src/main/resources/META-INF/spring/mailbox-cassandra.xml

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexer.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/IndexCreationFactory.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeMappingFactory.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/search/ElasticSearchSearcher.java

james/mailbox/trunk/elasticsearch/src/main/resources/META-INF/spring/mailbox-elasticsearch.xml

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexerTest.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java

Modified: 
james/mailbox/trunk/cassandra/src/main/resources/META-INF/spring/mailbox-cassandra.xml
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/cassandra/src/main/resources/META-INF/spring/mailbox-cassandra.xml?rev=1688142r1=1688141r2=1688142view=diff
==
--- 
james/mailbox/trunk/cassandra/src/main/resources/META-INF/spring/mailbox-cassandra.xml
 (original)
+++ 
james/mailbox/trunk/cassandra/src/main/resources/META-INF/spring/mailbox-cassandra.xml
 Mon Jun 29 08:41:10 2015
@@ -30,6 +30,7 @@
 constructor-arg index=0 ref=cassandra-sessionMapperFactory/
 constructor-arg index=1 ref=authenticator/
 constructor-arg index=2 ref=cassandra-locker/
+property name=messageSearchIndex ref=indexer/
 /bean
 
 bean id =cassandra-subscriptionManager 
class=org.apache.james.mailbox.cassandra.CassandraSubscriptionManager

Added: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ClientProvider.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ClientProvider.java?rev=1688142view=auto
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ClientProvider.java
 (added)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ClientProvider.java
 Mon Jun 29 08:41:10 2015
@@ -0,0 +1,26 @@
+/
+ * 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.mailbox.elasticsearch;
+
+import org.elasticsearch.client.Client;
+
+public interface ClientProvider {
+
+Client get();
+}

Added: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ClientProviderImpl.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ClientProviderImpl.java?rev=1688142view=auto

svn commit: r1688143 - /james/mailbox/trunk/cassandra/src/main/resources/META-INF/spring/mailbox-cassandra.xml

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:41:31 2015
New Revision: 1688143

URL: http://svn.apache.org/r1688143
Log:
MAILBOX-155 Define ElasticSearch as search index in Cassandra - patch 
contributed by Antoine Duprat

Modified:

james/mailbox/trunk/cassandra/src/main/resources/META-INF/spring/mailbox-cassandra.xml

Modified: 
james/mailbox/trunk/cassandra/src/main/resources/META-INF/spring/mailbox-cassandra.xml
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/cassandra/src/main/resources/META-INF/spring/mailbox-cassandra.xml?rev=1688143r1=1688142r2=1688143view=diff
==
--- 
james/mailbox/trunk/cassandra/src/main/resources/META-INF/spring/mailbox-cassandra.xml
 (original)
+++ 
james/mailbox/trunk/cassandra/src/main/resources/META-INF/spring/mailbox-cassandra.xml
 Mon Jun 29 08:41:31 2015
@@ -30,7 +30,7 @@
 constructor-arg index=0 ref=cassandra-sessionMapperFactory/
 constructor-arg index=1 ref=authenticator/
 constructor-arg index=2 ref=cassandra-locker/
-property name=messageSearchIndex ref=indexer/
+property name=messageSearchIndex ref=elasticsearch-listener/
 /bean
 
 bean id =cassandra-subscriptionManager 
class=org.apache.james.mailbox.cassandra.CassandraSubscriptionManager



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (MAILBOX-235) Convert James Query to ElasticSearch query.

2015-06-29 Thread Tellier Benoit (JIRA)

 [ 
https://issues.apache.org/jira/browse/MAILBOX-235?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tellier Benoit resolved MAILBOX-235.

Resolution: Fixed

I just commited patchs for this.

 Convert James Query to ElasticSearch query.
 ---

 Key: MAILBOX-235
 URL: https://issues.apache.org/jira/browse/MAILBOX-235
 Project: James Mailbox
  Issue Type: New Feature
Reporter: Tellier Benoit

 We should manage to convert James query into a combinaiseon of filters and 
 queries.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (MAILBOX-242) ElasticSearch indexer Event Listener

2015-06-29 Thread Tellier Benoit (JIRA)

 [ 
https://issues.apache.org/jira/browse/MAILBOX-242?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tellier Benoit resolved MAILBOX-242.

Resolution: Fixed

Thanks to Antoine Duprat.

 ElasticSearch indexer Event Listener
 

 Key: MAILBOX-242
 URL: https://issues.apache.org/jira/browse/MAILBOX-242
 Project: James Mailbox
  Issue Type: New Feature
Affects Versions: 0.6
Reporter: Tellier Benoit
 Fix For: 0.6


 Rationals
 Provide a class that updates the index upon events.
 This class should transform Create/Update/Delete events on messages to 
 indexation commands in ElasticSearch.
 This should use ElasticSearch client library
 Acceptance Criteria
 Provide some curl commands to add/modify/delete messages and to dump the 
 content of ElasticSearch indices.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Created] (MAILBOX-245) Offer possibility to index non textual attachment in ElasticSearch

2015-06-29 Thread Tellier Benoit (JIRA)
Tellier Benoit created MAILBOX-245:
--

 Summary: Offer possibility to index non textual attachment in 
ElasticSearch
 Key: MAILBOX-245
 URL: https://issues.apache.org/jira/browse/MAILBOX-245
 Project: James Mailbox
  Issue Type: Improvement
Reporter: Tellier Benoit


Text can be extracted via apache Tika.

This dependency should be optional ( in a separate module, with a profile to 
produce an empty JAR ).

Acceptance criteria :

 - We should be able to index PDF, libreoffice documents and Office documents, 
and to make searches on their content.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688117 [4/4] - in /james/mailbox/trunk/elasticsearch/src: main/java/org/apache/james/mailbox/elasticsearch/json/ test/java/org/apache/james/mailbox/elasticsearch/json/ test/resources/ te

2015-06-29 Thread btellier
Added: 
james/mailbox/trunk/elasticsearch/src/test/resources/documents/pgpSignedMail.eml
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/test/resources/documents/pgpSignedMail.eml?rev=1688117view=auto
==
--- 
james/mailbox/trunk/elasticsearch/src/test/resources/documents/pgpSignedMail.eml
 (added)
+++ 
james/mailbox/trunk/elasticsearch/src/test/resources/documents/pgpSignedMail.eml
 Mon Jun 29 08:26:08 2015
@@ -0,0 +1,136 @@
+Return-Path: bounce-debian-security-announce=benwa=minet@lists.debian.org
+Received: from mx2.minet.net (mx2.minet.net [192.168.102.26])
+by imap (Cyrus v2.4.16-Debian-2.4.16-4+deb7u1) with LMTPA;
+Wed, 03 Jun 2015 21:19:59 +0200
+X-Sieve: CMU Sieve 2.4
+Received: from localhost (spam.minet.net [192.168.102.97])
+   by mx2.minet.net (Postfix) with ESMTP id 8A9DAA27DA1
+   for be...@minet.net; Wed,  3 Jun 2015 21:20:03 +0200 (CEST)
+X-Virus-Scanned: by amavisd-new using ClamAV at minet.net
+X-Spam-Flag: NO
+X-Spam-Score: -1.51
+X-Spam-Level:
+X-Spam-Status: No, score=-1.51 required=1 tests=[BAYES_00=-1.5,
+   T_RP_MATCHES_RCVD=-0.01] autolearn=unavailable
+Received: from mx2.minet.net ([IPv6::::192.168.102.26])
+   by localhost (spam.minet.net [:::192.168.102.97]) (amavisd-new, 
port 10024)
+   with ESMTP id cF6J0AAnzsTX for be...@minet.net;
+   Wed,  3 Jun 2015 19:20:02 + (UTC)
+Received-SPF: None (no SPF record) identity=mailfrom; client-ip=82.195.75.100; 
helo=bendel.debian.org; 
envelope-from=bounce-debian-security-announce=benwa=minet@lists.debian.org; 
receiver=be...@minet.net
+Received: from bendel.debian.org (bendel.debian.org [82.195.75.100])
+   (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits))
+   (No client certificate requested)
+   by mx2.minet.net (Postfix) with ESMTPS id 7F69FA27D98
+   for be...@minet.net; Wed,  3 Jun 2015 21:20:01 +0200 (CEST)
+Received: from localhost (localhost [127.0.0.1])
+   by bendel.debian.org (Postfix) with QMQP
+   id 1C2F6275; Wed,  3 Jun 2015 19:14:50 + (UTC)
+Old-Return-Path: car...@master.debian.org
+X-Original-To: lists-debian-security-annou...@bendel.debian.org
+Delivered-To: lists-debian-security-annou...@bendel.debian.org
+Received: from localhost (localhost [127.0.0.1])
+   by bendel.debian.org (Postfix) with ESMTP id 7EFBF228
+   for lists-debian-security-annou...@bendel.debian.org; Wed,  3 Jun 
2015 19:14:39 + (UTC)
+X-Amavis-Spam-Status: No, score=-8.99 tagged_above=-1 required=5.3
+   tests=[BAYES_00=-2, DIGITS_LETTERS=1, FVGT_m_MULTI_ODD=0.02,
+   LDO_WHITELIST=-5, OUR_MTA_MSGID=2, PGPSIGNATURE=-5,
+   T_RP_MATCHES_RCVD=-0.01] autolearn=ham
+Received: from bendel.debian.org ([127.0.0.1])
+   by localhost (lists.debian.org [127.0.0.1]) (amavisd-new, port 2525)
+   with ESMTP id RiKdt2PVwXOm
+   for lists-debian-security-annou...@bendel.debian.org;
+   Wed,  3 Jun 2015 19:14:34 + (UTC)
+Received: from master.debian.org (master.debian.org 
[IPv6:2001:41b8:202:deb:216:36ff:fe40:4001])
+   (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits))
+   (Client CN master.debian.org, Issuer Debian SMTP CA (not verified))
+   by bendel.debian.org (Postfix) with ESMTPS id ABE761B7
+   for debian-security-annou...@lists.debian.org; Wed,  3 Jun 2015 
19:14:34 + (UTC)
+Received: from carnil by master.debian.org with local (Exim 4.84)
+   (envelope-from car...@master.debian.org)
+   id 1Z0E7U-0004Bc-Jv
+   for debian-security-annou...@lists.debian.org; Wed, 03 Jun 2015 
19:14:32 +
+From: Markus Koschany a...@gambaru.de
+To: debian-security-annou...@lists.debian.org
+Message-Id: e1z0e7u-0004bc...@master.debian.org
+Date: Wed, 03 Jun 2015 19:14:32 +
+X-Debian: PGP check passed for security officers
+Subject: [SECURITY] [DSA 3278-1] libapache-mod-jk security update
+Priority: urgent
+Reply-To: debian-secur...@lists.debian.org
+X-Rc-Virus: 2007-09-13_01
+X-Rc-Spam: 2008-11-04_01
+Resent-Message-ID: Aqb4x1ejWlF.A.ltC.qI1bVB@bendel
+Resent-From: debian-security-annou...@lists.debian.org
+X-Mailing-List: debian-security-annou...@lists.debian.org archive/latest/2089
+X-Loop: debian-security-annou...@lists.debian.org
+List-Id: debian-security-announce.lists.debian.org
+List-Post: mailto:debian-security-annou...@lists.debian.org
+List-Help: 
mailto:debian-security-announce-requ...@lists.debian.org?subject=help
+List-Subscribe: 
mailto:debian-security-announce-requ...@lists.debian.org?subject=subscribe
+List-Unsubscribe: 
mailto:debian-security-announce-requ...@lists.debian.org?subject=unsubscribe
+Precedence: list
+Resent-Sender: debian-security-announce-requ...@lists.debian.org
+Resent-Date: Wed,  3 Jun 2015 19:14:50 + (UTC)
+
+-BEGIN PGP SIGNED MESSAGE-
+Hash: SHA512
+
+- -

svn commit: r1688117 [2/4] - in /james/mailbox/trunk/elasticsearch/src: main/java/org/apache/james/mailbox/elasticsearch/json/ test/java/org/apache/james/mailbox/elasticsearch/json/ test/resources/ te

2015-06-29 Thread btellier
Added: 
james/mailbox/trunk/elasticsearch/src/test/resources/documents/htmlMail.eml
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/test/resources/documents/htmlMail.eml?rev=1688117view=auto
==
--- james/mailbox/trunk/elasticsearch/src/test/resources/documents/htmlMail.eml 
(added)
+++ james/mailbox/trunk/elasticsearch/src/test/resources/documents/htmlMail.eml 
Mon Jun 29 08:26:08 2015
@@ -0,0 +1,1489 @@
+Delivered-To: benoittelli...@gmail.com
+Received: by 10.28.170.202 with SMTP id t193csp327634wme;
+Thu, 4 Jun 2015 00:36:15 -0700 (PDT)
+X-Received: by 10.180.77.195 with SMTP id u3mr5042880wiw.30.1433403375307;
+Thu, 04 Jun 2015 00:36:15 -0700 (PDT)
+Return-Path: bounces+1453977-062b-benoittellier3=gmail@email.airbnb.com
+Received: from o7.email.airbnb.com (o7.email.airbnb.com. [167.89.32.249])
+by mx.google.com with ESMTPS id i2si5691730wjz.123.2015.06.04.00.36.13
+for benoittelli...@gmail.com
+(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
+Thu, 04 Jun 2015 00:36:15 -0700 (PDT)
+Received-SPF: pass (google.com: domain of 
bounces+1453977-062b-benoittellier3=gmail@email.airbnb.com designates 
167.89.32.249 as permitted sender) client-ip=167.89.32.249;
+Authentication-Results: mx.google.com;
+   spf=pass (google.com: domain of 
bounces+1453977-062b-benoittellier3=gmail@email.airbnb.com designates 
167.89.32.249 as permitted sender) 
smtp.mail=bounces+1453977-062b-benoittellier3=gmail@email.airbnb.com;
+   dkim=pass header.i=@email.airbnb.com;
+   dmarc=pass (p=REJECT dis=NONE) header.from=airbnb.com
+DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=email.airbnb.com;
+   h=from:to:subject:mime-version:content-type:content-transfer-encoding;
+   s=s20150428; bh=2mhWUwzjtQTC0KljgpaEsuvrqok=; b=EhC2QHKb5+63egDD
+   qDCAepUELCeUZXCkw8+31kGT+O1va3iAKvQSAvzXJ3qJlIL9FgdeFk8sR78Vszn/
+   A73vp6NGjAW60M4gUZjxEOIPzGKIS95KfmHxg10fXUOFW0uePojNEg4ZPCcuitrZ
+   HuWvzHK5I2siGnqupiivwxDgs5c=
+DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sendgrid.info;
+   
h=from:to:subject:mime-version:content-type:content-transfer-encoding:x-feedback-id;
+   s=smtpapi; bh=2mhWUwzjtQTC0KljgpaEsuvrqok=; b=FPiYMmNJLCrL2e8v/0
+   DQC4voofe8nuuE7rhXZ25oqNAhAQja4oKIysJ1qAME2aEaqh+N5aJlCEuHrSG/7+
+   NAQ0OY8KaJ2zlnxAbmgJETOjnf4oGdAa+nU/nVVEPfN2NRcBCNLGQZ80U4T5k8Xi
+   PakIuZvKDTRq7PiosSCSHT/FQ=
+Received: by filter0490p1mdw1.sendgrid.net with SMTP id 
filter0490p1mdw1.13271.556FFFE7B
+2015-06-04 07:36:09.249601779 + UTC
+Received: from i-dee0850e.inst.aws.airbnb.com 
(ec2-54-90-154-187.compute-1.amazonaws.com [54.90.154.187])
+   by ismtpd-017 (SG) with ESMTP id 14dbd7fa6b4.779a.254b43
+   for benoittelli...@gmail.com; Thu, 04 Jun 2015 07:36:09 + (UTC)
+Received: by i-dee0850e.inst.aws.airbnb.com (Postfix, from userid 1041)
+   id 19CBA24C60; Thu,  4 Jun 2015 07:36:09 + (UTC)
+Date: Thu, 04 Jun 2015 07:36:08 +
+From: Airbnb disco...@airbnb.com
+To: benoittelli...@gmail.com
+Message-ID: 556fffe8cac78_7ed0e0fe20445...@i-dee0850e.mail
+Subject: Regardez les meilleures destinations depuis Paris
+Mime-Version: 1.0
+Content-Type: multipart/alternative;
+ boundary=--==_mimepart_556fffe8c7e84_7ed0e0fe20445637;
+ charset=UTF-8
+Content-Transfer-Encoding: 7bit
+X-User-ID: 32692788
+X-Locale: fr
+X-Category: engagement
+X-Template: low_intent_top_destinations
+recipients:
+sent-on:
+X-SG-EID: 
mgVKhb3i1xMIKbRk82EYOUTMOPmiNk6g5BaWGQQKDTQchtClhw7VcIxig2BMwy1QMCr7h56hNVush8
+ 4aRV0ieMn+WZ1XVnpY0OcmMYNZnuuvlOoNkBaiuiqeWuKVZO9c9S5OyxPy7WQeI0mccenq35NpLqjI
+ nQt7IAl2sIUksUD4lM8Ai0u2C88YW13cL+Lo
+X-SG-ID: 
pQ7zy0fBcyQB3Gm22dZtqT6AR3zbAquH5ABZFkQfSKaxWRhz0YhtD36Li5uybRUjnPsuB21NpreKvG
+ t8iQBUn2ygs6hx6sMcgyI7L7bAY28p14Qj47KqA3JXbtMa0Xa3wdZaUUjZpemCg078XxMM5VaSHdDO
+ ChUhSV+z9RAJ38wAdUfXkpbO+m97vpU+mtWzVBoOrSiWCVYoNxPhvE4yIQ==
+X-Feedback-ID: 
1453977:N5+DXWRfRBXSDDbqVYXPNg8MjWYWwZibliGo1i/oSqY=:Ibl/atjs+SOcHCINmWWv/YvIGzDUihUrks9jdHsNF1+pafkc987UhcxmuyggxNgdCkEmMZDb9gJcndcUJy5KOw==:SG
+
+==_mimepart_556fffe8c7e84_7ed0e0fe20445637
+Content-Type: text/plain;
+ charset=UTF-8
+Content-Transfer-Encoding: quoted-printable
+
+Meilleures destinations depuis Paris
+D=C3=A9couvrez notre s=C3=A9lection de destinations populaires.
+
+Lisbonne - http://www.airbnb.fr/discovery/getaways?euid=3Ddf1e15a9-8137-607=
+a-5090-2285b5a2b578market=3DLisbonne
+Amsterdam - http://www.airbnb.fr/discovery/getaways?euid=3Ddf1e15a9-8137-60=
+7a-5090-2285b5a2b578market=3DAmsterdam
+New York - http://www.airbnb.fr/discovery/getaways?euid=3Ddf1e15a9-8137-607=
+a-5090-2285b5a2b578market=3DNew+York
+Londres - http://www.airbnb.fr/discovery/getaways?euid=3Ddf1e15a9-8137-607a=
+-5090-2285b5a2b578market=3DLondres
+
+Voir toutes les destinations
+https://www.airbnb.fr/go/Paris?euid=3Ddf1e15a9-8137-607a-5090-2285b5a2b578
+
+Merci,

svn commit: r1688117 [3/4] - in /james/mailbox/trunk/elasticsearch/src: main/java/org/apache/james/mailbox/elasticsearch/json/ test/java/org/apache/james/mailbox/elasticsearch/json/ test/resources/ te

2015-06-29 Thread btellier
Added: 
james/mailbox/trunk/elasticsearch/src/test/resources/documents/htmlMail.json
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/test/resources/documents/htmlMail.json?rev=1688117view=auto
==
--- 
james/mailbox/trunk/elasticsearch/src/test/resources/documents/htmlMail.json 
(added)
+++ 
james/mailbox/trunk/elasticsearch/src/test/resources/documents/htmlMail.json 
Mon Jun 29 08:26:08 2015
@@ -0,0 +1,159 @@
+{
+  id:25,
+  mailboxId:18,
+  modSeq:42,
+  size:25,
+  date:2015-06-07T00:00:00+02:00,
+  mediaType:plain,
+  subtype:text,
+  userFlags:[social,pocket-money],
+  headers:{
+date:[
+  Thu, 04 Jun 2015 07:36:08 +
+],
+mime-version:[
+  1.0
+],
+x-template:[
+  low_intent_top_destinations
+],
+x-category:[
+  engagement
+],
+return-path:[
+  bounces+1453977-062b-benoittellier3=gmail@email.airbnb.com
+],
+subject:[
+  Regardez les meilleures destinations depuis Paris
+
],x-sg-id:[pQ7zy0fBcyQB3Gm22dZtqT6AR3zbAquH5ABZFkQfSKaxWRhz0YhtD36Li5uybRUjnPsuB21NpreKvG
 t8iQBUn2ygs6hx6sMcgyI7L7bAY28p14Qj47KqA3JXbtMa0Xa3wdZaUUjZpemCg078XxMM5VaSHdDO 
ChUhSV+z9RAJ38wAdUfXkpbO+m97vpU+mtWzVBoOrSiWCVYoNxPhvE4yIQ==
+],
+received:[
+  by 10.28.170.202 with SMTP id t193csp327634wme;Thu, 4 Jun 2015 
00:36:15 -0700 (PDT),from o7.email.airbnb.com (o7.email.airbnb.com. 
[167.89.32.249])by mx.google.com with ESMTPS id 
i2si5691730wjz.123.2015.06.04.00.36.13for benoittelli...@gmail.com
(version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128);
Thu, 04 Jun 2015 00:36:15 -0700 (PDT),by filter0490p1mdw1.sendgrid.net with 
SMTP id filter0490p1mdw1.13271.556FFFE7B2015-06-04 07:36:09.249601779 
+ UTC,from i-dee0850e.inst.aws.airbnb.com 
(ec2-54-90-154-187.compute-1.amazonaws.com [54.90.154.187])\tby ismtpd-017 (SG) 
with ESMTP id 14dbd7fa6b4.779a.254b43\tfor benoittelli...@gmail.com; Thu, 04 
Jun 2015 07:36:09 + (UTC),by i-dee0850e.inst.aws.airbnb.com (Postfix, 
from userid 1041)\tid 19CBA24C60; Thu,  4 Jun 2015 07:36:09 + (UTC)
+],
+x-user-id:[
+  32692788
+],
+x-feedback-id:[
+  
1453977:N5+DXWRfRBXSDDbqVYXPNg8MjWYWwZibliGo1i/oSqY=:Ibl/atjs+SOcHCINmWWv/YvIGzDUihUrks9jdHsNF1+pafkc987UhcxmuyggxNgdCkEmMZDb9gJcndcUJy5KOw==:SG
+],
+content-transfer-encoding:[
+  7bit
+],
+x-locale:[
+  fr
+],
+received-spf:[
+  pass (google.com: domain of 
bounces+1453977-062b-benoittellier3=gmail@email.airbnb.com designates 
167.89.32.249 as permitted sender) client-ip=167.89.32.249;
+],
+delivered-to:[
+  benoittelli...@gmail.com
+],
+x-received:[
+  by 10.180.77.195 with SMTP id u3mr5042880wiw.30.1433403375307;
Thu, 04 Jun 2015 00:36:15 -0700 (PDT)
+],
+recipients:[
+  
+],
+x-sg-eid:[
+  
mgVKhb3i1xMIKbRk82EYOUTMOPmiNk6g5BaWGQQKDTQchtClhw7VcIxig2BMwy1QMCr7h56hNVush8 
4aRV0ieMn+WZ1XVnpY0OcmMYNZnuuvlOoNkBaiuiqeWuKVZO9c9S5OyxPy7WQeI0mccenq35NpLqjI 
nQt7IAl2sIUksUD4lM8Ai0u2C88YW13cL+Lo
+],
+message-id:[
+  556fffe8cac78_7ed0e0fe20445...@i-dee0850e.mail
+],
+from:[
+  Airbnb disco...@airbnb.com
+],
+content-type:[
+  multipart/alternative; 
boundary=\--==_mimepart_556fffe8c7e84_7ed0e0fe20445637\; charset=UTF-8
+],
+authentication-results:[
+  mx.google.com;   spf=pass (google.com: domain of 
bounces+1453977-062b-benoittellier3=gmail@email.airbnb.com designates 
167.89.32.249 as permitted sender) 
smtp.mail=bounces+1453977-062b-benoittellier3=gmail@email.airbnb.com;   
dkim=pass header.i=@email.airbnb.com;   dmarc=pass (p=REJECT dis=NONE) 
header.from=airbnb.com
+],
+to:[
+  benoittelli...@gmail.com
+],
+sent-on:[
+  
+],
+dkim-signature:[
+  v=1; a=rsa-sha1; c=relaxed; 
d=email.airbnb.com;\th=from:to:subject:mime-version:content-type:content-transfer-encoding;\ts=s20150428;
 bh=2mhWUwzjtQTC0KljgpaEsuvrqok=; 
b=EhC2QHKb5+63egDD\tqDCAepUELCeUZXCkw8+31kGT+O1va3iAKvQSAvzXJ3qJlIL9FgdeFk8sR78Vszn/\tA73vp6NGjAW60M4gUZjxEOIPzGKIS95KfmHxg10fXUOFW0uePojNEg4ZPCcuitrZ\tHuWvzHK5I2siGnqupiivwxDgs5c=,v=1;
 a=rsa-sha1; c=relaxed; 
d=sendgrid.info;\th=from:to:subject:mime-version:content-type:content-transfer-encoding:x-feedback-id;\ts=smtpapi;
 bh=2mhWUwzjtQTC0KljgpaEsuvrqok=; 
b=FPiYMmNJLCrL2e8v/0\tDQC4voofe8nuuE7rhXZ25oqNAhAQja4oKIysJ1qAME2aEaqh+N5aJlCEuHrSG/7+\tNAQ0OY8KaJ2zlnxAbmgJETOjnf4oGdAa+nU/nVVEPfN2NRcBCNLGQZ80U4T5k8Xi\tPakIuZvKDTRq7PiosSCSHT/FQ=
+]
+  },
+  from:[
+{
+  name:Airbnb,
+  address:disco...@airbnb.com
+}
+  ],
+  to:[
+{
+  name:benoittelli...@gmail.com,
+  address:benoittelli...@gmail.com
+}
+  ],
+  cc:[],
+  bcc:[],
+  subject:[
+Regardez les meilleures destinations depuis Paris
+  ],
+  sentDate:2015-06-04T07:36:08Z,
+  

svn commit: r1688118 - /james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/model/SearchQuery.java

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:26:30 2015
New Revision: 1688118

URL: http://svn.apache.org/r1688118
Log:
MAILBOX-235 Delete unused constants in Search Query

Modified:

james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/model/SearchQuery.java

Modified: 
james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/model/SearchQuery.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/model/SearchQuery.java?rev=1688118r1=1688117r2=1688118view=diff
==
--- 
james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/model/SearchQuery.java
 (original)
+++ 
james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/model/SearchQuery.java
 Mon Jun 29 08:26:30 2015
@@ -1845,12 +1845,6 @@ public class SearchQuery implements Seri
 public static final class NumericOperator implements Operator {
 private static final long serialVersionUID = 1L;
 
-public static final int EQUALS = 1;
-
-public static final int LESS_THAN = 2;
-
-public static final int GREATER_THAN = 3;
-
 private final long value;
 
 private final NumericComparator type;



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688117 [1/4] - in /james/mailbox/trunk/elasticsearch/src: main/java/org/apache/james/mailbox/elasticsearch/json/ test/java/org/apache/james/mailbox/elasticsearch/json/ test/resources/ te

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:26:08 2015
New Revision: 1688117

URL: http://svn.apache.org/r1688117
Log:
MAILBOX-234 Convert messages into JSON

Added:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessage.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MessageToElasticSearchJson.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/MessageToElasticSearchJsonTest.java
james/mailbox/trunk/elasticsearch/src/test/resources/
james/mailbox/trunk/elasticsearch/src/test/resources/documents/
james/mailbox/trunk/elasticsearch/src/test/resources/documents/htmlMail.eml
james/mailbox/trunk/elasticsearch/src/test/resources/documents/htmlMail.json
james/mailbox/trunk/elasticsearch/src/test/resources/documents/mail.eml
james/mailbox/trunk/elasticsearch/src/test/resources/documents/mail.json

james/mailbox/trunk/elasticsearch/src/test/resources/documents/pgpSignedMail.eml

james/mailbox/trunk/elasticsearch/src/test/resources/documents/pgpSignedMail.json

james/mailbox/trunk/elasticsearch/src/test/resources/documents/recursiveMail.eml

james/mailbox/trunk/elasticsearch/src/test/resources/documents/recursiveMail.json
james/mailbox/trunk/elasticsearch/src/test/resources/documents/spamMail.eml
james/mailbox/trunk/elasticsearch/src/test/resources/documents/spamMail.json
Modified:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/JsonMessageConstants.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MimePart.java

Added: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessage.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessage.java?rev=1688117view=auto
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessage.java
 (added)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessage.java
 Mon Jun 29 08:26:08 2015
@@ -0,0 +1,252 @@
+/
+ * 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.mailbox.elasticsearch.json;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.base.Preconditions;
+import com.google.common.base.Throwables;
+import com.google.common.collect.Multimap;
+import org.apache.james.mailbox.store.mail.model.MailboxId;
+import org.apache.james.mailbox.store.mail.model.Message;
+import org.apache.james.mailbox.store.mail.model.Property;
+import org.apache.james.mime4j.MimeException;
+
+import java.io.IOException;
+import java.time.Instant;
+import java.time.ZoneId;
+import java.time.ZonedDateTime;
+
+import static java.time.format.DateTimeFormatter.ISO_OFFSET_DATE_TIME;
+import java.util.List;
+import java.util.Optional;
+import java.util.Set;
+import java.util.stream.Collectors;
+
+public class IndexableMessage {
+
+public static IndexableMessage from(Message? extends MailboxId message) {
+Preconditions.checkNotNull(message.getMailboxId());
+IndexableMessage indexableMessage = new IndexableMessage();
+try {
+MimePart parsingResult = new MimePartParser(message).parse();
+indexableMessage.bodyText = parsingResult.locateFirstTextualBody();
+indexableMessage.setFlattenedAttachments(parsingResult);
+
indexableMessage.copyHeaderFields(parsingResult.getHeaderCollection(), 
getSanitizedInternalDate(message));
+} catch 

svn commit: r1688144 - /james/mailbox/trunk/spring/src/main/resources/META-INF/spring/spring-mailbox.xml

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:44:20 2015
New Revision: 1688144

URL: http://svn.apache.org/r1688144
Log:
MAILBOX-155 Add ElasticSearch in Cassandra profile - patch contributed by 
Antoine Duprat

Modified:

james/mailbox/trunk/spring/src/main/resources/META-INF/spring/spring-mailbox.xml

Modified: 
james/mailbox/trunk/spring/src/main/resources/META-INF/spring/spring-mailbox.xml
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/spring/src/main/resources/META-INF/spring/spring-mailbox.xml?rev=1688144r1=1688143r2=1688144view=diff
==
--- 
james/mailbox/trunk/spring/src/main/resources/META-INF/spring/spring-mailbox.xml
 (original)
+++ 
james/mailbox/trunk/spring/src/main/resources/META-INF/spring/spring-mailbox.xml
 Mon Jun 29 08:44:20 2015
@@ -56,5 +56,6 @@
 
 beans profile=cassandra
 import resource=classpath:META-INF/spring/mailbox-cassandra.xml/
+import 
resource=classpath:META-INF/spring/mailbox-elasticsearch.xml/
 /beans
 /beans



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688155 - in /james/server/trunk: app/pom.xml pom.xml

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:52:18 2015
New Revision: 1688155

URL: http://svn.apache.org/r1688155
Log:
MAILBOX-235 Include Tika dependency to Class Path

Modified:
james/server/trunk/app/pom.xml
james/server/trunk/pom.xml

Modified: james/server/trunk/app/pom.xml
URL: 
http://svn.apache.org/viewvc/james/server/trunk/app/pom.xml?rev=1688155r1=1688154r2=1688155view=diff
==
--- james/server/trunk/app/pom.xml (original)
+++ james/server/trunk/app/pom.xml Mon Jun 29 08:52:18 2015
@@ -472,6 +472,17 @@
 /dependency
 dependency
 groupIdorg.apache.james/groupId
+artifactIdapache-james-mailbox-tika/artifactId
+scoperuntime/scope
+exclusions
+exclusion
+artifactIdmail/artifactId
+groupIdjavax.mail/groupId
+/exclusion
+/exclusions
+/dependency
+dependency
+groupIdorg.apache.james/groupId
 artifactIdjames-server-data-file/artifactId
 scoperuntime/scope
 exclusions

Modified: james/server/trunk/pom.xml
URL: 
http://svn.apache.org/viewvc/james/server/trunk/pom.xml?rev=1688155r1=1688154r2=1688155view=diff
==
--- james/server/trunk/pom.xml (original)
+++ james/server/trunk/pom.xml Mon Jun 29 08:52:18 2015
@@ -519,6 +519,12 @@
 /dependency
 dependency
 groupIdorg.apache.james/groupId
+artifactIdapache-james-mailbox-tika/artifactId
+version${mailbox.version}/version
+scopetest/scope
+/dependency
+dependency
+groupIdorg.apache.james/groupId
 artifactIdapache-james-mailbox-spring/artifactId
 version${mailbox.version}/version
 /dependency



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



[jira] [Resolved] (MAILBOX-234) Convert Message into JSON

2015-06-29 Thread Tellier Benoit (JIRA)

 [ 
https://issues.apache.org/jira/browse/MAILBOX-234?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tellier Benoit resolved MAILBOX-234.

Resolution: Fixed

Changes commited.

Many thanks to Antoine Duprat and Matthieu Baechler for their reviews.

 Convert Message into JSON
 -

 Key: MAILBOX-234
 URL: https://issues.apache.org/jira/browse/MAILBOX-234
 Project: James Mailbox
  Issue Type: New Feature
Reporter: Tellier Benoit

 This would give us the ability to index e-mails in ElasticSearch.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688110 - in /james/mailbox/trunk: elasticsearch/ elasticsearch/pom.xml lucene/pom.xml pom.xml

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:22:19 2015
New Revision: 1688110

URL: http://svn.apache.org/r1688110
Log:
MAILBOX-234 Creating ElasticSearch module

Added:
james/mailbox/trunk/elasticsearch/
james/mailbox/trunk/elasticsearch/pom.xml
Modified:
james/mailbox/trunk/lucene/pom.xml
james/mailbox/trunk/pom.xml

Added: james/mailbox/trunk/elasticsearch/pom.xml
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/pom.xml?rev=1688110view=auto
==
--- james/mailbox/trunk/elasticsearch/pom.xml (added)
+++ james/mailbox/trunk/elasticsearch/pom.xml Mon Jun 29 08:22:19 2015
@@ -0,0 +1,253 @@
+?xml version=1.0 encoding=UTF-8?
+!--
+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.
+--
+project xmlns=http://maven.apache.org/POM/4.0.0; 
xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance; 
xsi:schemaLocation=http://maven.apache.org/POM/4.0.0 
http://maven.apache.org/xsd/maven-4.0.0.xsd;
+modelVersion4.0.0/modelVersion
+
+parent
+artifactIdapache-james-mailbox/artifactId
+groupIdorg.apache.james/groupId
+version0.6-SNAPSHOT/version
+relativePath../pom.xml/relativePath
+/parent
+
+
+artifactIdapache-james-mailbox-elasticsearch/artifactId
+descriptionApache James Mailbox IMAP search implementation using 
ElasticSearch/description
+
+properties
+javax.mail.groupIdjavax.mail/javax.mail.groupId
+javax.mail.artifactIdmail/javax.mail.artifactId
+/properties
+
+dependencies
+dependency
+groupId${project.groupId}/groupId
+artifactIdapache-james-mailbox-api/artifactId
+/dependency
+dependency
+groupId${project.groupId}/groupId
+artifactIdapache-james-mailbox-store/artifactId
+/dependency
+
+dependency
+groupIdcom.fasterxml.jackson.core/groupId
+artifactIdjackson-databind/artifactId
+/dependency
+dependency
+groupIdcom.fasterxml.jackson.datatype/groupId
+artifactIdjackson-datatype-guava/artifactId
+version2.3.3/version
+/dependency
+dependency
+groupIdcom.fasterxml.jackson.datatype/groupId
+artifactIdjackson-datatype-jdk8/artifactId
+version2.4.3/version
+/dependency
+dependency
+groupIdcom.google.guava/groupId
+artifactIdguava/artifactId
+version16.0/version
+/dependency
+dependency
+groupId${javax.mail.groupId}/groupId
+artifactId${javax.mail.artifactId}/artifactId
+/dependency
+dependency
+groupIdjunit/groupId
+artifactIdjunit/artifactId
+scopetest/scope
+/dependency
+dependency
+groupIdnet.javacrumbs.json-unit/groupId
+artifactIdjson-unit/artifactId
+version1.5.5/version
+scopetest/scope
+/dependency
+dependency
+groupIdnet.javacrumbs.json-unit/groupId
+artifactIdjson-unit-fluent/artifactId
+version1.5.5/version
+scopetest/scope
+/dependency
+dependency
+groupIdorg.assertj/groupId
+artifactIdassertj-core/artifactId
+scopetest/scope
+/dependency
+dependency
+groupIdorg.elasticsearch/groupId
+artifactIdelasticsearch/artifactId
+version1.5.2/version
+/dependency
+dependency
+groupIdorg.slf4j/groupId
+artifactIdslf4j-api/artifactId
+/dependency
+dependency
+groupIdorg.slf4j/groupId
+artifactIdslf4j-simple/artifactId
+scopetest/scope
+/dependency
+/dependencies
+
+profiles
+profile
+iddisable-build-for-older-jdk/id
+activation
+jdk(,1.8)/jdk
+/activation
+build
+plugins
+plugin
+artifactIdmaven-jar-plugin/artifactId
+executions
+   

svn commit: r1688112 - in /james/mailbox/trunk/elasticsearch/src: ./ main/ main/java/ main/java/org/ main/java/org/apache/ main/java/org/apache/james/ main/java/org/apache/james/mailbox/ main/java/org

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:23:16 2015
New Revision: 1688112

URL: http://svn.apache.org/r1688112
Log:
MAILBOX-234 Define constants used to generate message JSON

Added:
james/mailbox/trunk/elasticsearch/src/
james/mailbox/trunk/elasticsearch/src/main/
james/mailbox/trunk/elasticsearch/src/main/java/
james/mailbox/trunk/elasticsearch/src/main/java/org/
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/JsonMessageConstants.java

Added: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/JsonMessageConstants.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/JsonMessageConstants.java?rev=1688112view=auto
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/JsonMessageConstants.java
 (added)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/JsonMessageConstants.java
 Mon Jun 29 08:23:16 2015
@@ -0,0 +1,69 @@
+/
+ * 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.mailbox.elasticsearch.json;
+
+public interface JsonMessageConstants {
+
+/*
+Properties defined by JMAP
+ */
+String ID = id;
+String MAILBOX_ID = mailboxId;
+String IS_UNREAD = isUnread;
+String IS_FLAGGED = isFlagged;
+String IS_ANSWERED = isAnswered;
+String IS_DRAFT = isDraft;
+String HEADERS = headers;
+String FROM = from;
+String TO = to;
+String CC = cc;
+String BCC = bcc;
+String SUBJECT = subject;
+String DATE = date;
+String SIZE = size;
+String TEXT_BODY = textBody;
+String SENT_DATE = sentDate;
+
+/*
+James properties we can easily get
+ */
+String PROPERTIES = properties;
+String MODSEQ = modSeq;
+String USER_FLAGS = userFlags;
+String IS_RECENT = isRecent;
+String IS_DELETED = isDeleted;
+String MEDIA_TYPE = mediaType;
+String SUBTYPE = subtype;
+String HAS_ATTACHMENT = hasAttachment;
+
+interface EMailer {
+String NAME = name;
+String ADDRESS = address;
+}
+
+interface Attachment {
+String TEXT_CONTENT = textContent;
+String MEDIA_TYPE = mediaType;
+String SUBTYPE = subtype;
+String CONTENT_DISPOSITION = contentDisposition;
+String FILENAME = fileName;
+String FILE_EXTENSION = fileExtension;
+}
+}



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688111 - /james/mailbox/trunk/elasticsearch/jsonStructure.adoc

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:22:39 2015
New Revision: 1688111

URL: http://svn.apache.org/r1688111
Log:
MAILBOX-234 Documentation of JSON structure

Added:
james/mailbox/trunk/elasticsearch/jsonStructure.adoc

Added: james/mailbox/trunk/elasticsearch/jsonStructure.adoc
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/jsonStructure.adoc?rev=1688111view=auto
==
--- james/mailbox/trunk/elasticsearch/jsonStructure.adoc (added)
+++ james/mailbox/trunk/elasticsearch/jsonStructure.adoc Mon Jun 29 08:22:39 
2015
@@ -0,0 +1,64 @@
+= Structure of indexed documents
+
+== Message
+
+A message is transformed in JSON in a way that looks like JMAP.
+
+A message has the following fields :
+ - An *id* : corresponds to the message uid. This fields is a long.
+ - A *mailboxId* : identifies in which mailbox this message belongs. This 
field is a string.
+ - A *date* : corresponds to the internal date ( date James parse it and 
APPENDED it to a mailbox ). This field is a date this the following format : 
-MM-dd HH:mm:ssZZ ( Z is the offset with GMT ), corresponding to the 
date_time_no_millis ElasticSearch date format. Note that if the internal date 
is null, current time will be used instead.
+ - A *size* : Number of bytes composing this message. This field is a long.
+ - A *hasAttachments* : Tells you if this message has attachments. This field 
is a boolean.
+ - A *mediaType* : First part of the contentType for the Maim MIME part. This 
field is a string.
+ - A *subType* : Second part of the contentType for the Maim MIME par. This 
field is a string.
+ - A *modSeq* : Corresponds to IMAP modification sequence of this mail. This 
field is a long.
+ - *headers* : A multimap of header name to (decoded) list of header value for 
all headers in the message. This field is a nested document using header names 
as key and list of strings as value ( corresponding to the list of the 
corresponding header values ).
+ - *attachments* : An array of Attachments Json object. See below.
+ - *properties* : An Array of property. See below.
+ - *textBody* : Text body. Corresponds to what a user should see in an e-mail 
client. If this message is not multipart, we will use the Body. If it is 
multipart, we will use the first textual mime part body found. This field is a 
string.
+
+Flags properties are directly attached to the Json message structure. You will 
found :
+ - *isAnswered* : Is this message answered ? This field is a boolean.
+ - *isDeleted* : Is this message deleted ? This field is a boolean.
+ - *isDraft* : Is this message a draft ? This field is a boolean.
+ - *isFlagged* : Is this message flagged ? This field is a boolean.
+ - *isRecent* : Is this message recent ? This field is a boolean.
+ - *isUnread* : Is this message unread ? This field is a boolean.
+ - *userFlags* : List of the user flags attached to this e-mail. This field is 
a array of strings.
+
+Some informations are extracted from the headers :
+ - *from* : Emailers at the origin of the e-mail. Array of Emailer.
+ - *to* : Emailers for who this Email was sent. Array of Emailer.
+ - *cc* : Emailers notified about this e-mail. Array of Emailer.
+ - *bcc* : Emailers blindly notified about this e-mail. Array of Emailer.
+ - *sentDate* : Date this message was sent. This field is a date this the 
following format : -MM-dd HH:mm:ssZZ ( Z is the offset with GMT ), 
corresponding to the date_time_no_millis ElasticSearch date format. If null, 
non parsable or absent from headers, this field is set to the internal date.
+ - *subject* : Subject for this message. As several Subject headers can be 
found, this field is an array of string.
+
+== Emailer
+
+An Emailer represents someone sending an e-mail.
+
+It has the following properties :
+
+ - A *name* : The Fully qualified name of the Emailer. This field is a string.
+ - An *email* : The email of the emailer. This field is a string.
+
+== Attachments
+
+An attachment is composed of the following fields :
+ - A *mediaType* : Similar to the message property. This is a string field.
+ - A *subType* : Similar to the message property. This is a string field.
+ - A *contentDisposition* : Content-Disposition header field extracted. This 
is a string field.
+ - A *fileName* : Name of the attached file. This is a string field.
+ - A *fileExtension* : Extension part of the file name. This is a string field.
+
+== Properties
+
+A property is a string value computed by James when storing the message.
+
+A property contains :
+
+ - A *namespace* : identifies the domain of this property. This field is a 
string.
+ - A *name* : identifies this property. This field is a string.
+ - A *value* : value of the property. This field is a string.
\ No newline at end of file



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, 

svn commit: r1688135 - in /james/mailbox/trunk/elasticsearch/src: main/java/org/apache/james/mailbox/elasticsearch/json/ main/java/org/apache/james/mailbox/elasticsearch/query/ test/resources/document

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:37:10 2015
New Revision: 1688135

URL: http://svn.apache.org/r1688135
Log:
MAILBOX-242 Implement a node provider in order to connect to ElasticSearch as a 
client node - patch contributed by Antoine Duprat

Modified:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessage.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/CriterionConverter.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/DateResolutionFormater.java
james/mailbox/trunk/elasticsearch/src/test/resources/documents/htmlMail.json

james/mailbox/trunk/elasticsearch/src/test/resources/documents/pgpSignedMail.json
james/mailbox/trunk/elasticsearch/src/test/resources/documents/spamMail.json

Modified: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessage.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessage.java?rev=1688135r1=1688134r2=1688135view=diff
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessage.java
 (original)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/IndexableMessage.java
 Mon Jun 29 08:37:10 2015
@@ -23,6 +23,7 @@ import com.fasterxml.jackson.annotation.
 import com.google.common.base.Preconditions;
 import com.google.common.base.Throwables;
 import com.google.common.collect.Multimap;
+import org.apache.james.mailbox.elasticsearch.query.DateResolutionFormater;
 import org.apache.james.mailbox.store.mail.model.MailboxId;
 import org.apache.james.mailbox.store.mail.model.Message;
 import org.apache.james.mailbox.store.mail.model.Property;
@@ -33,7 +34,6 @@ import java.time.Instant;
 import java.time.ZoneId;
 import java.time.ZonedDateTime;
 
-import static java.time.format.DateTimeFormatter.ISO_OFFSET_DATE_TIME;
 import java.util.List;
 import java.util.Optional;
 import java.util.Set;
@@ -68,9 +68,7 @@ public class IndexableMessage {
 this.to = headerCollection.getToAddressSet();
 this.cc = headerCollection.getCcAddressSet();
 this.bcc = headerCollection.getBccAddressSet();
-this.sentDate = ISO_OFFSET_DATE_TIME.format(
-headerCollection.getSentDate()
-.orElse(internalDate));
+this.sentDate = 
DateResolutionFormater.DATE_TIME_FOMATTER.format(headerCollection.getSentDate().orElse(internalDate));
 }
 
 private void copyMessageFields(Message? extends MailboxId message) {
@@ -78,7 +76,7 @@ public class IndexableMessage {
 this.mailboxId = message.getMailboxId().serialize();
 this.modSeq = message.getModSeq();
 this.size = message.getFullContentOctets();
-this.date = 
ISO_OFFSET_DATE_TIME.format(getSanitizedInternalDate(message));
+this.date = 
DateResolutionFormater.DATE_TIME_FOMATTER.format(getSanitizedInternalDate(message));
 this.mediaType = message.getMediaType();
 this.subType = message.getSubType();
 this.isAnswered = message.isAnswered();

Modified: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/CriterionConverter.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/CriterionConverter.java?rev=1688135r1=1688134r2=1688135view=diff
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/CriterionConverter.java
 (original)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/CriterionConverter.java
 Mon Jun 29 08:37:10 2015
@@ -40,7 +40,6 @@ import static org.elasticsearch.index.qu
 import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;
 import static org.elasticsearch.index.query.QueryBuilders.matchQuery;
 import static org.elasticsearch.index.query.QueryBuilders.nestedQuery;
-import static java.time.format.DateTimeFormatter.ISO_OFFSET_DATE_TIME;
 
 public class CriterionConverter {
 
@@ -129,8 +128,8 @@ public class CriterionConverter {
 
 private FilteredQueryRepresentation dateRangeFilter(String field, 
SearchQuery.DateOperator dateOperator) {
 SearchQuery.DateResolution dateResolution = 
dateOperator.getDateResultion();
-String lowDateString = 
ISO_OFFSET_DATE_TIME.format(DateResolutionFormater.computeLowerDate(DateResolutionFormater.convertDateToZonedDateTime(dateOperator.getDate()),
 dateResolution));
-String upDateString = ISO_OFFSET_DATE_TIME.format(
+String lowDateString = 

svn commit: r1688137 - /james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:38:09 2015
New Revision: 1688137

URL: http://svn.apache.org/r1688137
Log:
MAILBOX-234 Dates extraction from headers

Modified:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java

Modified: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java?rev=1688137r1=1688136r2=1688137view=diff
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java
 (original)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java
 Mon Jun 29 08:38:09 2015
@@ -26,14 +26,12 @@ import org.elasticsearch.node.Node;
 public class NodeProvider {
 
 private static final String GLOBAL_NETWORK_HOST_SETTING = network.host;
-private static final String SCRIPT_DISABLE_DYNAMIC = 
script.disable_dynamic;
 
 public static Node createNodeForClusterName(String clusterName, String 
masterHost) {
 return nodeBuilder()
 .clusterName(clusterName)
 .settings(ImmutableSettings.builder()
-.put(GLOBAL_NETWORK_HOST_SETTING, masterHost)
-.put(SCRIPT_DISABLE_DYNAMIC, true))
+.put(GLOBAL_NETWORK_HOST_SETTING, masterHost))
 .client(true)
 .node()
 .start();



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688136 - in /james/mailbox/trunk/elasticsearch/src: main/java/org/apache/james/mailbox/elasticsearch/query/CriterionConverter.java test/java/org/apache/james/mailbox/elasticsearch/Elasti

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:37:39 2015
New Revision: 1688136

URL: http://svn.apache.org/r1688136
Log:
MAILBOX-234 ElasticSearch project creation - patch contributed by Antoine Duprat

Modified:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/CriterionConverter.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java

Modified: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/CriterionConverter.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/CriterionConverter.java?rev=1688136r1=1688135r2=1688136view=diff
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/CriterionConverter.java
 (original)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/query/CriterionConverter.java
 Mon Jun 29 08:37:39 2015
@@ -60,17 +60,13 @@ public class CriterionConverter {
 registerCriterionConverter(SearchQuery.ConjunctionCriterion.class, 
this::convertConjunction);
 registerCriterionConverter(SearchQuery.InternalDateCriterion.class, 
this::convertInternalDate);
 registerCriterionConverter(SearchQuery.HeaderCriterion.class, 
this::convertHeader);
+registerCriterionConverter(SearchQuery.TextCriterion.class, 
this::convertTextCriterion);
 
 registerCriterionConverter(
 SearchQuery.AllCriterion.class, 
 criterion - 
FilteredQueryRepresentation.fromQuery(matchAllQuery()));
 
 registerCriterionConverter(
-SearchQuery.TextCriterion.class,
-criterion - FilteredQueryRepresentation.fromQuery(
-matchQuery(JsonMessageConstants.TEXT_BODY, 
criterion.getOperator().getValue(;
-
-registerCriterionConverter(
 SearchQuery.ModSeqCriterion.class,
 criterion - createNumericFilter(JsonMessageConstants.MODSEQ, 
criterion.getOperator()));
 
@@ -121,6 +117,22 @@ public class CriterionConverter {
 return 
criterionConverterMap.get(criterion.getClass()).apply(criterion);
 }
 
+
+private FilteredQueryRepresentation 
convertTextCriterion(SearchQuery.TextCriterion textCriterion) {
+switch (textCriterion.getType()) {
+case BODY:
+return FilteredQueryRepresentation.fromQuery(
+matchQuery(JsonMessageConstants.TEXT_BODY, 
textCriterion.getOperator().getValue()));
+case FULL:
+return FilteredQueryRepresentation.fromQuery(
+boolQuery()
+.should(matchQuery(JsonMessageConstants.TEXT_BODY, 
textCriterion.getOperator().getValue()))
+.should(matchQuery(JsonMessageConstants.ATTACHMENTS + . 
+ JsonMessageConstants.Attachment.TEXT_CONTENT,
+textCriterion.getOperator().getValue(;
+}
+throw new RuntimeException(Unknown SCOPE for text criterion);
+}
+
 private FilteredQueryRepresentation 
convertInternalDate(SearchQuery.InternalDateCriterion dateCriterion) {
 SearchQuery.DateOperator dateOperator = dateCriterion.getOperator();
 return dateRangeFilter(JsonMessageConstants.DATE, dateOperator);

Modified: 
james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java?rev=1688136r1=1688135r2=1688136view=diff
==
--- 
james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java
 (original)
+++ 
james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java
 Mon Jun 29 08:37:39 2015
@@ -512,4 +512,12 @@ public class ElasticSearchIntegrationTes
 .containsOnly(4L, 9L);
 }
 
+@Test
+public void 
mailsContainsShouldIncludeMailHavingAttachmentsMatchingTheRequest() throws 
Exception {
+SearchQuery searchQuery = new SearchQuery();
+searchQuery.andCriteria(SearchQuery.mailContains(root mailing list));
+assertThat(elasticSearchListeningMessageSearchIndex.search(session, 
mailbox, searchQuery))
+.containsOnly(1L, 6L);
+}
+
 }



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688157 - in /james/mpt/trunk/impl/imap-mailbox: inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java maildir/src/test/java/org/apache/james/mpt/i

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:55:34 2015
New Revision: 1688157

URL: http://svn.apache.org/r1688157
Log:
MAILBOX-236 make use of strong types for Mailbox id - patch commited by 
Matthieu Baechler

Modified:

james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java

james/mpt/trunk/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java

Modified: 
james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java
URL: 
http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java?rev=1688157r1=1688156r2=1688157view=diff
==
--- 
james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java
 (original)
+++ 
james/mpt/trunk/impl/imap-mailbox/inmemory/src/test/java/org/apache/james/mpt/imapmailbox/inmemory/host/InMemoryHostSystem.java
 Mon Jun 29 08:55:34 2015
@@ -28,6 +28,7 @@ import org.apache.james.mailbox.acl.Mail
 import org.apache.james.mailbox.acl.SimpleGroupMembershipResolver;
 import org.apache.james.mailbox.acl.UnionMailboxACLResolver;
 import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.inmemory.InMemoryId;
 import org.apache.james.mailbox.inmemory.InMemoryMailboxSessionMapperFactory;
 import org.apache.james.mailbox.model.MailboxPath;
 import org.apache.james.mailbox.store.MockAuthenticator;
@@ -38,7 +39,7 @@ import org.apache.james.mpt.imapmailbox.
 
 public class InMemoryHostSystem extends JamesImapHostSystem {
 
-private StoreMailboxManagerLong mailboxManager;
+private StoreMailboxManagerInMemoryId mailboxManager;
 private MockAuthenticator userManager; 
 private InMemoryMailboxSessionMapperFactory factory;
 
@@ -67,7 +68,7 @@ public class InMemoryHostSystem extends
 MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
 GroupMembershipResolver groupMembershipResolver = new 
SimpleGroupMembershipResolver();
 
-mailboxManager = new StoreMailboxManagerLong(factory, userManager, 
aclResolver, groupMembershipResolver);
+mailboxManager = new StoreMailboxManagerInMemoryId(factory, 
userManager, aclResolver, groupMembershipResolver);
 mailboxManager.init();
 
 final ImapProcessor defaultImapProcessorFactory = 
DefaultImapProcessorFactory.createDefaultProcessor(mailboxManager, new 
StoreSubscriptionManager(factory));

Modified: 
james/mpt/trunk/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
URL: 
http://svn.apache.org/viewvc/james/mpt/trunk/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java?rev=1688157r1=1688156r2=1688157view=diff
==
--- 
james/mpt/trunk/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
 (original)
+++ 
james/mpt/trunk/impl/imap-mailbox/maildir/src/test/java/org/apache/james/mpt/imapmailbox/maildir/host/MaildirHostSystem.java
 Mon Jun 29 08:55:34 2015
@@ -30,6 +30,7 @@ import org.apache.james.mailbox.acl.Mail
 import org.apache.james.mailbox.acl.SimpleGroupMembershipResolver;
 import org.apache.james.mailbox.acl.UnionMailboxACLResolver;
 import org.apache.james.mailbox.exception.MailboxException;
+import org.apache.james.mailbox.maildir.MaildirId;
 import org.apache.james.mailbox.maildir.MaildirMailboxSessionMapperFactory;
 import org.apache.james.mailbox.maildir.MaildirStore;
 import org.apache.james.mailbox.model.MailboxPath;
@@ -45,7 +46,7 @@ public class MaildirHostSystem extends J
 public static final String META_DATA_DIRECTORY = target/user-meta-data;
 private static final String MAILDIR_HOME = target/Maildir;
 
-private final StoreMailboxManagerInteger mailboxManager;
+private final StoreMailboxManagerMaildirId mailboxManager;
 private final MockAuthenticator userManager;
 private final MaildirMailboxSessionMapperFactory 
mailboxSessionMapperFactory;
 
@@ -63,7 +64,7 @@ public class MaildirHostSystem extends J
 MailboxACLResolver aclResolver = new UnionMailboxACLResolver();
 GroupMembershipResolver groupMembershipResolver = new 
SimpleGroupMembershipResolver();
 
-mailboxManager = new 
StoreMailboxManagerInteger(mailboxSessionMapperFactory, userManager, locker, 
aclResolver, groupMembershipResolver);
+mailboxManager = new 
StoreMailboxManagerMaildirId(mailboxSessionMapperFactory, userManager, 
locker, aclResolver, groupMembershipResolver);
 mailboxManager.init();
 
 final ImapProcessor 

[jira] [Commented] (MAILBOX-155) Add elasticsearch based search index

2015-06-29 Thread Tellier Benoit (JIRA)

[ 
https://issues.apache.org/jira/browse/MAILBOX-155?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanelfocusedCommentId=14605321#comment-14605321
 ] 

Tellier Benoit commented on MAILBOX-155:


I just added this functionnality.

Can someone resolve this issue ( I do not have rights to do this )

 Add elasticsearch based search index
 

 Key: MAILBOX-155
 URL: https://issues.apache.org/jira/browse/MAILBOX-155
 Project: James Mailbox
  Issue Type: New Feature
Reporter: Norman Maurer
Assignee: Norman Maurer
 Attachments: MAILBOX-155.patch






--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688125 - in /james/mailbox/trunk/elasticsearch/src: main/java/org/apache/james/mailbox/elasticsearch/ main/resources/META-INF/spring/ test/java/org/apache/james/mailbox/elasticsearch/

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:32:05 2015
New Revision: 1688125

URL: http://svn.apache.org/r1688125
Log:
MAILBOX-242 Implement an ElasticSearch indexer for basic index, update  delete 
methods - patch contributed by Antoine Duprat

Added:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexer.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexerTest.java
Modified:

james/mailbox/trunk/elasticsearch/src/main/resources/META-INF/spring/mailbox-elasticsearch.xml

Added: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexer.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexer.java?rev=1688125view=auto
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexer.java
 (added)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexer.java
 Mon Jun 29 08:32:05 2015
@@ -0,0 +1,79 @@
+/
+ * 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.mailbox.elasticsearch;
+
+import org.elasticsearch.action.delete.DeleteResponse;
+import org.elasticsearch.action.deletebyquery.DeleteByQueryResponse;
+import org.elasticsearch.action.index.IndexResponse;
+import org.elasticsearch.action.update.UpdateResponse;
+import org.elasticsearch.client.Client;
+import org.elasticsearch.index.query.QueryBuilders;
+import org.elasticsearch.node.Node;
+
+import com.google.common.base.Preconditions;
+
+public class ElasticSearchIndexer {
+
+public static final String MAILBOX_INDEX = mailbox;
+public static final String MESSAGE_TYPE = message;
+
+private final Node node;
+
+public ElasticSearchIndexer(Node node) {
+this.node = node;
+}
+
+public IndexResponse indexMessage(String id, String content) {
+checkArgument(content);
+try (Client client = node.client()) {
+return client.prepareIndex(MAILBOX_INDEX, MESSAGE_TYPE, id)
+.setSource(content)
+.get();
+}
+}
+
+public UpdateResponse updateMessage(String id, String content) {
+checkArgument(content);
+try (Client client = node.client()) {
+return client.prepareUpdate(MAILBOX_INDEX, MESSAGE_TYPE, id)
+.setDoc(content)
+.get();
+}
+}
+
+public DeleteResponse deleteMessage(String id) {
+try (Client client = node.client()) {
+return client.prepareDelete(MAILBOX_INDEX, MESSAGE_TYPE, id)
+.get();
+}
+}
+
+public DeleteByQueryResponse deleteAllWithIdStarting(String idStart) {
+try (Client client = node.client()) {
+return client.prepareDeleteByQuery(MAILBOX_INDEX)
+.setTypes(MESSAGE_TYPE)
+.setQuery(QueryBuilders.prefixQuery(_id, idStart))
+.get();
+}
+}
+
+private void checkArgument(String content) {
+Preconditions.checkArgument(content != null, content should be 
provided);
+}
+}

Modified: 
james/mailbox/trunk/elasticsearch/src/main/resources/META-INF/spring/mailbox-elasticsearch.xml
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/resources/META-INF/spring/mailbox-elasticsearch.xml?rev=1688125r1=1688124r2=1688125view=diff
==
--- 
james/mailbox/trunk/elasticsearch/src/main/resources/META-INF/spring/mailbox-elasticsearch.xml
 (original)
+++ 

svn commit: r1688126 - /james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/model/MessageRange.java

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:32:38 2015
New Revision: 1688126

URL: http://svn.apache.org/r1688126
Log:
MAILBOX-242 Add equals  hashCode methods to MessageRange (generated by 
Eclipse) - patch contributed by Antoine Duprat

Modified:

james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/model/MessageRange.java

Modified: 
james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/model/MessageRange.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/model/MessageRange.java?rev=1688126r1=1688125r2=1688126view=diff
==
--- 
james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/model/MessageRange.java
 (original)
+++ 
james/mailbox/trunk/api/src/main/java/org/apache/james/mailbox/model/MessageRange.java
 Mon Jun 29 08:32:38 2015
@@ -165,7 +165,6 @@ public class MessageRange implements Ite
 return TYPE:  + type +  UID:  + uidFrom + : + uidTo;
 }
 
-
 /**
  * Converts the given {@link Collection} of uids to a {@link List} of 
{@link MessageRange} instances
  * 
@@ -298,4 +297,32 @@ public class MessageRange implements Ite
 }
 return ranges;
 }
+
+@Override
+public int hashCode() {
+final int prime = 31;
+int result = 1;
+result = prime * result + ((type == null) ? 0 : type.hashCode());
+result = prime * result + (int) (uidFrom ^ (uidFrom  32));
+result = prime * result + (int) (uidTo ^ (uidTo  32));
+return result;
+}
+
+@Override
+public boolean equals(Object obj) {
+if (this == obj)
+return true;
+if (obj == null)
+return false;
+if (getClass() != obj.getClass())
+return false;
+MessageRange other = (MessageRange) obj;
+if (type != other.type)
+return false;
+if (uidFrom != other.uidFrom)
+return false;
+if (uidTo != other.uidTo)
+return false;
+return true;
+}
 }



-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688124 - in /james/mailbox/trunk/elasticsearch/src/main: java/org/apache/james/mailbox/elasticsearch/NodeProvider.java resources/ resources/META-INF/ resources/META-INF/spring/ resources

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:31:36 2015
New Revision: 1688124

URL: http://svn.apache.org/r1688124
Log:
MAILBOX-242 Implement a node provider in order to connect to ElasticSearch as a 
client node - patch contributed by Antoine Duprat

Added:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java
james/mailbox/trunk/elasticsearch/src/main/resources/
james/mailbox/trunk/elasticsearch/src/main/resources/META-INF/
james/mailbox/trunk/elasticsearch/src/main/resources/META-INF/spring/

james/mailbox/trunk/elasticsearch/src/main/resources/META-INF/spring/mailbox-elasticsearch.xml

Added: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java?rev=1688124view=auto
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java
 (added)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/NodeProvider.java
 Mon Jun 29 08:31:36 2015
@@ -0,0 +1,41 @@
+/
+ * 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.mailbox.elasticsearch;
+
+import static org.elasticsearch.node.NodeBuilder.nodeBuilder;
+
+import org.elasticsearch.common.settings.ImmutableSettings;
+import org.elasticsearch.node.Node;
+
+public class NodeProvider {
+
+private static final String GLOBAL_NETWORK_HOST_SETTING = network.host;
+private static final String SCRIPT_DISABLE_DYNAMIC = 
script.disable_dynamic;
+
+public static Node createNodeForClusterName(String clusterName, String 
masterHost) {
+return nodeBuilder()
+.clusterName(clusterName)
+.settings(ImmutableSettings.builder()
+.put(GLOBAL_NETWORK_HOST_SETTING, masterHost)
+.put(SCRIPT_DISABLE_DYNAMIC, true))
+.client(true)
+.node()
+.start();
+}
+}

Added: 
james/mailbox/trunk/elasticsearch/src/main/resources/META-INF/spring/mailbox-elasticsearch.xml
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/resources/META-INF/spring/mailbox-elasticsearch.xml?rev=1688124view=auto
==
--- 
james/mailbox/trunk/elasticsearch/src/main/resources/META-INF/spring/mailbox-elasticsearch.xml
 (added)
+++ 
james/mailbox/trunk/elasticsearch/src/main/resources/META-INF/spring/mailbox-elasticsearch.xml
 Mon Jun 29 08:31:36 2015
@@ -0,0 +1,31 @@
+?xml version=1.0 encoding=UTF-8?
+!--
+  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.
+--
+
+beans xmlns=http://www.springframework.org/schema/beans;
+   xmlns:xsi=http://www.w3.org/2001/XMLSchema-instance;
+   xsi:schemaLocation=
+  http://www.springframework.org/schema/beans 

svn commit: r1688123 - in /james/mailbox/trunk: elasticsearch/.gitignore elasticsearch/README.txt elasticsearch/pom.xml elasticsearch/src/reporting-site/ elasticsearch/src/reporting-site/site.xml pom.

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:31:02 2015
New Revision: 1688123

URL: http://svn.apache.org/r1688123
Log:
MAILBOX-242 Complete mailbox-elasticsearch project - patch contributed by 
Antoine Duprat

Added:
james/mailbox/trunk/elasticsearch/.gitignore
james/mailbox/trunk/elasticsearch/README.txt
james/mailbox/trunk/elasticsearch/src/reporting-site/
james/mailbox/trunk/elasticsearch/src/reporting-site/site.xml
Modified:
james/mailbox/trunk/elasticsearch/pom.xml
james/mailbox/trunk/pom.xml

Added: james/mailbox/trunk/elasticsearch/.gitignore
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/.gitignore?rev=1688123view=auto
==
--- james/mailbox/trunk/elasticsearch/.gitignore (added)
+++ james/mailbox/trunk/elasticsearch/.gitignore Mon Jun 29 08:31:02 2015
@@ -0,0 +1,6 @@
+data
+.classpath
+.project
+.settings/
+target/
+*.iml

Added: james/mailbox/trunk/elasticsearch/README.txt
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/README.txt?rev=1688123view=auto
==
--- james/mailbox/trunk/elasticsearch/README.txt (added)
+++ james/mailbox/trunk/elasticsearch/README.txt Mon Jun 29 08:31:02 2015
@@ -0,0 +1 @@
+= ElasticSearch search implementation

Modified: james/mailbox/trunk/elasticsearch/pom.xml
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/pom.xml?rev=1688123r1=1688122r2=1688123view=diff
==
--- james/mailbox/trunk/elasticsearch/pom.xml (original)
+++ james/mailbox/trunk/elasticsearch/pom.xml Mon Jun 29 08:31:02 2015
@@ -27,9 +27,9 @@
 relativePath../pom.xml/relativePath
 /parent
 
-
 artifactIdapache-james-mailbox-elasticsearch/artifactId
 descriptionApache James Mailbox IMAP search implementation using 
ElasticSearch/description
+nameApache James :: Mailbox :: ElasticSearch/name
 
 properties
 javax.mail.groupIdjavax.mail/javax.mail.groupId
@@ -42,7 +42,7 @@
 artifactIdapache-james-mailbox-api/artifactId
 /dependency
 dependency
-groupId${project.groupId}/groupId
+groupIdorg.apache.james/groupId
 artifactIdapache-james-mailbox-store/artifactId
 /dependency
 dependency
@@ -51,7 +51,6 @@
 typetest-jar/type
 scopetest/scope
 /dependency
-
 dependency
 groupIdcom.fasterxml.jackson.core/groupId
 artifactIdjackson-databind/artifactId
@@ -72,6 +71,11 @@
 version16.0/version
 /dependency
 dependency
+groupIdcom.jayway.awaitility/groupId
+artifactIdawaitility/artifactId
+version1.6.3/version
+/dependency
+dependency
 groupId${javax.mail.groupId}/groupId
 artifactId${javax.mail.artifactId}/artifactId
 /dependency
@@ -93,6 +97,12 @@
 scopetest/scope
 /dependency
 dependency
+groupIdorg.apache.lucene/groupId
+artifactIdlucene-core/artifactId
+version4.10.4/version
+scopetest/scope
+/dependency
+dependency
 groupIdorg.assertj/groupId
 artifactIdassertj-core/artifactId
 version3.0.0/version
@@ -104,6 +114,13 @@
 version1.5.2/version
 /dependency
 dependency
+groupIdorg.elasticsearch/groupId
+artifactIdelasticsearch/artifactId
+version1.5.2/version
+scopetest/scope
+typetest-jar/type
+/dependency
+dependency
 groupIdorg.slf4j/groupId
 artifactIdslf4j-api/artifactId
 /dependency
@@ -257,4 +274,4 @@
 /profile
 /profiles
 
-/project
\ No newline at end of file
+/project

Added: james/mailbox/trunk/elasticsearch/src/reporting-site/site.xml
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/reporting-site/site.xml?rev=1688123view=auto
==
--- james/mailbox/trunk/elasticsearch/src/reporting-site/site.xml (added)
+++ james/mailbox/trunk/elasticsearch/src/reporting-site/site.xml Mon Jun 29 
08:31:02 2015
@@ -0,0 +1,29 @@
+?xml version=1.0 encoding=ISO-8859-1?
+!--
+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 

[jira] [Resolved] (MAILBOX-244) Create a profile to produce an empty Lucene Jar

2015-06-29 Thread Tellier Benoit (JIRA)

 [ 
https://issues.apache.org/jira/browse/MAILBOX-244?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Tellier Benoit resolved MAILBOX-244.

Resolution: Fixed

Thanks to Antoine Duprat

 Create a profile to produce an empty Lucene Jar
 ---

 Key: MAILBOX-244
 URL: https://issues.apache.org/jira/browse/MAILBOX-244
 Project: James Mailbox
  Issue Type: Improvement
Reporter: Tellier Benoit

 This allow us to avoid having conflicted Lucene dependency when using 
 ElasticSearch at runtime.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



svn commit: r1688115 - in /james/mailbox/trunk/elasticsearch: ./ src/main/java/org/apache/james/mailbox/elasticsearch/json/

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:25:02 2015
New Revision: 1688115

URL: http://svn.apache.org/r1688115
Log:
MAILBOX-234 Provide mime parsing utilities - Patch I contributed with the help 
of Matthieu Baechlor

Added:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MimePart.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MimePartContainerBuilder.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MimePartParser.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/RootMimePartContainerBuilder.java
Modified:
james/mailbox/trunk/elasticsearch/pom.xml

Modified: james/mailbox/trunk/elasticsearch/pom.xml
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/pom.xml?rev=1688115r1=1688114r2=1688115view=diff
==
--- james/mailbox/trunk/elasticsearch/pom.xml (original)
+++ james/mailbox/trunk/elasticsearch/pom.xml Mon Jun 29 08:25:02 2015
@@ -45,6 +45,12 @@
 groupId${project.groupId}/groupId
 artifactIdapache-james-mailbox-store/artifactId
 /dependency
+dependency
+groupId${project.groupId}/groupId
+artifactIdapache-james-mailbox-store/artifactId
+typetest-jar/type
+scopetest/scope
+/dependency
 
 dependency
 groupIdcom.fasterxml.jackson.core/groupId

Added: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MimePart.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MimePart.java?rev=1688115view=auto
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MimePart.java
 (added)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/MimePart.java
 Mon Jun 29 08:25:02 2015
@@ -0,0 +1,223 @@
+/
+ * 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.mailbox.elasticsearch.json;
+
+import com.fasterxml.jackson.annotation.JsonIgnore;
+import com.fasterxml.jackson.annotation.JsonProperty;
+import com.google.common.collect.Lists;
+import com.google.common.collect.Multimap;
+import org.apache.commons.io.FilenameUtils;
+import org.apache.commons.io.IOUtils;
+import org.apache.james.mime4j.stream.Field;
+import org.slf4j.Logger;
+import org.slf4j.LoggerFactory;
+
+import java.io.IOException;
+import java.io.InputStream;
+import java.util.List;
+import java.util.Optional;
+import java.util.stream.Stream;
+
+public class MimePart {
+
+public static class Builder implements MimePartContainerBuilder {
+
+private HeaderCollection.Builder headerCollectionBuilder;
+private OptionalInputStream bodyContent;
+private ListMimePart children;
+private OptionalString mediaType;
+private OptionalString subType;
+private OptionalString fileName;
+private OptionalString fileExtension;
+private OptionalString contentDisposition;
+
+
+private Builder() {
+children = Lists.newArrayList();
+headerCollectionBuilder = HeaderCollection.builder();
+this.bodyContent = Optional.empty();
+this.mediaType = Optional.empty();
+this.subType = Optional.empty();
+this.fileName = Optional.empty();
+this.fileExtension = Optional.empty();
+this.contentDisposition = Optional.empty();
+}
+
+@Override
+public Builder addToHeaders(Field 

svn commit: r1688116 - in /james/mailbox/trunk/store/src: main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMessage.java test/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMes

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:25:29 2015
New Revision: 1688116

URL: http://svn.apache.org/r1688116
Log:
MAILBOX-234 Add user flags support in SimpleMessage

Modified:

james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMessage.java

james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMessageTest.java

Modified: 
james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMessage.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMessage.java?rev=1688116r1=1688115r2=1688116view=diff
==
--- 
james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMessage.java
 (original)
+++ 
james/mailbox/trunk/store/src/main/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMessage.java
 Mon Jun 29 08:25:29 2015
@@ -48,6 +48,7 @@ public class SimpleMessageId extends Ma
 private boolean flagged;
 private boolean recent;
 private boolean seen;
+private String[] userFlags;
 private Date internalDate;
 private final String subType;
 private ListProperty properties;
@@ -71,6 +72,7 @@ public class SimpleMessageId extends Ma
 this.properties = propertyBuilder.toProperties();
 this.mediaType = propertyBuilder.getMediaType();
 this.subType = propertyBuilder.getSubType();
+this.userFlags = flags.getUserFlags();
 }
 
 public SimpleMessage(MailboxId mailbox, MessageId original)
@@ -100,6 +102,11 @@ public class SimpleMessageId extends Ma
 }
 }
 
+@Override
+protected String[] createUserFlags() {
+return userFlags.clone();
+}
+
 public Date getInternalDate() {
 return internalDate;
 }
@@ -143,6 +150,7 @@ public class SimpleMessageId extends Ma
 flagged = flags.contains(Flags.Flag.FLAGGED);
 recent = flags.contains(Flags.Flag.RECENT);
 seen = flags.contains(Flags.Flag.SEEN);
+userFlags = flags.getUserFlags();
 }
 
 public InputStream getBodyContent() throws IOException {

Modified: 
james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMessageTest.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMessageTest.java?rev=1688116r1=1688115r2=1688116view=diff
==
--- 
james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMessageTest.java
 (original)
+++ 
james/mailbox/trunk/store/src/test/java/org/apache/james/mailbox/store/mail/model/impl/SimpleMessageTest.java
 Mon Jun 29 08:25:29 2015
@@ -20,6 +20,7 @@ package org.apache.james.mailbox.store.m
 
 import static org.junit.Assert.assertEquals;
 import static org.junit.Assert.assertFalse;
+import static org.assertj.core.api.Assertions.assertThat;
 
 import java.io.IOException;
 import java.io.InputStream;
@@ -31,14 +32,22 @@ import javax.mail.util.SharedByteArrayIn
 
 import org.apache.commons.io.IOUtils;
 import org.apache.james.mailbox.store.TestId;
+import org.apache.james.mailbox.FlagsBuilder;
+import org.junit.Before;
 import org.junit.Test;
 
 public class SimpleMessageTest {
 private static final Charset MESSAGE_CHARSET = Charset.forName(UTF-8);
 private static final String MESSAGE_CONTENT = Simple message content 
without special characters;
 private static final String MESSAGE_CONTENT_SPECIAL_CHAR = Simple message 
content with special characters: \'(§è!çà$*`;
-private static final SimpleMessageTestId MESSAGE = 
buildMessage(MESSAGE_CONTENT);
-private static final SimpleMessageTestId MESSAGE_SPECIAL_CHAR = 
buildMessage(MESSAGE_CONTENT_SPECIAL_CHAR);
+private SimpleMessageTestId MESSAGE;
+private SimpleMessageTestId MESSAGE_SPECIAL_CHAR;
+
+@Before
+public void setUp() {
+MESSAGE = buildMessage(MESSAGE_CONTENT);
+MESSAGE_SPECIAL_CHAR = buildMessage(MESSAGE_CONTENT_SPECIAL_CHAR);
+}
 
 @Test
 public void testSize() {
@@ -75,8 +84,14 @@ public class SimpleMessageTest {
 new 
String(IOUtils.toByteArray(MESSAGE_SPECIAL_CHAR.getFullContent()),MESSAGE_CHARSET));
 }
 
-private static SimpleMessageTestId buildMessage(String content) {
-return new SimpleMessageTestId(Calendar.getInstance().getTime(),
+@Test
+public void simpleMessageShouldReturnTheSameUserFlagsThatThoseProvided() {
+MESSAGE.setFlags(new FlagsBuilder().add(Flags.Flag.DELETED, 
Flags.Flag.SEEN).add(mozzarela, parmesan, coppa, limonchello).build());
+assertThat(MESSAGE.createUserFlags()).containsOnly(mozzarela, 
parmesan, coppa, limonchello);
+}
+
+private static SimpleMessageTestId 

svn commit: r1688113 - in /james/mailbox/trunk/elasticsearch/src: main/java/org/apache/james/mailbox/elasticsearch/json/ test/ test/java/ test/java/org/ test/java/org/apache/ test/java/org/apache/jame

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:23:55 2015
New Revision: 1688113

URL: http://svn.apache.org/r1688113
Log:
MAILBOX-234 Extract specific header values and store it

Added:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/EMailer.java

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/HeaderCollection.java
james/mailbox/trunk/elasticsearch/src/test/
james/mailbox/trunk/elasticsearch/src/test/java/
james/mailbox/trunk/elasticsearch/src/test/java/org/
james/mailbox/trunk/elasticsearch/src/test/java/org/apache/
james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/
james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/FieldImpl.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/json/HeaderCollectionTest.java

Added: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/EMailer.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/EMailer.java?rev=1688113view=auto
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/EMailer.java
 (added)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/EMailer.java
 Mon Jun 29 08:23:55 2015
@@ -0,0 +1,69 @@
+/
+ * 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.mailbox.elasticsearch.json;
+
+import com.fasterxml.jackson.annotation.JsonProperty;
+import org.elasticsearch.common.base.MoreObjects;
+
+import java.util.Objects;
+
+public class EMailer {
+
+private final String name;
+private final String address;
+
+public EMailer(String name, String address) {
+this.name = name;
+this.address = address;
+}
+
+@JsonProperty(JsonMessageConstants.EMailer.NAME)
+public String getName() {
+return name;
+}
+
+@JsonProperty(JsonMessageConstants.EMailer.ADDRESS)
+public String getAddress() {
+return address;
+}
+
+@Override
+public boolean equals(Object o) {
+if (o instanceof EMailer) {
+EMailer otherEMailer = (EMailer) o;
+return Objects.equals(name, otherEMailer.name)
+ Objects.equals(address, otherEMailer.address);
+}
+return false;
+}
+
+@Override
+public int hashCode() {
+return Objects.hash(name, address);
+}
+
+@Override
+public String toString() {
+return MoreObjects.toStringHelper(this)
+.add(name, name)
+.add(address, address)
+.toString();
+}
+}

Added: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/HeaderCollection.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/HeaderCollection.java?rev=1688113view=auto
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/HeaderCollection.java
 (added)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/json/HeaderCollection.java
 Mon Jun 29 08:23:55 2015
@@ -0,0 +1,208 @@

svn commit: r1688133 - in /james/mailbox/trunk/elasticsearch: ./ src/main/java/org/apache/james/mailbox/elasticsearch/events/ src/main/java/org/apache/james/mailbox/elasticsearch/search/ src/main/reso

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:36:12 2015
New Revision: 1688133

URL: http://svn.apache.org/r1688133
Log:
MAILBOX-155 Replacing ISO_OFFSET_DATE_TIME

Added:

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/search/

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/search/ElasticSearchSearcher.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java
james/mailbox/trunk/elasticsearch/src/test/resources/documents/frnog.eml
james/mailbox/trunk/elasticsearch/src/test/resources/documents/mail1.eml
james/mailbox/trunk/elasticsearch/src/test/resources/documents/mail2.eml
james/mailbox/trunk/elasticsearch/src/test/resources/documents/mail3.eml
james/mailbox/trunk/elasticsearch/src/test/resources/documents/mail4.eml
Modified:
james/mailbox/trunk/elasticsearch/pom.xml

james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java

james/mailbox/trunk/elasticsearch/src/main/resources/META-INF/spring/mailbox-elasticsearch.xml

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndexTest.java
james/mailbox/trunk/elasticsearch/src/test/resources/documents/spamMail.eml
james/mailbox/trunk/elasticsearch/src/test/resources/documents/spamMail.json

Modified: james/mailbox/trunk/elasticsearch/pom.xml
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/pom.xml?rev=1688133r1=1688132r2=1688133view=diff
==
--- james/mailbox/trunk/elasticsearch/pom.xml (original)
+++ james/mailbox/trunk/elasticsearch/pom.xml Mon Jun 29 08:36:12 2015
@@ -97,10 +97,6 @@
 scopetest/scope
 /dependency
 dependency
-groupIdorg.apache.james/groupId
-artifactIdapache-james-mailbox-store/artifactId
-/dependency
-dependency
 groupIdorg.apache.lucene/groupId
 artifactIdlucene-core/artifactId
 version4.10.4/version
@@ -144,6 +140,11 @@
 artifactIdgroovy-all/artifactId
 version2.3.2/version
 /dependency
+dependency
+groupIdorg.apache.james/groupId
+artifactIdapache-james-mailbox-memory/artifactId
+scopetest/scope
+/dependency
 /dependencies
 
 profiles

Modified: 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java?rev=1688133r1=1688132r2=1688133view=diff
==
--- 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java
 (original)
+++ 
james/mailbox/trunk/elasticsearch/src/main/java/org/apache/james/mailbox/elasticsearch/events/ElasticSearchListeningMessageSearchIndex.java
 Mon Jun 29 08:36:12 2015
@@ -22,10 +22,10 @@ import java.util.Iterator;
 
 import javax.mail.Flags;
 
-import org.apache.commons.lang.NotImplementedException;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.elasticsearch.ElasticSearchIndexer;
 import org.apache.james.mailbox.elasticsearch.json.MessageToElasticSearchJson;
+import org.apache.james.mailbox.elasticsearch.search.ElasticSearchSearcher;
 import org.apache.james.mailbox.exception.MailboxException;
 import org.apache.james.mailbox.model.MessageRange;
 import org.apache.james.mailbox.model.MessageRange.Type;
@@ -42,22 +42,23 @@ import org.slf4j.LoggerFactory;
 public class ElasticSearchListeningMessageSearchIndexId extends MailboxId 
extends ListeningMessageSearchIndexId {
 
 private final static Logger LOGGER = 
LoggerFactory.getLogger(ElasticSearchListeningMessageSearchIndex.class);
-private final static int NO_LIMIT = -1;
 private final static String ID_SEPARATOR = :;
 
 private final ElasticSearchIndexer indexer;
+private final ElasticSearchSearcherId searcher;
 private final MessageToElasticSearchJson messageToElasticSearchJson;
 
-public ElasticSearchListeningMessageSearchIndex(MessageMapperFactoryId 
factory, 
-ElasticSearchIndexer indexer, MessageToElasticSearchJson 
messageToElasticSearchJson) {
+public ElasticSearchListeningMessageSearchIndex(MessageMapperFactoryId 
factory, ElasticSearchIndexer indexer,
+ElasticSearchSearcherId searcher, MessageToElasticSearchJson 
messageToElasticSearchJson) {
 super(factory);
 this.indexer = indexer;
 

svn commit: r1688134 - in /james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch: ElasticSearchIndexerTest.java ElasticSearchIntegrationTest.java EmbeddedElasticSearch

2015-06-29 Thread btellier
Author: btellier
Date: Mon Jun 29 08:36:31 2015
New Revision: 1688134

URL: http://svn.apache.org/r1688134
Log:
MAILBOX-235 Adding full mail search support

Modified:

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexerTest.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIntegrationTest.java

james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/EmbeddedElasticSearch.java

Modified: 
james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexerTest.java
URL: 
http://svn.apache.org/viewvc/james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexerTest.java?rev=1688134r1=1688133r2=1688134view=diff
==
--- 
james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexerTest.java
 (original)
+++ 
james/mailbox/trunk/elasticsearch/src/test/java/org/apache/james/mailbox/elasticsearch/ElasticSearchIndexerTest.java
 Mon Jun 29 08:36:31 2015
@@ -27,37 +27,36 @@ import org.elasticsearch.action.search.S
 import org.elasticsearch.client.Client;
 import org.elasticsearch.index.query.QueryBuilders;
 import org.elasticsearch.node.Node;
-import org.junit.After;
 import org.junit.Before;
 import org.junit.Rule;
 import org.junit.Test;
+import org.junit.rules.RuleChain;
 import org.junit.rules.TemporaryFolder;
 
 public class ElasticSearchIndexerTest {
 
-@Rule public TemporaryFolder temporaryFolder = new TemporaryFolder();
+private TemporaryFolder temporaryFolder = new TemporaryFolder();
+private EmbeddedElasticSearch embeddedElasticSearch = new 
EmbeddedElasticSearch(temporaryFolder);
+
+@Rule
+public RuleChain chain = 
RuleChain.outerRule(temporaryFolder).around(embeddedElasticSearch);
 
 private Node node;
 private ElasticSearchIndexer testee;
 
 @Before
 public void setup() throws IOException {
-node = EmbeddedElasticSearch.provideNode(temporaryFolder);
+node = embeddedElasticSearch.getNode();
 testee = new ElasticSearchIndexer(node);
 }
 
-@After
-public void tearDown() {
-EmbeddedElasticSearch.shutDown(node);
-}
-
 @Test
 public void indexMessageShouldWork() throws Exception {
 String messageId = 1;
 String content = {\message\: \trying out Elasticsearch\};
 
 testee.indexMessage(messageId, content);
-EmbeddedElasticSearch.awaitForElasticSearch(node);
+embeddedElasticSearch.awaitForElasticSearch();
 
 try (Client client = node.client()) {
 SearchResponse searchResponse = 
client.prepareSearch(ElasticSearchIndexer.MAILBOX_INDEX)
@@ -79,10 +78,10 @@ public class ElasticSearchIndexerTest {
 String content = {\message\: \trying out 
Elasticsearch\,\field\:\Should be unchanged\};
 
 testee.indexMessage(messageId, content);
-EmbeddedElasticSearch.awaitForElasticSearch(node);
+embeddedElasticSearch.awaitForElasticSearch();
 
 testee.updateMessage(messageId, {\message\: \mastering out 
Elasticsearch\});
-EmbeddedElasticSearch.awaitForElasticSearch(node);
+embeddedElasticSearch.awaitForElasticSearch();
 
 try (Client client = node.client()) {
 SearchResponse searchResponse = 
client.prepareSearch(ElasticSearchIndexer.MAILBOX_INDEX)
@@ -107,7 +106,7 @@ public class ElasticSearchIndexerTest {
 String content = {\message\: \trying out Elasticsearch\};
 
 testee.indexMessage(messageId, content);
-EmbeddedElasticSearch.awaitForElasticSearch(node);
+embeddedElasticSearch.awaitForElasticSearch();
 
 testee.updateMessage(1, null);
 }
@@ -118,10 +117,10 @@ public class ElasticSearchIndexerTest {
 String content = {\message\: \trying out Elasticsearch\};
 
 testee.indexMessage(messageId, content);
-EmbeddedElasticSearch.awaitForElasticSearch(node);
+embeddedElasticSearch.awaitForElasticSearch();
 
 testee.deleteAllWithIdStarting(1:);
-EmbeddedElasticSearch.awaitForElasticSearch(node);
+embeddedElasticSearch.awaitForElasticSearch();
 
 try (Client client = node.client()) {
 SearchResponse searchResponse = 
client.prepareSearch(ElasticSearchIndexer.MAILBOX_INDEX)
@@ -138,22 +137,22 @@ public class ElasticSearchIndexerTest {
 String content = {\message\: \trying out Elasticsearch\};
 
 testee.indexMessage(messageId, content);
-EmbeddedElasticSearch.awaitForElasticSearch(node);
+embeddedElasticSearch.awaitForElasticSearch();
 
 String messageId2 = 1:2;
 String content2 = {\message\: \trying out Elasticsearch 2\};
 

Re: The patches for your review

2015-06-29 Thread Alina Sun
Hi Eric,

I have created JIRA tickets JAMES-1581, JAMES-1582, JAMES-1583. Please review. 
Thanks.



Alina Sun
Senior Developer

e   alinas  @   orionhealth.com




www.orionhealth.com​





From: Eric Charles e...@apache.org
Sent: Monday, June 29, 2015 5:26 PM
To: James Developers List
Subject: Re: The patches for your review

Can you create JIRA and uplooad your patches there?

https://issues.apache.org/jira/browse/JAMES

On 2015-06-29 07:15, Alina Sun wrote:
 Hi all,

 We are using an old version of direct james and we fixed some bugs. I
 attach the diff files for your review in case you may find some useful
 fixes.

 Thanks and regards,



 https://www.orionhealth.com/
 *Alina Sun*
 Senior Developer

 *e*   alinas  @   orionhealth.com

 mailto:ali...@orionhealth.com

 https://www.facebook.com/orionhealth
 https://www.twitter.com/orionhealth
 https://www.linkedin.com/company/orion-health

 www.orionhealth.com https://www.orionhealth.com/​





 -
 To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
 For additional commands, e-mail: server-dev-h...@james.apache.org


-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org


[jira] [Updated] (JAMES-1583) SRV weighting not correctly observed in certificate lookup

2015-06-29 Thread Alina Sun (JIRA)

 [ 
https://issues.apache.org/jira/browse/JAMES-1583?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Alina Sun updated JAMES-1583:
-
Attachment: srv.diff

 SRV weighting not correctly observed in certificate lookup
 --

 Key: JAMES-1583
 URL: https://issues.apache.org/jira/browse/JAMES-1583
 Project: James Server
  Issue Type: Bug
Reporter: Alina Sun
 Attachments: srv.diff


 The patch files is attached. Please review. Thanks.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org



Build failed in Jenkins: james-mailet #2809

2015-06-29 Thread Apache Jenkins Server
See https://builds.apache.org/job/james-mailet/2809/

--
Started by timer
Building remotely on ubuntu3 (Ubuntu ubuntu legacy-ubuntu) in workspace 
https://builds.apache.org/job/james-mailet/ws/
Updating http://svn.apache.org/repos/asf/james/mailet/trunk at revision 
'2015-06-30T04:32:58.100 +'
At revision 1688352
no change for http://svn.apache.org/repos/asf/james/mailet/trunk since the 
previous build
Parsing POMs
Downloaded artifact 
http://repository.apache.org/snapshots/org/apache/james/james-project/1.8.3-SNAPSHOT/maven-metadata.xml
maven3-agent.jar already up to date
maven3-interceptor.jar already up to date
maven3-interceptor-commons.jar already up to date
[trunk] $ /home/jenkins/tools/java/latest1.6/bin/java -Xmx2g -Xms256m 
-XX:MaxPermSize=512m -cp 
/home/jenkins/jenkins-slave/maven3-agent.jar:/home/jenkins/tools/maven/apache-maven-3.0.4/boot/plexus-classworlds-2.4.jar
 org.jvnet.hudson.maven3.agent.Maven3Main 
/home/jenkins/tools/maven/apache-maven-3.0.4 
/x1/jenkins/jenkins-slave/slave.jar 
/home/jenkins/jenkins-slave/maven3-interceptor.jar 
/home/jenkins/jenkins-slave/maven3-interceptor-commons.jar 59139
===[JENKINS REMOTING CAPACITY]===   channel started
Executing Maven:  -B -f 
https://builds.apache.org/job/james-mailet/ws/trunk/pom.xml 
-Dmaven.repo.local=/home/jenkins/jenkins-slave/maven-repositories/0 clean deploy
[INFO] Scanning for projects...
[INFO] 
[INFO] Reactor Build Order:
[INFO] 
[INFO] Apache James :: Mailets parent and aggregator
[INFO] Apache James :: Mailet API
[INFO] Apache James :: Basic Mailet Toolkit
[INFO] Apache James :: Mailetdocs Maven Plugin
[INFO] Apache James :: Crypto Mailets
[INFO] Apache James :: Standard Mailets
[INFO] Apache James :: AI Mailets
[INFO] 
[INFO] 
[INFO] Building Apache James :: Mailets parent and aggregator 2.5.1-SNAPSHOT
[INFO] 
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ apache-mailet ---
[INFO] Deleting https://builds.apache.org/job/james-mailet/ws/trunk/target
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.4:process (default) @ apache-mailet 
---
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (jar) @ apache-mailet ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: 
https://builds.apache.org/job/james-mailet/ws/trunk/target/apache-mailet-2.5.1-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-jar-plugin:2.4:test-jar (test-jar) @ apache-mailet ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: 
https://builds.apache.org/job/james-mailet/ws/trunk/target/apache-mailet-2.5.1-SNAPSHOT-tests.jar
[WARNING] Failed to getClass for org.apache.maven.plugin.source.SourceJarMojo
[INFO] 
[INFO] --- maven-source-plugin:2.2.1:jar (attach-sources) @ apache-mailet ---
[WARNING] Failed to getClass for 
org.apache.maven.plugin.source.TestSourceJarMojo
[INFO] 
[INFO] --- maven-source-plugin:2.2.1:test-jar (attach-sources) @ apache-mailet 
---
[INFO] 
[INFO] --- maven-site-plugin:3.2:attach-descriptor (attach-descriptor) @ 
apache-mailet ---
[INFO] 
[INFO] --- apache-rat-plugin:0.8:check (default) @ apache-mailet ---
[INFO] Exclude: NOTICE.*
[INFO] Exclude: LICENSE.*
[INFO] Exclude: release.properties
[INFO] Exclude: dist/**/*
[INFO] Exclude: **/.*
[INFO] Exclude: .*/**/*
[INFO] Exclude: **/.*/**/*
[INFO] Exclude: **/LICENSE*
[INFO] Exclude: **/target/**
[INFO] Exclude: **/*.iml
[INFO] Exclude: src/site/**
[INFO] 
[INFO] --- maven-install-plugin:2.5.1:install (default-install) @ apache-mailet 
---
[INFO] Installing https://builds.apache.org/job/james-mailet/ws/trunk/pom.xml 
to 
/home/jenkins/jenkins-slave/maven-repositories/0/org/apache/james/apache-mailet/2.5.1-SNAPSHOT/apache-mailet-2.5.1-SNAPSHOT.pom
[INFO] Installing 
https://builds.apache.org/job/james-mailet/ws/trunk/target/apache-mailet-2.5.1-SNAPSHOT-tests.jar
 to 
/home/jenkins/jenkins-slave/maven-repositories/0/org/apache/james/apache-mailet/2.5.1-SNAPSHOT/apache-mailet-2.5.1-SNAPSHOT-tests.jar
[INFO] Installing 
https://builds.apache.org/job/james-mailet/ws/trunk/target/apache-mailet-2.5.1-SNAPSHOT-site.xml
 to 
/home/jenkins/jenkins-slave/maven-repositories/0/org/apache/james/apache-mailet/2.5.1-SNAPSHOT/apache-mailet-2.5.1-SNAPSHOT-site.xml
[INFO] 
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ apache-mailet ---
Downloading: 
https://repository.apache.org/content/repositories/snapshots/org/apache/james/apache-mailet/2.5.1-SNAPSHOT/maven-metadata.xml
[WARNING] Could not transfer metadata 
org.apache.james:apache-mailet:2.5.1-SNAPSHOT/maven-metadata.xml from/to 
apache.snapshots.https 
(https://repository.apache.org/content/repositories/snapshots): 

Build failed in Jenkins: james-mailet » Apache James :: Mailets parent and aggregator #2809

2015-06-29 Thread Apache Jenkins Server
See 
https://builds.apache.org/job/james-mailet/org.apache.james$apache-mailet/2809/

--
maven3-agent.jar already up to date
maven3-interceptor.jar already up to date
maven3-interceptor-commons.jar already up to date
===[JENKINS REMOTING CAPACITY]===   channel started
Executing Maven:  -B -f 
https://builds.apache.org/job/james-mailet/org.apache.james$apache-mailet/ws/pom.xml
 -Dmaven.repo.local=/home/jenkins/jenkins-slave/maven-repositories/0 clean 
deploy
[INFO] Scanning for projects...
[INFO] 
[INFO] Reactor Build Order:
[INFO] 
[INFO] Apache James :: Mailets parent and aggregator
[INFO] Apache James :: Mailet API
[INFO] Apache James :: Basic Mailet Toolkit
[INFO] Apache James :: Mailetdocs Maven Plugin
[INFO] Apache James :: Crypto Mailets
[INFO] Apache James :: Standard Mailets
[INFO] Apache James :: AI Mailets
[INFO] 
[INFO] 
[INFO] Building Apache James :: Mailets parent and aggregator 2.5.1-SNAPSHOT
[INFO] 
[INFO] 
[INFO] --- maven-clean-plugin:2.5:clean (default-clean) @ apache-mailet ---
[INFO] Deleting 
https://builds.apache.org/job/james-mailet/org.apache.james$apache-mailet/ws/target
[INFO] 
[INFO] --- maven-remote-resources-plugin:1.4:process (default) @ apache-mailet 
---
[INFO] 
[INFO] --- maven-jar-plugin:2.4:jar (jar) @ apache-mailet ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: 
https://builds.apache.org/job/james-mailet/org.apache.james$apache-mailet/ws/target/apache-mailet-2.5.1-SNAPSHOT.jar
[INFO] 
[INFO] --- maven-jar-plugin:2.4:test-jar (test-jar) @ apache-mailet ---
[WARNING] JAR will be empty - no content was marked for inclusion!
[INFO] Building jar: 
https://builds.apache.org/job/james-mailet/org.apache.james$apache-mailet/ws/target/apache-mailet-2.5.1-SNAPSHOT-tests.jar
[WARNING] Failed to getClass for org.apache.maven.plugin.source.SourceJarMojo
[INFO] 
[INFO] --- maven-source-plugin:2.2.1:jar (attach-sources) @ apache-mailet ---
[WARNING] Failed to getClass for 
org.apache.maven.plugin.source.TestSourceJarMojo
[INFO] 
[INFO] --- maven-source-plugin:2.2.1:test-jar (attach-sources) @ apache-mailet 
---
[INFO] 
[INFO] --- maven-site-plugin:3.2:attach-descriptor (attach-descriptor) @ 
apache-mailet ---
[INFO] 
[INFO] --- apache-rat-plugin:0.8:check (default) @ apache-mailet ---
[INFO] Exclude: NOTICE.*
[INFO] Exclude: LICENSE.*
[INFO] Exclude: release.properties
[INFO] Exclude: dist/**/*
[INFO] Exclude: **/.*
[INFO] Exclude: .*/**/*
[INFO] Exclude: **/.*/**/*
[INFO] Exclude: **/LICENSE*
[INFO] Exclude: **/target/**
[INFO] Exclude: **/*.iml
[INFO] Exclude: src/site/**
[INFO] 
[INFO] --- maven-install-plugin:2.5.1:install (default-install) @ apache-mailet 
---
[INFO] Installing 
https://builds.apache.org/job/james-mailet/org.apache.james$apache-mailet/ws/pom.xml
 to 
/home/jenkins/jenkins-slave/maven-repositories/0/org/apache/james/apache-mailet/2.5.1-SNAPSHOT/apache-mailet-2.5.1-SNAPSHOT.pom
[INFO] Installing 
https://builds.apache.org/job/james-mailet/org.apache.james$apache-mailet/ws/target/apache-mailet-2.5.1-SNAPSHOT-tests.jar
 to 
/home/jenkins/jenkins-slave/maven-repositories/0/org/apache/james/apache-mailet/2.5.1-SNAPSHOT/apache-mailet-2.5.1-SNAPSHOT-tests.jar
[INFO] Installing 
https://builds.apache.org/job/james-mailet/org.apache.james$apache-mailet/ws/target/apache-mailet-2.5.1-SNAPSHOT-site.xml
 to 
/home/jenkins/jenkins-slave/maven-repositories/0/org/apache/james/apache-mailet/2.5.1-SNAPSHOT/apache-mailet-2.5.1-SNAPSHOT-site.xml
[INFO] 
[INFO] --- maven-deploy-plugin:2.7:deploy (default-deploy) @ apache-mailet ---
Downloading: 
https://repository.apache.org/content/repositories/snapshots/org/apache/james/apache-mailet/2.5.1-SNAPSHOT/maven-metadata.xml
[WARNING] Could not transfer metadata 
org.apache.james:apache-mailet:2.5.1-SNAPSHOT/maven-metadata.xml from/to 
apache.snapshots.https 
(https://repository.apache.org/content/repositories/snapshots): 
java.lang.RuntimeException: Could not generate DH keypair

-
To unsubscribe, e-mail: server-dev-unsubscr...@james.apache.org
For additional commands, e-mail: server-dev-h...@james.apache.org