org.apache.james.protocols.smtp
Class SMTPResponse

java.lang.Object
  extended by org.apache.james.protocols.smtp.SMTPResponse
All Implemented Interfaces:
Response, RetCodeResponse

public final class SMTPResponse
extends java.lang.Object
implements RetCodeResponse

Contains an SMTP result


Constructor Summary
SMTPResponse(java.lang.String rawLine)
          Construct a new SMTPResponse.
SMTPResponse(java.lang.String code, java.lang.CharSequence description)
          Construct a new SMTPResponse.
 
Method Summary
 void appendLine(java.lang.CharSequence line)
          Append the responseLine to the SMTPResponse
 java.util.List<java.lang.CharSequence> getLines()
          Return a List of all responseLines stored in this SMTPResponse
 java.lang.String getRawLine()
          Return the raw representation of the Stored SMTPResponse
 java.lang.String getRetCode()
          Return the SMTPCode
 boolean isEndSession()
          Return true if the session is ended
 void setEndSession(boolean endSession)
          Set to true to end the session
 void setRetCode(java.lang.String retCode)
          Set the SMTPCode
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

SMTPResponse

public SMTPResponse(java.lang.String code,
                    java.lang.CharSequence description)
Construct a new SMTPResponse. The given code and description can not be null, if null an IllegalArgumentException get thrown

Parameters:
code - the returnCode
description - the description

SMTPResponse

public SMTPResponse(java.lang.String rawLine)
Construct a new SMTPResponse. The given rawLine need to be in format [SMTPResponseReturnCode SMTResponseDescription]. If this is not the case an IllegalArgumentException get thrown.

Parameters:
rawLine - the raw SMTPResponse
Method Detail

appendLine

public void appendLine(java.lang.CharSequence line)
Append the responseLine to the SMTPResponse

Specified by:
appendLine in interface Response
Parameters:
line - the responseLine to append

getRetCode

public java.lang.String getRetCode()
Return the SMTPCode

Specified by:
getRetCode in interface RetCodeResponse
Returns:
the SMTPCode

setRetCode

public void setRetCode(java.lang.String retCode)
Set the SMTPCode

Specified by:
setRetCode in interface RetCodeResponse
Parameters:
retCode - the SMTPCode

getLines

public java.util.List<java.lang.CharSequence> getLines()
Return a List of all responseLines stored in this SMTPResponse

Specified by:
getLines in interface Response
Returns:
all responseLines

getRawLine

public java.lang.String getRawLine()
Return the raw representation of the Stored SMTPResponse

Specified by:
getRawLine in interface Response
Returns:
rawLine the raw SMTPResponse

isEndSession

public boolean isEndSession()
Return true if the session is ended

Specified by:
isEndSession in interface Response
Returns:
true if session is ended

setEndSession

public void setEndSession(boolean endSession)
Set to true to end the session

Specified by:
setEndSession in interface Response
Parameters:
endSession -

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object
See Also:
Object.toString()


Copyright © 2010 The Apache Software Foundation. All Rights Reserved.