org.outerj.daisy.repository.user
Interface User


public interface User

A repository user.


Method Summary
 void addToRole(Role role)
          Adds the User to the specified Role role.
 void clearRoles()
          Clears all roles for this user and sets the default role to null.
 long[] getAllRoleIds()
          Returns the ids of the roles to which the user belongs.
 Roles getAllRoles()
          Returns the Roles to which the user belongs
 java.lang.String getAuthenticationScheme()
           
 java.lang.String getConfirmKey()
           
 Role getDefaultRole()
          Gets the default role for this user, can return null if there is no default role assigned.
 java.lang.String getDisplayName()
          Returns either the concatenation of firstName and lastName, if at least one of those has a value, or otherwise the login.
 java.lang.String getEmail()
          Gets the email address of this user, or null if not assigned.
 java.lang.String getFirstName()
          Gets the first name of the user, could be null.
 long getId()
          Returns the user id.
 java.util.Date getLastModified()
           
 long getLastModifier()
          Gets the user id of the last modifier.
 java.lang.String getLastName()
          Gets the last name of the user, could be null.
 java.lang.String getLogin()
          Returns the user login.
 org.outerx.daisy.x10.PublicUserInfoDocument getPublicUserInfo()
           
 long getUpdateCount()
           
 org.outerx.daisy.x10.UserDocument getXml()
          Gets the XML representation of this object.
 boolean hasRole(long roleId)
          Returns true if the user belongs to the specified role.
 boolean isConfirmed()
           
 boolean isUpdateableByUser()
          Returns true if the user to who this user object corresponds can update this object.
 void removeFromRole(Role role)
          Remove the User from the specified Role role.
 void save()
          Persist this User to a data store.
 void setAuthenticationScheme(java.lang.String schemeName)
           
 void setConfirmed(boolean confirmed)
           
 void setConfirmKey(java.lang.String confirmKey)
           
 void setDefaultRole(Role role)
          Sets this User's default role.
 void setEmail(java.lang.String emailAddress)
          Sets this User's e-mail.
 void setFirstName(java.lang.String firstName)
          Sets the first name of the user (can be null).
 void setLastName(java.lang.String lastName)
          Sets the last name of the user (can be null).
 void setLogin(java.lang.String loginName)
          Sets the user login string.
 void setPassword(java.lang.String password)
          Sets the password for this user.
 void setUpdateableByUser(boolean updateableByUser)
           
 

Method Detail

setDefaultRole

public void setDefaultRole(Role role)
                    throws UserManagementException
Sets this User's default role.

If the user is not yet associated with this role (via addToRole(Role)), then this will be done implicitely.

You can specify null to unset the default role.

A default role is optional, if a user does not have a default role, then the authentication code will itself decide which role(s) to take as default.

Throws:
UserManagementException

getDefaultRole

public Role getDefaultRole()
Gets the default role for this user, can return null if there is no default role assigned.


addToRole

public void addToRole(Role role)
Adds the User to the specified Role role. If the user is added to the same role twice, nothing happens (no exception is thrown). In that case, the user will only belong to that role once.

Parameters:
role - the Role to add the user to

removeFromRole

public void removeFromRole(Role role)
Remove the User from the specified Role role.

Parameters:
role - the Role to remove the user from

getAllRoles

public Roles getAllRoles()
Returns the Roles to which the user belongs


getAllRoleIds

public long[] getAllRoleIds()
Returns the ids of the roles to which the user belongs.

Returns:

setPassword

public void setPassword(java.lang.String password)
Sets the password for this user.

For security reasons, getPassword is not provided.


setEmail

public void setEmail(java.lang.String emailAddress)
Sets this User's e-mail.

Parameters:
emailAddress - allowed to be null

getEmail

public java.lang.String getEmail()
Gets the email address of this user, or null if not assigned.


getLogin

public java.lang.String getLogin()
Returns the user login.


setLogin

public void setLogin(java.lang.String loginName)
Sets the user login string.


getId

public long getId()
Returns the user id.


setFirstName

public void setFirstName(java.lang.String firstName)
Sets the first name of the user (can be null).


setLastName

public void setLastName(java.lang.String lastName)
Sets the last name of the user (can be null).


getFirstName

public java.lang.String getFirstName()
Gets the first name of the user, could be null.


getLastName

public java.lang.String getLastName()
Gets the last name of the user, could be null.


getDisplayName

public java.lang.String getDisplayName()
Returns either the concatenation of firstName and lastName, if at least one of those has a value, or otherwise the login.


save

public void save()
          throws RepositoryException
Persist this User to a data store.

Throws:
RepositoryException

getLastModified

public java.util.Date getLastModified()

getLastModifier

public long getLastModifier()
Gets the user id of the last modifier.


getXml

public org.outerx.daisy.x10.UserDocument getXml()
Gets the XML representation of this object.


clearRoles

public void clearRoles()
Clears all roles for this user and sets the default role to null.


hasRole

public boolean hasRole(long roleId)
Returns true if the user belongs to the specified role.


isUpdateableByUser

public boolean isUpdateableByUser()
Returns true if the user to who this user object corresponds can update this object. This allows the user to change its login, email, password, etc. but not the roles he/she has.


setUpdateableByUser

public void setUpdateableByUser(boolean updateableByUser)
See Also:
isUpdateableByUser()

isConfirmed

public boolean isConfirmed()

setConfirmed

public void setConfirmed(boolean confirmed)

getConfirmKey

public java.lang.String getConfirmKey()

setConfirmKey

public void setConfirmKey(java.lang.String confirmKey)

getAuthenticationScheme

public java.lang.String getAuthenticationScheme()

setAuthenticationScheme

public void setAuthenticationScheme(java.lang.String schemeName)

getUpdateCount

public long getUpdateCount()

getPublicUserInfo

public org.outerx.daisy.x10.PublicUserInfoDocument getPublicUserInfo()


Copyright © -2005 . All Rights Reserved.