org.openstreetmap.josm.io.auth
Class JosmPreferencesCredentialAgent

java.lang.Object
  extended by org.openstreetmap.josm.io.auth.AbstractCredentialsAgent
      extended by org.openstreetmap.josm.io.auth.JosmPreferencesCredentialAgent
All Implemented Interfaces:
CredentialsAgent

public class JosmPreferencesCredentialAgent
extends AbstractCredentialsAgent

This is the default credentials agent in JOSM. It keeps username and password for both the OSM API and an optional HTTP proxy in the JOSM preferences file.


Field Summary
 
Fields inherited from class org.openstreetmap.josm.io.auth.AbstractCredentialsAgent
memoryCredentialsCache
 
Constructor Summary
JosmPreferencesCredentialAgent()
           
 
Method Summary
 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.
 
Methods inherited from class org.openstreetmap.josm.io.auth.AbstractCredentialsAgent
getCredentials
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

JosmPreferencesCredentialAgent

public JosmPreferencesCredentialAgent()
Method Detail

lookup

public java.net.PasswordAuthentication lookup(java.net.Authenticator.RequestorType requestorType,
                                              java.lang.String host)
                                       throws CredentialsAgentException
Description copied from interface: CredentialsAgent
Looks up the credentials for a given type.

Returns:
the credentials
Throws:
CredentialsAgentException - thrown if a problem occurs in a implementation of this interface
See Also:
CredentialsAgent#lookup(RequestorType)

store

public void store(java.net.Authenticator.RequestorType requestorType,
                  java.lang.String host,
                  java.net.PasswordAuthentication credentials)
           throws CredentialsAgentException
Description copied from interface: CredentialsAgent
Saves the credentials in credentials for the given service type.

credentials - the credentials
Throws:
CredentialsAgentException
See Also:
CredentialsAgent#store(RequestorType, PasswordAuthentication)

lookupOAuthAccessToken

public OAuthToken lookupOAuthAccessToken()
                                  throws CredentialsAgentException
Lookup the current OAuth Access Token to access the OSM server. Replies null, if no Access Token is currently managed by this CredentialManager.

Returns:
the current OAuth Access Token to access the OSM server.
Throws:
CredentialsAgentException - thrown if something goes wrong

storeOAuthAccessToken

public void storeOAuthAccessToken(OAuthToken accessToken)
                           throws CredentialsAgentException
Stores the OAuth Access Token accessToken.

Parameters:
accessToken - the access Token. null, to remove the Access Token.
Throws:
CredentialsAgentException - thrown if something goes wrong

getPreferencesDecorationPanel

public java.awt.Component getPreferencesDecorationPanel()
Description copied from interface: CredentialsAgent
Provide a Panel that is shown below the API password / username fields in the JOSM Preferences. (E.g. a warning that password is saved unencrypted.)


getSaveUsernameAndPasswordCheckboxText

public java.lang.String getSaveUsernameAndPasswordCheckboxText()
Description copied from class: AbstractCredentialsAgent
Provide the text for a checkbox that offers to save the username and password that has been entered by the user.

Specified by:
getSaveUsernameAndPasswordCheckboxText in class AbstractCredentialsAgent


JOSM