Package com.jk.webstack.services.account
Class Account
java.lang.Object
com.jk.core.jpa.JKBaseEntity
com.jk.webstack.services.account.Account
- All Implemented Interfaces:
 Serializable,org.springframework.security.core.userdetails.UserDetails
@Entity
public class Account
extends JKBaseEntity
implements org.springframework.security.core.userdetails.UserDetails, Serializable
This class represents user account information in a web application.
 
 It extends JKBaseEntity and implements UserDetails and
 Serializable interfaces.
- Version:
 - 1.0
 - Author:
 - Dr. Jalal H. Kiswani
 - See Also:
 
- 
Constructor Summary
Constructors - 
Method Summary
Modifier and TypeMethodDescriptionstatic Accountcreate()This method creates a newAccount.This method sets the user account email address to the provided value.This method sets the user account first name to the provided value.Collection<? extends org.springframework.security.core.GrantedAuthority>This method is yet to be implemented (TBI).This method gets the user account user name.booleanIndicates whether the user's account has expired.booleanIndicates whether the user is locked or unlocked.booleanIndicates whether the user's credentials (password) has expired.booleanIndicates whether the user is enabled or disabled.booleanThis method checks whether the token has expired or not.This method sets the user account last name to the provided value.voidThis method is invoked before the entity is persisted (inserted) into the database.voidThis method is invoked before the entity is updated in the database.Methods inherited from class com.jk.core.jpa.JKBaseEntity
equals, postUpdateMethods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, waitMethods inherited from interface org.springframework.security.core.userdetails.UserDetails
getPassword 
- 
Constructor Details
- 
Account
public Account() 
 - 
 - 
Method Details
- 
create
This method creates a newAccount.- Returns:
 - the newly created user account.
 
 - 
email
This method sets the user account email address to the provided value.- Parameters:
 email- Specifies the user account email address.- Returns:
 - the edited account instance.
 
 - 
firstname
This method sets the user account first name to the provided value.- Parameters:
 firstname- Specifies the user account first name.- Returns:
 - the edited account instance.
 
 - 
lastname
This method sets the user account last name to the provided value.- Parameters:
 lastname- Specifies the user account last name.- Returns:
 - the edited account instance.
 
 - 
getAuthorities
This method is yet to be implemented (TBI).- Specified by:
 getAuthoritiesin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
 - null.
 
 - 
getUsername
This method gets the user account user name.- Specified by:
 getUsernamein interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
 - the user account user name.
 
 - 
isAccountNonExpired
public boolean isAccountNonExpired()Indicates whether the user's account has expired.An expired account cannot be authenticated.
- Specified by:
 isAccountNonExpiredin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
 trueif the user's account is valid (non-expired),falseif no longer valid (expired).
 - 
isAccountNonLocked
public boolean isAccountNonLocked()Indicates whether the user is locked or unlocked.A locked user cannot be authenticated.
- Specified by:
 isAccountNonLockedin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
 trueif the user is not locked,falseotherwise.
 - 
isCredentialsNonExpired
public boolean isCredentialsNonExpired()Indicates whether the user's credentials (password) has expired.Expired credentials prevent authentication.
- Specified by:
 isCredentialsNonExpiredin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
 trueif the user's credentials are valid (non-expired),falseif no longer valid (expired).
 - 
isEnabled
public boolean isEnabled()Indicates whether the user is enabled or disabled.A disabled user cannot be authenticated.
- Specified by:
 isEnabledin interfaceorg.springframework.security.core.userdetails.UserDetails- Returns:
 trueif the user is enabled,falseotherwise.
 - 
isTokenExpired
public boolean isTokenExpired()This method checks whether the token has expired or not.- Returns:
 - true, if the token has expired, false otherwise.
 
 - 
prePersist
public void prePersist()This method is invoked before the entity is persisted (inserted) into the database.This method initializes the creation and modification dates with the current date and time.
- Overrides:
 prePersistin classJKBaseEntity
 - 
preUpdate
public void preUpdate()This method is invoked before the entity is updated in the database.This method updates the modification date with the current date and time.
- Overrides:
 preUpdatein classJKBaseEntity
 
 -