com.atlassian.crowd.model.user
Class InternalUser

java.lang.Object
  extended by com.atlassian.crowd.model.InternalEntity
      extended by com.atlassian.crowd.model.InternalDirectoryEntity
          extended by com.atlassian.crowd.model.user.InternalUser
All Implemented Interfaces:
User, DirectoryEntity, TimestampedEntity, TimestampedUser, Serializable, Comparable<User>, Principal

public class InternalUser
extends InternalDirectoryEntity
implements TimestampedUser

Encapsulates the concept of crowd user.

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.atlassian.crowd.model.InternalDirectoryEntity
directory
 
Fields inherited from class com.atlassian.crowd.model.InternalEntity
active, createdDate, id, name, updatedDate
 
Constructor Summary
protected InternalUser()
           
  InternalUser(InternalEntityTemplate internalEntityTemplate, Directory directory, UserTemplate userTemplate, PasswordCredential credential)
          This constructor is used by the importer only.
  InternalUser(User user, Directory directory, PasswordCredential credential)
          Constructor used for adding a new user.
  InternalUser(UserTemplateWithCredentialAndAttributes user, Directory directory)
           
 
Method Summary
 int compareTo(User other)
          CompareTo must be compatible with the equals() and hashCode() methods
 boolean equals(Object o)
          Implementations must ensure equality based on getDirectoryId() and case-insensitive getName().
 PasswordCredential getCredential()
           
 List<PasswordCredential> getCredentialHistory()
           
 List<InternalUserCredentialRecord> getCredentialRecords()
           
 String getDisplayName()
           
 String getEmailAddress()
           
 String getFirstName()
           
 String getLastName()
           
 String getLowerDisplayName()
           
 String getLowerEmailAddress()
           
 String getLowerFirstName()
           
 String getLowerLastName()
           
 String getLowerName()
           
 int hashCode()
          Implementations must produce a hashcode based on getDirectoryId() and case-insensitive getName().
 void renameTo(String newUsername)
           
 void setName(String name)
           
 String toString()
           
 void updateCredentialTo(PasswordCredential newCredential, int maxCredentialHistory)
           
 void updateDetailsFrom(User user)
           
 
Methods inherited from class com.atlassian.crowd.model.InternalDirectoryEntity
getDirectory, getDirectoryId
 
Methods inherited from class com.atlassian.crowd.model.InternalEntity
getCreatedDate, getId, getName, getUpdatedDate, isActive, setActive, setCreatedDate, setCreatedDateToNow, setUpdatedDate, setUpdatedDateToNow
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.atlassian.crowd.model.DirectoryEntity
getDirectoryId, getName
 
Methods inherited from interface com.atlassian.crowd.embedded.api.User
getDirectoryId, isActive
 
Methods inherited from interface java.security.Principal
getName
 
Methods inherited from interface com.atlassian.crowd.model.TimestampedEntity
getCreatedDate, getUpdatedDate
 

Constructor Detail

InternalUser

protected InternalUser()

InternalUser

public InternalUser(InternalEntityTemplate internalEntityTemplate,
                    Directory directory,
                    UserTemplate userTemplate,
                    PasswordCredential credential)
This constructor is used by the importer only.

Parameters:
internalEntityTemplate - template.
directory - directory reference.
userTemplate - user template.
credential - encrypted credential.

InternalUser

public InternalUser(UserTemplateWithCredentialAndAttributes user,
                    Directory directory)

InternalUser

public InternalUser(User user,
                    Directory directory,
                    PasswordCredential credential)
Constructor used for adding a new user.

Parameters:
user - user template.
directory - directory of user.
credential - password of user.
Method Detail

updateDetailsFrom

public void updateDetailsFrom(User user)

renameTo

public void renameTo(String newUsername)

updateCredentialTo

public void updateCredentialTo(PasswordCredential newCredential,
                               int maxCredentialHistory)

setName

public void setName(String name)
Overrides:
setName in class InternalEntity

getEmailAddress

public String getEmailAddress()
Specified by:
getEmailAddress in interface User
Returns:
email address of the user.

getFirstName

public String getFirstName()

getLastName

public String getLastName()

getDisplayName

public String getDisplayName()
Specified by:
getDisplayName in interface User
Returns:
display name (eg. full name) of the user, must never be null.

getLowerEmailAddress

public String getLowerEmailAddress()

getLowerFirstName

public String getLowerFirstName()

getLowerLastName

public String getLowerLastName()

getLowerDisplayName

public String getLowerDisplayName()

getLowerName

public String getLowerName()

getCredential

public PasswordCredential getCredential()

getCredentialRecords

public List<InternalUserCredentialRecord> getCredentialRecords()

getCredentialHistory

public List<PasswordCredential> getCredentialHistory()

equals

public boolean equals(Object o)
Description copied from interface: DirectoryEntity
Implementations must ensure equality based on getDirectoryId() and case-insensitive getName().

Specified by:
equals in interface User
Specified by:
equals in interface DirectoryEntity
Specified by:
equals in interface Principal
Specified by:
equals in class InternalEntity
Parameters:
o - object to compare to.
Returns:
true if and only if the directoryId and the lowercase names of the directory entities match.

hashCode

public int hashCode()
Description copied from interface: DirectoryEntity
Implementations must produce a hashcode based on getDirectoryId() and case-insensitive getName().

Specified by:
hashCode in interface User
Specified by:
hashCode in interface DirectoryEntity
Specified by:
hashCode in interface Principal
Specified by:
hashCode in class InternalEntity
Returns:
hashcode.

compareTo

public int compareTo(User other)
Description copied from interface: User
CompareTo must be compatible with the equals() and hashCode() methods

Specified by:
compareTo in interface User
Specified by:
compareTo in interface Comparable<User>

toString

public String toString()
Specified by:
toString in interface Principal
Overrides:
toString in class Object


Copyright © 2013 Atlassian. All Rights Reserved.