gov.lanl.Web
Class Login

java.lang.Object
  |
  +--gov.lanl.Web.Login

public class Login
extends java.lang.Object

This class authenticates a user and holds their "credentials" until they are logged out. It obtains the users from UserMgr.

Version:
$Id: Login.java,v 1.20 2002/11/18 20:21:37 dwokoun Exp $
Author:
$Author: dwokoun $

Constructor Summary
Login()
          Public default constructor
 
Method Summary
 User authenticate()
          authenticate the user by checking the password
 java.lang.String getCountry()
          get the country field
 java.lang.String getDN()
          get the Distinguished Name of the user
 java.lang.String getEmail()
          get the current email address
static java.lang.String[] getMail()
          return known email addresses
static java.lang.String[] getNames()
          obtain list of valid users
 java.lang.String getRole()
          return the role of the current user.
 User getUser()
          get the User from one of two ways.
static UserMgr getUserMgr()
          get the UserMgr that contains the Users
 java.lang.String getUsername()
          get the current username from user if defined
static void init()
          Initialize and load all the users.
 void logOut()
          logout the current user
static void main(java.lang.String[] argv)
          test program
static void setConfigFile(java.lang.String theConfigFile)
          Bean setter and getter methods
 void setCountry(java.lang.String c)
          set the Country
 void setEmail(java.lang.String email)
          set the email address
 void setOrg(java.lang.String org)
          set the Organization to which the logged in user belongs
 void setPassword(java.lang.String password)
          set the password
 void setUserId(java.lang.String userId)
          set the active user from the userId
static void setUserMgr(UserMgr theUserMgr)
          set the UserMgr containing the Users.
 void setUsername(java.lang.String username)
          set the username and get the user corresponding to the resulting dn
 java.lang.String toString()
          get all the users in memory
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Constructor Detail

Login

public Login()
Public default constructor

Method Detail

init

public static void init()
Initialize and load all the users.


setConfigFile

public static void setConfigFile(java.lang.String theConfigFile)
Bean setter and getter methods

Parameters:
theConfigFile - the properties file

setUsername

public void setUsername(java.lang.String username)
set the username and get the user corresponding to the resulting dn

Parameters:
username -

getUsername

public java.lang.String getUsername()
get the current username from user if defined


setPassword

public void setPassword(java.lang.String password)
set the password

Parameters:
password -

setEmail

public void setEmail(java.lang.String email)
set the email address

Parameters:
email - address

setOrg

public void setOrg(java.lang.String org)
set the Organization to which the logged in user belongs


setCountry

public void setCountry(java.lang.String c)
set the Country

Parameters:
c - containing the value of the country (e.g. US)

getCountry

public java.lang.String getCountry()
get the country field

Returns:

setUserId

public void setUserId(java.lang.String userId)
set the active user from the userId

Parameters:
userId -

getEmail

public java.lang.String getEmail()
get the current email address


getUser

public User getUser()
get the User from one of two ways. Return the current user if it is already defined. First see if there is a defined email address (userId) and get the user directly If not, then check the organization table and the the associated table of username using the username and organization (country is defaulted to "US").


getRole

public java.lang.String getRole()
return the role of the current user.

Returns:
String containing the Role of the current user

getDN

public java.lang.String getDN()
get the Distinguished Name of the user

Returns:
String containing the distinguished name

logOut

public void logOut()
logout the current user


authenticate

public User authenticate()
authenticate the user by checking the password

Returns:
user

getNames

public static java.lang.String[] getNames()
obtain list of valid users

Returns:
String[] list of known users

getMail

public static java.lang.String[] getMail()
return known email addresses

Returns:
String[] list of known emails

setUserMgr

public static void setUserMgr(UserMgr theUserMgr)
set the UserMgr containing the Users.

Parameters:
theUserMgr - to be used

getUserMgr

public static UserMgr getUserMgr()
get the UserMgr that contains the Users

Returns:
UserMgr

toString

public java.lang.String toString()
get all the users in memory

Overrides:
toString in class java.lang.Object
Returns:
String

main

public static void main(java.lang.String[] argv)
test program



Copyright © 2000 University of California. All Rights Reserved.