public interface EmailClientProvider
EmailClientProvider
specifies the contract for different email client service providers.
EmailClientProvider services are used to parse relevant information (like post, post author, etc) from mail
message. Whether the EmailClientProvider can parse given mailMessage can be checked using acceptsMail() method. For
EmailClientProvider which parses mailMessage for creation of post, mandatory set of properties which needs to be
parsed are email.message
and email.author.id
.
EmailClientProvider Services has been intended to provide dynamic support for various email clients like gmail,
outlook which use different patterns of quoted text in their reply email.
Abstract implementation is provided by AbstractEmailClientProvider.java
Modifier and Type | Field and Description |
---|---|
static String |
EMAIL_AUTHOR_PROPERTY
Property for author of email, i.e.
|
static String |
EMAIL_MESSAGE_PROPERTY
Property for message contents parsed from email body.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsMail(MimeMessage mailMessage)
Returns true if mailMessage can be parsed using this EmailClientProvider else false.
|
String |
getEmailContent(MimeMessage mailMessage)
Returns mailMessage content.
|
Properties |
getMailProperties(MimeMessage mailMessage)
Returns a set of mail properties parsed from mailMessage.
|
int |
getPriorityOrder()
Returns the priority rank deciding the order in which this email client provider will be used to parse reply
emails.
|
static final String EMAIL_MESSAGE_PROPERTY
static final String EMAIL_AUTHOR_PROPERTY
boolean acceptsMail(MimeMessage mailMessage)
mailMessage
- mail to be parsedProperties getMailProperties(MimeMessage mailMessage)
email.message
and email.author.id
.mailMessage
- String getEmailContent(MimeMessage mailMessage) throws IOException, MessagingException
Multipart
, first part with content type "text/plain" is returned. Quoted text, in case of reply
emails, is not pruned from content.
Can be extended by implementations for more complex parsing of mail content.mailMessage
- mail whose content is to be readIOException
- thrown by MimeMessage DataHandlerjavax.mail.MessagingException
- thrown by MimeMessage DataHandlerMessagingException
int getPriorityOrder()
"Copyright © 2006 - 2015 Adobe Systems Incorporated. All Rights Reserved"