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
public class LegacyMailProvider extends AbstractMailProvider
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from class com.jalios.jcms.mail.AbstractMailProvider
AbstractMailProvider.Feature
-
-
Field Summary
Fields Modifier and Type Field Description static java.lang.StringADDITIONALS_PROPERTIES_SUFFIXstatic java.lang.StringFETCHER_PREFIXstatic java.lang.StringHOST_SUFFIXstatic java.lang.StringLOGIN_SUFFIXstatic java.lang.StringPASSWORD_SUFFIXstatic java.lang.StringPORT_SUFFIXstatic java.lang.StringPROTOCOL_SUFFIXstatic java.lang.StringSMTP_PREFIXstatic java.lang.StringSSL_SUFFIX-
Fields inherited from class com.jalios.jcms.mail.AbstractMailProvider
MAIL_ACCOUNT_REQUEST_ATTRIBUTE, MAIL_PROVIDER_PROP_PREFIX
-
-
Constructor Summary
Constructors Constructor Description LegacyMailProvider()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description voidendFetchTransaction(FetchMailTransaction mailTransaction)End aFetchMailTransactionjava.util.Set<MailMessage>expunge(FetchMailTransaction mailTransaction, java.util.Set<MailMessage> messageToExpunge)expunge the provided message from the remote mailbox servicejava.util.List<MailMessage>fetch(FetchMailTransaction mailTransaction, boolean expungeOnFetch)Fetch MailMessage from a mail boxjava.lang.Class<? extends AbstractMailEditHandler>getEditHandlerClass()java.util.Set<AbstractMailProvider.Feature>getFeatureSet()Returns the set of features current provider does support.java.util.PropertiesgetFetcherAdditionalsProperties()java.lang.StringgetFetcherHost()java.lang.StringgetFetcherLogin()java.lang.StringgetFetcherPassword()intgetFetcherPort()java.lang.StringgetFetcherProtocol()java.lang.StringgetMailInfoJsp()java.util.PropertiesgetSmtpAdditionalsProperties()java.lang.StringgetSmtpHost()java.lang.StringgetSmtpLogin()java.lang.StringgetSmtpPassword()intgetSmtpPort()voidinit(java.lang.String providerName, JProperties properties)this method is called on provider's initializationbooleanisFetcherSsl()booleanisFetchFeatureInitialized()indicate if the provider is correctly initialized for fetching emailbooleanisSendFeatureInitialized()indicate if the provider is correctly initialized for sending emailjava.util.List<MailMessage>sendMessages(MailMessage[] messages, boolean catchMailErrors)Send given messages.voidsetFetcherAdditionalsProperties(java.util.Properties fetcherAdditionalsProperties)voidsetFetcherHost(java.lang.String fetcherHost)voidsetFetcherLogin(java.lang.String fetcherLogin)voidsetFetcherPassword(java.lang.String fetcherPassword)voidsetFetcherPort(int fetcherPort)voidsetFetcherProtocol(java.lang.String fetcherProtocol)voidsetFetcherSsl(boolean fetcherSsl)voidsetSmtpAdditionalsProperties(java.util.Properties smtpAdditionalsProperties)voidsetSmtpHost(java.lang.String smtpHost)voidsetSmtpLogin(java.lang.String smtpLogin)voidsetSmtpPassword(java.lang.String smtpPassword)protected voidsetSmtpPort(int smtpPort)FetchMailTransactionstartFetchTransaction(java.lang.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, supportFeature
-
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
-
Methods inherited from interface com.jalios.jcms.GenericProvider
isInitialized
-
-
-
-
Field Detail
-
FETCHER_PREFIX
public static final java.lang.String FETCHER_PREFIX
- See Also:
- Constant Field Values
-
SMTP_PREFIX
public static final java.lang.String SMTP_PREFIX
- See Also:
- Constant Field Values
-
HOST_SUFFIX
public static final java.lang.String HOST_SUFFIX
- See Also:
- Constant Field Values
-
PORT_SUFFIX
public static final java.lang.String PORT_SUFFIX
- See Also:
- Constant Field Values
-
LOGIN_SUFFIX
public static final java.lang.String LOGIN_SUFFIX
- See Also:
- Constant Field Values
-
PASSWORD_SUFFIX
public static final java.lang.String PASSWORD_SUFFIX
- See Also:
- Constant Field Values
-
ADDITIONALS_PROPERTIES_SUFFIX
public static final java.lang.String ADDITIONALS_PROPERTIES_SUFFIX
- See Also:
- Constant Field Values
-
PROTOCOL_SUFFIX
public static final java.lang.String PROTOCOL_SUFFIX
- See Also:
- Constant Field Values
-
SSL_SUFFIX
public static final java.lang.String SSL_SUFFIX
- See Also:
- Constant Field Values
-
-
Method Detail
-
init
public void init(java.lang.String providerName, JProperties properties)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
public java.lang.Class<? extends AbstractMailEditHandler> getEditHandlerClass()
- Overrides:
getEditHandlerClassin classAbstractMailProvider
-
getMailInfoJsp
public java.lang.String getMailInfoJsp()
- Overrides:
getMailInfoJspin classAbstractMailProvider
-
getFeatureSet
public java.util.Set<AbstractMailProvider.Feature> 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 java.util.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
public FetchMailTransaction startFetchTransaction(java.lang.String mbox) throws ServiceException
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
public void endFetchTransaction(FetchMailTransaction mailTransaction) throws ServiceException
Description copied from class:AbstractMailProviderEnd aFetchMailTransaction- Overrides:
endFetchTransactionin classAbstractMailProvider- Parameters:
mailTransaction- theFetchMailTransactioninstance to end- Throws:
ServiceException- if any exception occurs
-
fetch
public java.util.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 java.util.Set<MailMessage> expunge(FetchMailTransaction mailTransaction, java.util.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
public java.lang.String getSmtpHost()
-
setSmtpHost
public void setSmtpHost(java.lang.String smtpHost)
-
getSmtpPort
public int getSmtpPort()
-
setSmtpPort
protected void setSmtpPort(int smtpPort)
-
getSmtpLogin
public java.lang.String getSmtpLogin()
-
setSmtpLogin
public void setSmtpLogin(java.lang.String smtpLogin)
-
getSmtpPassword
public java.lang.String getSmtpPassword()
-
setSmtpPassword
public void setSmtpPassword(java.lang.String smtpPassword)
-
getSmtpAdditionalsProperties
public java.util.Properties getSmtpAdditionalsProperties()
-
setSmtpAdditionalsProperties
public void setSmtpAdditionalsProperties(java.util.Properties smtpAdditionalsProperties)
-
getFetcherHost
public java.lang.String getFetcherHost()
-
setFetcherHost
public void setFetcherHost(java.lang.String fetcherHost)
-
getFetcherPort
public int getFetcherPort()
-
setFetcherPort
public void setFetcherPort(int fetcherPort)
-
getFetcherProtocol
public java.lang.String getFetcherProtocol()
-
setFetcherProtocol
public void setFetcherProtocol(java.lang.String fetcherProtocol)
-
getFetcherLogin
public java.lang.String getFetcherLogin()
-
setFetcherLogin
public void setFetcherLogin(java.lang.String fetcherLogin)
-
getFetcherPassword
public java.lang.String getFetcherPassword()
-
setFetcherPassword
public void setFetcherPassword(java.lang.String fetcherPassword)
-
isFetcherSsl
public boolean isFetcherSsl()
-
setFetcherSsl
public void setFetcherSsl(boolean fetcherSsl)
-
getFetcherAdditionalsProperties
public java.util.Properties getFetcherAdditionalsProperties()
-
setFetcherAdditionalsProperties
public void setFetcherAdditionalsProperties(java.util.Properties fetcherAdditionalsProperties)
-
-