com.buglabs.services.ws
Class WSResponse

java.lang.Object
  extended by com.buglabs.services.ws.WSResponse
All Implemented Interfaces:
IWSResponse

public class WSResponse
extends java.lang.Object
implements IWSResponse

A simple IWSResponse implementation.


Field Summary
static IWSResponse UnimplementedErrorResponse
           
 
Constructor Summary
WSResponse(int errorCode, java.lang.String errorMessage)
           
WSResponse(java.lang.Object content, java.lang.String mimeType)
           
 
Method Summary
 java.lang.Object getContent()
          Get content of response.
 int getErrorCode()
          Return error code if the response is an error.
 java.lang.String getErrorMessage()
          Return error message if the response is an error.
 java.lang.String getMimeType()
          Return an appropriate mime-type for content being passed.
 boolean isError()
          Return true if the repsonse is an error.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

UnimplementedErrorResponse

public static final IWSResponse UnimplementedErrorResponse
Constructor Detail

WSResponse

public WSResponse(java.lang.Object content,
                  java.lang.String mimeType)

WSResponse

public WSResponse(int errorCode,
                  java.lang.String errorMessage)
Method Detail

getContent

public java.lang.Object getContent()
Description copied from interface: IWSResponse
Get content of response.

Specified by:
getContent in interface IWSResponse
Returns:

isError

public boolean isError()
Description copied from interface: IWSResponse
Return true if the repsonse is an error. If the response is an error, mimeType and Content are ignored.

Specified by:
isError in interface IWSResponse
Returns:

getErrorCode

public int getErrorCode()
Description copied from interface: IWSResponse
Return error code if the response is an error.

Specified by:
getErrorCode in interface IWSResponse
Returns:

getErrorMessage

public java.lang.String getErrorMessage()
Description copied from interface: IWSResponse
Return error message if the response is an error.

Specified by:
getErrorMessage in interface IWSResponse
Returns:

getMimeType

public java.lang.String getMimeType()
Description copied from interface: IWSResponse
Return an appropriate mime-type for content being passed.

Specified by:
getMimeType in interface IWSResponse
Returns: