Expresso 5-5-0

com.jcorporate.expresso.core.security
Interface UserInfo

All Superinterfaces:
LookupInterface
All Known Implementing Classes:
DefaultUserInfo, SingleDBUserInfo, UserDBObj, UserLDAP

public interface UserInfo
extends LookupInterface

UserInfo defines the interface to an object that provides information about a user this object may get it's information from LDAP, Database, or any other source

Version:
$Revision: 1.13 $ $Date: 2004/03/26 02:52:23 $
Author:
Michael Nash

Method Summary
 void add()
          Adds the current UserInfo object into the repository
 void delete()
          Deletes the current UserInfo object from the repository
 boolean find()
          Find a UserInfo object in the repository that matches the non-empty properties filled in the current UserInfo object
 String getAccountStatus()
          Retrieve the current account status.
 Vector getAllUsers()
          Returns a Vector of all the UserInfo objects in the repository
 String getCreateDate()
          Returns the date that this UserInfo object was created
 String getDataContext()
          gets the DB context; can return null
 String getDBName()
          gets the DB context; can return null
 String getEmail()
          Returns the email address for this user
 String getEmailAuthCode()
          Returns the email auth code previously set for this user
 String getEmailValCode()
          Retrieve the validation code required for authorization by email
 String getField(String fieldName)
          Deprecated. Use the direct getLoginName, getEmail, getPassword, etc. methods instead
 Vector getGroups()
          Return a vector of the group names that this user belongs to
 String getLoginName()
          Returns the login name of this user
 String getPassword()
          Returns the password for this user
 String getPrimaryGroup()
          the primary group of this user is appropriate for unix-like purposes, such as setting the group for a file permission
 boolean getRegComplete()
          Returns the status of whether extended registration has been completed or not Valid values are "Y" or "N"
 String getRegistrationDomain()
          Returns the unique integer for the registration domain that this user belongs to
 int getUid()
          Returns the user id for this user
 String getUpdateDate()
          Returns the date that this UserInfo object was last modified
 String getUserName()
          Returns the descriptive string for this user
 boolean passwordEquals(String testPassword)
          Checks if the given password equals what we have on file.
 void retrieve()
          Retrieves the current user from the repository
 void sendAuthEmail()
           
 void sendFollowUpEmail()
           
 void setAccountStatus(String accountStatus)
          Sets the current status of the account - "A" (active), "D" (disabled), "I" (inactive)
 void setDBName(String newDBName)
          Sets the DB context
 void setEmail(String email)
          Sets the email address
 void setEmailValCode(String code)
          Sets the code required for auth. via email
 void setLoginName(String loginName)
          Sets the login name
 void setPassword(String password)
          Sets the password
 void setRegComplete(boolean status)
          Sets the extended registration complete flag - "Y" or "N"
 void setRegistrationDomain(String id)
          Sets the registration domain
 void setUid(int uid)
          Sets the user UID
 void setUserName(String name)
          Sets the user name
 void update()
          Update the user in the repository with modified properties
 
Methods inherited from interface com.jcorporate.expresso.core.dbobj.LookupInterface
getValues
 

Method Detail

add

public void add()
         throws DBException
Adds the current UserInfo object into the repository

Throws:
DBException - If the add fails

delete

public void delete()
            throws DBException
Deletes the current UserInfo object from the repository

Throws:
DBException - If the delete fails

find

public boolean find()
             throws DBException
Find a UserInfo object in the repository that matches the non-empty properties filled in the current UserInfo object

Returns:
true if the user is found
Throws:
DBException - If the find fails

getAccountStatus

public String getAccountStatus()
                        throws DBException
Retrieve the current account status. Valid values are "A" (active), "I" (inactive), "D" (disabled)

Returns:
java.lang.String
Throws:
DBException - If the find fails

getAllUsers

public Vector getAllUsers()
                   throws DBException
Returns a Vector of all the UserInfo objects in the repository

Returns:
java.util.Vector
Throws:
DBException - If there is an error during the retrieval

getCreateDate

public String getCreateDate()
                     throws DBException
Returns the date that this UserInfo object was created

Returns:
java.lang.String
Throws:
DBException - If there is an error during the retrieval

getEmail

public String getEmail()
                throws DBException
Returns the email address for this user

Returns:
java.lang.String
Throws:
DBException - If there is an error during the retrieval

getEmailAuthCode

public String getEmailAuthCode()
                        throws DBException
Returns the email auth code previously set for this user

Returns:
java.lang.String
Throws:
DBException - If there is an error during the retrieval

getEmailValCode

public String getEmailValCode()
                       throws DBException
Retrieve the validation code required for authorization by email

Returns:
java.lang.String
Throws:
DBException - If the find fails

getField

public String getField(String fieldName)
                throws DBException
Deprecated. Use the direct getLoginName, getEmail, getPassword, etc. methods instead

Return a vector of the group names that this user belongs to

Parameters:
fieldName - The field to retrieve
Returns:
Vector Group names that this user belongs to
Throws:
DBException - If an error occurs when the group info is read

getGroups

public Vector getGroups()
                 throws DBException
Return a vector of the group names that this user belongs to

Returns:
Vector Group names that this user belongs to
Throws:
DBException - If an error occurs when the group info is read

getLoginName

public String getLoginName()
                    throws DBException
Returns the login name of this user

Returns:
java.lang.String
Throws:
DBException - If there is an error during the retrieval

getPassword

public String getPassword()
                   throws DBException
Returns the password for this user

Returns:
java.lang.String
Throws:
DBException - If there is an error during the retrieval

getRegComplete

public boolean getRegComplete()
                       throws DBException
Returns the status of whether extended registration has been completed or not Valid values are "Y" or "N"

Returns:
java.lang.String
Throws:
DBException - If there is an error during the retrieval

getRegistrationDomain

public String getRegistrationDomain()
                             throws DBException
Returns the unique integer for the registration domain that this user belongs to

Returns:
java.lang.String
Throws:
DBException - If the underlying User implementation throws the same

getUid

public int getUid()
           throws DBException
Returns the user id for this user

Returns:
java.lang.String
Throws:
DBException - If there is an error during the retrieval

getUpdateDate

public String getUpdateDate()
                     throws DBException
Returns the date that this UserInfo object was last modified

Returns:
java.lang.String
Throws:
DBException - If there is an error during the retrieval

getUserName

public String getUserName()
                   throws DBException
Returns the descriptive string for this user

Returns:
java.lang.String
Throws:
DBException - If there is an error during the retrieval

passwordEquals

public boolean passwordEquals(String testPassword)
                       throws DBException
Checks if the given password equals what we have on file. We don't directly compare userInfo fields because often we store the password in a hash instead of a normal string so we have to take the testPassword, hash it and compare the two hashes.

Parameters:
testPassword - The string to test if it's a correct password
Returns:
true if the testPassword equals the password on file.
Throws:
DBException - If an error occurs when the group info is read

retrieve

public void retrieve()
              throws DBException
Retrieves the current user from the repository

Throws:
DBException - If the add fails

sendAuthEmail

public void sendAuthEmail()
                   throws DBException
Throws:
DBException

sendFollowUpEmail

public void sendFollowUpEmail()
                       throws DBException
Throws:
DBException

setAccountStatus

public void setAccountStatus(String accountStatus)
                      throws DBException
Sets the current status of the account - "A" (active), "D" (disabled), "I" (inactive)

Parameters:
accountStatus - java.lang.String
Throws:
DBException - If there is an error

setDBName

public void setDBName(String newDBName)
               throws DBException
Sets the DB context

Parameters:
newDBName - java.lang.String
Throws:
DBException - If there is an error

getDBName

public String getDBName()
gets the DB context; can return null


getDataContext

public String getDataContext()
gets the DB context; can return null


setEmail

public void setEmail(String email)
              throws DBException
Sets the email address

Parameters:
email - java.lang.String
Throws:
DBException - If there is an error

setEmailValCode

public void setEmailValCode(String code)
                     throws DBException
Sets the code required for auth. via email

Parameters:
code - java.lang.String
Throws:
DBException - If there is an error

setLoginName

public void setLoginName(String loginName)
                  throws DBException
Sets the login name

Parameters:
loginName - java.lang.String
Throws:
DBException - If there is an error

setPassword

public void setPassword(String password)
                 throws DBException
Sets the password

Parameters:
password - java.lang.String
Throws:
DBException - If there is an error

setRegComplete

public void setRegComplete(boolean status)
                    throws DBException
Sets the extended registration complete flag - "Y" or "N"

Parameters:
status - java.lang.String
Throws:
DBException - If there is an error

setRegistrationDomain

public void setRegistrationDomain(String id)
                           throws DBException
Sets the registration domain

Parameters:
id - java.lang.String
Throws:
DBException - If there is an error
See Also:
RegistrationDomain

setUid

public void setUid(int uid)
            throws DBException
Sets the user UID

Parameters:
uid - The uid of the user
Throws:
DBException - If there is an error

setUserName

public void setUserName(String name)
                 throws DBException
Sets the user name

Parameters:
name - java.lang.String
Throws:
DBException - If there is an error

update

public void update()
            throws DBException
Update the user in the repository with modified properties

Throws:
DBException - If the add fails

getPrimaryGroup

public String getPrimaryGroup()
                       throws DBException
the primary group of this user is appropriate for unix-like purposes, such as setting the group for a file permission

Returns:
name of the primary group of this user; null if no group is found
Throws:
DBException

Expresso 5-5-0

Please see www.jcorporate.com for information about new Expresso releases.