public class GreenMailBean extends Object implements org.springframework.beans.factory.InitializingBean, org.springframework.beans.factory.DisposableBean, org.springframework.beans.factory.BeanNameAware
Modifier and Type | Field and Description |
---|---|
protected org.slf4j.Logger |
log
New logger.
|
Constructor and Description |
---|
GreenMailBean() |
Modifier and Type | Method and Description |
---|---|
void |
afterPropertiesSet()
Invoked by a BeanFactory after it has set all bean properties supplied (and satisfied
BeanFactoryAware and ApplicationContextAware).
|
void |
destroy()
Invoked by a BeanFactory on destruction of a singleton.
|
GreenMail |
getGreenMail()
Getter for property 'greenMail'.
|
String |
getHostname()
Getter for property 'hostname'.
|
int |
getPortOffset()
Getter for property 'portOffset'.
|
javax.mail.internet.MimeMessage[] |
getReceivedMessages()
Gets the currently received messages.
|
long |
getServerStartupTimeout()
Timeout to wait for server startup in millis
|
List<String> |
getUsers()
Getter for property 'users'.
|
boolean |
isAutostart()
Getter for property 'autostart'.
|
boolean |
isImapProtocol()
Getter for property 'imapProtocol'.
|
boolean |
isImapsProtocol()
Getter for property 'imapsProtocol'.
|
boolean |
isPop3Protocol()
Getter for property 'pop3Protocol'.
|
boolean |
isPop3sProtocol()
Getter for property 'pop3sProtocol'.
|
boolean |
isSmtpProtocol()
Getter for property 'smtpProtocol'.
|
boolean |
isSmtpsProtocol()
Getter for property 'smtpsProtocol'.
|
boolean |
isStarted()
Getter for property 'started'.
|
void |
sendEmail(String theTo,
String theFrom,
String theSubject,
String theContent)
Sends a mail message to the GreenMail server.
|
void |
setAutostart(boolean theAutostart)
Sets the autostart flag.
|
void |
setBeanName(String pName) |
void |
setHostname(String pHostname)
Setter for property 'hostname'.
|
void |
setImapProtocol(boolean theImapProtocoll)
Setter for property 'imapProtocol'.
|
void |
setImapsProtocol(boolean theImapsProtocoll)
Setter for property 'imapsProtocol'.
|
void |
setPop3Protocol(boolean thePop3Protocoll)
Setter for property 'pop3Protocol'.
|
void |
setPop3sProtocol(boolean thePop3sProtocoll)
Setter for property 'pop3sProtocol'.
|
void |
setPortOffset(int pPortOffset)
Setter for property 'portOffset'.
|
void |
setServerStartupTimeout(long serverStartupTimeout) |
void |
setSmtpProtocol(boolean theSmtpProtocoll)
Setter for property 'smtpProtocol'.
|
void |
setSmtpsProtocol(boolean theSmtpsProtocoll)
Setter for property 'smtpsProtocol'.
|
void |
setUsers(List<String> theUsers)
Setter for property 'users'.
|
void |
start()
Starts the server.
|
void |
stop()
Stops the server.
|
public void afterPropertiesSet() throws Exception
This method allows the bean instance to perform initialization only possible when all bean properties have been set and to throw an exception in the event of misconfiguration.
afterPropertiesSet
in interface org.springframework.beans.factory.InitializingBean
Exception
- in the event of misconfiguration (such as failure to set an essential
property) or if initialization fails.public void start()
public void stop()
public javax.mail.internet.MimeMessage[] getReceivedMessages()
public void destroy() throws Exception
destroy
in interface org.springframework.beans.factory.DisposableBean
Exception
- in case of shutdown errors. Exceptions will get logged but not rethrown to
allow other beans to release their resources too.public void setAutostart(boolean theAutostart)
theAutostart
- the flag.public boolean isAutostart()
public void setSmtpProtocol(boolean theSmtpProtocoll)
theSmtpProtocoll
- Value to set for property 'smtpProtocol'.public boolean isSmtpProtocol()
public void setSmtpsProtocol(boolean theSmtpsProtocoll)
theSmtpsProtocoll
- Value to set for property 'smtpsProtocol'.public boolean isSmtpsProtocol()
public void setPop3Protocol(boolean thePop3Protocoll)
thePop3Protocoll
- Value to set for property 'pop3Protocol'.public boolean isPop3Protocol()
public void setPop3sProtocol(boolean thePop3sProtocoll)
thePop3sProtocoll
- Value to set for property 'pop3sProtocol'.public boolean isPop3sProtocol()
public void setImapProtocol(boolean theImapProtocoll)
theImapProtocoll
- Value to set for property 'imapProtocol'.public boolean isImapProtocol()
public void setImapsProtocol(boolean theImapsProtocoll)
theImapsProtocoll
- Value to set for property 'imapsProtocol'.public boolean isImapsProtocol()
public void setHostname(String pHostname)
pHostname
- Value to set for property 'hostname'.public String getHostname()
public void setPortOffset(int pPortOffset)
pPortOffset
- Value to set for property 'portOffset'.public int getPortOffset()
public void setUsers(List<String> theUsers)
theUsers
- Value to set for property 'users'.public List<String> getUsers()
public boolean isStarted()
public GreenMail getGreenMail()
public void sendEmail(String theTo, String theFrom, String theSubject, String theContent)
theTo
- the TO field.theFrom
- the FROMfield.theSubject
- the subject.theContent
- the message content.public void setBeanName(String pName)
setBeanName
in interface org.springframework.beans.factory.BeanNameAware
public long getServerStartupTimeout()
public void setServerStartupTimeout(long serverStartupTimeout)
Copyright © 2006–2017 Icegreen Technologies. All rights reserved.