org.abstracthorizon.mercury.smtp
Class SMTPResponse

java.lang.Object
  extended by org.abstracthorizon.mercury.smtp.SMTPResponse

public class SMTPResponse
extends Object

SMTP response

Author:
Daniel Sendula

Field Summary
protected  int code
          Response code
protected static byte[] CRLF
          CR as byte array
protected  String[] msg
          List of messages
 
Constructor Summary
SMTPResponse(int code)
          Constructor
SMTPResponse(int code, String msg)
          Constructor
SMTPResponse(int code, String[] msg)
          Constructor
 
Method Summary
 void addLine(String line)
          Adds new line
 int getCode()
          Returns code.
 void setLine(String line)
          Sets line
 void submit(OutputStream out)
          Submits response
 String toString()
          Returns string representation of response
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

CRLF

protected static final byte[] CRLF
CR as byte array


code

protected int code
Response code


msg

protected String[] msg
List of messages

Constructor Detail

SMTPResponse

public SMTPResponse(int code)
Constructor

Parameters:
code - code

SMTPResponse

public SMTPResponse(int code,
                    String msg)
Constructor

Parameters:
code - code
msg - message

SMTPResponse

public SMTPResponse(int code,
                    String[] msg)
Constructor

Parameters:
code - code
msg - array of strings
Method Detail

setLine

public void setLine(String line)
Sets line

Parameters:
line - line

addLine

public void addLine(String line)
Adds new line

Parameters:
line - line

submit

public void submit(OutputStream out)
            throws IOException
Submits response

Parameters:
out - output stream
Throws:
IOException

toString

public String toString()
Returns string representation of response

Overrides:
toString in class Object
Returns:
string representation of response

getCode

public int getCode()
Returns code.

Returns:
code


Copyright © 2005-2009 Abstract Horizon. All Rights Reserved.