org.gcube.contentmanagement.baselayer
Class BaseLayerAuthenticator

java.lang.Object
  extended by java.net.Authenticator
      extended by 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 Class Summary
 
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
 

Constructor Detail

BaseLayerAuthenticator

public BaseLayerAuthenticator(java.lang.String username,
                              java.lang.String password)
Creates a new authenticator

Parameters:
username - the username
password - the password
Method Detail

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