FileDocCategorySizeDatePackage
UserBeanImpl.javaAPI DocExample1862Sat Nov 22 19:35:12 GMT 2003s2wexample.model

UserBeanImpl

public class UserBeanImpl extends Object implements UserBean
A (very) simple implementation of the UserBean interface. This simply stores values in memory.

Fields Summary
private String
username
the username
private String
password
the password
private String
language
the preferred language
private boolean
loggedIn
whether or not the user is logged in
Constructors Summary
public UserBeanImpl()
Constructor.

    
          
      
    
Methods Summary
public booleandoLogin()
Business method to perform login

        loggedIn = false;
       
        // this implementation just checks that the password is more
        // than three characters long.  A real implementation should
        // use some real method of verifying the username and password.
        if((username != null) && (username.length() > 0) &&
           (password != null) && (password.length() > 3)) {
            loggedIn = true;
        }
        
        return loggedIn;
    
public java.lang.StringgetLanguage()
Get the user's preferred language

        return language;
    
public java.lang.StringgetUsername()
Get the username

        return username;
    
public booleanisLoggedIn()
Determine if the user is logged in

        return loggedIn;
    
public voidsetLanguage(java.lang.String language)
Set the user's preferred language

        this.language = language;
    
public voidsetPassword(java.lang.String password)
Set the user's password

        this.password = password;
    
public voidsetUsername(java.lang.String username)
Set the username

        this.username = username;