Package org.appng.api.model
Interface Subject
-
- All Superinterfaces:
Account
,AuthSubject
,Identifiable<Integer>
,Nameable
,Named<Integer>
,Serializable
- All Known Implementing Classes:
SubjectImpl
public interface Subject extends Named<Integer>, AuthSubject
ASubject
is a fully featured user-account managed by appNG.- Author:
- Matthias Müller
-
-
Nested Class Summary
-
Nested classes/interfaces inherited from interface org.appng.api.model.AuthSubject
AuthSubject.PasswordChangePolicy
-
-
Method Summary
All Methods Instance Methods Abstract Methods Default Methods Modifier and Type Method Description default Date
getExpiryDate()
The date on which the subject expires.default Integer
getFailedLoginAttempts()
Returns the number of failed login attempts for this subject.List<Group>
getGroups()
default Date
getLastLogin()
Returns the date of the last login, if any.default Date
getPasswordLastChanged()
Returns the date when the password was last changed.UserType
getUserType()
Returns theUserType
.boolean
hasApplication(Application application)
boolean
isAuthenticated()
Checks whether thisSubject
is authenticated.boolean
isAuthorized(Authorizable<?> authorizable)
Checks whether thisSubject
has authorization for the givenAuthorizable
.default boolean
isLocked()
Whether or not the subject is locked.-
Methods inherited from interface org.appng.api.model.Account
getAuthName, getEmail, getLanguage, getRealname, getTimeZone
-
Methods inherited from interface org.appng.api.model.AuthSubject
getDigest, getPasswordChangePolicy, getSalt, setDigest, setPasswordChangePolicy, setPasswordLastChanged, setSalt
-
Methods inherited from interface org.appng.api.model.Identifiable
getId
-
Methods inherited from interface org.appng.api.model.Nameable
getDescription, getName
-
-
-
-
Method Detail
-
isAuthenticated
boolean isAuthenticated()
Checks whether thisSubject
is authenticated.- Returns:
true
if thisSubject
is authenticated,false
otherwise
-
isAuthorized
boolean isAuthorized(Authorizable<?> authorizable)
Checks whether thisSubject
has authorization for the givenAuthorizable
.- Parameters:
authorizable
- theAuthorizable
- Returns:
true
if thisSubject
has authorization for the givenAuthorizable
,false
otherwise
-
hasApplication
boolean hasApplication(Application application)
- Parameters:
application
- theApplication
- Returns:
true
if thisSubject
owns at least oneRole
of the the givenApplication
,false
otherwise
-
isLocked
default boolean isLocked()
Whether or not the subject is locked.- Returns:
true
if the subject is locked.- Since:
- 1.21
-
getExpiryDate
default Date getExpiryDate()
The date on which the subject expires.- Returns:
- the date, if any (may be
null
) - Since:
- 1.21
-
getLastLogin
default Date getLastLogin()
Returns the date of the last login, if any.- Returns:
- the date.
- Since:
- 1.21
-
getPasswordLastChanged
default Date getPasswordLastChanged()
Returns the date when the password was last changed. Default to the creation date of the subject.- Returns:
- the date.
- Since:
- 1.21
-
getFailedLoginAttempts
default Integer getFailedLoginAttempts()
Returns the number of failed login attempts for this subject.- Returns:
- the number of failed login attempts
- Since:
- 1.21
-
-