public abstract class SMTPAppenderBase<E> extends AppenderBase<E>
Constructor and Description |
---|
SMTPAppenderBase() |
Modifier and Type | Method and Description |
---|---|
void |
addTo(java.lang.String to) |
boolean |
checkEntryConditions()
This method determines if there is a sense in attempting to append.
|
java.lang.String |
getCharsetEncoding() |
CyclicBufferTracker<E> |
getCyclicBufferTracker() |
Discriminator<E> |
getDiscriminator() |
java.lang.String |
getFrom()
Returns value of the From option.
|
java.lang.String |
getJndiLocation() |
Layout<E> |
getLayout() |
java.lang.String |
getLocalhost() |
java.lang.String |
getPassword() |
java.lang.String |
getSmtpHost()
Returns value of the SMTPHost option.
|
java.lang.String |
getSMTPHost()
Alias for getSmtpHost().
|
int |
getSmtpPort()
See
setSmtpPort(int) |
int |
getSMTPPort()
Alias for
getSmtpPort() |
java.lang.String |
getSubject()
Returns value of the Subject option.
|
java.util.List<java.lang.String> |
getToAsListOfString() |
java.util.List<PatternLayoutBase<E>> |
getToList()
Returns value of the toList option.
|
java.lang.String |
getUsername() |
boolean |
isAsynchronousSending() |
boolean |
isSessionViaJNDI() |
boolean |
isSSL() |
boolean |
isSTARTTLS() |
void |
setAsynchronousSending(boolean asynchronousSending)
By default, SMTAppender transmits emails asynchronously.
|
void |
setCharsetEncoding(java.lang.String charsetEncoding)
Set the character set encoding of the outgoing email messages.
|
void |
setCyclicBufferTracker(CyclicBufferTracker<E> cbTracker) |
void |
setDiscriminator(Discriminator<E> discriminator) |
void |
setEvaluator(EventEvaluator<E> eventEvaluator)
The EventEvaluator option takes a string value representing the name
of the class implementing the
EventEvaluator interface. |
void |
setFrom(java.lang.String from)
The From option takes a string value which should be a e-mail
address of the sender.
|
void |
setJndiLocation(java.lang.String jndiLocation)
Set the location where a
Session resource is located in JNDI. |
void |
setLayout(Layout<E> layout) |
void |
setLocalhost(java.lang.String localhost)
Set the "mail.smtp.localhost" property to the value passed as parameter to
this method.
|
void |
setPassword(java.lang.String password) |
void |
setSessionViaJNDI(boolean sessionViaJNDI)
If set to true, a
Session resource will be retrieved from JNDI. |
void |
setSmtpHost(java.lang.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 |
setSMTPHost(java.lang.String smtpHost)
Alias for smtpHost
|
void |
setSmtpPort(int port)
The port where the SMTP server is running.
|
void |
setSMTPPort(int port)
Alias for
setSmtpPort(int) . |
void |
setSSL(boolean ssl) |
void |
setSTARTTLS(boolean startTLS) |
void |
setSubject(java.lang.String subject)
The Subject option takes a string value which should be a the
subject of the e-mail message.
|
void |
setUsername(java.lang.String username) |
void |
start()
Start the appender
|
void |
stop() |
addFilter, clearAllFilters, doAppend, getCopyOfAttachedFiltersList, getFilterChainDecision, getName, isStarted, setName, toString
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, getStatusManager, setContext
equals, getClass, hashCode, notify, notifyAll, wait, wait, wait
addError, addError, addInfo, addInfo, addStatus, addWarn, addWarn, getContext, setContext
public void start()
start
in interface LifeCycle
start
in class AppenderBase<E>
public boolean checkEntryConditions()
false
is
returned.public void stop()
stop
in interface LifeCycle
stop
in class AppenderBase<E>
public java.util.List<PatternLayoutBase<E>> getToList()
public java.lang.String getFrom()
public java.lang.String getSubject()
public void setFrom(java.lang.String from)
public void setSubject(java.lang.String subject)
public void setSMTPHost(java.lang.String smtpHost)
smtpHost
- public void setSmtpHost(java.lang.String smtpHost)
public java.lang.String getSMTPHost()
public java.lang.String getSmtpHost()
public void setSMTPPort(int port)
setSmtpPort(int)
.port
- public void setSmtpPort(int port)
port
- public int getSMTPPort()
getSmtpPort()
public int getSmtpPort()
setSmtpPort(int)
public java.lang.String getLocalhost()
public void setLocalhost(java.lang.String localhost)
Useful in case the hostname for the client host is not fully qualified and as a consequence the SMTP server rejects the clients HELO/EHLO command.
localhost
- public CyclicBufferTracker<E> getCyclicBufferTracker()
public void setCyclicBufferTracker(CyclicBufferTracker<E> cbTracker)
public Discriminator<E> getDiscriminator()
public void setDiscriminator(Discriminator<E> discriminator)
public boolean isAsynchronousSending()
public void setAsynchronousSending(boolean asynchronousSending)
asynchronousSending
- determines whether sending is done asynchronously or notpublic void addTo(java.lang.String to)
public java.util.List<java.lang.String> getToAsListOfString()
public boolean isSTARTTLS()
public void setSTARTTLS(boolean startTLS)
public boolean isSSL()
public void setSSL(boolean ssl)
public void setEvaluator(EventEvaluator<E> eventEvaluator)
EventEvaluator
interface. A
corresponding object will be instantiated and assigned as the event
evaluator for the SMTPAppender.public java.lang.String getUsername()
public void setUsername(java.lang.String username)
public java.lang.String getPassword()
public void setPassword(java.lang.String password)
public java.lang.String getCharsetEncoding()
setCharsetEncoding(String)
public java.lang.String getJndiLocation()
public void setJndiLocation(java.lang.String jndiLocation)
Session
resource is located in JNDI. Default value is
"java:comp/env/mail/Session".jndiLocation
- public boolean isSessionViaJNDI()
public void setSessionViaJNDI(boolean sessionViaJNDI)
Session
resource will be retrieved from JNDI. Default is false.sessionViaJNDI
- whether to obtain a javax.mail.Session by JNDIpublic void setCharsetEncoding(java.lang.String charsetEncoding)
charsetEncoding
- Copyright © 2010 - 2020 Adobe. All Rights Reserved