com.google.visualization.datasource.base
Class ResponseStatus

java.lang.Object
  extended by com.google.visualization.datasource.base.ResponseStatus

public class ResponseStatus
extends java.lang.Object

A response status holds three parameters: 1) The response type (Ok, Warning or Error). 2) The response reason type. 3) A string with an error message to the user.

Author:
Hillel M.

Field Summary
static java.lang.String SIGN_IN_MESSAGE_KEY
          The sign in message key in the ResourceBundle
 
Constructor Summary
ResponseStatus(StatusType statusType)
           
ResponseStatus(StatusType statusType, ReasonType reasonType, java.lang.String description)
          Constructs a response status object.
 
Method Summary
static ResponseStatus createResponseStatus(DataSourceException dse)
          Creates a ResponseStatus for the given DataSourceException.
 java.lang.String getDescription()
          Returns the message to pass to the user.
static ResponseStatus getModifiedResponseStatus(ResponseStatus responseStatus)
          Gets a modified response status in case of ReasonType#USER_NOT_AUTHENTICATED by adding a sign in html link for the given url.
 ReasonType getReasonType()
          Returns the response reason type.
 StatusType getStatusType()
          Returns the response status type.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

SIGN_IN_MESSAGE_KEY

public static final java.lang.String SIGN_IN_MESSAGE_KEY
The sign in message key in the ResourceBundle

See Also:
Constant Field Values
Constructor Detail

ResponseStatus

public ResponseStatus(StatusType statusType,
                      ReasonType reasonType,
                      java.lang.String description)
Constructs a response status object. This object contains a status type, reason type, and a message that is sent to the user.

Parameters:
statusType - The response status type.
reasonType - The response reason type.
description - A message to be passed to the user.

ResponseStatus

public ResponseStatus(StatusType statusType)
Method Detail

createResponseStatus

public static ResponseStatus createResponseStatus(DataSourceException dse)
Creates a ResponseStatus for the given DataSourceException.

Parameters:
dse - The data source exception.
Returns:
A response status object for the given data source exception.

getModifiedResponseStatus

public static ResponseStatus getModifiedResponseStatus(ResponseStatus responseStatus)
Gets a modified response status in case of ReasonType#USER_NOT_AUTHENTICATED by adding a sign in html link for the given url. If no url is provided in the ResponseStatus# no change is made.

Parameters:
responseStatus - The response status.
Returns:
The modified response status if modified, or else the original response status.

getStatusType

public StatusType getStatusType()
Returns the response status type.

Returns:
the response status type.

getReasonType

public ReasonType getReasonType()
Returns the response reason type.

Returns:
the response reason type.

getDescription

public java.lang.String getDescription()
Returns the message to pass to the user.

Returns:
The message to pass to the user.


Copyright © 2009 Google. All Rights Reserved.