org.appng.core.domain

## Class SubjectImpl

- java.lang.Object
- - org.appng.core.domain.SubjectImpl

- All Implemented Interfaces:
    Serializable, Account, AuthSubject, Identifiable<Integer>, Nameable, Named<Integer>, Subject, Versionable<Date>, Auditable<Integer>

      @Entity
      public class SubjectImpl
      extends Object
      implements Subject, Auditable<Integer>

  Default `Subject`-implementation
  Author:
    Matthias Müller
  See Also:
    Serialized Form

- - ### Nested Class Summary

    - ### Nested classes/interfaces inherited from interface org.appng.api.model.AuthSubject

      `AuthSubject.PasswordChangePolicy`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `SubjectImpl()`

  - ### Method Summary

    All Methods Instance Methods Concrete Methods Deprecated Methods
    Modifier and Type | Method and Description
    --- | ---
    `boolean` | `equals(Object o)`
    `List<Role>` | `getApplicationroles(Application application)` Deprecated.
    `List<Role>` | `getApplicationRoles(Application application)`
    `String` | `getAuthName()` Returns the username of this `Account`, e.g.
    `@Size(max=8192,message="{validation.string.max}") String` | `getDescription()` Returns the description.
    `String` | `getDigest()` Returns the salted digest for this `AuthSubject`.
    `@Pattern(regexp="^([a-zA-Z0-9_\\.-])+@(([a-zA-Z0-9-])+\\.)+([a-zA-Z0-9]){2,}$",message="{validation.email}") String` | `getEmail()` Returns the email for this `Account`, e.g.
    `Date` | `getExpiryDate()` The date on which the subject expires.
    `Integer` | `getFailedLoginAttempts()` Returns the number of failed login attempts for this subject.
    `List<Group>` | `getGroups()` Returns the `Group`s for this `Subject`.
    `Integer` | `getId()` Returns the id.
    `@NotNull(message="{validation.notNull}") @Size(min=2,max=3,message="{validation.string.min.max}") String` | `getLanguage()` Returns the language tag for this `Account` in the IETF BCP 47 notation: `<lang>-<country>`. Examples: en en-US de de-CH
    `Date` | `getLastLogin()` Returns the date of the last login, if any.
    `@NotNull(message="{validation.notNull}") @Pattern(regexp="^((((CN|cn)=[^,]+),?)*(((OU|ou)=[^,]+),?)*(((DC|dc)=[^,]+),?)*)|(([a-zA-Z0-9_\\.-])+(@(([a-zA-Z0-9-])+\\.)+([a-zA-Z0-9]){2,})?)$",message="{validation.usernameGroup}") @Size(max=255,message="{validation.string.max}") String` | `getName()` Returns the name.
    `AuthSubject.PasswordChangePolicy` | `getPasswordChangePolicy()` Returns the `AuthSubject.PasswordChangePolicy` for this subject
    `Date` | `getPasswordLastChanged()` Returns the date when the password was last changed.
    `@NotNull(message="{validation.notNull}") @Size(max=64,message="{validation.string.max}") String` | `getRealname()` Returns the real name of this `Account`, e.g.
    `String` | `getSalt()` Returns the salt for this `AuthSubject`.
    `String` | `getTimeZone()` Returns the timezone for this `Account`, e.g.
    `String` | `getTypeName()`
    `UserType` | `getUserType()` Returns the `UserType`.
    `Date` | `getVersion()` Returns the version.
    `boolean` | `hasApplication(Application application)` Checks whether this `Subject` owns at least one `Role` of the the given `Application`.
    `int` | `hashCode()`
    `boolean` | `isAuthenticated()` Checks whether this `Subject` is authenticated.
    `boolean` | `isAuthorized(Authorizable<?> authorizable)` Checks whether this `Subject` has authorization for the given `Authorizable`.
    `boolean` | `isExpired(Date date)`
    `boolean` | `isInactive(Date now, Integer inactiveLockPeriod)`
    `boolean` | `isLocked()` Whether or not the subject is locked.
    `void` | `setEmail(String email)`
    `String` | `toString()`

    - ### Methods inherited from class java.lang.Object

      `clone, finalize, getClass, notify, notifyAll, wait, wait, wait`

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

      `setDigest, setPasswordChangePolicy, setPasswordLastChanged, setSalt`

    - ### Methods inherited from interface org.appng.core.domain.Auditable

      `getAuditName`

- - ### Constructor Detail

    - #### SubjectImpl

          public SubjectImpl()

  - ### Method Detail

    - #### getName

          @NotNull(message="{validation.notNull}")
           @Pattern(regexp="^((((CN|cn)=[^,]+),?)*(((OU|ou)=[^,]+),?)*(((DC|dc)=[^,]+),?)*)|(([a-zA-Z0-9_\\.-])+(@(([a-zA-Z0-9-])+\\.)+([a-zA-Z0-9]){2,})?)$",
                   message="{validation.usernameGroup}")
           @Size(max=255,
                message="{validation.string.max}")
          public @NotNull(message="{validation.notNull}") @Pattern(regexp="^((((CN|cn)=[^,]+),?)*(((OU|ou)=[^,]+),?)*(((DC|dc)=[^,]+),?)*)|(([a-zA-Z0-9_\\.-])+(@(([a-zA-Z0-9-])+\\.)+([a-zA-Z0-9]){2,})?)$",message="{validation.usernameGroup}") @Size(max=255,message="{validation.string.max}") String getName()

      Description copied from interface: `Nameable`
      Returns the name.
      Specified by:
        `getName` in interface `Nameable`
      Returns:
        the name

    - #### getDescription

          @Size(max=8192,
                message="{validation.string.max}")
          public @Size(max=8192,message="{validation.string.max}") String getDescription()

      Description copied from interface: `Nameable`
      Returns the description.
      Specified by:
        `getDescription` in interface `Nameable`
      Returns:
        the description

    - #### getId

          public Integer getId()

      Description copied from interface: `Identifiable`
      Returns the id.
      Specified by:
        `getId` in interface `Identifiable<Integer>`
      Returns:
        the id

    - #### getVersion

          public Date getVersion()

      Description copied from interface: `Versionable`
      Returns the version.
      Specified by:
        `getVersion` in interface `Versionable<Date>`
      Returns:
        the version

    - #### getLanguage

          @NotNull(message="{validation.notNull}")
           @Size(min=2,
                max=3,
                message="{validation.string.min.max}")
          public @NotNull(message="{validation.notNull}") @Size(min=2,max=3,message="{validation.string.min.max}") String getLanguage()

      Description copied from interface: `Account`
      Returns the language tag for this `Account` in the IETF BCP 47 notation: `<lang>-<country>`.
      Examples:
      - en
      - en-US
      - de
      - de-CH
      Specified by:
        `getLanguage` in interface `Account`
      Returns:
        the language
      See Also:
        `Locale.forLanguageTag(String)`

    - #### getRealname

          @NotNull(message="{validation.notNull}")
           @Size(max=64,
                message="{validation.string.max}")
          public @NotNull(message="{validation.notNull}") @Size(max=64,message="{validation.string.max}") String getRealname()

      Description copied from interface: `Account`
      Returns the real name of this `Account`, e.g. 'appNG Administrator'.
      Specified by:
        `getRealname` in interface `Account`
      Returns:
        the real name

    - #### getEmail

          @Pattern(regexp="^([a-zA-Z0-9_\\.-])+@(([a-zA-Z0-9-])+\\.)+([a-zA-Z0-9]){2,}$",
                   message="{validation.email}")
          public @Pattern(regexp="^([a-zA-Z0-9_\\.-])+@(([a-zA-Z0-9-])+\\.)+([a-zA-Z0-9]){2,}$",message="{validation.email}") String getEmail()

      Description copied from interface: `Account`
      Returns the email for this `Account`, e.g. 'admin@example.com'.
      Specified by:
        `getEmail` in interface `Account`
      Returns:
        the email

    - #### setEmail

          public void setEmail(String email)

    - #### getDigest

          public String getDigest()

      Description copied from interface: `AuthSubject`
      Returns the salted digest for this `AuthSubject`.
      Specified by:
        `getDigest` in interface `AuthSubject`
      Returns:
        the salted digest

    - #### getSalt

          public String getSalt()

      Description copied from interface: `AuthSubject`
      Returns the salt for this `AuthSubject`.
      Specified by:
        `getSalt` in interface `AuthSubject`
      Returns:
        the salt

    - #### getGroups

          public List<Group> getGroups()

      Description copied from interface: `Subject`
      Returns the `Group`s for this `Subject`.
      Specified by:
        `getGroups` in interface `Subject`
      Returns:
        the `Group`s

    - #### getUserType

          public UserType getUserType()

      Description copied from interface: `Subject`
      Returns the `UserType`.
      Specified by:
        `getUserType` in interface `Subject`
      Returns:
        the `UserType`

    - #### isExpired

          public boolean isExpired(Date date)

    - #### getExpiryDate

          public Date getExpiryDate()

      Description copied from interface: `Subject`
      The date on which the subject expires.
      Specified by:
        `getExpiryDate` in interface `Subject`
      Returns:
        the date, if any (may be `null`)

    - #### getLastLogin

          public Date getLastLogin()

      Description copied from interface: `Subject`
      Returns the date of the last login, if any.
      Specified by:
        `getLastLogin` in interface `Subject`
      Returns:
        the date.

    - #### getPasswordLastChanged

          public Date getPasswordLastChanged()

      Description copied from interface: `Subject`
      Returns the date when the password was last changed. Default to the creation date of the subject.
      Specified by:
        `getPasswordLastChanged` in interface `Subject`
      Returns:
        the date.

    - #### isLocked

          public boolean isLocked()

      Description copied from interface: `Subject`
      Whether or not the subject is locked.
      Specified by:
        `isLocked` in interface `Subject`
      Returns:
        `true` if the subject is locked.

    - #### getPasswordChangePolicy

          public AuthSubject.PasswordChangePolicy getPasswordChangePolicy()

      Description copied from interface: `AuthSubject`
      Returns the `AuthSubject.PasswordChangePolicy` for this subject
      Specified by:
        `getPasswordChangePolicy` in interface `AuthSubject`
      Returns:
        the `AuthSubject.PasswordChangePolicy` for this subject

    - #### getFailedLoginAttempts

          public Integer getFailedLoginAttempts()

      Description copied from interface: `Subject`
      Returns the number of failed login attempts for this subject.
      Specified by:
        `getFailedLoginAttempts` in interface `Subject`
      Returns:
        the number of failed login attempts

    - #### isAuthenticated

          public boolean isAuthenticated()

      Description copied from interface: `Subject`
      Checks whether this `Subject` is authenticated.
      Specified by:
        `isAuthenticated` in interface `Subject`
      Returns:
        `true` if this `Subject` is authenticated, `false` otherwise

    - #### hasApplication

          public boolean hasApplication(Application application)

      Description copied from interface: `Subject`
      Checks whether this `Subject` owns at least one `Role` of the the given `Application`.
      Specified by:
        `hasApplication` in interface `Subject`
      Parameters:
        `application` - the `Application`
      Returns:
        `true` if this `Subject` owns at least one `Role` of the the given `Application` , `false` otherwise

    - #### getApplicationroles

          @Deprecated
          public List<Role> getApplicationroles(Application application)

      Deprecated.

    - #### getApplicationRoles

          public List<Role> getApplicationRoles(Application application)

    - #### hashCode

          public int hashCode()

      Overrides:
        `hashCode` in class `Object`

    - #### equals

          public boolean equals(Object o)

      Overrides:
        `equals` in class `Object`

    - #### isAuthorized

          public boolean isAuthorized(Authorizable<?> authorizable)

      Description copied from interface: `Subject`
      Checks whether this `Subject` has authorization for the given `Authorizable`.
      Specified by:
        `isAuthorized` in interface `Subject`
      Parameters:
        `authorizable` - the `Authorizable`
      Returns:
        `true` if this `Subject` has authorization for the given `Authorizable`, `false` otherwise

    - #### toString

          public String toString()

      Overrides:
        `toString` in class `Object`

    - #### getTimeZone

          public String getTimeZone()

      Description copied from interface: `Account`
      Returns the timezone for this `Account`, e.g. 'Europe/Berlin'.
      Specified by:
        `getTimeZone` in interface `Account`
      Returns:
        the timezone

    - #### getAuthName

          public String getAuthName()

      Description copied from interface: `Account`
      Returns the username of this `Account`, e.g. 'admin'.
      Specified by:
        `getAuthName` in interface `Account`
      Returns:
        the username

    - #### getTypeName

          public String getTypeName()

    - #### isInactive

          public boolean isInactive(Date now,
                                    Integer inactiveLockPeriod)

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