Nuxeo Enterprise Platform 5.4

org.nuxeo.ecm.platform.mail.service
Class MailServiceImpl

java.lang.Object
  extended by org.nuxeo.runtime.model.DefaultComponent
      extended by org.nuxeo.ecm.platform.mail.service.MailServiceImpl
All Implemented Interfaces:
MailService, Adaptable, Component, Extensible

public class MailServiceImpl
extends DefaultComponent
implements MailService

Author:
Alexandre Russel

Constructor Summary
MailServiceImpl()
           
 
Method Summary
 javax.mail.Store getConnectedStore(java.lang.String name)
          Returns a connected store for this factory.
 javax.mail.Store getConnectedStore(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> context)
           
 javax.mail.Transport getConnectedTransport(java.lang.String name)
          Returns a connected transport for this factory.
 javax.mail.Transport getConnectedTransport(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> context)
           
 PropertiesFetcher getFetcher(java.lang.String name)
           
 MailBoxActions getMailBoxActions(java.lang.String factoryName, java.lang.String folderName)
          Returns an actions pipe configured with this factory.
 MailBoxActions getMailBoxActions(java.lang.String factoryName, java.lang.String folderName, java.util.Map<java.lang.String,java.lang.Object> context)
           
 MessageActionPipe getPipe(java.lang.String name)
          Gets the pipe of actions for given name
 javax.mail.Session getSession(java.lang.String name)
          Returns a session for this factory, using the context to find the session or the default if no context is provided.
 javax.mail.Session getSession(java.lang.String name, java.util.Map<java.lang.String,java.lang.Object> context)
           
 void registerContribution(java.lang.Object contribution, java.lang.String extensionPoint, ComponentInstance contributor)
           
 void sendMail(java.lang.String text, java.lang.String subject, java.lang.String factory, javax.mail.Address[] recipients)
          Sends a mail using the setting of this factory to this recipients.
 void sendMail(java.lang.String text, java.lang.String subject, java.lang.String factory, javax.mail.Address[] recipients, java.util.Map<java.lang.String,java.lang.Object> context)
           
 void unregisterContribution(java.lang.Object contribution, java.lang.String extensionPoint, ComponentInstance contributor)
           
 
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, deactivate, getAdapter, registerExtension, unregisterExtension
 
Methods inherited from class java.lang.Object
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

MailServiceImpl

public MailServiceImpl()
Method Detail

registerContribution

public void registerContribution(java.lang.Object contribution,
                                 java.lang.String extensionPoint,
                                 ComponentInstance contributor)
                          throws java.lang.Exception
Overrides:
registerContribution in class DefaultComponent
Throws:
java.lang.Exception

unregisterContribution

public void unregisterContribution(java.lang.Object contribution,
                                   java.lang.String extensionPoint,
                                   ComponentInstance contributor)
                            throws java.lang.Exception
Overrides:
unregisterContribution in class DefaultComponent
Throws:
java.lang.Exception

getConnectedStore

public javax.mail.Store getConnectedStore(java.lang.String name)
                                   throws java.lang.Exception
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:
java.lang.Exception

getConnectedStore

public javax.mail.Store getConnectedStore(java.lang.String name,
                                          java.util.Map<java.lang.String,java.lang.Object> context)
                                   throws java.lang.Exception
Specified by:
getConnectedStore in interface MailService
Throws:
java.lang.Exception

getConnectedTransport

public javax.mail.Transport getConnectedTransport(java.lang.String name)
                                           throws java.lang.Exception
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:
java.lang.Exception

getConnectedTransport

public javax.mail.Transport getConnectedTransport(java.lang.String name,
                                                  java.util.Map<java.lang.String,java.lang.Object> context)
                                           throws java.lang.Exception
Specified by:
getConnectedTransport in interface MailService
Throws:
java.lang.Exception

getSession

public javax.mail.Session getSession(java.lang.String name)
                              throws java.lang.Exception
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
Throws:
java.lang.Exception

getSession

public javax.mail.Session getSession(java.lang.String name,
                                     java.util.Map<java.lang.String,java.lang.Object> context)
                              throws java.lang.Exception
Specified by:
getSession in interface MailService
Throws:
java.lang.Exception

getMailBoxActions

public MailBoxActions getMailBoxActions(java.lang.String factoryName,
                                        java.lang.String folderName)
                                 throws java.lang.Exception
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:
java.lang.Exception

getMailBoxActions

public MailBoxActions getMailBoxActions(java.lang.String factoryName,
                                        java.lang.String folderName,
                                        java.util.Map<java.lang.String,java.lang.Object> context)
                                 throws java.lang.Exception
Specified by:
getMailBoxActions in interface MailService
Throws:
java.lang.Exception

sendMail

public void sendMail(java.lang.String text,
                     java.lang.String subject,
                     java.lang.String factory,
                     javax.mail.Address[] recipients)
              throws java.lang.Exception
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
Throws:
java.lang.Exception

sendMail

public void sendMail(java.lang.String text,
                     java.lang.String subject,
                     java.lang.String factory,
                     javax.mail.Address[] recipients,
                     java.util.Map<java.lang.String,java.lang.Object> context)
              throws java.lang.Exception
Specified by:
sendMail in interface MailService
Throws:
java.lang.Exception

getFetcher

public PropertiesFetcher getFetcher(java.lang.String name)
                             throws java.lang.Exception
Specified by:
getFetcher in interface MailService
Throws:
java.lang.Exception

getPipe

public MessageActionPipe getPipe(java.lang.String name)
Description copied from interface: MailService
Gets the pipe of actions for given name

Specified by:
getPipe in interface MailService

Nuxeo Enterprise Platform 5.4

Copyright © 2010 Nuxeo SAS. All Rights Reserved.