|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectch.qos.logback.core.spi.ContextAwareBase
ch.qos.logback.core.AppenderBase<E>
ch.qos.logback.core.net.SMTPAppenderBase<E>
public abstract class SMTPAppenderBase<E>
An abstract class that provides support for sending events to an email address.
See http://logback.qos.ch/manual/appenders.html#SMTPAppender for further documentation.
Field Summary | |
---|---|
protected EventEvaluator<E> |
eventEvaluator
|
protected Layout<E> |
layout
|
protected javax.mail.internet.MimeMessage |
mimeMsg
|
protected Layout<E> |
subjectLayout
|
Fields inherited from class ch.qos.logback.core.AppenderBase |
---|
name, started |
Fields inherited from class ch.qos.logback.core.spi.ContextAwareBase |
---|
context |
Constructor Summary | |
---|---|
SMTPAppenderBase()
|
Method Summary | |
---|---|
void |
addTo(String to)
The To option takes a string value which should be an e-mail address of one of the recipients. |
protected void |
append(E eventObject)
Perform SMTPAppender specific appending actions, delegating some of them to a subclass and checking if the event triggers an e-mail to be sent. |
boolean |
checkEntryConditions()
This method determines if there is a sense in attempting to append. |
protected abstract void |
fillBuffer(StringBuffer sbuf)
|
String |
getCharsetEncoding()
|
String |
getFrom()
Returns value of the From option. |
Layout<E> |
getLayout()
|
javax.mail.Message |
getMessage()
|
String |
getPassword()
|
String |
getSMTPHost()
Returns value of the SMTPHost option. |
int |
getSMTPPort()
|
String |
getSubject()
Returns value of the Subject option. |
List<String> |
getTo()
Returns value of the To option. |
String |
getUsername()
|
boolean |
isSSL()
|
boolean |
isSTARTTLS()
|
protected abstract Layout<E> |
makeSubjectLayout(String subjectStr)
return a layout for the subjet string as appropriate for the module. |
protected void |
sendBuffer(E lastEventObject)
Send the contents of the cyclic buffer as an e-mail message. |
void |
setCharsetEncoding(String charsetEncoding)
Set the character set encoding of the outgoing email messages. |
void |
setEvaluator(EventEvaluator<E> eventEvaluator)
The EventEvaluator option takes a string value representing the name of the class implementing the EventEvaluators interface. |
void |
setFrom(String from)
The From option takes a string value which should be a e-mail address of the sender. |
void |
setLayout(Layout<E> layout)
|
void |
setMessage(javax.mail.internet.MimeMessage msg)
|
void |
setPassword(String password)
|
void |
setSMTPHost(String smtpHost)
The SMTPHost option takes a string value which should be a the host name of the SMTP server that will send the e-mail message. |
void |
setSMTPPort(int port)
The port where the SMTP server is running. |
void |
setSSL(boolean ssl)
|
void |
setSTARTTLS(boolean startTLS)
|
void |
setSubject(String subject)
The Subject option takes a string value which should be a the subject of the e-mail message. |
void |
setUsername(String username)
|
void |
start()
Start the appender |
void |
stop()
|
protected abstract void |
subAppend(E eventObject)
|
Methods inherited from class ch.qos.logback.core.AppenderBase |
---|
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toString |
Methods inherited from class ch.qos.logback.core.spi.ContextAwareBase |
---|
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getDeclaredOrigin, getStatusManager, setContext |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait |
Methods inherited from interface ch.qos.logback.core.spi.ContextAware |
---|
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext |
Field Detail |
---|
protected Layout<E> subjectLayout
protected Layout<E> layout
protected javax.mail.internet.MimeMessage mimeMsg
protected EventEvaluator<E> eventEvaluator
Constructor Detail |
---|
public SMTPAppenderBase()
Method Detail |
---|
protected abstract Layout<E> makeSubjectLayout(String subjectStr)
subjectStr
-
public void start()
start
in interface LifeCycle
start
in class AppenderBase<E>
protected void append(E eventObject)
append
in class AppenderBase<E>
protected abstract void subAppend(E eventObject)
public boolean checkEntryConditions()
It checks whether there is a set output target and also if there is a set
layout. If these checks fail, then the boolean value false
is
returned.
public void stop()
stop
in interface LifeCycle
stop
in class AppenderBase<E>
public List<String> getTo()
protected void sendBuffer(E lastEventObject)
protected abstract void fillBuffer(StringBuffer sbuf)
public String getFrom()
public String getSubject()
public void setFrom(String from)
public void setSubject(String subject)
public void setSMTPHost(String smtpHost)
public String getSMTPHost()
public void setSMTPPort(int port)
port
- public int getSMTPPort()
setSMTPPort(int)
public void addTo(String to)
public javax.mail.Message getMessage()
public void setMessage(javax.mail.internet.MimeMessage msg)
public boolean isSTARTTLS()
public void setSTARTTLS(boolean startTLS)
public boolean isSSL()
public void setSSL(boolean ssl)
public void setEvaluator(EventEvaluator<E> eventEvaluator)
EventEvaluators
interface. A
corresponding object will be instantiated and assigned as the event
evaluator for the SMTPAppender.
public String getUsername()
public void setUsername(String username)
public String getPassword()
public void setPassword(String password)
public String getCharsetEncoding()
setCharsetEncoding(String)
public void setCharsetEncoding(String charsetEncoding)
charsetEncoding
- public Layout<E> getLayout()
public void setLayout(Layout<E> layout)
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |