public class AutoAuthenticationManager
extends java.net.Authenticator
Modifier and Type | Field and Description |
---|---|
protected static Version |
HOST_SUPPORT_VERSION |
protected static Version |
JAVA_VERSION |
Modifier and Type | Method and Description |
---|---|
boolean |
aboutToAccess(java.lang.String url)
This method must be called to activate the authenticator that provides
credentials to be able to access the given URL.
|
boolean |
aboutToAccess(java.net.URL url)
This method must be called to activate the authenticator that provides
credentials to be able to access the given URL.
|
protected void |
fillFallbackAuthenticator() |
protected LocationCredentials |
findCredentialsFor(java.lang.String url) |
protected LocationCredentials |
findCredentialsForRealm() |
protected LocationCredentials |
findCredentialsForRealm(java.lang.String realm) |
protected java.net.PasswordAuthentication |
findPasswordAuthenticationForRealm() |
protected LocationCredentials |
getActiveCredentials() |
protected LocationCredentials |
getCredentials(java.lang.String id)
Returns the location credentials registered under the specified key or
null if not found.
|
AbstractAuthenticator |
getFallbackAuthenticator()
Returns the fallback authenticator which will be called if no credentials
can be found in the registered credtentials.
|
protected java.util.Map<java.lang.String,LocationCredentials> |
getLocationCredentials() |
protected java.net.PasswordAuthentication |
getPasswordAuthentication() |
protected boolean |
hasActiveCredentials() |
static AutoAuthenticationManager |
install()
Must be called once, to activate this authentication manager mechanism
within the java.net.Authenticator.
|
static AutoAuthenticationManager |
instance()
Returns the only instance this class supports (design pattern "Singleton")
|
protected boolean |
isBasicHttp() |
void |
register(java.lang.String id,
LocationCredentials credentials)
Registers the given location credentials under the specified id.
|
LocationCredentials |
remove(java.lang.String id)
Removes the location credentials registered under the specified key from
the registry.
|
void |
reset()
Removes all registered credentials and the fallback authenticator.
|
protected void |
setActiveCredentials(LocationCredentials newValue) |
void |
setFallbackAuthenticator(AbstractAuthenticator newValue)
Sets the fallback authenticator which will be called if no credentials
can be found in the registered credtentials.
|
protected void |
setLocationCredentials(java.util.Map<java.lang.String,LocationCredentials> newValue) |
protected StringUtil |
str() |
protected boolean |
supportsHostNames() |
static void |
uninstall()
Can be called to remove this authentication manager from
the java.net.Authenticator.
|
getRequestingHost, getRequestingPort, getRequestingPrompt, getRequestingProtocol, getRequestingScheme, getRequestingSite, getRequestingURL, getRequestorType, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthentication, setDefault
protected static final Version HOST_SUPPORT_VERSION
protected static final Version JAVA_VERSION
public static AutoAuthenticationManager install()
public static void uninstall()
public static AutoAuthenticationManager instance()
public AbstractAuthenticator getFallbackAuthenticator()
public void setFallbackAuthenticator(AbstractAuthenticator newValue)
public boolean aboutToAccess(java.lang.String url)
url
- The URL that might need authentication to be accessedpublic boolean aboutToAccess(java.net.URL url)
url
- The URL that might need authentication to be accessedpublic void register(java.lang.String id, LocationCredentials credentials)
public LocationCredentials remove(java.lang.String id)
public void reset()
protected java.net.PasswordAuthentication getPasswordAuthentication()
getPasswordAuthentication
in class java.net.Authenticator
protected java.net.PasswordAuthentication findPasswordAuthenticationForRealm()
protected LocationCredentials getCredentials(java.lang.String id)
protected LocationCredentials findCredentialsFor(java.lang.String url)
protected LocationCredentials findCredentialsForRealm()
protected LocationCredentials findCredentialsForRealm(java.lang.String realm)
protected void fillFallbackAuthenticator()
protected boolean hasActiveCredentials()
protected boolean isBasicHttp()
protected boolean supportsHostNames()
protected java.util.Map<java.lang.String,LocationCredentials> getLocationCredentials()
protected void setLocationCredentials(java.util.Map<java.lang.String,LocationCredentials> newValue)
protected LocationCredentials getActiveCredentials()
protected void setActiveCredentials(LocationCredentials newValue)
protected StringUtil str()