public class FaultyEmailAddressScanner extends Object
IMAPMailBoxReader parses for failed email addresses.
Cleans them out and products a faulty List and a clean list.| Modifier and Type | Field and Description |
|---|---|
protected Pattern |
emailPattern
Scan content for emails in the pattern
|
protected String[] |
filterHeaders
Will scan for these Headers for faulty emails directly, and skip parsing main content.
|
protected Pattern |
filterSubjectCatchPhrases
Filter mails that indicate there was something wrong with the email or Mail
The RegEx defined by this will filter based on subjects |
protected boolean |
scanOnlyUsingSubject |
| Constructor and Description |
|---|
FaultyEmailAddressScanner() |
FaultyEmailAddressScanner(OneLoadReader<javax.mail.internet.InternetAddress> addressReader) |
FaultyEmailAddressScanner(Set<javax.mail.internet.InternetAddress> inputSet) |
| Modifier and Type | Method and Description |
|---|---|
Set<String> |
filterValidAddresses(Set<String> faulty)
Convenience mothod
Given a Faulty list that maybe derived from scanForFaultyAddresses(), this method returns only valid ones from original input set |
Pattern |
getEmailPattern() |
String[] |
getFilterHeaders() |
Pattern |
getFilterSubjectCatchPhrases() |
Set<javax.mail.internet.InternetAddress> |
getInputSet() |
IMAPMailBoxReader |
getMailBoxReader() |
protected boolean |
matchSubject(String subject) |
Set<String> |
scanForFaultyAddresses()
Scan for faulty mails using
IMAPMailBoxReader |
protected Set<String> |
scanHeadersForFaultyAddresses(javax.mail.Message mail) |
void |
setEmailPattern(Pattern emailPattern) |
void |
setFilterHeaders(String[] filterHeaders) |
void |
setFilterSubjectCatchPhrases(Pattern filterSubjectCatchPhrases) |
void |
setInputSet(Set<javax.mail.internet.InternetAddress> inputSet) |
void |
setMailBoxReader(IMAPMailBoxReader mailBoxReader) |
protected boolean scanOnlyUsingSubject
protected Pattern filterSubjectCatchPhrases
protected Pattern emailPattern
protected String[] filterHeaders
public FaultyEmailAddressScanner()
public FaultyEmailAddressScanner(Set<javax.mail.internet.InternetAddress> inputSet)
public FaultyEmailAddressScanner(OneLoadReader<javax.mail.internet.InternetAddress> addressReader) throws Exception
Exceptionprotected boolean matchSubject(String subject)
protected Set<String> scanHeadersForFaultyAddresses(javax.mail.Message mail) throws javax.mail.MessagingException
javax.mail.MessagingExceptionpublic Set<String> scanForFaultyAddresses() throws Exception
IMAPMailBoxReaderjavax.mail.MessagingExceptionIOExceptionExceptionpublic Set<String> filterValidAddresses(Set<String> faulty)
scanForFaultyAddresses(), this method returns only valid ones from original input setfaulty - public Set<javax.mail.internet.InternetAddress> getInputSet()
public void setInputSet(Set<javax.mail.internet.InternetAddress> inputSet)
public IMAPMailBoxReader getMailBoxReader()
public void setMailBoxReader(IMAPMailBoxReader mailBoxReader)
public Pattern getFilterSubjectCatchPhrases()
public void setFilterSubjectCatchPhrases(Pattern filterSubjectCatchPhrases)
public Pattern getEmailPattern()
public void setEmailPattern(Pattern emailPattern)
public String[] getFilterHeaders()
public void setFilterHeaders(String[] filterHeaders)
Copyright © 2018. All rights reserved.