public class JosmPreferencesCredentialAgent extends AbstractCredentialsAgent
memoryCredentialsCache
Constructor and Description |
---|
JosmPreferencesCredentialAgent() |
Modifier and Type | Method and Description |
---|---|
Component |
getPreferencesDecorationPanel()
Provide a Panel that is shown below the API password / username fields
in the JOSM Preferences.
|
String |
getSaveUsernameAndPasswordCheckboxText()
Provide the text for a checkbox that offers to save the
username and password that has been entered by the user.
|
PasswordAuthentication |
lookup(Authenticator.RequestorType requestorType,
String host)
Looks up the credentials for a given type.
|
OAuthToken |
lookupOAuthAccessToken()
Lookup the current OAuth Access Token to access the OSM server.
|
void |
store(Authenticator.RequestorType requestorType,
String host,
PasswordAuthentication credentials)
Saves the credentials in
credentials for the given service type. |
void |
storeOAuthAccessToken(OAuthToken accessToken)
Stores the OAuth Access Token
accessToken . |
getCredentials
public JosmPreferencesCredentialAgent()
public PasswordAuthentication lookup(Authenticator.RequestorType requestorType, String host) throws CredentialsAgentException
CredentialsAgent
requestorType
- the type of service. Authenticator.RequestorType.SERVER
for the OSM API server, Authenticator.RequestorType.PROXY
for a proxy serverhost
- the hostname for these credentialsCredentialsAgentException
- thrown if a problem occurs in a implementation of this interfaceCredentialsAgent.lookup(java.net.Authenticator.RequestorType, java.lang.String)
public void store(Authenticator.RequestorType requestorType, String host, PasswordAuthentication credentials) throws CredentialsAgentException
CredentialsAgent
credentials
for the given service type.requestorType
- the type of service. Authenticator.RequestorType.SERVER
for the OSM API server, Authenticator.RequestorType.PROXY
for a proxy serverhost
- the hostname for these credentialscredentials
- the credentialsCredentialsAgentException
CredentialsAgent.store(java.net.Authenticator.RequestorType, java.lang.String, java.net.PasswordAuthentication)
public OAuthToken lookupOAuthAccessToken() throws CredentialsAgentException
CredentialsAgentException
- thrown if something goes wrongpublic void storeOAuthAccessToken(OAuthToken accessToken) throws CredentialsAgentException
accessToken
.accessToken
- the access Token. null, to remove the Access Token.CredentialsAgentException
- thrown if something goes wrongpublic Component getPreferencesDecorationPanel()
CredentialsAgent
public String getSaveUsernameAndPasswordCheckboxText()
AbstractCredentialsAgent
getSaveUsernameAndPasswordCheckboxText
in class AbstractCredentialsAgent