public class OsmConnection extends java.lang.Object
| Modifier and Type | Field and Description |
|---|---|
protected HttpClient |
activeConnection |
protected boolean |
cancel |
protected OAuthParameters |
oauthParameters |
| Constructor and Description |
|---|
OsmConnection() |
| Modifier and Type | Method and Description |
|---|---|
protected void |
addAuth(HttpClient connection) |
protected void |
addBasicAuthorizationHeader(HttpClient con)
Adds an authentication header for basic authentication
|
protected void |
addOAuthAuthorizationHeader(HttpClient connection)
Signs the connection with an OAuth authentication header
|
void |
cancel()
Cancels the connection.
|
boolean |
isCanceled()
Replies true if this connection is canceled
|
protected void |
obtainAccessToken(HttpClient connection)
Obtains an OAuth access token for the connection.
|
protected boolean cancel
protected HttpClient activeConnection
protected OAuthParameters oauthParameters
public OsmConnection()
public void cancel()
protected void addBasicAuthorizationHeader(HttpClient con) throws OsmTransferException
con - the connectionOsmTransferException - if something went wrong. Check for nested exceptionsprotected void addOAuthAuthorizationHeader(HttpClient connection) throws OsmTransferException
connection - the connectionOsmTransferException - if there is currently no OAuth Access Token configuredOsmTransferException - if signing failsprotected void obtainAccessToken(HttpClient connection) throws MissingOAuthAccessTokenException
OAuthAccessTokenHolder.connection - connection for which the access token should be obtainedMissingOAuthAccessTokenException - if the process cannot be completec successfullyprotected void addAuth(HttpClient connection) throws OsmTransferException
OsmTransferExceptionpublic boolean isCanceled()