    1   /*
    2    * Dumbster: a dummy SMTP server.
    3    * Copyright (C) 2003, Jason Paul Kitchen
    4    * lilnottsman@yahoo.com
    5    *
    6    * This library is free software; you can redistribute it and/or
    7    * modify it under the terms of the GNU Lesser General Public
    8    * License as published by the Free Software Foundation; either
    9    * version 2.1 of the License, or (at your option) any later version.
    10   *
    11   * This library is distributed in the hope that it will be useful,
    12   * but WITHOUT ANY WARRANTY; without even the implied warranty of
    13   * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
    14   * Lesser General Public License for more details.
    15   *
    16   * You should have received a copy of the GNU Lesser General Public
    17   * License along with this library; if not, write to the Free Software
    18   * Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA 02111-1307 USA
    19   */
    20  package com.dumbster.smtp;
    21
    22  /***
    23   * SMTP response container.
    24   */
    25  public class SmtpResponse {
    26
    27  	/*** Response code - see RFC-2821. */
    28  	private int code;
    29
    30  	/*** Response message. */
    31  	private String message;
    32
    33  	/*** New state of the SMTP server once the request has been executed. */
    34  	private SmtpState nextState;
    35
    36  	/***
    37  	 * Constructor.
    38  	 * @param code response code
    39  	 * @param message response message
    40  	 * @param next next state of the SMTP server
    41  	 */
    42  	public SmtpResponse(int code, String message, SmtpState next) {
    43  		this.code = code;
    44  		this.message = message;
    45  		this.nextState = next;
    46  	}
    47
    48  	/***
    49  	 * Get the response code.
    50  	 * @return response code
    51  	 */
    52  	public int getCode() {
    53  		return code;
    54  	}
    55
    56  	/***
    57  	 * Get the response message.
    58  	 * @return response message
    59  	 */
    60  	public String getMessage() {
    61  		return message;
    62  	}
    63
    64  	/***
    65  	 * Get the next SMTP server state.
    66  	 * @return state
    67  	 */
    68  	public SmtpState getNextState() {
    69  		return nextState;
    70  	}
    71  }