Package com.adaptris.core.http.auth
Class AdapterResourceAuthenticator
- java.lang.Object
-
- java.net.Authenticator
-
- com.adaptris.core.http.auth.AdapterResourceAuthenticator
-
public class AdapterResourceAuthenticator extends java.net.Authenticator
Responsible for authenticating against network resources when requested.This calls
Authenticator.setDefault(Authenticator)
in a static block; when authentication is required, this will iterate over the list of configuredResourceAuthenticator
instances and return the first non-nullPasswordAuthentication
provided.Classes that wish to provide an
Authenticator
instance are encouraged to instead implementResourceAuthenticator
and add to this instance using theaddAuthenticator(ResourceAuthenticator)
andremoveAuthenticator(ResourceAuthenticator)
methods.
-
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description boolean
addAuthenticator(ResourceAuthenticator a)
java.util.Collection<ResourceAuthenticator>
currentAuthenticators()
Return a cloned list of the current set of configured authenticators.static AdapterResourceAuthenticator
getInstance()
protected java.net.PasswordAuthentication
getPasswordAuthentication()
boolean
removeAuthenticator(ResourceAuthenticator a)
-
Methods inherited from class java.net.Authenticator
getDefault, getRequestingHost, getRequestingPort, getRequestingPrompt, getRequestingProtocol, getRequestingScheme, getRequestingSite, getRequestingURL, getRequestorType, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthenticationInstance, setDefault
-
-
-
-
Method Detail
-
getInstance
public static final AdapterResourceAuthenticator getInstance()
-
getPasswordAuthentication
protected java.net.PasswordAuthentication getPasswordAuthentication()
- Overrides:
getPasswordAuthentication
in classjava.net.Authenticator
-
addAuthenticator
public boolean addAuthenticator(ResourceAuthenticator a)
-
removeAuthenticator
public boolean removeAuthenticator(ResourceAuthenticator a)
-
currentAuthenticators
public java.util.Collection<ResourceAuthenticator> currentAuthenticators()
Return a cloned list of the current set of configured authenticators.- Returns:
- a shallow clone of the current set of authenticators.
-
-