edu.cuny.cat.comm
Class CatpResponse

java.lang.Object
  extended by edu.cuny.cat.comm.Message
      extended by edu.cuny.cat.comm.CatpMessage
          extended by edu.cuny.cat.comm.CatpResponse

public class CatpResponse
extends CatpMessage

represents a catp response message.

Version:
$Revision: 1.8 $
Author:
Jinzhong Niu

Field Summary
 
Fields inherited from class edu.cuny.cat.comm.CatpMessage
ASK, BID, BUYER, CHECKIN, CLIENT, CURRENT_VERSION, DAYCLOSED, DAYOPENED, DAYOPENING, ERROR, FEE, GAMEOVER, GAMESTARTED, GAMESTARTING, GET, HEADER_SEPARATOR, headers, ID, INFORMATION, INVALID, OK, OPTIONS, POST, PROFIT, REGISTER, REGISTRATION, ROUNDCLOSED, ROUNDCLOSING, ROUNDOPENED, ROUNDOPENING, SELLER, SHOUT, SPECIALIST, startLine, SUBSCRIBE, TAG, TEXT, TIME, TRADER, TRANSACTION, TYPE, VALUE, VERSION, WRONGTIME
 
Fields inherited from class edu.cuny.cat.comm.Message
CRLF, VALUE_SEPARATOR
 
Constructor Summary
CatpResponse()
           
 
Method Summary
static CatpResponse createResponse(java.lang.String startLine)
          constructs a catp response message containing only a starting line.
static CatpResponse createResponse(java.lang.String startLine, java.lang.String[] pairs)
          constructs a catp response message containing a starting line and a list of header fields.
 java.lang.String getStatusCode()
           
 
Methods inherited from class edu.cuny.cat.comm.CatpMessage
addHeader, getDoubleHeader, getHeader, getHeaderNames, getIntHeader, getStartLine, getTag, setHeader, setHeaders, setStartLine, setTag, setTag, toString
 
Methods inherited from class edu.cuny.cat.comm.Message
concatenate, concatenate, concatenate, concatenate, parseDoubles, parseIntegers, parseStrings
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

CatpResponse

public CatpResponse()
Method Detail

getStatusCode

public java.lang.String getStatusCode()
Returns:
the status code in the response.

createResponse

public static CatpResponse createResponse(java.lang.String startLine)
constructs a catp response message containing only a starting line.

Parameters:
startLine - the starting line.
Returns:
an instance of CatpResponse

createResponse

public static CatpResponse createResponse(java.lang.String startLine,
                                          java.lang.String[] pairs)
constructs a catp response message containing a starting line and a list of header fields.

Parameters:
startLine - the starting line.
pairs - the header field name-value pairs.
Returns:
an instance of CatpResponse