Package com.nilhcem.fakesmtp.server
Enum Class SMTPServerHandler
- All Implemented Interfaces:
Serializable
,Comparable<SMTPServerHandler>
,java.lang.constant.Constable
Starts and stops the SMTP server.
- Since:
- 1.0
- Author:
- Nilhcem
-
Nested Class Summary
Nested classes/interfaces inherited from class java.lang.Enum
Enum.EnumDesc<E extends Enum<E>>
-
Enum Constant Summary
Enum Constants -
Method Summary
Modifier and TypeMethodDescriptionReturns theMailSaver
object.org.subethamail.smtp.server.SMTPServer
Returns theSMTPServer
object.void
startServer
(int port, InetAddress bindAddress) Starts the server on the port and address specified in parameters.void
Stops the server.static SMTPServerHandler
Returns the enum constant of this class with the specified name.static SMTPServerHandler[]
values()
Returns an array containing the constants of this enum class, in the order they are declared.
-
Enum Constant Details
-
INSTANCE
-
-
Method Details
-
values
Returns an array containing the constants of this enum class, in the order they are declared.- Returns:
- an array containing the constants of this enum class, in the order they are declared
-
valueOf
Returns the enum constant of this class with the specified name. The string must match exactly an identifier used to declare an enum constant in this class. (Extraneous whitespace characters are not permitted.)- Parameters:
name
- the name of the enum constant to be returned.- Returns:
- the enum constant with the specified name
- Throws:
IllegalArgumentException
- if this enum class has no constant with the specified nameNullPointerException
- if the argument is null
-
startServer
public void startServer(int port, InetAddress bindAddress) throws BindPortException, OutOfRangePortException Starts the server on the port and address specified in parameters.- Parameters:
port
- the SMTP port to be opened.bindAddress
- the address to bind to. null means bind to all.- Throws:
BindPortException
- when the port can't be opened.OutOfRangePortException
- when port is out of range.IllegalArgumentException
- when port is out of range.
-
stopServer
public void stopServer()Stops the server.If the server is not started, does nothing special.
-
getMailSaver
Returns theMailSaver
object.- Returns:
- the
MailSaver
object.
-
getSmtpServer
public org.subethamail.smtp.server.SMTPServer getSmtpServer()Returns theSMTPServer
object.- Returns:
- the
SMTPServer
object.
-