01: /*
02: * Dumbster - a dummy SMTP server
03: * Copyright 2004 Jason Paul Kitchen
04: *
05: * Licensed under the Apache License, Version 2.0 (the "License");
06: * you may not use this file except in compliance with the License.
07: * You may obtain a copy of the License at
08: *
09: * http://www.apache.org/licenses/LICENSE-2.0
10: *
11: * Unless required by applicable law or agreed to in writing, software
12: * distributed under the License is distributed on an "AS IS" BASIS,
13: * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14: * See the License for the specific language governing permissions and
15: * limitations under the License.
16: */
17: package com.dumbster.smtp;
18:
19: /**
20: * SMTP response container.
21: */
22: public class SmtpResponse {
23: /** Response code - see RFC-2821. */
24: private int code;
25: /** Response message. */
26: private String message;
27: /** New state of the SMTP server once the request has been executed. */
28: private SmtpState nextState;
29:
30: /**
31: * Constructor.
32: * @param code response code
33: * @param message response message
34: * @param next next state of the SMTP server
35: */
36: public SmtpResponse(int code, String message, SmtpState next) {
37: this .code = code;
38: this .message = message;
39: this .nextState = next;
40: }
41:
42: /**
43: * Get the response code.
44: * @return response code
45: */
46: public int getCode() {
47: return code;
48: }
49:
50: /**
51: * Get the response message.
52: * @return response message
53: */
54: public String getMessage() {
55: return message;
56: }
57:
58: /**
59: * Get the next SMTP server state.
60: * @return state
61: */
62: public SmtpState getNextState() {
63: return nextState;
64: }
65: }
|