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 ctEmailClientProvider.java
Modifier and Type | Field and Description |
---|---|
static java.lang.String |
EMAIL_AUTHOR_PROPERTY
Property for author of email, i.e.
|
static java.lang.String |
EMAIL_MESSAGE_PROPERTY
Property for message contents parsed from email body.
|
static java.lang.String |
EMAIL_SUBJECT_PROPERTY
Property for subject of email.
|
Modifier and Type | Method and Description |
---|---|
boolean |
acceptsMail(MimeMessage mailMessage)
Returns true if mailMessage can be parsed using this EmailClientProvider else false.
|
java.lang.String |
getEmailContent(MimeMessage mailMessage)
Returns mailMessage content.
|
java.util.Properties |
getMailProperties(EmailReplyConfiguration configuration,
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 java.lang.String EMAIL_MESSAGE_PROPERTY
static final java.lang.String EMAIL_AUTHOR_PROPERTY
static final java.lang.String EMAIL_SUBJECT_PROPERTY
boolean acceptsMail(MimeMessage mailMessage)
mailMessage
- mail to be parsedjava.util.Properties getMailProperties(EmailReplyConfiguration configuration, MimeMessage mailMessage)
email.message
and email.author.id
.configuration
- current EmailReplyConfiguration
implementationmailMessage
- mail whose properties is to be parsedjava.lang.String getEmailContent(MimeMessage mailMessage) throws java.io.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 readjava.io.IOException
- thrown by MimeMessage DataHandlerMessagingException
- thrown by MimeMessage DataHandlerint getPriorityOrder()
"Copyright © 2010 - 2020 Adobe Systems Incorporated. All Rights Reserved"