Package oauth.signpost.basic
Class DefaultOAuthProvider
java.lang.Object
oauth.signpost.AbstractOAuthProvider
oauth.signpost.basic.DefaultOAuthProvider
- All Implemented Interfaces:
Serializable
,OAuthProvider
This default implementation uses
HttpURLConnection
type GET
requests to receive tokens from a service provider.- See Also:
-
Field Summary
Fields -
Constructor Summary
ConstructorsConstructorDescriptionDefaultOAuthProvider
(String requestTokenEndpointUrl, String accessTokenEndpointUrl, String authorizationWebsiteUrl) -
Method Summary
Modifier and TypeMethodDescriptionprotected void
closeConnection
(HttpRequest request, HttpResponse response) Called when the connection is being finalized after receiving the response.protected HttpRequest
createRequest
(String endpointUrl) Overrride this method if you want to customize the logic for building a request object for the given endpoint URL.protected HttpResponse
sendRequest
(HttpRequest request) Override this method if you want to customize the logic for how the given request is sent to the server.Methods inherited from class oauth.signpost.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:
-
-
Constructor Details
-
DefaultOAuthProvider
-
-
Method Details
-
createRequest
Description copied from class:AbstractOAuthProvider
Overrride this method if you want to customize the logic for building a request object for the given endpoint URL.- Specified by:
createRequest
in classAbstractOAuthProvider
- Parameters:
endpointUrl
- the URL to which the request will go- Returns:
- the request object
- Throws:
MalformedURLException
IOException
-
sendRequest
Description copied from class:AbstractOAuthProvider
Override this method if you want to customize the logic for how the given request is sent to the server.- Specified by:
sendRequest
in classAbstractOAuthProvider
- Parameters:
request
- the request to send- Returns:
- the response to the request
- Throws:
IOException
-
closeConnection
Description copied from class:AbstractOAuthProvider
Called when the connection is being finalized after receiving the response. Use this to do any cleanup / resource freeing.- Overrides:
closeConnection
in classAbstractOAuthProvider
- Parameters:
request
- the request that has been sentresponse
- the response that has been received
-