net.incongru.berkano.user
Interface User

All Superinterfaces:
java.security.Principal
All Known Implementing Classes:
UserImpl

public interface User
extends java.security.Principal

This interface defines the basic user functionalities and attributes. todo : Maybe some are useless or superfluous(email, fullName, ...), we'll refine that later. todo : do we need preferences that are not application specific or shared between applications? todo : should we foresee sharing of preferences by grouped applications, or just "global" prefs?

Version:
$Revision: 1.13 $
Author:
gjoseph, $Author: gj $ (last edit)
See Also:
UserDAO

Method Summary
 java.util.Date getCreationTimestamp()
           
 java.lang.String getEmail()
           
 java.lang.String getFullName()
          This returns the user name as it should be displayed.
 java.util.Set getGroups()
          TODO : how could we possibly prevent people playing with the returned set? It would probably not hurt anyway, but it should be mandatory to use the UserDAO object to add groups to a user.
 java.lang.String getPassword()
          TODO : This is to be discussed: do we need to expose getPassword here? I think yes, because some people might be annoyed by a "change-only" password system (no existing password sent by mail), but implementations might skip it (make it throw IllegalStateException for exemple)
 java.util.Date getUpdateTimestamp()
           
 java.lang.Long getUserId()
           
 java.lang.String getUserName()
           
 
Methods inherited from interface java.security.Principal
equals, getName, hashCode, toString
 

Method Detail

getUserId

java.lang.Long getUserId()

getUserName

java.lang.String getUserName()

getPassword

java.lang.String getPassword()
                             throws java.lang.UnsupportedOperationException
TODO : This is to be discussed: do we need to expose getPassword here? I think yes, because some people might be annoyed by a "change-only" password system (no existing password sent by mail), but implementations might skip it (make it throw IllegalStateException for exemple)

Returns:
the password of the user
Throws:
java.lang.UnsupportedOperationException

getGroups

java.util.Set getGroups()
TODO : how could we possibly prevent people playing with the returned set? It would probably not hurt anyway, but it should be mandatory to use the UserDAO object to add groups to a user. Implementations could return Collection.unmodifiableSet instances, but this can not be enforced by this interface can it?


getFullName

java.lang.String getFullName()
This returns the user name as it should be displayed. In most implementations this will just return the same as getUserName, but some implementations might decide to replace _ by space for example, etc... Some other implementations will also allow users to define this themselves

Returns:
the username as it should be displayed

getEmail

java.lang.String getEmail()

getCreationTimestamp

java.util.Date getCreationTimestamp()

getUpdateTimestamp

java.util.Date getUpdateTimestamp()


Copyright © 2004-2007. All Rights Reserved.