public class JosmPreferencesCredentialAgent extends AbstractCredentialsAgent
memoryCredentialsCache| Constructor and Description |
|---|
JosmPreferencesCredentialAgent() |
| Modifier and Type | Method and Description |
|---|---|
java.awt.Component |
getPreferencesDecorationPanel()
Provide a Panel that is shown below the API password / username fields
in the JOSM Preferences.
|
java.lang.String |
getSaveUsernameAndPasswordCheckboxText()
Provide the text for a checkbox that offers to save the
username and password that has been entered by the user.
|
java.net.PasswordAuthentication |
lookup(java.net.Authenticator.RequestorType requestorType,
java.lang.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(java.net.Authenticator.RequestorType requestorType,
java.lang.String host,
java.net.PasswordAuthentication credentials)
Saves the credentials in
credentials for the given service type. |
void |
storeOAuthAccessToken(OAuthToken accessToken)
Stores the OAuth Access Token
accessToken. |
getCredentialspublic JosmPreferencesCredentialAgent()
public java.net.PasswordAuthentication lookup(java.net.Authenticator.RequestorType requestorType, java.lang.String host) throws CredentialsAgentException
CredentialsAgentrequestorType - 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(java.net.Authenticator.RequestorType requestorType, java.lang.String host, java.net.PasswordAuthentication credentials) throws CredentialsAgentException
CredentialsAgentcredentials 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 - thrown if a problem occurs in a implementation of this interfaceCredentialsAgent.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 java.awt.Component getPreferencesDecorationPanel()
CredentialsAgentpublic java.lang.String getSaveUsernameAndPasswordCheckboxText()
AbstractCredentialsAgentgetSaveUsernameAndPasswordCheckboxText in class AbstractCredentialsAgent