1 22 package org.objectweb.petals.binding.mail; 23 24 import org.objectweb.petals.binding.mail.listeners.MailBCExternalListenerManager; 25 import org.objectweb.petals.binding.mail.listeners.MailBCJBIListener; 26 import org.objectweb.petals.binding.mail.listeners.MailSessionManager; 27 import org.objectweb.petals.binding.mail.listeners.MimeMessageManager; 28 import org.objectweb.petals.binding.mail.listeners.SessionDescriptorBuilder; 29 import org.objectweb.petals.component.common.bc.AbstractBindingComponent; 30 import org.objectweb.petals.component.common.bc.ExternalListenerManager; 31 import org.objectweb.petals.component.common.bc.JBIListener; 32 33 63 public class MailBCImpl extends AbstractBindingComponent { 64 65 public final static String FROM_PATHELEMENT = "from:"; 66 67 public final static String MAIL_FROM_KEY = "mail.from"; 68 69 public final static String MAIL_HOST_KEY = "mail.host"; 70 71 public final static String MAIL_USER_KEY = "mail.user"; 72 73 public final static String MAIL_STORE_PROTOCOL_KEY = "mail.store.protocol"; 74 75 public final static String MAIL_SMTP_PORT_DEFAULT = "25"; 76 77 public final static String MAIL_IMAP_PORT_DEFAULT = "143"; 78 79 public final static String MAIL_POP3_PORT_DEFAULT = "110"; 80 81 public final static String MAIL_SCHEME_SMTP = "smtp"; 82 83 public final static String MAIL_SCHEME_IMAP = "imap"; 84 85 public final static String MAIL_SCHEME_POP3 = "pop3"; 86 87 public final static String MAIL_TRANSPORT_PROTOCOL_KEY = "mail.transport.protocol"; 88 89 public final static String TO_PATHELEMENT = "to:"; 90 91 public final static String PERIOD_QUERYELEMENT = "period"; 92 93 public final static String PERIOD_DEFAULT = "60000"; 94 95 public final static String FOLDER_QUERYELEMENT = "folder"; 96 97 public final static String FOLDER_DEFAULT = "INBOX"; 98 99 public final static String QUERY_SEPARATOR = "&"; 100 101 public final static String DESTINATION_ADDRESS = "destinationAddress"; 102 103 protected SessionDescriptorBuilder sessionDescriptorBuilder; 104 105 protected MimeMessageManager mimeMessageManager; 106 107 protected MailSessionManager mailSessionManager; 108 109 110 @Override 111 protected void init(BindingComponentInitializer initializer) { 112 this.sessionDescriptorBuilder = new SessionDescriptorBuilder( 113 getLogger()); 114 this.mimeMessageManager = new MimeMessageManager(getLogger(), this); 115 this.mailSessionManager = new MailSessionManager(getLogger()); 116 ExternalListenerManager externalListenerManager = new MailBCExternalListenerManager( 117 getLogger(), mailSessionManager, sessionDescriptorBuilder, 118 mimeMessageManager); 119 JBIListener listener = new MailBCJBIListener(mimeMessageManager, 120 mailSessionManager, sessionDescriptorBuilder, getLogger()); 121 122 initializer.setExternalListenerManager(externalListenerManager); 123 initializer.setJbiListener(listener); 124 125 } 126 127 } 128 | Popular Tags |