Package org.ametys.core.user
Class User<T extends UserFactory>
java.lang.Object
org.ametys.core.user.User<T>
- Type Parameters:
T
- The type of the factory
- All Implemented Interfaces:
Principal
Implementation of the principal abstraction to represent an user with a login and a
StoredUser
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum
Enumeration for the user creation originstatic class
Basic structure holding necessary data representing an user profile image -
Field Summary
FieldsModifier and TypeFieldDescriptionprotected T
The factoryprotected UserIdentity
The identity of this principal.protected UserDirectory
The user directory this user belongs to.static final String
The id of the creation date data.static final String
The id of the creation origin data.static final String
The id of the email data.static final String
The id of the first name data.static final String
The id of the image data.static final String
The id of the language data.static final String
The id of the last name data.static final String
The id of the timezone data. -
Method Summary
Modifier and TypeMethodDescriptionprotected String
_getFullName
(boolean firstnameThenLastname) The full name of the user represented by this Principal.boolean
Test if two principal are equals.Get the user's creation dateGet the user's creation origingetEmail()
The email of the user represented by this Principal.The first name of the userThe fullname of this user.The identity of the user.getImage
(int size, int maxSize) Get user's avatar from theUserDataProvider
with the biggest priorityGet user's language from theUserDataProvider
with the biggest priorityGet the last connection date of the userThe last name of the usergetName()
getProviderFor
(String dataId) Get theUserDataProvider
with the biggest priority and a value not null for the data requestedThe fullname to use to display if sort is needed.Get the StoredUser of the UserGet user's TimeZone from theUserDataProvider
with the biggest priorityThe user directory this user belongs to.Get a user's data from theUserDataProvider
with the biggest priorityint
hashCode()
toString()
Return a String representation of this object, which exposes only information that should be public.
-
Field Details
-
LAST_NAME_DATA_ID
The id of the last name data. This data is of typeString
- See Also:
-
FIRST_NAME_DATA_ID
The id of the first name data. This data is of typeString
- See Also:
-
EMAIL_DATA_ID
The id of the email data. This data is of typeString
- See Also:
-
IMAGE_DATA_ID
The id of the image data. This data is of typeUser.UserImage
- See Also:
-
LANGUAGE_DATA_ID
The id of the language data. This data is of type String- See Also:
-
TIMEZONE_DATA_ID
- See Also:
-
CREATION_DATE_DATA_ID
The id of the creation date data. This data is of typeZonedDateTime
- See Also:
-
CREATION_ORIGIN_DATA_ID
The id of the creation origin data. This data is of typeUser.UserCreationOrigin
- See Also:
-
_identity
The identity of this principal. -
_userDirectory
The user directory this user belongs to. -
_factory
The factory
-
-
Method Details
-
getIdentity
The identity of the user.- Returns:
- The identity.
-
getStoredUser
Get the StoredUser of the User- Returns:
- The
StoredUser
-
getName
-
getUserDirectory
The user directory this user belongs to.- Returns:
- The user directory
-
getLastName
The last name of the user- Returns:
- The last name.
-
getFirstName
The first name of the user- Returns:
- The first name.
-
getEmail
The email of the user represented by this Principal.- Returns:
- The email.
-
getFullName
The fullname of this user.- Returns:
- The full name
-
getSortableName
The fullname to use to display if sort is needed. Ensure the sort will be on- Returns:
- The sortable name
-
getImage
Get user's avatar from theUserDataProvider
with the biggest priority- Parameters:
size
- The sizemaxSize
- The maxSize- Returns:
- A
User.UserImage
the user's avatar
-
getLanguage
Get user's language from theUserDataProvider
with the biggest priority- Returns:
- The user's language
-
getTimeZone
Get user's TimeZone from theUserDataProvider
with the biggest priority- Returns:
- The user's timezone
-
getLastConnectionDate
Get the last connection date of the user- Returns:
- the last connection date or null if the user never logged in
-
getCreationDate
Get the user's creation date- Returns:
- the creation date
-
getCreationOrigin
Get the user's creation origin- Returns:
- the creation origin
-
getValue
Get a user's data from theUserDataProvider
with the biggest priority- Parameters:
dataId
- The data id- Returns:
- A user's data
-
getProviderFor
Get theUserDataProvider
with the biggest priority and a value not null for the data requested- Parameters:
dataId
- The data id- Returns:
- A
UserDataProvider
the user data provider which is going to provide the data requested
-
_getFullName
The full name of the user represented by this Principal.- Parameters:
firstnameThenLastname
- Define the name order in the full name. Set totrue
to retrieve the fullname with firstname first and lastname second. Set tofalse
to retrieve the fullname with lastname first and firstname second.- Returns:
- The full name.
-
toString
Return a String representation of this object, which exposes only information that should be public. -
equals
Test if two principal are equals. -
hashCode
-