1 10 11 package org.mule.providers.email; 12 13 import javax.mail.Authenticator ; 14 15 import org.mule.providers.AbstractServiceEnabledConnector; 16 import org.mule.umo.UMOComponent; 17 import org.mule.umo.endpoint.UMOEndpoint; 18 import org.mule.umo.provider.UMOMessageReceiver; 19 20 24 public class Pop3Connector extends AbstractServiceEnabledConnector implements MailConnector 25 { 26 public static final String MAILBOX = "INBOX"; 27 public static final int DEFAULT_POP3_PORT = 110; 28 public static final int DEFAULT_CHECK_FREQUENCY = 60000; 29 30 34 protected long checkFrequency = DEFAULT_CHECK_FREQUENCY; 35 36 39 protected String backupFolder = null; 40 41 46 protected Authenticator authenticator = null; 47 48 51 protected boolean deleteReadMessages = true; 52 53 public Pop3Connector() 54 { 55 super(); 56 this.setCreateDispatcherPerRequest(true); 58 } 59 60 63 public long getCheckFrequency() 64 { 65 return checkFrequency; 66 } 67 68 73 public String getProtocol() 74 { 75 return "pop3"; 76 } 77 78 81 public void setCheckFrequency(long l) 82 { 83 if (l < 1) 84 { 85 l = DEFAULT_CHECK_FREQUENCY; 86 } 87 checkFrequency = l; 88 } 89 90 93 public String getBackupFolder() 94 { 95 return backupFolder; 96 } 97 98 101 public void setBackupFolder(String string) 102 { 103 backupFolder = string; 104 } 105 106 112 public UMOMessageReceiver createReceiver(UMOComponent component, UMOEndpoint endpoint) throws Exception 113 { 114 Object [] args = {new Long (checkFrequency), backupFolder}; 115 return serviceDescriptor.createMessageReceiver(this, component, endpoint, args); 116 } 117 118 public Authenticator getAuthenticator() 119 { 120 return authenticator; 121 } 122 123 public void setAuthenticator(Authenticator authenticator) 124 { 125 this.authenticator = authenticator; 126 } 127 128 public int getDefaultPort() 129 { 130 return DEFAULT_POP3_PORT; 131 } 132 133 public boolean isDeleteReadMessages() 134 { 135 return deleteReadMessages; 136 } 137 138 public void setDeleteReadMessages(boolean deleteReadMessages) 139 { 140 this.deleteReadMessages = deleteReadMessages; 141 } 142 } 143 | Popular Tags |