- java.lang.Object
-
- aeonics.template.Item<User.Type>
-
- aeonics.entity.security.User
-
public class User extends Item<User.Type>
This item plays a role in the definition of theSecurity
. It represents a login to the system, whether or not it is linked to a physical person, a service, or a device is left at the sole discretion of the securityProvider
.Important implementation notes:
The
Entity.id()
is the unique identifier for a user, it does not carry information but is used to reference users. You should avoid duplicate IDs and those must be stable over time: never change and the same user must always have the same ID.The
User.Type.login()
is used to perform the authentication, it can be of any form: email, login name or opaque credentials.The
Entity.name()
is the friendly name of the user. Usually it is identical to the login but it is not a requirement. Since the name is free text there may be duplicates, so never rely on this information.Any other property or profile information is not included by default, you can add them in the custom attributes property, fetch them somehow, or add a related profile entity.
Example:
id: 12345-678910 login: john.doe@example.com name: Monster2023 email: john.doe@example.com (custom attribute) firstname: John (custom attribute) lastname: Doe (custom attribute)
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static class
User.Type
Superclass for all user entities.
-
Constructor Summary
Constructors Constructor Description User()
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description protected java.lang.Class<? extends User>
category()
Returns the target entity category.protected java.util.function.Supplier<? extends User.Type>
defaultCreator()
Returns the default target entity creator.protected java.lang.Class<? extends User.Type>
defaultTarget()
Returns the default target entity type.Template<? extends User.Type>
template()
Returns the template to build the target entity.
-
-
-
Method Detail
-
defaultTarget
protected java.lang.Class<? extends User.Type> defaultTarget()
Description copied from class:Item
Returns the default target entity type. This method should be implemented by subclasses to specify the target entity type.- Specified by:
defaultTarget
in classItem<User.Type>
- Returns:
- the default target entity type
-
defaultCreator
protected java.util.function.Supplier<? extends User.Type> defaultCreator()
Description copied from class:Item
Returns the default target entity creator. This method should be implemented by subclasses to specify the entity creator.- Specified by:
defaultCreator
in classItem<User.Type>
- Returns:
- the default target entity creator
-
category
protected java.lang.Class<? extends User> category()
Description copied from class:Item
Returns the target entity category. This method should be implemented by subclasses to specify the entity category.
-
-