public class OAuthParameters extends Object
Modifier and Type | Field and Description |
---|---|
private String |
accessTokenUrl |
private String |
authoriseUrl |
private String |
consumerKey |
private String |
consumerSecret |
static String |
DEFAULT_ACCESS_TOKEN_URL
The default OSM OAuth access token URL.
|
static String |
DEFAULT_AUTHORISE_URL
The default OSM OAuth authorize URL.
|
static String |
DEFAULT_JOSM_CONSUMER_KEY
The default JOSM OAuth consumer key (created by user josmeditor).
|
static String |
DEFAULT_JOSM_CONSUMER_SECRET
The default JOSM OAuth consumer secret (created by user josmeditor).
|
static String |
DEFAULT_REQUEST_TOKEN_URL
The default OSM OAuth request token URL.
|
private String |
requestTokenUrl |
Constructor and Description |
---|
OAuthParameters(OAuthParameters other)
Creates a clone of the parameters in
other . |
OAuthParameters(String consumerKey,
String consumerSecret,
String requestTokenUrl,
String accessTokenUrl,
String authoriseUrl)
Constructs a new
OAuthParameters . |
Modifier and Type | Method and Description |
---|---|
oauth.signpost.OAuthConsumer |
buildConsumer()
Builds an
OAuthConsumer based on these parameters. |
oauth.signpost.OAuthProvider |
buildProvider(oauth.signpost.OAuthConsumer consumer)
Builds an
OAuthProvider based on these parameters and a OAuth consumer consumer . |
static OAuthParameters |
createDefault()
Replies a set of default parameters for a consumer accessing the standard OSM server
at
OsmApi.DEFAULT_API_URL . |
static OAuthParameters |
createDefault(String apiUrl)
Replies a set of default parameters for a consumer accessing an OSM server
at the given API url.
|
static OAuthParameters |
createFromPreferences(Preferences pref)
Replies a set of parameters as defined in the preferences.
|
boolean |
equals(Object obj) |
String |
getAccessTokenUrl()
Gets the access token URL.
|
String |
getAuthoriseUrl()
Gets the authorise URL.
|
String |
getConsumerKey()
Gets the consumer key.
|
String |
getConsumerSecret()
Gets the consumer secret.
|
String |
getRequestTokenUrl()
Gets the request token URL.
|
int |
hashCode() |
public static final String DEFAULT_JOSM_CONSUMER_KEY
public static final String DEFAULT_JOSM_CONSUMER_SECRET
public static final String DEFAULT_REQUEST_TOKEN_URL
public static final String DEFAULT_ACCESS_TOKEN_URL
public static final String DEFAULT_AUTHORISE_URL
private final String consumerKey
private final String consumerSecret
private final String requestTokenUrl
private final String accessTokenUrl
private final String authoriseUrl
public OAuthParameters(String consumerKey, String consumerSecret, String requestTokenUrl, String accessTokenUrl, String authoriseUrl)
OAuthParameters
.consumerKey
- consumer keyconsumerSecret
- consumer secretrequestTokenUrl
- request token URLaccessTokenUrl
- access token URLauthoriseUrl
- authorise URLcreateDefault()
,
createFromPreferences(org.openstreetmap.josm.data.Preferences)
public OAuthParameters(OAuthParameters other)
other
.other
- the other parameters. Must not be null.IllegalArgumentException
- if other is nullpublic static OAuthParameters createDefault()
OsmApi.DEFAULT_API_URL
.public static OAuthParameters createDefault(String apiUrl)
OsmApi.DEFAULT_API_URL
or references the domain "dev.openstreetmap.org", otherwise they may be null
.apiUrl
- The API URL for which the OAuth default parameters are created. If null or empty, the default OSM API url is used.apiUrl
public static OAuthParameters createFromPreferences(Preferences pref)
pref
- the preferencespublic String getConsumerKey()
public String getConsumerSecret()
public String getRequestTokenUrl()
public String getAccessTokenUrl()
public String getAuthoriseUrl()
public oauth.signpost.OAuthConsumer buildConsumer()
OAuthConsumer
based on these parameters.public oauth.signpost.OAuthProvider buildProvider(oauth.signpost.OAuthConsumer consumer)
OAuthProvider
based on these parameters and a OAuth consumer consumer
.consumer
- the consumer. Must not be null.IllegalArgumentException
- if consumer is null