Package com.atlassian.jira.user
Class LazyLoadingApplicationUser
java.lang.Object
com.atlassian.jira.user.LazyLoadingApplicationUser
- All Implemented Interfaces:
WithId
,WithKey
,ApplicationUser
,Serializable
,Principal
Application user that is created just from a name and loads its other details from Crowd when needed.
Take care not to call equals() and hashCode() unless absolutely needed, as this will cause the full user to be loaded from the database.
- Since:
- 7.0
- See Also:
-
Field Summary
Fields inherited from interface com.atlassian.jira.entity.WithId
ID_COMPARATOR
-
Constructor Summary
ConstructorsConstructorDescriptionLazyLoadingApplicationUser
(String name, com.atlassian.crowd.embedded.api.CrowdService crowdService) -
Method Summary
Modifier and TypeMethodDescriptionboolean
Implementations must ensure equality based on getKey().long
com.atlassian.crowd.embedded.api.User
Returns the display name of the user.getId()
getKey()
Returns the key which distinguishes the ApplicationUser as unique.getName()
Synonym forApplicationUser.getUsername()
and implementation ofPrincipal.getName()
.int
hashCode()
Implementations must produce a hashcode based on getKey().boolean
isActive()
toString()
-
Constructor Details
-
LazyLoadingApplicationUser
public LazyLoadingApplicationUser(String name, com.atlassian.crowd.embedded.api.CrowdService crowdService)
-
-
Method Details
-
getDirectoryId
public long getDirectoryId()- Specified by:
getDirectoryId
in interfaceApplicationUser
- Returns:
- the ID of the user directory that this user comes from.
-
getDirectoryUser
public com.atlassian.crowd.embedded.api.User getDirectoryUser()- Specified by:
getDirectoryUser
in interfaceApplicationUser
- Returns:
- the user as seen by the particular user directory that this User is defined in.
-
getDisplayName
Description copied from interface:ApplicationUser
Returns the display name of the user. This is sometimes referred to as "full name".- Specified by:
getDisplayName
in interfaceApplicationUser
- Returns:
- display name of the user, must never be null.
-
getEmailAddress
- Specified by:
getEmailAddress
in interfaceApplicationUser
- Returns:
- email address of the user.
-
getKey
Description copied from interface:ApplicationUser
Returns the key which distinguishes the ApplicationUser as unique. The same key is shared by allUser
s with the same username (ignoring case) across all user directories.- Specified by:
getKey
in interfaceApplicationUser
- Specified by:
getKey
in interfaceWithKey
- Returns:
- the key which distinguishes the ApplicationUser as unique
-
getName
Description copied from interface:ApplicationUser
Synonym forApplicationUser.getUsername()
and implementation ofPrincipal.getName()
.- Specified by:
getName
in interfaceApplicationUser
- Specified by:
getName
in interfacePrincipal
- Returns:
- the username (login) of the user; must never be
null
. - See Also:
-
getUsername
- Specified by:
getUsername
in interfaceApplicationUser
- Returns:
- the username (login) of the user; must never be
null
. - See Also:
-
isActive
public boolean isActive()- Specified by:
isActive
in interfaceApplicationUser
- Returns:
true
if this user is active.
-
getId
-
equals
Description copied from interface:ApplicationUser
Implementations must ensure equality based on getKey(). -
hashCode
public int hashCode()Description copied from interface:ApplicationUser
Implementations must produce a hashcode based on getKey(). -
toString
-