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

  A `Subject` 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 and 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()` Returns the `Group`s for this `Subject`.
    `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 the `UserType`.
    `boolean` | `hasApplication(Application application)` Checks whether this `Subject` owns at least one `Role` of the the given `Application`.
    `boolean` | `isAuthenticated()` Checks whether this `Subject` is authenticated.
    `boolean` | `isAuthorized(Authorizable<?> authorizable)` Checks whether this `Subject` has authorization for the given `Authorizable`.
    `default boolean` | `isLocked()` Whether or not the subject is locked.

    - ### Methods inherited from interface org.appng.api.model.Nameable

      `getDescription, getName`

    - ### Methods inherited from interface org.appng.api.model.Identifiable

      `getId`

    - ### Methods inherited from interface org.appng.api.model.AuthSubject

      `getDigest, getPasswordChangePolicy, getSalt, setDigest, setPasswordChangePolicy, setPasswordLastChanged, setSalt`

    - ### Methods inherited from interface org.appng.api.model.Account

      `getAuthName, getEmail, getLanguage, getRealname, getTimeZone`

- - ### Method Detail

    - #### getGroups

          List<Group> getGroups()

      Returns the `Group`s for this `Subject`.
      Returns:
        the `Group`s

    - #### getUserType

          UserType getUserType()

      Returns the `UserType`.
      Returns:
        the `UserType`

    - #### isAuthenticated

          boolean isAuthenticated()

      Checks whether this `Subject` is authenticated.
      Returns:
        `true` if this `Subject` is authenticated, `false` otherwise

    - #### isAuthorized

          boolean isAuthorized(Authorizable<?> authorizable)

      Checks whether this `Subject` has authorization for the given `Authorizable`.
      Parameters:
        `authorizable` - the `Authorizable`
      Returns:
        `true` if this `Subject` has authorization for the given `Authorizable`, `false` otherwise

    - #### hasApplication

          boolean hasApplication(Application application)

      Checks whether this `Subject` owns at least one `Role` of the the given `Application`.
      Parameters:
        `application` - the `Application`
      Returns:
        `true` if this `Subject` owns at least one `Role` of the the given `Application` , `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

Copyright © 2011–2023 aiticon GmbH. All rights reserved.