net.incongru.berkano.user
Class UserImpl

java.lang.Object
  extended by net.incongru.berkano.user.UserImpl
All Implemented Interfaces:
java.security.Principal, PropertiesAware, User

public class UserImpl
extends java.lang.Object
implements User, PropertiesAware

This is an hibernated implementation of User.

Version:
$Revision: 1.12 $
Author:
greg, $Author: gj $ (last edit)

Constructor Summary
UserImpl()
           
 
Method Summary
 void addGroup(Group group)
           
 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 getName()
           
 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.Map getProperties()
           
 java.lang.Object getProperty(java.lang.String key)
           
 java.util.Date getUpdateTimestamp()
           
 java.lang.Long getUserId()
           
 java.lang.String getUserName()
           
 void removeGroup(Group group)
           
 void removeProperty(java.lang.String key)
           
 void setCreationTimestamp(java.util.Date creationTimestamp)
           
 void setEmail(java.lang.String email)
           
 void setFullName(java.lang.String fullName)
           
 void setGroups(java.util.Set groups)
           
 void setPassword(java.lang.String password)
           
 void setProperty(java.lang.String key, java.lang.Object object)
           
 void setUpdateTimestamp(java.util.Date updateTimestamp)
           
 void setUserId(java.lang.Long userId)
           
 void setUserName(java.lang.String userName)
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 
Methods inherited from interface java.security.Principal
equals, hashCode, toString
 

Constructor Detail

UserImpl

public UserImpl()
Method Detail

getUserId

public java.lang.Long getUserId()
Specified by:
getUserId in interface User

setUserId

public void setUserId(java.lang.Long userId)

getUserName

public java.lang.String getUserName()
Specified by:
getUserName in interface User

getName

public java.lang.String getName()
Specified by:
getName in interface java.security.Principal

setUserName

public void setUserName(java.lang.String userName)

getPassword

public java.lang.String getPassword()
Description copied from interface: User
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)

Specified by:
getPassword in interface User
Returns:
the password of the user

setPassword

public void setPassword(java.lang.String password)

getEmail

public java.lang.String getEmail()
Specified by:
getEmail in interface User

setEmail

public void setEmail(java.lang.String email)

getFullName

public java.lang.String getFullName()
Description copied from interface: User
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

Specified by:
getFullName in interface User
Returns:
the username as it should be displayed

setFullName

public void setFullName(java.lang.String fullName)

getCreationTimestamp

public java.util.Date getCreationTimestamp()
Specified by:
getCreationTimestamp in interface User

setCreationTimestamp

public void setCreationTimestamp(java.util.Date creationTimestamp)

getUpdateTimestamp

public java.util.Date getUpdateTimestamp()
Specified by:
getUpdateTimestamp in interface User

setUpdateTimestamp

public void setUpdateTimestamp(java.util.Date updateTimestamp)

getGroups

public java.util.Set getGroups()
Description copied from interface: User
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?

Specified by:
getGroups in interface User

setGroups

public void setGroups(java.util.Set groups)

addGroup

public void addGroup(Group group)

removeGroup

public void removeGroup(Group group)

getProperty

public java.lang.Object getProperty(java.lang.String key)

setProperty

public void setProperty(java.lang.String key,
                        java.lang.Object object)

removeProperty

public void removeProperty(java.lang.String key)

getProperties

public java.util.Map getProperties()
Specified by:
getProperties in interface PropertiesAware


Copyright © 2004-2007. All Rights Reserved.