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

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

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


addToRole

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

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

Parameters:
role - the Role to remove the user from

getAllRoles

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


getAllRoleIds

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


setPassword

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

For security reasons, getPassword is not provided.


setEmail

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

Parameters:
emailAddress - allowed to be null

getEmail

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


getLogin

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


setLogin

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


getId

long getId()
Returns the user id.


setFirstName

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


setLastName

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


getFirstName

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


getLastName

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


getDisplayName

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

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

Throws:
RepositoryException

getLastModified

java.util.Date getLastModified()

getLastModifier

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


getXml

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


clearRoles

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


hasRole

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


isUpdateableByUser

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

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

isConfirmed

boolean isConfirmed()

setConfirmed

void setConfirmed(boolean confirmed)

getConfirmKey

java.lang.String getConfirmKey()

setConfirmKey

void setConfirmKey(java.lang.String confirmKey)

getAuthenticationScheme

java.lang.String getAuthenticationScheme()

setAuthenticationScheme

void setAuthenticationScheme(java.lang.String schemeName)

getUpdateCount

long getUpdateCount()

getPublicUserInfo

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


Copyright © -2012 . All Rights Reserved.