Class AccountManager

java.lang.Object
ucar.unidata.util.AccountManager
All Implemented Interfaces:
org.apache.http.client.CredentialsProvider, IOUtil.UserAccountManager

public class AccountManager extends Object implements org.apache.http.client.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
  • Constructor Details

    • AccountManager

      public AccountManager(File stateDir)
      constructor
      Parameters:
      stateDir - The directory to read/write state to
  • Method Details

    • clear

      public void clear()
      _more_
      Specified by:
      clear in interface org.apache.http.client.CredentialsProvider
    • 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.http.auth.AuthScope scope, org.apache.http.auth.Credentials creds)
      _more_
      Specified by:
      setCredentials in interface org.apache.http.client.CredentialsProvider
      Parameters:
      scope - _more_
      creds -
    • getCredentials

      public org.apache.http.auth.Credentials getCredentials(org.apache.http.auth.AuthScope scope)
      Do the authentication
      Specified by:
      getCredentials in interface org.apache.http.client.CredentialsProvider
      Parameters:
      scope - authscope
      Returns:
      Null if the user presses cancel. Else return the credentials
    • getCredentials

      public org.apache.http.auth.Credentials getCredentials()
      Returns:
      _more_
    • getCredentialsnew

      public org.apache.http.auth.Credentials getCredentialsnew(org.apache.http.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_
    • removeUserNamePassword

      public void removeUserNamePassword()
      _more_
    • writeTable

      protected void writeTable()
      _more_
    • getTable

      protected Hashtable<String,UserInfo> getTable()
      _more_
      Returns:
      _more_