|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectcom.twitterapime.io.HttpResponseCodeInterpreter
public final class HttpResponseCodeInterpreter
This class is responsible for interpreting the Http response-codes from Twitter API, in order to check the status of a request: success or failure.
LimitExceededException,
InvalidQueryException| Field Summary | |
|---|---|
static int |
CUSTOM_HTTP_CODE_ENHANCE_YOUR_CALM
420: Custom Http code from Twitter API which means to wait a little bit for a new request. |
| Method Summary | |
|---|---|
static java.lang.String |
getErrorMessage(HttpResponse response)
Get error messages from connection's response. |
static void |
perform(HttpResponse response)
Perform an analyze of a given HttpResponse object's response-code in order to interpret whether the requests to Twitter API went well. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
public static final int CUSTOM_HTTP_CODE_ENHANCE_YOUR_CALM
420: Custom Http code from Twitter API which means to wait a little bit for a new request.
| Method Detail |
|---|
public static void perform(HttpResponse response)
throws java.io.IOException,
LimitExceededException
Perform an analyze of a given HttpResponse object's response-code in order to interpret whether the requests to Twitter API went well. Otherwise, an exception is thrown describing the problem.
response - HttpResponse object to be interpreted.
java.io.IOException - If an I/O or service error occurs.
LimitExceededException - If a request limit exceeded error occurs.
InvalidQueryException - If an invalid query error occurs.
java.lang.SecurityException - If a security error occurs.
java.lang.IllegalArgumentException - If response is null.
public static java.lang.String getErrorMessage(HttpResponse response)
throws java.io.IOException
Get error messages from connection's response.
response - Http response.
java.io.IOException - If any I/O error occurs.
|
||||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||