diff --git a/getting-started/mail/.settings/com.springsource.sts.config.flow.prefs b/getting-started/mail/.settings/com.springsource.sts.config.flow.prefs index 0c2ac0ec..a6509c42 100644 --- a/getting-started/mail/.settings/com.springsource.sts.config.flow.prefs +++ b/getting-started/mail/.settings/com.springsource.sts.config.flow.prefs @@ -1,3 +1,4 @@ -#Fri Sep 17 14:01:50 EDT 2010 -//com.springsource.sts.config.flow.coordinates\:http\://www.springframework.org/schema/integration\:/mail/src/main/resources/META-INF/spring/integration/mail-imap-idle-config.xml=\n\n\n\n\n\n\n\n\n\n +#Sun Sep 26 07:06:34 EDT 2010 +//com.springsource.sts.config.flow.coordinates\:http\://www.springframework.org/schema/integration\:/mail/src/main/resources/META-INF/spring/integration/gmail-pop3-config.xml=\n\n\n\n\n\n\n\n\n\n +//com.springsource.sts.config.flow.coordinates\:http\://www.springframework.org/schema/integration\:/mail/src/main/resources/META-INF/spring/integration/mail-imap-idle-config.xml=\n\n\n\n\n\n\n\n\n\n eclipse.preferences.version=1 diff --git a/getting-started/mail/.settings/org.springframework.ide.eclipse.core.prefs b/getting-started/mail/.settings/org.springframework.ide.eclipse.core.prefs new file mode 100644 index 00000000..58f10846 --- /dev/null +++ b/getting-started/mail/.settings/org.springframework.ide.eclipse.core.prefs @@ -0,0 +1,68 @@ +#Sun Sep 26 06:59:44 EDT 2010 +eclipse.preferences.version=1 +org.springframework.ide.eclipse.core.builders.enable.aopreferencemodelbuilder=true +org.springframework.ide.eclipse.core.builders.enable.beanmetadatabuilder=true +org.springframework.ide.eclipse.core.builders.enable.osgibundleupdater=false +org.springframework.ide.eclipse.core.enable.project.preferences=true +org.springframework.ide.eclipse.core.validator.enable.com.springsource.server.ide.manifest.core.manifestvalidator=false +org.springframework.ide.eclipse.core.validator.enable.com.springsource.sts.bestpractices.beansvalidator=false +org.springframework.ide.eclipse.core.validator.enable.com.springsource.sts.server.quickfix.manifestvalidator=false +org.springframework.ide.eclipse.core.validator.enable.org.springframework.ide.eclipse.beans.core.beansvalidator=false +org.springframework.ide.eclipse.core.validator.enable.org.springframework.ide.eclipse.core.springvalidator=false +org.springframework.ide.eclipse.core.validator.enable.org.springframework.ide.eclipse.webflow.core.validator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.applicationSymbolicNameRule-com.springsource.server.ide.manifest.core.manifestvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.applicationVersionRule-com.springsource.server.ide.manifest.core.manifestvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.bundleActivationPolicyRule-com.springsource.server.ide.manifest.core.manifestvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.bundleActivatorRule-com.springsource.server.ide.manifest.core.manifestvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.bundleManifestVersionRule-com.springsource.server.ide.manifest.core.manifestvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.bundleSymbolicNameRule-com.springsource.server.ide.manifest.core.manifestvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.bundleVersionRule-com.springsource.server.ide.manifest.core.manifestvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.exportPackageRule-com.springsource.server.ide.manifest.core.manifestvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.importRule-com.springsource.server.ide.manifest.core.manifestvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.parsingProblemsRule-com.springsource.server.ide.manifest.core.manifestvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.server.ide.manifest.core.requireBundleRule-com.springsource.server.ide.manifest.core.manifestvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.bestpractices.com.springsource.sts.bestpractices.AvoidDriverManagerDataSource-com.springsource.sts.bestpractices.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.bestpractices.com.springsource.sts.bestpractices.ImportElementsAtTopRulee-com.springsource.sts.bestpractices.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.bestpractices.com.springsource.sts.bestpractices.ParentBeanSpecifiesAbstractClassRule-com.springsource.sts.bestpractices.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.bestpractices.com.springsource.sts.bestpractices.RefElementRule-com.springsource.sts.bestpractices.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.bestpractices.com.springsource.sts.bestpractices.TooManyBeansInFileRule-com.springsource.sts.bestpractices.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.bestpractices.com.springsource.sts.bestpractices.UnnecessaryValueElementRule-com.springsource.sts.bestpractices.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.bestpractices.com.springsource.sts.bestpractices.UseBeanInheritance-com.springsource.sts.bestpractices.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.bestpractices.legacyxmlusage.jndiobjectfactory-com.springsource.sts.bestpractices.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.server.quickfix.importBundleVersionRule-com.springsource.sts.server.quickfix.manifestvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.server.quickfix.importLibraryVersionRule-com.springsource.sts.server.quickfix.manifestvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.server.quickfix.importPackageVersionRule-com.springsource.sts.server.quickfix.manifestvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.com.springsource.sts.server.quickfix.requireBundleVersionRule-com.springsource.sts.server.quickfix.manifestvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.autowire.autowire-org.springframework.ide.eclipse.beans.core.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanAlias-org.springframework.ide.eclipse.beans.core.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanClass-org.springframework.ide.eclipse.beans.core.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanConstructorArgument-org.springframework.ide.eclipse.beans.core.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanDefinition-org.springframework.ide.eclipse.beans.core.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanDefinitionHolder-org.springframework.ide.eclipse.beans.core.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanFactory-org.springframework.ide.eclipse.beans.core.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanInitDestroyMethod-org.springframework.ide.eclipse.beans.core.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanProperty-org.springframework.ide.eclipse.beans.core.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.beanReference-org.springframework.ide.eclipse.beans.core.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.methodOverride-org.springframework.ide.eclipse.beans.core.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.parsingProblems-org.springframework.ide.eclipse.beans.core.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.requiredProperty-org.springframework.ide.eclipse.beans.core.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.beans.core.toolAnnotation-org.springframework.ide.eclipse.beans.core.beansvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.core.springClasspath-org.springframework.ide.eclipse.core.springvalidator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.action-org.springframework.ide.eclipse.webflow.core.validator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.actionstate-org.springframework.ide.eclipse.webflow.core.validator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.attribute-org.springframework.ide.eclipse.webflow.core.validator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.attributemapper-org.springframework.ide.eclipse.webflow.core.validator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.beanaction-org.springframework.ide.eclipse.webflow.core.validator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.evaluationaction-org.springframework.ide.eclipse.webflow.core.validator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.evaluationresult-org.springframework.ide.eclipse.webflow.core.validator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.exceptionhandler-org.springframework.ide.eclipse.webflow.core.validator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.import-org.springframework.ide.eclipse.webflow.core.validator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.inputattribute-org.springframework.ide.eclipse.webflow.core.validator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.mapping-org.springframework.ide.eclipse.webflow.core.validator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.outputattribute-org.springframework.ide.eclipse.webflow.core.validator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.set-org.springframework.ide.eclipse.webflow.core.validator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.state-org.springframework.ide.eclipse.webflow.core.validator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.subflowstate-org.springframework.ide.eclipse.webflow.core.validator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.transition-org.springframework.ide.eclipse.webflow.core.validator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.variable-org.springframework.ide.eclipse.webflow.core.validator=false +org.springframework.ide.eclipse.core.validator.rule.enable.org.springframework.ide.eclipse.webflow.core.validation.webflowstate-org.springframework.ide.eclipse.webflow.core.validator=false diff --git a/getting-started/mail/.springBeans b/getting-started/mail/.springBeans index 0e9f29f3..f0a03393 100644 --- a/getting-started/mail/.springBeans +++ b/getting-started/mail/.springBeans @@ -7,7 +7,7 @@ - src/main/resources/META-INF/spring/integration/mail-imap-idle-config.xml + src/main/resources/META-INF/spring/integration/gmail-imap-idle-config.xml diff --git a/getting-started/mail/pom.xml b/getting-started/mail/pom.xml index 195d02a6..7f222462 100644 --- a/getting-started/mail/pom.xml +++ b/getting-started/mail/pom.xml @@ -6,7 +6,7 @@ Spring Integration IMAP IDLE Sample 2.0.0 - 2.0.0.M7 + 2.0.0.BUILD-SNAPSHOT 1.2.16 4.7 diff --git a/getting-started/mail/readme.txt b/getting-started/mail/readme.txt index 0ece10d1..15e74264 100644 --- a/getting-started/mail/readme.txt +++ b/getting-started/mail/readme.txt @@ -1,8 +1,15 @@ This example demonstrates the following aspects of the Mail support available with Spring Integration: -1. IMAP IDLE Channel Adapter (with sample GMail configuration) +1. IMAP IDLE Inbound Channel Adapter (with sample GMail configuration) +2. POP3 Inbound Channel Adapter (with sample GMail configuration) + +Simply change configuration file (src/main/resources/META-INF/spring/integration/gmail-imap-idle-config.xml or gmail-pop3-config.xml) +to point to your existing GMail account (replace userid and password) and run: + + GmailInboundImapIdleAdapterTest.java - for IMAP IDLE sample + GmailInboundPop3AdapterTest - for POP3 sample + +IMPORTANT: You must enable POP3/IMAP access for your google account (follow "Settings" link on your GMail page). -Simply change configuration file (src/main/resources/META-INF/spring/integration/mail-imap-idle-config.xml) -to point to your existing GMail account (replace userid and password) and run the GmailImapIdleAdapterTest. Once started start sending emails to your account. You'll see that adapter will receive messages and will publish them to a channel specified by 'channel' attribute. diff --git a/getting-started/mail/src/main/resources/META-INF/spring/integration/mail-imap-idle-config.xml b/getting-started/mail/src/main/resources/META-INF/spring/integration/gmail-imap-idle-config.xml similarity index 100% rename from getting-started/mail/src/main/resources/META-INF/spring/integration/mail-imap-idle-config.xml rename to getting-started/mail/src/main/resources/META-INF/spring/integration/gmail-imap-idle-config.xml diff --git a/getting-started/mail/src/main/resources/META-INF/spring/integration/gmail-pop3-config.xml b/getting-started/mail/src/main/resources/META-INF/spring/integration/gmail-pop3-config.xml new file mode 100644 index 00000000..4b46abbf --- /dev/null +++ b/getting-started/mail/src/main/resources/META-INF/spring/integration/gmail-pop3-config.xml @@ -0,0 +1,32 @@ + + + + + + + + + + + + + false + true + 995 + javax.net.ssl.SSLSocketFactory + 995 + + diff --git a/getting-started/mail/src/test/java/org/springframework/integration/samples/mail/imapidle/GmailInboundImapIdleAdapterTest.java b/getting-started/mail/src/test/java/org/springframework/integration/samples/mail/imapidle/GmailInboundImapIdleAdapterTest.java new file mode 100644 index 00000000..391dac00 --- /dev/null +++ b/getting-started/mail/src/test/java/org/springframework/integration/samples/mail/imapidle/GmailInboundImapIdleAdapterTest.java @@ -0,0 +1,31 @@ +/** + * + */ +package org.springframework.integration.samples.mail.imapidle; + +import org.apache.log4j.Logger; +import org.springframework.context.ApplicationContext; +import org.springframework.context.support.ClassPathXmlApplicationContext; +import org.springframework.integration.Message; +import org.springframework.integration.MessagingException; +import org.springframework.integration.channel.DirectChannel; +import org.springframework.integration.core.MessageHandler; + +/** + * @author Oleg Zhurakousky + * + */ +public class GmailInboundImapIdleAdapterTest { + private static Logger logger = Logger.getLogger(GmailInboundImapIdleAdapterTest.class); + + + public static void main (String[] args) throws Exception { + ApplicationContext ac = new ClassPathXmlApplicationContext("/META-INF/spring/integration/gmail-imap-idle-config.xml"); + DirectChannel inputChannel = ac.getBean("recieveChannel", DirectChannel.class); + inputChannel.subscribe(new MessageHandler() { + public void handleMessage(Message message) throws MessagingException { + logger.info("Message: " + message); + } + }); + } +} diff --git a/getting-started/mail/src/test/java/org/springframework/integration/samples/mail/imapidle/GmailImapIdleAdapterTest.java b/getting-started/mail/src/test/java/org/springframework/integration/samples/mail/imapidle/GmailInboundPop3AdapterTest.java similarity index 83% rename from getting-started/mail/src/test/java/org/springframework/integration/samples/mail/imapidle/GmailImapIdleAdapterTest.java rename to getting-started/mail/src/test/java/org/springframework/integration/samples/mail/imapidle/GmailInboundPop3AdapterTest.java index 01d542c9..1b36392e 100644 --- a/getting-started/mail/src/test/java/org/springframework/integration/samples/mail/imapidle/GmailImapIdleAdapterTest.java +++ b/getting-started/mail/src/test/java/org/springframework/integration/samples/mail/imapidle/GmailInboundPop3AdapterTest.java @@ -15,12 +15,12 @@ import org.springframework.integration.core.MessageHandler; * @author Oleg Zhurakousky * */ -public class GmailImapIdleAdapterTest { - private static Logger logger = Logger.getLogger(GmailImapIdleAdapterTest.class); +public class GmailInboundPop3AdapterTest { + private static Logger logger = Logger.getLogger(GmailInboundPop3AdapterTest.class); public static void main (String[] args) throws Exception { - ApplicationContext ac = new ClassPathXmlApplicationContext("/META-INF/spring/integration/mail-imap-idle-config.xml"); + ApplicationContext ac = new ClassPathXmlApplicationContext("/META-INF/spring/integration/gmail-pop3-config.xml"); DirectChannel inputChannel = ac.getBean("recieveChannel", DirectChannel.class); inputChannel.subscribe(new MessageHandler() { public void handleMessage(Message message) throws MessagingException {