Class CommonsHttpOAuthProvider
java.lang.Object
oauth.signpost.AbstractOAuthProvider
oauth.signpost.commonshttp.CommonsHttpOAuthProvider
- All Implemented Interfaces:
Serializable, OAuthProvider
This implementation uses the Apache Commons
HttpClient 4.x HTTP
implementation to fetch OAuth tokens from a service provider. Android users
should use this provider implementation in favor of the default one, since
the latter is known to cause problems with Android's Apache Harmony
underpinnings.- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionprivate org.apache.http.client.HttpClientprivate static final long -
Constructor Summary
ConstructorsConstructorDescriptionCommonsHttpOAuthProvider(String requestTokenEndpointUrl, String accessTokenEndpointUrl, String authorizationWebsiteUrl) CommonsHttpOAuthProvider(String requestTokenEndpointUrl, String accessTokenEndpointUrl, String authorizationWebsiteUrl, org.apache.http.client.HttpClient httpClient) -
Method Summary
Modifier and TypeMethodDescriptionprotected voidcloseConnection(HttpRequest request, HttpResponse response) Called when the connection is being finalized after receiving the response.protected HttpRequestcreateRequest(String endpointUrl) Overrride this method if you want to customize the logic for building a request object for the given endpoint URL.protected HttpResponsesendRequest(HttpRequest request) Override this method if you want to customize the logic for how the given request is sent to the server.voidsetHttpClient(org.apache.http.client.HttpClient httpClient) Methods inherited from class AbstractOAuthProvider
getAccessTokenEndpointUrl, getAuthorizationWebsiteUrl, getRequestHeaders, getRequestTokenEndpointUrl, getResponseParameter, getResponseParameters, handleUnexpectedResponse, isOAuth10a, removeListener, retrieveAccessToken, retrieveRequestToken, retrieveToken, setListener, setOAuth10a, setRequestHeader, setResponseParameters
-
Field Details
-
serialVersionUID
private static final long serialVersionUID- See Also:
-
httpClient
private transient org.apache.http.client.HttpClient httpClient
-
-
Constructor Details
-
CommonsHttpOAuthProvider
-
CommonsHttpOAuthProvider
-
-
Method Details
-
setHttpClient
public void setHttpClient(org.apache.http.client.HttpClient httpClient) -
createRequest
Description copied from class:AbstractOAuthProviderOverrride this method if you want to customize the logic for building a request object for the given endpoint URL.- Specified by:
createRequestin classAbstractOAuthProvider- Parameters:
endpointUrl- the URL to which the request will go- Returns:
- the request object
- Throws:
Exception- if something breaks
-
sendRequest
Description copied from class:AbstractOAuthProviderOverride this method if you want to customize the logic for how the given request is sent to the server.- Specified by:
sendRequestin classAbstractOAuthProvider- Parameters:
request- the request to send- Returns:
- the response to the request
- Throws:
Exception- if something breaks
-
closeConnection
Description copied from class:AbstractOAuthProviderCalled when the connection is being finalized after receiving the response. Use this to do any cleanup / resource freeing.- Overrides:
closeConnectionin classAbstractOAuthProvider- Parameters:
request- the request that has been sentresponse- the response that has been received- Throws:
Exception- if something breaks
-