Class AbstractMailProvider

    • Field Detail

      • MAIL_PROVIDER_PROP_PREFIX

        public static java.lang.String MAIL_PROVIDER_PROP_PREFIX
      • MAIL_ACCOUNT_REQUEST_ATTRIBUTE

        public static java.lang.String MAIL_ACCOUNT_REQUEST_ATTRIBUTE
    • Constructor Detail

      • AbstractMailProvider

        public AbstractMailProvider()
    • Method Detail

      • supportFeature

        public boolean supportFeature​(java.lang.String featureName)
        Returns true if current provider does support given feature.

        To be overridden by each provider implementation to indicate which features are supported.

        Return false by default.

        Parameters:
        featureName - the name of the feature to test
        Returns:
        true if the given feature is supported by the current provider.
      • supportFeature

        public boolean supportFeature​(AbstractMailProvider.Feature feature)
        Returns true if current provider does support given feature.

        Feature is checked to be contained in getFeatureSet().

        Parameters:
        feature - feature to test
        Returns:
        true if the given feature is supported by the current provider.
      • getFeatureSet

        public java.util.Set<AbstractMailProvider.Feature> getFeatureSet()
        Returns the set of features current provider does support.

        By default, returns null.

        Has to be override by each provider for real feature support detection.

        Returns:
        provider supported features set
      • getName

        public java.lang.String getName()
        Description copied from interface: GenericProvider
        returns the name of the provider
        Specified by:
        getName in interface GenericProvider
        Returns:
        the name of the provider
      • setName

        protected void setName​(java.lang.String name)
      • getLabel

        public java.lang.String getLabel​(java.lang.String lang)
        Description copied from interface: GenericProvider
        returns the label of the provider
        Specified by:
        getLabel in interface GenericProvider
        Parameters:
        lang - the language of the label
        Returns:
        the label of the provider
      • init

        public void init​(java.lang.String providerName,
                         JProperties properties)
        Description copied from interface: GenericProvider
        this method is called on provider's initialization
        Specified by:
        init in interface GenericProvider
        Parameters:
        providerName - the name of the provider, from class configuration property
        properties - the properties with the same prefix than the property describing the provider class
      • isSendFeatureInitialized

        public boolean isSendFeatureInitialized()
        indicate if the provider is correctly initialized for sending email
        Returns:
        true if the provider is correctly initialized for sending email, false otherwise
      • isFetchFeatureInitialized

        public boolean isFetchFeatureInitialized()
        indicate if the provider is correctly initialized for fetching email
        Returns:
        true if the provider is correctly initialized for fetching email, false otherwise
      • sendMessages

        public java.util.List<MailMessage> sendMessages​(MailMessage[] msg,
                                                        boolean catchMailErrors)
                                                 throws ServiceException
        Send given messages.
        Parameters:
        msg - array of MailMessage to be sent
        catchMailErrors - 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
      • getMailInfoJsp

        public java.lang.String getMailInfoJsp()