source: josm/trunk/src/org/openstreetmap/josm/io/auth/CredentialsManager.java@ 2711

Last change on this file since 2711 was 2711, checked in by stoecker, 14 years ago

fix bad line endings

File size: 2.1 KB
Line 
1// License: GPL. For details, see LICENSE file.
2package org.openstreetmap.josm.io.auth;
3
4import java.net.PasswordAuthentication;
5import java.net.Authenticator.RequestorType;
6
7/**
8 * A CredentialManager manages two credentials:
9 * <ul>
10 * <li>the credential for {@see RequestorType#SERVER} which is equal to the OSM API credentials
11 * in JOSM</li>
12 * <li>the credential for {@see RequestorType#PROXY} which is equal to the credentials for an
13 * optional HTTP proxy server a user may use</li>
14 * </ul>
15 */
16public interface CredentialsManager {
17
18 /**
19 * Looks up the credentials for a given type.
20 *
21 * @param the type of service. {@see RequestorType#SERVER} for the OSM API server, {@see RequestorType#PROXY}
22 * for a proxy server
23 * @return the credentials
24 * @throws CredentialsManagerException thrown if a problem occurs in a implementation of this interface
25 */
26 public PasswordAuthentication lookup(RequestorType requestorType) throws CredentialsManagerException;
27
28 /**
29 * Saves the credentials in <code>credentials</code> for the given service type.
30 *
31 * @param the type of service. {@see RequestorType#SERVER} for the OSM API server, {@see RequestorType#PROXY}
32 * for a proxy server
33 * @param credentials the credentials
34 * @throws CredentialsManagerException thrown if a problem occurs in a implementation of this interface
35 */
36 public void store(RequestorType requestorType, PasswordAuthentication credentials) throws CredentialsManagerException;
37
38 /**
39 *
40 * @param requestorType the type of service. {@see RequestorType#SERVER} for the OSM API server, {@see RequestorType#PROXY}
41 * for a proxy server
42 * @param noSuccessWithLastResponse true, if the last request with the supplied credentials failed; false otherwise.
43 * If true, implementations of this interface are adviced prompt user for new credentials.
44 * @throws CredentialsManagerException thrown if a problem occurs in a implementation of this interface
45
46 */
47 public CredentialsManagerResponse getCredentials(RequestorType requestorType, boolean noSuccessWithLastResponse) throws CredentialsManagerException;
48}
Note: See TracBrowser for help on using the repository browser.