Nuxeo ECM Projects 5.4.3-SNAPSHOT

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
 Store getConnectedStore(String name)
          Returns a connected store for this factory.
 Store getConnectedStore(String name, Map<String,Object> context)
           
 Transport getConnectedTransport(String name)
          Returns a connected transport for this factory.
 Transport getConnectedTransport(String name, Map<String,Object> context)
           
 PropertiesFetcher getFetcher(String name)
           
 MailBoxActions getMailBoxActions(String factoryName, String folderName)
          Returns an actions pipe configured with this factory.
 MailBoxActions getMailBoxActions(String factoryName, String folderName, Map<String,Object> context)
           
 MessageActionPipe getPipe(String name)
          Gets the pipe of actions for given name
 Session getSession(String name)
          Returns a session for this factory, using the context to find the session or the default if no context is provided.
 Session getSession(String name, Map<String,Object> context)
           
 void registerContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
           
 void sendMail(String text, String subject, String factory, Address[] recipients)
          Sends a mail using the setting of this factory to this recipients.
 void sendMail(String text, String subject, String factory, Address[] recipients, Map<String,Object> context)
           
 void unregisterContribution(Object contribution, String extensionPoint, ComponentInstance contributor)
           
 
Methods inherited from class org.nuxeo.runtime.model.DefaultComponent
activate, applicationStarted, 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(Object contribution,
                                 String extensionPoint,
                                 ComponentInstance contributor)
                          throws Exception
Overrides:
registerContribution in class DefaultComponent
Throws:
Exception

unregisterContribution

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

getConnectedStore

public Store getConnectedStore(String name)
                        throws 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:
Exception

getConnectedStore

public Store getConnectedStore(String name,
                               Map<String,Object> context)
                        throws Exception
Specified by:
getConnectedStore in interface MailService
Throws:
Exception

getConnectedTransport

public Transport getConnectedTransport(String name)
                                throws 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:
Exception

getConnectedTransport

public Transport getConnectedTransport(String name,
                                       Map<String,Object> context)
                                throws Exception
Specified by:
getConnectedTransport in interface MailService
Throws:
Exception

getSession

public Session getSession(String name)
                   throws 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:
Exception

getSession

public Session getSession(String name,
                          Map<String,Object> context)
                   throws Exception
Specified by:
getSession in interface MailService
Throws:
Exception

getMailBoxActions

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

getMailBoxActions

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

sendMail

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

sendMail

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

getFetcher

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

getPipe

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

Specified by:
getPipe in interface MailService

Nuxeo ECM Projects 5.4.3-SNAPSHOT

Copyright © 2011 Nuxeo SAS. All Rights Reserved.