com.stackmob.sdk.api
Class StackMobRequest
java.lang.Object
com.stackmob.sdk.api.StackMobRequest
- Direct Known Subclasses:
- StackMobAccessTokenRequest, StackMobRequestWithoutPayload, StackMobRequestWithPayload, StackMobUserBasedRequest
public abstract class StackMobRequest
- extends Object
| Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
EmptyHeaders
public static final List<Map.Entry<String,String>> EmptyHeaders
EmptyParams
public static final Map<String,String> EmptyParams
DEFAULT_RETRY_AFTER_MILLIS
public static final int DEFAULT_RETRY_AFTER_MILLIS
- See Also:
- Constant Field Values
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
API_KEY_HEADER
protected static final String API_KEY_HEADER
- See Also:
- Constant Field Values
AUTHORIZATION_HEADER
protected static final String AUTHORIZATION_HEADER
- 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
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)
setCookieStore
public static void setCookieStore(StackMobCookieStore store)
getCookieStore
public static StackMobCookieStore getCookieStore()
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)
getContentType
protected String getContentType()
getOAuthVersion
protected StackMob.OAuthVersion getOAuthVersion()
getOAuthRequest
protected org.scribe.model.OAuthRequest getOAuthRequest(HttpVerb method,
String url)
getOAuthRequest
protected org.scribe.model.OAuthRequest getOAuthRequest(HttpVerb method,
String url,
String payload)
getRequestVerb
protected static HttpVerb getRequestVerb(org.scribe.model.OAuthRequest req)
getRequestHeaders
protected static List<Map.Entry<String,String>> getRequestHeaders(org.scribe.model.OAuthRequest req)
tryRefreshToken
protected boolean tryRefreshToken()
refreshTokenAndResend
protected void refreshTokenAndResend()
sendRequest
protected void sendRequest(org.scribe.model.OAuthRequest req)
throws InterruptedException,
ExecutionException
- Throws:
InterruptedException
ExecutionException
Copyright © 2012 StackMob. All Rights Reserved.