de.umass.lastfm
Class Result

java.lang.Object
  extended byde.umass.lastfm.Result
Direct Known Subclasses:
ScrobbleResult

public class Result
extends Object

The Result class contains the response sent by the server, i.e. the status (either ok or failed), an error code and message if failed and the xml response sent by the server.

Author:
Janni Kovacs

Field Summary
protected  int errorCode
           
protected  String errorMessage
           
protected  int httpErrorCode
           
protected  Document resultDocument
           
protected  int status
           
static int Status_FAILED
           
static int Status_OK
           
 
Constructor Summary
protected Result()
           
  Result(Document resultDocument)
           
  Result(String errorMessage)
           
 
Method Summary
 DomElement getContentElement()
           
 int getErrorCode()
           
 String getErrorMessage()
           
 int getHttpErrorCode()
           
 Document getResultDocument()
           
 int getStatus()
           
 boolean isSuccessful()
          Returns if the operation was successful.
 String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

Status_OK

public static final int Status_OK
See Also:
Constant Field Values

Status_FAILED

public static final int Status_FAILED
See Also:
Constant Field Values

status

protected int status

errorMessage

protected String errorMessage

errorCode

protected int errorCode

httpErrorCode

protected int httpErrorCode

resultDocument

protected Document resultDocument
Constructor Detail

Result

protected Result()

Result

public Result(Document resultDocument)

Result

public Result(String errorMessage)
Method Detail

isSuccessful

public boolean isSuccessful()
Returns if the operation was successful. Same as getStatus() == Status.OK.

Returns:
true if the operation was successful

getErrorCode

public int getErrorCode()

getHttpErrorCode

public int getHttpErrorCode()

getStatus

public int getStatus()

getResultDocument

public Document getResultDocument()

getErrorMessage

public String getErrorMessage()

getContentElement

public DomElement getContentElement()

toString

public String toString()