com.stackmob.sdkapi.http
Class HttpService

java.lang.Object
  extended by com.stackmob.sdkapi.http.HttpService

public abstract class HttpService
extends Object


Constructor Summary
HttpService()
           
 
Method Summary
abstract  HttpResponse delete(DeleteRequest req)
          execute a DELETE request
abstract  Future<HttpResponse> deleteAsync(DeleteRequest req)
          execute a DELETE request in the background
abstract  HttpResponse get(GetRequest req)
          execute a GET request
abstract  Future<HttpResponse> getAsync(GetRequest req)
          execute a GET request in the background
abstract  boolean isWhitelisted(String url)
          determines whether the given URL is on the whitelist
abstract  HttpResponse post(PostRequest req)
          execute a POST request
abstract  Future<HttpResponse> postAsync(PostRequest req)
          execute a POST request in the background
abstract  HttpResponse put(PutRequest req)
          execute a PUT request
abstract  Future<HttpResponse> putAsync(PutRequest req)
          execute a PUT request in the background
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

HttpService

public HttpService()
Method Detail

isWhitelisted

public abstract boolean isWhitelisted(String url)
determines whether the given URL is on the whitelist

Parameters:
url - the URL to test
Returns:
true if it is on the whitelist, false otherwise

get

public abstract HttpResponse get(GetRequest req)
                          throws AccessDeniedException,
                                 TimeoutException
execute a GET request

Parameters:
req - the request to execute
Returns:
the response that resulted from the GET request
Throws:
AccessDeniedException - if the request was rate limited, whitelisted, or for any other reason denied by the StackMob custom code environment
TimeoutException

getAsync

public abstract Future<HttpResponse> getAsync(GetRequest req)
                                       throws AccessDeniedException
execute a GET request in the background

Parameters:
req - the request to execute
Returns:
a future representing the response that will result from the GET request
Throws:
AccessDeniedException - if the request was rate limited, whitelisted, or for any other reason denied by the StackMob custom code environment

post

public abstract HttpResponse post(PostRequest req)
                           throws AccessDeniedException,
                                  TimeoutException
execute a POST request

Parameters:
req - the request to execute
Returns:
the response that resulted from the GET request
Throws:
AccessDeniedException - if the request was rate limited, whitelisted, or for any other reason denied by the StackMob custom code environment
TimeoutException

postAsync

public abstract Future<HttpResponse> postAsync(PostRequest req)
                                        throws AccessDeniedException
execute a POST request in the background

Parameters:
req - the request to execute
Returns:
a future representing the response that will result from the GET request
Throws:
AccessDeniedException - if the request was rate limited, whitelisted, or for any other reason denied by the StackMob custom code environment

put

public abstract HttpResponse put(PutRequest req)
                          throws AccessDeniedException,
                                 TimeoutException
execute a PUT request

Parameters:
req - the request to execute
Returns:
the response that resulted from the GET request
Throws:
AccessDeniedException - if the request was rate limited, whitelisted, or for any other reason denied by the StackMob custom code environment
TimeoutException

putAsync

public abstract Future<HttpResponse> putAsync(PutRequest req)
                                       throws AccessDeniedException
execute a PUT request in the background

Parameters:
req - the request to execute
Returns:
a future representing the response that will result from the GET request
Throws:
AccessDeniedException - if the request was rate limited, whitelisted, or for any other reason denied by the StackMob custom code environment

delete

public abstract HttpResponse delete(DeleteRequest req)
                             throws AccessDeniedException,
                                    TimeoutException
execute a DELETE request

Parameters:
req - the request to execute
Returns:
the response that resulted from the GET request
Throws:
AccessDeniedException - if the request was rate limited, whitelisted, or for any other reason denied by the StackMob custom code environment
TimeoutException

deleteAsync

public abstract Future<HttpResponse> deleteAsync(DeleteRequest req)
                                          throws AccessDeniedException
execute a DELETE request in the background

Parameters:
req - the request to execute
Returns:
a future representing the response that will result from the GET request
Throws:
AccessDeniedException - if the request was rate limited, whitelisted, or for any other reason denied by the StackMob custom code environment


Copyright © 2012 StackMob. All Rights Reserved.