org.gcube.contentmanagement.baselayer
Class BaseLayerAuthenticator
java.lang.Object
java.net.Authenticator
org.gcube.contentmanagement.baselayer.BaseLayerAuthenticator
public class BaseLayerAuthenticator
- extends java.net.Authenticator
This class implements a simple Authenticator using username and password from
defined storage hints
Nested classes/interfaces inherited from class java.net.Authenticator |
java.net.Authenticator.RequestorType |
Constructor Summary |
BaseLayerAuthenticator(java.lang.String username,
java.lang.String password)
Creates a new authenticator |
Method Summary |
static java.net.Authenticator |
getAnonymousAuthenticator()
factory method to get singleton authenticator for anonymous access |
static java.net.Authenticator |
getAuthenticatorFor(BasicStorageHints hints)
Factory method to generate an authenticator based on StorageHints |
Methods inherited from class java.net.Authenticator |
requestPasswordAuthentication, requestPasswordAuthentication, requestPasswordAuthentication, setDefault |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
BaseLayerAuthenticator
public BaseLayerAuthenticator(java.lang.String username,
java.lang.String password)
- Creates a new authenticator
- Parameters:
username
- the usernamepassword
- the password
getAnonymousAuthenticator
public static java.net.Authenticator getAnonymousAuthenticator()
- factory method to get singleton authenticator for anonymous access
- Returns:
- authenticator for anonymous access
getAuthenticatorFor
public static java.net.Authenticator getAuthenticatorFor(BasicStorageHints hints)
throws ValueNotValidException
- Factory method to generate an authenticator based on StorageHints
- Parameters:
hints
- the hints defining the username / password
- Returns:
- the new authenticator
- Throws:
ValueNotValidException
- in case any of the hints is invalid- See Also:
BasicStorageHints.HINT_NAME_USERNAME
,
BasicStorageHints.HINT_NAME_PASSWORD