com.atlassian.mail.server.impl
Class SMTPMailServerImpl

java.lang.Object
  extended by com.atlassian.mail.server.AbstractMailServer
      extended by com.atlassian.mail.server.impl.SMTPMailServerImpl
All Implemented Interfaces:
MailServer, SMTPMailServer, java.io.Serializable

public class SMTPMailServerImpl
extends AbstractMailServer
implements SMTPMailServer

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.atlassian.mail.server.AbstractMailServer
LOG
 
Fields inherited from interface com.atlassian.mail.server.SMTPMailServer
DEFAULT_SMTP_PORT
 
Constructor Summary
SMTPMailServerImpl()
           
SMTPMailServerImpl(java.lang.Long id, java.lang.String name, java.lang.String description, java.lang.String from, java.lang.String prefix, boolean isSession, boolean removePrecedence, java.lang.String location, java.lang.String username, java.lang.String password, java.lang.String smtpPort)
           
SMTPMailServerImpl(java.lang.Long id, java.lang.String name, java.lang.String description, java.lang.String from, java.lang.String prefix, boolean isSession, java.lang.String location, java.lang.String username, java.lang.String password)
           
SMTPMailServerImpl(java.lang.Long id, java.lang.String name, java.lang.String description, java.lang.String from, java.lang.String prefix, boolean isSession, java.lang.String location, java.lang.String username, java.lang.String password, java.lang.String smtpPort)
           
 
Method Summary
 boolean equals(java.lang.Object o)
           
protected  javax.mail.Authenticator getAuthenticator()
           
 boolean getDebug()
          Whether SMTP-level logging is enabled.
 java.io.PrintStream getDebugStream()
          Where debug logs currently go to.
 java.lang.String getDefaultFrom()
           
 java.lang.String getJndiLocation()
           
protected  java.lang.Object getJndiSession()
           
 java.lang.String getPrefix()
           
 alt.javax.mail.Session getSession()
          get the mail session
 java.lang.String getSmtpPort()
           
 java.lang.String getType()
           
 int hashCode()
           
 boolean isRemovePrecedence()
           
 boolean isSessionServer()
           
protected  void propertyChanged()
          Discard the cached session when a property of the server changes.
 void quietSend(Email email)
          Send a message - but don't throw exceptions, just log the errors
 void send(Email email)
           
 void setDebug(boolean debug)
          Enable or disable SMTP-level logging.
 void setDebugStream(java.io.PrintStream debugStream)
          If debug is enabled, output will go to this stream.
 void setDefaultFrom(java.lang.String defaultFrom)
           
 void setJndiLocation(java.lang.String jndiLocation)
           
 void setPrefix(java.lang.String prefix)
           
 void setRemovePrecedence(boolean precedence)
           
 void setSessionServer(boolean sessionServer)
           
 void setSmtpPort(java.lang.String smtpPort)
           
 java.lang.String toString()
           
 
Methods inherited from class com.atlassian.mail.server.AbstractMailServer
getDescription, getHostname, getId, getName, getPassword, getUsername, setDescription, setHostname, setId, setName, setPassword, setUsername
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.atlassian.mail.server.MailServer
getDescription, getHostname, getId, getName, getPassword, getUsername, setDescription, setHostname, setId, setName, setPassword, setUsername
 

Constructor Detail

SMTPMailServerImpl

public SMTPMailServerImpl()

SMTPMailServerImpl

public SMTPMailServerImpl(java.lang.Long id,
                          java.lang.String name,
                          java.lang.String description,
                          java.lang.String from,
                          java.lang.String prefix,
                          boolean isSession,
                          java.lang.String location,
                          java.lang.String username,
                          java.lang.String password)

SMTPMailServerImpl

public SMTPMailServerImpl(java.lang.Long id,
                          java.lang.String name,
                          java.lang.String description,
                          java.lang.String from,
                          java.lang.String prefix,
                          boolean isSession,
                          java.lang.String location,
                          java.lang.String username,
                          java.lang.String password,
                          java.lang.String smtpPort)

SMTPMailServerImpl

public SMTPMailServerImpl(java.lang.Long id,
                          java.lang.String name,
                          java.lang.String description,
                          java.lang.String from,
                          java.lang.String prefix,
                          boolean isSession,
                          boolean removePrecedence,
                          java.lang.String location,
                          java.lang.String username,
                          java.lang.String password,
                          java.lang.String smtpPort)
Method Detail

getJndiLocation

public java.lang.String getJndiLocation()
Specified by:
getJndiLocation in interface SMTPMailServer

setJndiLocation

public void setJndiLocation(java.lang.String jndiLocation)
Specified by:
setJndiLocation in interface SMTPMailServer

getAuthenticator

protected javax.mail.Authenticator getAuthenticator()

getSession

public alt.javax.mail.Session getSession()
                                  throws javax.naming.NamingException,
                                         MailException
get the mail session

Specified by:
getSession in interface MailServer
Throws:
javax.naming.NamingException
MailException

getJndiSession

protected java.lang.Object getJndiSession()
                                   throws javax.naming.NamingException
Throws:
javax.naming.NamingException

send

public void send(Email email)
          throws MailException
Specified by:
send in interface SMTPMailServer
Throws:
MailException

quietSend

public void quietSend(Email email)
               throws MailException
Send a message - but don't throw exceptions, just log the errors

Specified by:
quietSend in interface SMTPMailServer
Throws:
MailException

getType

public java.lang.String getType()
Specified by:
getType in interface MailServer

getDefaultFrom

public java.lang.String getDefaultFrom()
Specified by:
getDefaultFrom in interface SMTPMailServer

setDefaultFrom

public void setDefaultFrom(java.lang.String defaultFrom)
Specified by:
setDefaultFrom in interface SMTPMailServer

getPrefix

public java.lang.String getPrefix()
Specified by:
getPrefix in interface SMTPMailServer

setPrefix

public void setPrefix(java.lang.String prefix)
Specified by:
setPrefix in interface SMTPMailServer

isRemovePrecedence

public boolean isRemovePrecedence()
Specified by:
isRemovePrecedence in interface SMTPMailServer

setRemovePrecedence

public void setRemovePrecedence(boolean precedence)
Specified by:
setRemovePrecedence in interface SMTPMailServer

getSmtpPort

public java.lang.String getSmtpPort()
Specified by:
getSmtpPort in interface SMTPMailServer

setSmtpPort

public void setSmtpPort(java.lang.String smtpPort)
Specified by:
setSmtpPort in interface SMTPMailServer

setDebug

public void setDebug(boolean debug)
Description copied from interface: SMTPMailServer
Enable or disable SMTP-level logging.

Specified by:
setDebug in interface SMTPMailServer
Parameters:
debug - Turn debugging on or off

setDebugStream

public void setDebugStream(java.io.PrintStream debugStream)
Description copied from interface: SMTPMailServer
If debug is enabled, output will go to this stream.

Specified by:
setDebugStream in interface SMTPMailServer
Parameters:
debugStream - An optional stream to send debug messages to. If null, System.out is used.

getDebug

public boolean getDebug()
Description copied from interface: SMTPMailServer
Whether SMTP-level logging is enabled.

Specified by:
getDebug in interface SMTPMailServer

getDebugStream

public java.io.PrintStream getDebugStream()
Description copied from interface: SMTPMailServer
Where debug logs currently go to.

Specified by:
getDebugStream in interface SMTPMailServer

isSessionServer

public boolean isSessionServer()
Specified by:
isSessionServer in interface SMTPMailServer

setSessionServer

public void setSessionServer(boolean sessionServer)
Specified by:
setSessionServer in interface SMTPMailServer

equals

public boolean equals(java.lang.Object o)
Overrides:
equals in class AbstractMailServer

hashCode

public int hashCode()
Overrides:
hashCode in class AbstractMailServer

toString

public java.lang.String toString()
Overrides:
toString in class AbstractMailServer

propertyChanged

protected void propertyChanged()
Discard the cached session when a property of the server changes.

Overrides:
propertyChanged in class AbstractMailServer


Copyright © 2008 Atlassian Pty Ltd. All Rights Reserved.