Class RoleUser

java.lang.Object
rife.validation.MetaData
rife.authentication.credentials.RoleUser
All Implemented Interfaces:
Cloneable, Credentials, RememberMe, RoleUserCredentials, Constrained, MetaDataBeanAware, MetaDataMerged, Validated

public class RoleUser extends MetaData implements RoleUserCredentials, RememberMe

Provides standard RoleUserCredentials functionalities by implementing the property accessors and setting up basic validation rules. These rules make the login and password mandatory and limit their length according to the settings in RifeConfig.AuthenticationConfig.

Since:
1.0
  • Constructor Details

    • RoleUser

      public RoleUser()
    • RoleUser

      public RoleUser(String login, String password)
    • RoleUser

      public RoleUser(String login, String password, String role)
  • Method Details

    • activateMetaData

      public void activateMetaData()
      Description copied from class: MetaData
      This method is called at least once and maximum once when any meta-data introspection logic is executed.

      You need to implement this method since it will be called after the underlying validation context has been initialized. Incidentally, by doing all your metadata setup here, you don't enforce a performance penalty at each object construction like when you do this in the default constructor.

      Overrides:
      activateMetaData in class MetaData
    • getLogin

      public String getLogin()
      Description copied from interface: RoleUserCredentials
      Retrieves the submitted login.
      Specified by:
      getLogin in interface RoleUserCredentials
      Returns:
      the login
    • login

      public RoleUser login(String login)
    • setLogin

      public void setLogin(String login)
      Description copied from interface: RoleUserCredentials
      Sets the login to submit.
      Specified by:
      setLogin in interface RoleUserCredentials
      Parameters:
      login - the login
    • getPassword

      public String getPassword()
      Description copied from interface: RoleUserCredentials
      Retrieves the submitted password.
      Specified by:
      getPassword in interface RoleUserCredentials
      Returns:
      the password
    • password

      public RoleUser password(String password)
    • setPassword

      public void setPassword(String password)
      Description copied from interface: RoleUserCredentials
      Sets the password to submit.
      Specified by:
      setPassword in interface RoleUserCredentials
      Parameters:
      password - the password
    • getRole

      public String getRole()
      Description copied from interface: RoleUserCredentials
      Retrieves the submitted role.
      Specified by:
      getRole in interface RoleUserCredentials
      Returns:
      the role
    • role

      public RoleUser role(String role)
    • setRole

      public void setRole(String role)
      Description copied from interface: RoleUserCredentials
      Sets the role to submit.
      Specified by:
      setRole in interface RoleUserCredentials
      Parameters:
      role - the role
    • getRemember

      public boolean getRemember()
      Description copied from interface: RememberMe
      Indicates whether the submitted credentials should be remembered.
      Specified by:
      getRemember in interface RememberMe
      Returns:
      true if the submitted credentials should be remembered; or

      false otherwise

    • remember

      public RoleUser remember(boolean remember)
    • setRemember

      public void setRemember(boolean remember)
      Description copied from interface: RememberMe
      Sets whether the submitted credentials should be remembered.
      Specified by:
      setRemember in interface RememberMe
      Parameters:
      remember - true if the submitted credentials should be remembered; or false otherwise