public class RetrieveAccessTokenTask extends PleaseWaitRunnable
Modifier and Type | Field and Description |
---|---|
private OAuthToken |
accessToken |
private boolean |
canceled |
private OsmOAuthAuthorizationClient |
client |
private OAuthParameters |
parameters |
private java.awt.Component |
parent |
private OAuthToken |
requestToken |
progressMonitor
Constructor and Description |
---|
RetrieveAccessTokenTask(java.awt.Component parent,
OAuthParameters parameters,
OAuthToken requestToken)
Creates the task
|
Modifier and Type | Method and Description |
---|---|
protected void |
alertRetrievingAccessTokenFailed(OsmOAuthAuthorizationException e) |
protected void |
cancel()
User pressed cancel button.
|
protected void |
finish()
Finish up the data work.
|
OAuthToken |
getAccessToken()
Replies the retrieved Access Token.
|
boolean |
isCanceled()
Replies true if the task was canceled.
|
protected void |
realRun()
Called in the worker thread to do the actual work.
|
afterFinish, canRunInBackground, getProgressMonitor, operationCanceled, run
private boolean canceled
private OAuthToken accessToken
private final OAuthParameters parameters
private OsmOAuthAuthorizationClient client
private final OAuthToken requestToken
private final java.awt.Component parent
public RetrieveAccessTokenTask(java.awt.Component parent, OAuthParameters parameters, OAuthToken requestToken)
parent
- the parent component relative to which the PleaseWaitRunnable
-Dialog
is displayedparameters
- the OAuth parameters. Must not be null.requestToken
- the request token for which an Access Token is retrieved. Must not be null.java.lang.IllegalArgumentException
- if parameters is null.java.lang.IllegalArgumentException
- if requestToken is null.protected void cancel()
PleaseWaitRunnable
cancel
in class PleaseWaitRunnable
protected void finish()
PleaseWaitRunnable
finish
in class PleaseWaitRunnable
protected void alertRetrievingAccessTokenFailed(OsmOAuthAuthorizationException e)
protected void realRun() throws org.xml.sax.SAXException, java.io.IOException, OsmTransferException
PleaseWaitRunnable
realRun
in class PleaseWaitRunnable
org.xml.sax.SAXException
- if a SAX error occursjava.io.IOException
- if an I/O error occursOsmTransferException
- if a communication error with the OSM server occurspublic boolean isCanceled()
true
if user aborted operationpublic OAuthToken getAccessToken()