Package org.dspace.services.email
Class EmailServiceImpl
- java.lang.Object
-
- javax.mail.Authenticator
-
- org.dspace.services.email.EmailServiceImpl
-
- All Implemented Interfaces:
EmailService
public class EmailServiceImpl extends javax.mail.Authenticator implements EmailService
Provides mail sending services through JavaMail. If aSession
instance is provided through JNDI, it will be used. If not, then a session will be created from DSpace configuration data (mail.server
etc.)- Author:
- mwood
-
-
Constructor Summary
Constructors Constructor Description EmailServiceImpl()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected javax.mail.PasswordAuthentication
getPasswordAuthentication()
javax.mail.Session
getSession()
Provide a reference to the JavaMail session.void
init()
void
reset()
Force a new initialization of the session, useful for testing purposevoid
setCfg(ConfigurationService cfg)
Inject/set the ConfigurationService
-
-
-
Method Detail
-
setCfg
@Autowired(required=true) public void setCfg(ConfigurationService cfg)
Inject/set the ConfigurationService- Parameters:
cfg
- the configurationService object
-
getSession
public javax.mail.Session getSession()
Provide a reference to the JavaMail session.- Specified by:
getSession
in interfaceEmailService
- Returns:
- the managed Session, or
null
if none could be created.
-
init
@PostConstruct public void init()
-
getPasswordAuthentication
protected javax.mail.PasswordAuthentication getPasswordAuthentication()
- Overrides:
getPasswordAuthentication
in classjavax.mail.Authenticator
-
reset
public void reset()
Force a new initialization of the session, useful for testing purpose
-
-