Ignore:
Timestamp:
2011-07-14T19:52:24+02:00 (13 years ago)
Author:
bastiK
Message:

some renames to simplify further development

Location:
trunk/src/org/openstreetmap/josm/gui/preferences/server
Files:
5 edited

Legend:

Unmodified
Added
Removed
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/AuthenticationPreferencesPanel.java

    r3530 r4245  
    2020import org.openstreetmap.josm.gui.help.HelpUtil;
    2121import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel;
    22 import org.openstreetmap.josm.io.auth.CredentialsManagerFactory;
     22import org.openstreetmap.josm.io.auth.CredentialsManager;
    2323
    2424/**
     
    124124            pnlBasicAuthPreferences.saveToPreferences();
    125125            OAuthAccessTokenHolder.getInstance().clear();
    126             OAuthAccessTokenHolder.getInstance().save(Main.pref, CredentialsManagerFactory.getCredentialManager());
     126            OAuthAccessTokenHolder.getInstance().save(Main.pref, CredentialsManager.getInstance());
    127127        } else if (authMethod.equals("oauth")) {
    128128            // clear the password in the preferences
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/BasicAuthenticationPreferencesPanel.java

    r3530 r4245  
    2020import org.openstreetmap.josm.gui.widgets.HtmlPanel;
    2121import org.openstreetmap.josm.gui.widgets.SelectAllOnFocusGainedDecorator;
     22import org.openstreetmap.josm.io.auth.CredentialsAgent;
     23import org.openstreetmap.josm.io.auth.CredentialsAgentException;
    2224import org.openstreetmap.josm.io.auth.CredentialsManager;
    23 import org.openstreetmap.josm.io.auth.CredentialsManagerException;
    24 import org.openstreetmap.josm.io.auth.CredentialsManagerFactory;
    25 import org.openstreetmap.josm.io.auth.JosmPreferencesCredentialManager;
     25import org.openstreetmap.josm.io.auth.JosmPreferencesCredentialAgent;
    2626
    2727/**
     
    103103
    104104    public void initFromPreferences() {
    105         CredentialsManager cm = CredentialsManagerFactory.getCredentialManager();
     105        CredentialsAgent cm = CredentialsManager.getInstance();
    106106        try {
    107107            PasswordAuthentication pa = cm.lookup(RequestorType.SERVER);
     
    113113                tfOsmPassword.setText(pa.getPassword() == null ? "" : String.valueOf(pa.getPassword()));
    114114            }
    115         } catch(CredentialsManagerException e) {
     115        } catch(CredentialsAgentException e) {
    116116            e.printStackTrace();
    117117            System.err.println(tr("Warning: failed to retrieve OSM credentials from credential manager."));
     
    123123
    124124    public void saveToPreferences() {
    125         CredentialsManager cm = CredentialsManagerFactory.getCredentialManager();
     125        CredentialsAgent cm = CredentialsManager.getInstance();
    126126        try {
    127127            PasswordAuthentication pa = new PasswordAuthentication(
     
    132132            // always save the username to the preferences if it isn't already saved there
    133133            // by the credential manager
    134             if (! (cm instanceof JosmPreferencesCredentialManager)) {
     134            if (! (cm instanceof JosmPreferencesCredentialAgent)) {
    135135                Main.pref.put("osm-server.username", tfOsmUserName.getText().trim());
    136136            }
    137         } catch(CredentialsManagerException e) {
     137        } catch(CredentialsAgentException e) {
    138138            e.printStackTrace();
    139139            System.err.println(tr("Warning: failed to save OSM credentials to credential manager."));
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAccessTokenHolder.java

    r4191 r4245  
    66import org.openstreetmap.josm.data.Preferences;
    77import org.openstreetmap.josm.data.oauth.OAuthToken;
    8 import org.openstreetmap.josm.io.auth.CredentialsManager;
    9 import org.openstreetmap.josm.io.auth.CredentialsManagerException;
     8import org.openstreetmap.josm.io.auth.CredentialsAgent;
     9import org.openstreetmap.josm.io.auth.CredentialsAgentException;
    1010import org.openstreetmap.josm.tools.CheckParameterUtil;
    1111
     
    136136     * @throws IllegalArgumentException thrown if cm is null
    137137     */
    138     public void init(Preferences pref, CredentialsManager cm) throws IllegalArgumentException {
     138    public void init(Preferences pref, CredentialsAgent cm) throws IllegalArgumentException {
    139139        CheckParameterUtil.ensureParameterNotNull(pref, "pref");
    140140        CheckParameterUtil.ensureParameterNotNull(cm, "cm");
     
    142142        try {
    143143            token = cm.lookupOAuthAccessToken();
    144         } catch(CredentialsManagerException e) {
     144        } catch(CredentialsAgentException e) {
    145145            e.printStackTrace();
    146146            System.err.println(tr("Warning: Failed to retrieve OAuth Access Token from credential manager"));
     
    163163     * @throws IllegalArgumentException thrown if cm is null
    164164     */
    165     public void save(Preferences preferences, CredentialsManager cm) throws IllegalArgumentException {
     165    public void save(Preferences preferences, CredentialsAgent cm) throws IllegalArgumentException {
    166166        CheckParameterUtil.ensureParameterNotNull(preferences, "preferences");
    167167        CheckParameterUtil.ensureParameterNotNull(cm, "cm");
     
    173173                cm.storeOAuthAccessToken(new OAuthToken(accessTokenKey, accessTokenSecret));
    174174            }
    175         } catch(CredentialsManagerException e){
     175        } catch(CredentialsAgentException e){
    176176            e.printStackTrace();
    177177            System.err.println(tr("Warning: Failed to store OAuth Access Token to credentials manager"));
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/OAuthAuthenticationPreferencesPanel.java

    r4191 r4245  
    3232import org.openstreetmap.josm.gui.oauth.OAuthAuthorizationWizard;
    3333import org.openstreetmap.josm.gui.oauth.TestAccessTokenTask;
    34 import org.openstreetmap.josm.io.auth.CredentialsManagerFactory;
     34import org.openstreetmap.josm.io.auth.CredentialsManager;
    3535import org.openstreetmap.josm.tools.ImageProvider;
    3636
     
    161161    public void saveToPreferences() {
    162162        OAuthAccessTokenHolder.getInstance().setSaveToPreferences(cbSaveToPreferences.isSelected());
    163         OAuthAccessTokenHolder.getInstance().save(Main.pref, CredentialsManagerFactory.getCredentialManager());
     163        OAuthAccessTokenHolder.getInstance().save(Main.pref, CredentialsManager.getInstance());
    164164        pnlAdvancedProperties.getAdvancedParameters().saveToPreferences(Main.pref);
    165165    }
  • trunk/src/org/openstreetmap/josm/gui/preferences/server/ProxyPreferencesPanel.java

    r3530 r4245  
    3131import org.openstreetmap.josm.gui.widgets.VerticallyScrollablePanel;
    3232import org.openstreetmap.josm.io.DefaultProxySelector;
     33import org.openstreetmap.josm.io.auth.CredentialsAgent;
     34import org.openstreetmap.josm.io.auth.CredentialsAgentException;
    3335import org.openstreetmap.josm.io.auth.CredentialsManager;
    34 import org.openstreetmap.josm.io.auth.CredentialsManagerException;
    35 import org.openstreetmap.josm.io.auth.CredentialsManagerFactory;
    3636import org.openstreetmap.josm.tools.GBC;
    3737
     
    321321        // save the proxy user and the proxy password to a credentials store managed by
    322322        // the credentials manager
    323         CredentialsManager cm = CredentialsManagerFactory.getCredentialManager();
     323        CredentialsAgent cm = CredentialsManager.getInstance();
    324324        try {
    325325            PasswordAuthentication pa = cm.lookup(RequestorType.PROXY);
     
    331331                tfProxyHttpPassword.setText(pa.getPassword() == null ? "" : String.valueOf(pa.getPassword()));
    332332            }
    333         } catch(CredentialsManagerException e) {
     333        } catch(CredentialsAgentException e) {
    334334            e.printStackTrace();
    335335            tfProxyHttpUser.setText("");
     
    395395        }
    396396
    397         CredentialsManager cm = CredentialsManagerFactory.getCredentialManager();
     397        CredentialsAgent cm = CredentialsManager.getInstance();
    398398        try {
    399399            PasswordAuthentication pa = new PasswordAuthentication(
     
    402402            );
    403403            cm.store(RequestorType.PROXY, pa);
    404         } catch(CredentialsManagerException e) {
     404        } catch(CredentialsAgentException e) {
    405405            e.printStackTrace();
    406406        }
Note: See TracChangeset for help on using the changeset viewer.