All Downloads are FREE. Search and download functionalities are using the official Maven repository.

org.subethamail.smtp.RejectException Maven / Gradle / Ivy

Go to download

A fork of a fork (!) of SubEtha, an easy-to-use server-side SMTP library for Java.

There is a newer version: 7.1.3
Show newest version
/*
 * $Id$
 * $Source: /cvsroot/Similarity4/src/java/com/similarity/mbean/BindStatisticsManagerMBean.java,v $
 */
package org.subethamail.smtp;

/**
 * Thrown to reject an SMTP command with a specific code.
 *
 * @author Jeff Schnitzer
 */
@SuppressWarnings("serial")
public class RejectException extends Exception
{
	public static final int DEFAULT_CODE = 554;
	public static final String DEFAULT_MESSAGE = "Transaction failed";

	final int code;

	public RejectException()
	{
		this(DEFAULT_MESSAGE);
	}

	public RejectException(String message)
	{
		this(DEFAULT_CODE, message);
	}

	public RejectException(int code, String message)
	{
		super(message, null, true, false);

		this.code = code;
	}

	public int getCode()
	{
		return this.code;
	}

	public String getErrorResponse()
	{
		return this.code + " " + this.getMessage();
	}
}




© 2015 - 2025 Weber Informatics LLC | Privacy Policy