FileDocCategorySizeDatePackage
SharedUser.javaAPI DocExample2958Mon Mar 31 23:09:44 BST 2003org.dasein.security

SharedUser

public class SharedUser extends Object

Fields Summary
public static final String
AUTHORIZATION
public static final String
EMAIL
public static final String
FIRST_NAME
public static final String
LAST_NAME
public static final String
LOCALE
public static final String
NICKNAME
public static final String
USER_ID
public static final String
WEB_PAGE
private static final org.dasein.util.Cache
cache
private int
authorization
private String
email
private String
firstName
private String
lastName
private Locale
locale
private String
nickname
private String
userID
private String
webPage
Constructors Summary
private SharedUser(String uid, HashMap data)

    
         
        super();
        userID = uid;
        {
            Integer auth = (Integer)data.get(SharedUser.AUTHORIZATION);

            authorization = auth.intValue();
        }
        email = ((String)data.get(SharedUser.EMAIL)).trim();
        firstName = ((String)data.get(SharedUser.FIRST_NAME)).trim();
        lastName = ((String)data.get(SharedUser.LAST_NAME)).trim();
        nickname = ((String)data.get(SharedUser.NICKNAME)).trim();
        webPage = (String)data.get(SharedUser.WEB_PAGE);
        if( webPage != null ) {
            webPage = webPage.trim();
        }
    
Methods Summary
voidauthenticate(java.lang.String pw)

        UserDAO.authenticate(userID, pw);
    
booleanchangePassword(java.lang.String opw, java.lang.String npw)

        return UserDAO.changePassword(userID, opw, npw);
    
public intgetAuthorization()

        return authorization;
    
public java.lang.StringgetEmail()

        return email;
    
public java.lang.StringgetFirstName()

        return firstName;
    
public java.lang.StringgetLastName()

        return lastName;
    
public java.util.LocalegetLocale()

        return locale;
    
public java.lang.StringgetNickname()

        return nickname;
    
public static org.dasein.security.SharedUsergetUser(java.lang.String uid)


           
        synchronized( cache ) {
            SharedUser u = (SharedUser)cache.get(uid);

            if( u == null ) {
                HashMap data = UserDAO.load(uid);

                u = new SharedUser(uid, data);
                cache.cache(uid, u);
            }
            return u;
        }
    
public java.lang.StringgetUserID()

        return userID;
    
public java.lang.StringgetWebPage()

        return webPage;
    
public voidlogout()

        UserDAO.logout(userID);