org.appfuse.model
Class User
java.lang.Object
org.appfuse.model.BaseObject
org.appfuse.model.User
- All Implemented Interfaces:
- Serializable, org.acegisecurity.userdetails.UserDetails
public class User
- extends BaseObject
- implements Serializable, org.acegisecurity.userdetails.UserDetails
This class is used to generate the Struts Validator Form as well as the
This class is used to generate Spring Validation rules
as well as the Hibernate mapping file.
View Source
- Author:
- Matt Raible
Updated by Dan Kibler ([email protected])
Extended to implement Acegi UserDetails interface
by David Carter [email protected]
- See Also:
- Serialized Form
- Class:
- table="app_user"
- Form Name:
- include-all="true" extends="BaseForm"
id
protected Long id
username
protected String username
password
protected String password
confirmPassword
protected String confirmPassword
passwordHint
protected String passwordHint
firstName
protected String firstName
lastName
protected String lastName
email
protected String email
phoneNumber
protected String phoneNumber
website
protected String website
address
protected Address address
version
protected Integer version
roles
protected Set roles
enabled
protected boolean enabled
accountExpired
protected boolean accountExpired
accountLocked
protected boolean accountLocked
credentialsExpired
protected boolean credentialsExpired
User
public User()
User
public User(String username)
getId
public Long getId()
- Id:
- column="id" generator-class="native" unsaved-value="null"
getUsername
public String getUsername()
- Specified by:
getUsername
in interface org.acegisecurity.userdetails.UserDetails
- Property:
- length="50" not-null="true" unique="true"
- Validator:
- type="required"
getPassword
public String getPassword()
- Specified by:
getPassword
in interface org.acegisecurity.userdetails.UserDetails
- Property:
- column="password" not-null="true"
- Validator:
- type="required", type="twofields" msgkey="errors.twofields"
- Validator Args:
- arg1resource="userForm.password", arg1resource="userForm.confirmPassword"
- Validator Var:
- name="secondProperty" value="confirmPassword"
getConfirmPassword
public String getConfirmPassword()
- Validator:
- type="required"
getPasswordHint
public String getPasswordHint()
- Property:
- column="password_hint" not-null="false"
- Validator:
- type="required"
getFirstName
public String getFirstName()
- Property:
- column="first_name" not-null="true" length="50"
- Validator:
- type="required"
getLastName
public String getLastName()
- Property:
- column="last_name" not-null="true" length="50"
- Validator:
- type="required"
getEmail
public String getEmail()
- Property:
- name="email" not-null="true" unique="true"
- Validator:
- type="required", type="email"
getPhoneNumber
public String getPhoneNumber()
- Property:
- column="phone_number" not-null="false"
- Validator:
- type="mask" msgkey="errors.phone"
- Validator Var:
- name="mask" value="${phone}"
getWebsite
public String getWebsite()
- Property:
- column="website" not-null="false"
- Validator:
- type="required"
getFullName
public String getFullName()
- Returns the full name.
getAddress
public Address getAddress()
getRoles
public Set getRoles()
addRole
public void addRole(Role role)
- Adds a role for the user
- Parameters:
role
-
getAuthorities
public org.acegisecurity.GrantedAuthority[] getAuthorities()
- Specified by:
getAuthorities
in interface org.acegisecurity.userdetails.UserDetails
- See Also:
UserDetails.getAuthorities()
getVersion
public Integer getVersion()
isEnabled
public boolean isEnabled()
- Specified by:
isEnabled
in interface org.acegisecurity.userdetails.UserDetails
- Property:
- column="account_enabled" type="yes_no"
isAccountExpired
public boolean isAccountExpired()
- Property:
- column="account_expired" not-null="true" type="yes_no"
isAccountNonExpired
public boolean isAccountNonExpired()
- Specified by:
isAccountNonExpired
in interface org.acegisecurity.userdetails.UserDetails
- See Also:
UserDetails.isAccountNonExpired()
isAccountLocked
public boolean isAccountLocked()
- Property:
- column="account_locked" not-null="true" type="yes_no"
isAccountNonLocked
public boolean isAccountNonLocked()
- Specified by:
isAccountNonLocked
in interface org.acegisecurity.userdetails.UserDetails
- See Also:
UserDetails.isAccountNonLocked()
isCredentialsExpired
public boolean isCredentialsExpired()
- Property:
- column="credentials_expired" not-null="true" type="yes_no"
isCredentialsNonExpired
public boolean isCredentialsNonExpired()
- Specified by:
isCredentialsNonExpired
in interface org.acegisecurity.userdetails.UserDetails
- See Also:
UserDetails.isCredentialsNonExpired()
setId
public void setId(Long id)
setUsername
public void setUsername(String username)
setPassword
public void setPassword(String password)
setConfirmPassword
public void setConfirmPassword(String confirmPassword)
setPasswordHint
public void setPasswordHint(String passwordHint)
setFirstName
public void setFirstName(String firstName)
setLastName
public void setLastName(String lastName)
setEmail
public void setEmail(String email)
setPhoneNumber
public void setPhoneNumber(String phoneNumber)
setWebsite
public void setWebsite(String website)
setAddress
public void setAddress(Address address)
setRoles
public void setRoles(Set roles)
setVersion
public void setVersion(Integer version)
setEnabled
public void setEnabled(boolean enabled)
setAccountExpired
public void setAccountExpired(boolean accountExpired)
setAccountLocked
public void setAccountLocked(boolean accountLocked)
setCredentialsExpired
public void setCredentialsExpired(boolean credentialsExpired)
equals
public boolean equals(Object o)
- Specified by:
equals
in class BaseObject
hashCode
public int hashCode()
- Specified by:
hashCode
in class BaseObject
toString
public String toString()
- Specified by:
toString
in class BaseObject
Copyright � 2002-2006