|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.openstreetmap.josm.data.oauth.OAuthParameters
public class OAuthParameters
This class manages a set of OAuth parameters.
Field Summary | |
---|---|
private java.lang.String |
accessTokenUrl
|
private java.lang.String |
authoriseUrl
|
private java.lang.String |
consumerKey
|
private java.lang.String |
consumerSecret
|
static java.lang.String |
DEFAULT_ACCESS_TOKEN_URL
The default OSM OAuth access token URL. |
static java.lang.String |
DEFAULT_AUTHORISE_URL
The default OSM OAuth authorize URL. |
static java.lang.String |
DEFAULT_JOSM_CONSUMER_KEY
The default JOSM OAuth consumer key. |
static java.lang.String |
DEFAULT_JOSM_CONSUMER_SECRET
The default JOSM OAuth consumer secret. |
static java.lang.String |
DEFAULT_REQUEST_TOKEN_URL
The default OSM OAuth request token URL. |
private java.lang.String |
requestTokenUrl
|
Constructor Summary | |
---|---|
OAuthParameters()
Constructs a new, unitialized, OAuthParameters . |
|
OAuthParameters(OAuthParameters other)
Creates a clone of the parameters in other . |
Method Summary | |
---|---|
OAuthConsumer |
buildConsumer()
Builds an OAuthConsumer based on these parameters. |
OAuthProvider |
buildProvider(OAuthConsumer consumer)
Builds an OAuthProvider based on these parameters and a OAuth consumer consumer . |
static void |
clearPreferences(Preferences pref)
Clears the preferences for OAuth parameters |
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(java.lang.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(java.lang.Object obj)
|
java.lang.String |
getAccessTokenUrl()
Gets the access token URL. |
java.lang.String |
getAuthoriseUrl()
Gets the authorise URL. |
java.lang.String |
getConsumerKey()
Gets the consumer key. |
java.lang.String |
getConsumerSecret()
Gets the consumer secret. |
java.lang.String |
getRequestTokenUrl()
Gets the request token URL. |
int |
hashCode()
|
void |
saveToPreferences(Preferences pref)
Saves these OAuth parameters to the given Preferences . |
void |
setAccessTokenUrl(java.lang.String accessTokenUrl)
Sets the access token URL. |
void |
setAuthoriseUrl(java.lang.String authoriseUrl)
Sets the authorise URL. |
void |
setConsumerKey(java.lang.String consumerKey)
Sets the consumer key. |
void |
setConsumerSecret(java.lang.String consumerSecret)
Sets the consumer secret. |
void |
setRequestTokenUrl(java.lang.String requestTokenUrl)
Sets the request token URL. |
Methods inherited from class java.lang.Object |
---|
clone, finalize, getClass, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
public static final java.lang.String DEFAULT_JOSM_CONSUMER_KEY
public static final java.lang.String DEFAULT_JOSM_CONSUMER_SECRET
public static final java.lang.String DEFAULT_REQUEST_TOKEN_URL
public static final java.lang.String DEFAULT_ACCESS_TOKEN_URL
public static final java.lang.String DEFAULT_AUTHORISE_URL
private java.lang.String consumerKey
private java.lang.String consumerSecret
private java.lang.String requestTokenUrl
private java.lang.String accessTokenUrl
private java.lang.String authoriseUrl
Constructor Detail |
---|
public OAuthParameters()
OAuthParameters
.
createDefault()
,
createFromPreferences(org.openstreetmap.josm.data.Preferences)
public OAuthParameters(OAuthParameters other) throws java.lang.IllegalArgumentException
other
.
other
- the other parameters. Must not be null.
java.lang.IllegalArgumentException
- thrown if other is nullMethod Detail |
---|
public static OAuthParameters createDefault()
OsmApi.DEFAULT_API_URL
.
public static OAuthParameters createDefault(java.lang.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 preferences
public static void clearPreferences(Preferences pref)
pref
- the preferences in which keys related to OAuth parameters are
removedpublic java.lang.String getConsumerKey()
public void setConsumerKey(java.lang.String consumerKey)
consumerKey
- The consumer keypublic java.lang.String getConsumerSecret()
public void setConsumerSecret(java.lang.String consumerSecret)
consumerSecret
- The consumer secretpublic java.lang.String getRequestTokenUrl()
public void setRequestTokenUrl(java.lang.String requestTokenUrl)
requestTokenUrl
- the request token URLpublic java.lang.String getAccessTokenUrl()
public void setAccessTokenUrl(java.lang.String accessTokenUrl)
accessTokenUrl
- The access token URLpublic java.lang.String getAuthoriseUrl()
public void setAuthoriseUrl(java.lang.String authoriseUrl)
authoriseUrl
- The authorise URLpublic OAuthConsumer buildConsumer()
OAuthConsumer
based on these parameters.
public OAuthProvider buildProvider(OAuthConsumer consumer) throws java.lang.IllegalArgumentException
OAuthProvider
based on these parameters and a OAuth consumer consumer
.
consumer
- the consumer. Must not be null.
java.lang.IllegalArgumentException
- if consumer is nullpublic void saveToPreferences(Preferences pref)
Preferences
.
pref
- The Preferences into which are saved these OAuth parameters with the prefix "oauth.settings"public int hashCode()
hashCode
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |