ucar.unidata.util
Class AccountManager

java.lang.Object
  extended by ucar.unidata.util.AccountManager
All Implemented Interfaces:
org.apache.commons.httpclient.auth.CredentialsProvider, IOUtil.UserAccountManager

public class AccountManager
extends Object
implements org.apache.commons.httpclient.auth.CredentialsProvider, IOUtil.UserAccountManager

This class is used to provide authentication of access controlled CDM datasets.

Version:
$Id: AccountManager.java,v 1.3 2007/05/09 21:59:26 dmurray Exp $
Author:
IDV Development Team

Field Summary
 
Fields inherited from interface org.apache.commons.httpclient.auth.CredentialsProvider
PROVIDER
 
Constructor Summary
AccountManager(File stateDir)
          constructor
 
Method Summary
 void clear()
          _more_
 org.apache.commons.httpclient.Credentials getCredentials(org.apache.commons.httpclient.auth.AuthScheme authscope, String host, int port, boolean isproxy)
          Do the authentication
 org.apache.commons.httpclient.Credentials getCredentialsnew(org.apache.commons.httpclient.auth.AuthScope scope)
          _more_
static AccountManager getGlobalAccountManager()
          Get the account manager
protected  Hashtable<String,UserInfo> getTable()
          _more_
 UserInfo getUserNamePassword(String key, String label)
          _more_
 void setCredentials(org.apache.commons.httpclient.auth.AuthScheme scope, String host, int port, boolean isproxy)
          _more_
static void setGlobalAccountManager(AccountManager manager)
          Set te global account manager.
protected  void writeTable()
          _more_
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

AccountManager

public AccountManager(File stateDir)
constructor

Parameters:
stateDir - The directory to read/write state to
Method Detail

clear

public void clear()
_more_


getGlobalAccountManager

public static AccountManager getGlobalAccountManager()
Get the account manager

Returns:
The account manager

setGlobalAccountManager

public static void setGlobalAccountManager(AccountManager manager)
Set te global account manager. If one is set already then throw an exception

Parameters:
manager - Instance of the global account manager

setCredentials

public void setCredentials(org.apache.commons.httpclient.auth.AuthScheme scope,
                           String host,
                           int port,
                           boolean isproxy)
_more_

Parameters:
scope - _more_
host -
port -
isproxy -

getCredentials

public org.apache.commons.httpclient.Credentials getCredentials(org.apache.commons.httpclient.auth.AuthScheme authscope,
                                                                String host,
                                                                int port,
                                                                boolean isproxy)
Do the authentication

Specified by:
getCredentials in interface org.apache.commons.httpclient.auth.CredentialsProvider
Parameters:
authscope - authscope
Returns:
Null if the user presses cancel. Else return the credentials

getCredentialsnew

public org.apache.commons.httpclient.Credentials getCredentialsnew(org.apache.commons.httpclient.auth.AuthScope scope)
_more_

Parameters:
scope - _more_
Returns:
_more_

getUserNamePassword

public UserInfo getUserNamePassword(String key,
                                    String label)
_more_

Specified by:
getUserNamePassword in interface IOUtil.UserAccountManager
Parameters:
key - _more_
label - _more_
Returns:
_more_

writeTable

protected void writeTable()
_more_


getTable

protected Hashtable<String,UserInfo> getTable()
_more_

Returns:
_more_