Package com.jalios.jcms.mail.providers
Class LegacyMailProvider
java.lang.Object
com.jalios.jcms.mail.AbstractMailProvider
com.jalios.jcms.mail.providers.LegacyMailProvider
- All Implemented Interfaces:
GenericProvider
- Since:
- jcms-10.0.8 / JCMS-8473
-
Nested Class Summary
Nested classes/interfaces inherited from class com.jalios.jcms.mail.AbstractMailProvider
AbstractMailProvider.Feature -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final Stringstatic final StringFields inherited from class com.jalios.jcms.mail.AbstractMailProvider
MAIL_ACCOUNT_REQUEST_ATTRIBUTE, MAIL_PROVIDER_PROP_PREFIX -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionvoidendFetchTransaction(FetchMailTransaction mailTransaction) End aFetchMailTransactionexpunge(FetchMailTransaction mailTransaction, Set<MailMessage> messageToExpunge) expunge the provided message from the remote mailbox servicefetch(FetchMailTransaction mailTransaction, boolean expungeOnFetch) Fetch MailMessage from a mail boxClass<? extends AbstractMailEditHandler> Returns the set of features current provider does support.intintvoidinit(String providerName, JProperties properties) this method is called on provider's initializationbooleanbooleanindicate if the provider is correctly initialized for fetching emailbooleanindicate if the provider is correctly initialized for sending emailsendMessages(MailMessage[] messages, boolean catchMailErrors) Send given messages.voidsetFetcherAdditionalsProperties(Properties fetcherAdditionalsProperties) voidsetFetcherHost(String fetcherHost) voidsetFetcherLogin(String fetcherLogin) voidsetFetcherPassword(String fetcherPassword) voidsetFetcherPort(int fetcherPort) voidsetFetcherProtocol(String fetcherProtocol) voidsetFetcherSsl(boolean fetcherSsl) voidsetSmtpAdditionalsProperties(Properties smtpAdditionalsProperties) voidsetSmtpHost(String smtpHost) voidsetSmtpLogin(String smtpLogin) voidsetSmtpPassword(String smtpPassword) protected voidsetSmtpPort(int smtpPort) startFetchTransaction(String mbox) Start aFetchMailTransactionobject (end of this transaction is the responsibility of the caller).Methods inherited from class com.jalios.jcms.mail.AbstractMailProvider
getLabel, getName, setName, supportFeature, supportFeatureMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface com.jalios.jcms.GenericProvider
isInitialized
-
Field Details
-
FETCHER_PREFIX
- See Also:
-
SMTP_PREFIX
- See Also:
-
HOST_SUFFIX
- See Also:
-
PORT_SUFFIX
- See Also:
-
LOGIN_SUFFIX
- See Also:
-
PASSWORD_SUFFIX
- See Also:
-
ADDITIONALS_PROPERTIES_SUFFIX
- See Also:
-
PROTOCOL_SUFFIX
- See Also:
-
SSL_SUFFIX
- See Also:
-
-
Constructor Details
-
LegacyMailProvider
public LegacyMailProvider()
-
-
Method Details
-
init
Description copied from interface:GenericProviderthis method is called on provider's initialization- Specified by:
initin interfaceGenericProvider- Overrides:
initin classAbstractMailProvider- Parameters:
providerName- the name of the provider, from class configuration propertyproperties- the properties with the same prefix than the property describing the provider class
-
getEditHandlerClass
- Overrides:
getEditHandlerClassin classAbstractMailProvider
-
getMailInfoJsp
- Overrides:
getMailInfoJspin classAbstractMailProvider
-
getFeatureSet
Description copied from class:AbstractMailProviderReturns the set of features current provider does support.By default, returns null.
Has to be override by each provider for real feature support detection.
- Overrides:
getFeatureSetin classAbstractMailProvider- Returns:
- provider supported features set
-
isSendFeatureInitialized
public boolean isSendFeatureInitialized()Description copied from class:AbstractMailProviderindicate if the provider is correctly initialized for sending email- Overrides:
isSendFeatureInitializedin classAbstractMailProvider- Returns:
- true if the provider is correctly initialized for sending email, false otherwise
-
isFetchFeatureInitialized
public boolean isFetchFeatureInitialized()Description copied from class:AbstractMailProviderindicate if the provider is correctly initialized for fetching email- Overrides:
isFetchFeatureInitializedin classAbstractMailProvider- Returns:
- true if the provider is correctly initialized for fetching email, false otherwise
-
sendMessages
public List<MailMessage> sendMessages(MailMessage[] messages, boolean catchMailErrors) throws ServiceException Description copied from class:AbstractMailProviderSend given messages.- Overrides:
sendMessagesin classAbstractMailProvider- Parameters:
messages- array of MailMessage to be sentcatchMailErrors- set to true to prevent this method to throw exception when sending messages- Returns:
- null or empty list if catchMailErrors is false, a List of Message that could not be sent if catchMailErrors is true
- Throws:
ServiceException- if any exception occurs in send process
-
startFetchTransaction
Description copied from class:AbstractMailProviderStart aFetchMailTransactionobject (end of this transaction is the responsibility of the caller).- Overrides:
startFetchTransactionin classAbstractMailProvider- Parameters:
mbox- the mail box name (may be null if not needed)- Returns:
- the
FetchMailTransactioninstance - Throws:
ServiceException- if any exception occurs
-
endFetchTransaction
Description copied from class:AbstractMailProviderEnd aFetchMailTransaction- Overrides:
endFetchTransactionin classAbstractMailProvider- Parameters:
mailTransaction- theFetchMailTransactioninstance to end- Throws:
ServiceException- if any exception occurs
-
fetch
public List<MailMessage> fetch(FetchMailTransaction mailTransaction, boolean expungeOnFetch) throws ServiceException Description copied from class:AbstractMailProviderFetch MailMessage from a mail box- Overrides:
fetchin classAbstractMailProvider- Parameters:
mailTransaction- theFetchMailTransactionin which fetch should be done (seeAbstractMailProvider.startFetchTransaction(java.lang.String)andAbstractMailProvider.endFetchTransaction(com.jalios.jcms.mail.FetchMailTransaction)expungeOnFetch- expunge after mail fetch- Returns:
- The list of MailMessage read from the mailbox service
- Throws:
ServiceException- if any exception occurs in fetch process
-
expunge
public Set<MailMessage> expunge(FetchMailTransaction mailTransaction, Set<MailMessage> messageToExpunge) throws ServiceException Description copied from class:AbstractMailProviderexpunge the provided message from the remote mailbox service- Overrides:
expungein classAbstractMailProvider- Parameters:
mailTransaction- theFetchMailTransactionin which fetch should be done (seeAbstractMailProvider.startFetchTransaction(java.lang.String)andAbstractMailProvider.endFetchTransaction(com.jalios.jcms.mail.FetchMailTransaction)messageToExpunge- the Set ofMailMessageto expunge- Returns:
- the Set of MailMessage which has been successfully expunged
- Throws:
ServiceException- if any exception occurs in expunge process
-
getSmtpHost
-
setSmtpHost
-
getSmtpPort
public int getSmtpPort() -
setSmtpPort
protected void setSmtpPort(int smtpPort) -
getSmtpLogin
-
setSmtpLogin
-
getSmtpPassword
-
setSmtpPassword
-
getSmtpAdditionalsProperties
-
setSmtpAdditionalsProperties
-
getFetcherHost
-
setFetcherHost
-
getFetcherPort
public int getFetcherPort() -
setFetcherPort
public void setFetcherPort(int fetcherPort) -
getFetcherProtocol
-
setFetcherProtocol
-
getFetcherLogin
-
setFetcherLogin
-
getFetcherPassword
-
setFetcherPassword
-
isFetcherSsl
public boolean isFetcherSsl() -
setFetcherSsl
public void setFetcherSsl(boolean fetcherSsl) -
getFetcherAdditionalsProperties
-
setFetcherAdditionalsProperties
-