Class MailServiceImpl

    • Field Detail

      • sessions

        protected final Map<String,​javax.mail.Session> sessions
    • Constructor Detail

      • MailServiceImpl

        public MailServiceImpl()
    • Method Detail

      • getConnectedStore

        public javax.mail.Store getConnectedStore​(String name)
                                           throws javax.mail.MessagingException
        Description copied from interface: MailService
        Returns a connected store for this factory. The store needs to be closed after use.
        Specified by:
        getConnectedStore in interface MailService
        Parameters:
        name - The name of the factory that provides the properties.
        Returns:
        the store.
        Throws:
        javax.mail.MessagingException
      • getConnectedStore

        public javax.mail.Store getConnectedStore​(String name,
                                                  Map<String,​Object> context)
                                           throws javax.mail.MessagingException
        Specified by:
        getConnectedStore in interface MailService
        Throws:
        javax.mail.MessagingException
      • getConnectedTransport

        public javax.mail.Transport getConnectedTransport​(String name)
                                                   throws javax.mail.MessagingException
        Description copied from interface: MailService
        Returns a connected transport for this factory. The transport needs to be closed after use.
        Specified by:
        getConnectedTransport in interface MailService
        Parameters:
        name - the name of the factory that provides the properties.
        Returns:
        the transport.
        Throws:
        javax.mail.MessagingException
      • getSession

        public javax.mail.Session getSession​(String name)
        Description copied from interface: MailService
        Returns a session for this factory, using the context to find the session or the default if no context is provided.
        Specified by:
        getSession in interface MailService
      • getMailBoxActions

        public MailBoxActions getMailBoxActions​(String factoryName,
                                                String folderName)
                                         throws javax.mail.MessagingException
        Description copied from interface: MailService
        Returns an actions pipe configured with this factory.

        The actions will start from this folder. The context is be passed to the sessionFactory to be able to find the session. Use the default session if context is not used.

        Specified by:
        getMailBoxActions in interface MailService
        Throws:
        javax.mail.MessagingException
      • sendMail

        public void sendMail​(String text,
                             String subject,
                             String factory,
                             javax.mail.Address[] recipients)
        Description copied from interface: MailService
        Sends a mail using the setting of this factory to this recipients.

        The context is passed to the sessionFactory to be able to find the session. Use the default session if context is not used. This template is used, replacing variables with the ones from this variables.

        Specified by:
        sendMail in interface MailService
      • newSession

        protected javax.mail.Session newSession​(Properties props)