com.stackmob.sdk.api
Class StackMobRequest

java.lang.Object
  extended by com.stackmob.sdk.api.StackMobRequest
Direct Known Subclasses:
StackMobRequestWithoutPayload, StackMobRequestWithPayload

public abstract class StackMobRequest
extends Object


Field Summary
protected  StackMobRawCallback callback
           
protected static DateFormat cookieDateFormat
           
protected static ConcurrentHashMap<String,Map.Entry<String,Date>> cookies
           
static String DEFAULT_API_URL_FORMAT
           
static String DEFAULT_PUSH_URL_FORMAT
           
static String DEFAULT_URL_FORMAT
           
static List<Map.Entry<String,String>> EmptyHeaders
           
static Map<String,String> EmptyParams
           
protected  ExecutorService executor
           
protected static String EXPIRES
           
protected  com.google.gson.Gson gson
           
protected  List<Map.Entry<String,String>> headers
           
protected  HttpVerb httpVerb
           
protected  Boolean isSecure
           
protected  String methodName
           
protected  Map<String,String> params
           
protected  StackMobRedirectedCallback redirectedCallback
           
protected static String REGULAR_SCHEME
           
protected static String SECURE_SCHEME
           
protected  StackMobSession session
           
protected static String SetCookieHeaderKey
           
protected  String urlFormat
           
 
Constructor Summary
protected StackMobRequest(ExecutorService executor, StackMobSession session, HttpVerb verb, List<Map.Entry<String,String>> headers, Map<String,String> params, String method, StackMobRawCallback cb, StackMobRedirectedCallback redirCb)
           
 
Method Summary
protected  URI createURI(String scheme, String host, String path, String query)
           
protected static String formatQueryString(Map<String,String> params)
           
protected  org.scribe.model.OAuthRequest getOAuthRequest(HttpVerb method, String url)
           
protected  org.scribe.model.OAuthRequest getOAuthRequest(HttpVerb method, String url, String payload)
           
protected  String getPath()
           
protected abstract  String getRequestBody()
           
protected static List<Map.Entry<String,String>> getRequestHeaders(org.scribe.model.OAuthRequest req)
           
protected static HttpVerb getRequestVerb(org.scribe.model.OAuthRequest req)
           
protected  String getScheme()
           
protected static String percentEncode(String s)
           
protected  void sendDeleteRequest()
           
protected  void sendGetRequest()
           
protected  void sendPostRequest()
           
protected  void sendPutRequest()
           
 StackMobRequestSendResult sendRequest()
           
protected  void sendRequest(org.scribe.model.OAuthRequest req)
           
 StackMobRequest setUrlFormat(String urlFmt)
           
protected  void storeCookies(org.scribe.model.Response resp)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

EmptyHeaders

public static final List<Map.Entry<String,String>> EmptyHeaders

EmptyParams

public static final Map<String,String> EmptyParams

DEFAULT_URL_FORMAT

public static final String DEFAULT_URL_FORMAT
See Also:
Constant Field Values

DEFAULT_API_URL_FORMAT

public static final String DEFAULT_API_URL_FORMAT
See Also:
Constant Field Values

DEFAULT_PUSH_URL_FORMAT

public static final String DEFAULT_PUSH_URL_FORMAT
See Also:
Constant Field Values

SECURE_SCHEME

protected static final String SECURE_SCHEME
See Also:
Constant Field Values

REGULAR_SCHEME

protected static final String REGULAR_SCHEME
See Also:
Constant Field Values

cookies

protected static final ConcurrentHashMap<String,Map.Entry<String,Date>> cookies

SetCookieHeaderKey

protected static final String SetCookieHeaderKey
See Also:
Constant Field Values

cookieDateFormat

protected static final DateFormat cookieDateFormat

EXPIRES

protected static final String EXPIRES
See Also:
Constant Field Values

executor

protected final ExecutorService executor

session

protected final StackMobSession session

callback

protected StackMobRawCallback callback

redirectedCallback

protected final StackMobRedirectedCallback redirectedCallback

httpVerb

protected HttpVerb httpVerb

methodName

protected String methodName

urlFormat

protected String urlFormat

isSecure

protected Boolean isSecure

params

protected Map<String,String> params

headers

protected List<Map.Entry<String,String>> headers

gson

protected com.google.gson.Gson gson
Constructor Detail

StackMobRequest

protected StackMobRequest(ExecutorService executor,
                          StackMobSession session,
                          HttpVerb verb,
                          List<Map.Entry<String,String>> headers,
                          Map<String,String> params,
                          String method,
                          StackMobRawCallback cb,
                          StackMobRedirectedCallback redirCb)
Method Detail

setUrlFormat

public StackMobRequest setUrlFormat(String urlFmt)

getRequestBody

protected abstract String getRequestBody()

sendRequest

public StackMobRequestSendResult sendRequest()

sendGetRequest

protected void sendGetRequest()
                       throws StackMobException
Throws:
StackMobException

sendPostRequest

protected void sendPostRequest()
                        throws StackMobException
Throws:
StackMobException

sendPutRequest

protected void sendPutRequest()
                       throws StackMobException
Throws:
StackMobException

sendDeleteRequest

protected void sendDeleteRequest()
                          throws StackMobException
Throws:
StackMobException

createURI

protected URI createURI(String scheme,
                        String host,
                        String path,
                        String query)
                 throws URISyntaxException
Throws:
URISyntaxException

getPath

protected String getPath()

getScheme

protected String getScheme()

percentEncode

protected static String percentEncode(String s)
                               throws UnsupportedEncodingException
Throws:
UnsupportedEncodingException

formatQueryString

protected static String formatQueryString(Map<String,String> params)

getOAuthRequest

protected org.scribe.model.OAuthRequest getOAuthRequest(HttpVerb method,
                                                        String url)

getOAuthRequest

protected org.scribe.model.OAuthRequest getOAuthRequest(HttpVerb method,
                                                        String url,
                                                        String payload)

storeCookies

protected void storeCookies(org.scribe.model.Response resp)

getRequestVerb

protected static HttpVerb getRequestVerb(org.scribe.model.OAuthRequest req)

getRequestHeaders

protected static List<Map.Entry<String,String>> getRequestHeaders(org.scribe.model.OAuthRequest req)

sendRequest

protected void sendRequest(org.scribe.model.OAuthRequest req)
                    throws InterruptedException,
                           ExecutionException
Throws:
InterruptedException
ExecutionException


Copyright © 2012 StackMob. All Rights Reserved.