com.mizar.persistence.jpa.security
Class UserBean

java.lang.Object
  extended by com.mizar.persistence.jpa.beans.GenericBean
      extended by com.mizar.persistence.jpa.security.UserBean
All Implemented Interfaces:
User, UserIdentity, JPAInterface, java.io.Serializable, java.lang.Comparable
Direct Known Subclasses:
UserRow

@Entity
public class UserBean
extends GenericBean
implements User, UserIdentity

See Also:
Serialized Form

Field Summary
 
Fields inherited from class com.mizar.persistence.jpa.beans.GenericBean
_logger, DELETE, EDIT, NEW, READ, serialVersionUID
 
Constructor Summary
UserBean()
           
 
Method Summary
 GroupBean addGroupBean(GroupBean groupBean)
           
 PermissionBean addPermissionBean(PermissionBean permissionBean)
           
 RoleBean addRoleBean(RoleBean roleBean)
           
 UserPropertiesBean addUserPropertiesBean(UserPropertiesBean userPropertiesBean)
           
 boolean equals(java.lang.Object obj)
           
 java.lang.String getAddress1()
           
 java.lang.String getAddress2()
           
 java.lang.String getAdminNote()
           
 java.lang.String getAllPermissionNames()
           
 java.util.List<java.lang.String> getAllPermissions()
           
 java.lang.String getCity()
           
 java.lang.String getCompany()
           
 java.lang.String getCounty()
           
 java.util.Date getCreated()
           
 java.lang.String getEmail()
           
 java.lang.String getFirstName()
           
 java.lang.String getFormattedPhoneNumber()
           
 java.lang.String getFullName()
           
 java.lang.String getFullNameLF()
           
 java.util.List<GroupBean> getGroupList()
           
 java.lang.String getGroupNames()
           
 java.util.List<Group> getGroups()
           
 java.lang.String getLastName()
           
 java.util.Date getLockedOut()
           
 java.lang.String getName()
           
 java.util.List<PermissionBean> getPermissionList()
           
 java.lang.String getPermissionNames()
           
 java.util.List<Permission> getPermissions()
           
 java.lang.String getPhoneNumber()
           
 java.lang.Long getPrimaryKeyValue()
          NOTE: If an implementing bean expects to be extended by a RowInterface in a often-used Table, you should override this method in order to avoid the overheads associated with the reflective code in JPAUtils.getPrimaryKeyValue(this)
 java.util.List<UserProperties> getProperties()
           
 java.lang.Object[] getPropertiesAsArray()
           
 java.util.List<UserPropertiesBean> getPropertiesList()
           
 java.util.List<RoleBean> getRoleList()
           
 java.lang.String getRoleNames()
           
 java.util.List<Role> getRoles()
           
 java.lang.String getSalutation()
           
 char[] getSettings()
           
 java.lang.String getShaPassword()
           
 java.lang.String getState()
           
 java.lang.String getStatus()
           
 java.lang.String getTitle()
           
 java.lang.Long getUserId()
           
 java.lang.String getUserName()
           
 java.lang.String getZip()
           
 int hashCode()
           
 boolean hasPermission(java.lang.String permissionName)
          Determines if the user has the specified permission.
 boolean hasRole(java.lang.String roleName)
          Determines if the user has the specified role.
 boolean isDisabled()
           
 boolean isUserInGroup(java.lang.String groupName)
          Determines if the user is in the specified group.
 GroupBean removeGroupBean(GroupBean groupBean)
           
 PermissionBean removePermissionBean(PermissionBean permissionBean)
           
 RoleBean removeRoleBean(RoleBean roleBean)
           
 UserPropertiesBean removeUserPropertiesBean(UserPropertiesBean userPropertiesBean)
           
 void setAddress1(java.lang.String address1)
           
 void setAddress2(java.lang.String address2)
           
 void setAdminNote(java.lang.String adminNotes)
           
 void setCity(java.lang.String city)
           
 void setCompany(java.lang.String company)
           
 void setCounty(java.lang.String county)
           
 void setCreated(java.util.Date created)
           
 void setEmail(java.lang.String email)
           
 void setFirstName(java.lang.String firstName)
           
 void setGroupList(java.util.List<GroupBean> groups)
           
 void setGroups(java.util.List<Group> groups)
           
 void setLastName(java.lang.String lastName)
           
 void setLockedOut(java.util.Date lockedOut)
           
 void setPermissionList(java.util.List<PermissionBean> permissions)
           
 void setPermissions(java.util.List<Permission> permissions)
           
 void setPhoneNumber(java.lang.String phoneNumber)
           
 void setProperties(java.util.List<UserProperties> properties)
           
 void setPropertiesList(java.util.List<UserPropertiesBean> properties)
           
 void setRoleList(java.util.List<RoleBean> roles)
           
 void setRoles(java.util.List<Role> roles)
           
 void setSalutation(java.lang.String salutation)
           
 void setSettings(char[] settings)
           
 void setShaPassword(java.lang.String shaPassword)
           
 void setState(java.lang.String state)
           
 void setStatus(java.lang.String status)
           
 void setTitle(java.lang.String title)
           
 void setUserId(java.lang.Long userId)
           
 void setUserName(java.lang.String userName)
           
 void setZip(java.lang.String zip)
           
 
Methods inherited from class com.mizar.persistence.jpa.beans.GenericBean
compareTo, getDELETE, getEDIT, getEntityState, getEntityStateLabel, getLogger, getNEW, getREAD, isEditable, isNew, setEditable, setEntityState, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 

Constructor Detail

UserBean

public UserBean()
Method Detail

getPrimaryKeyValue

public java.lang.Long getPrimaryKeyValue()
Description copied from class: GenericBean

NOTE: If an implementing bean expects to be extended by a RowInterface in a often-used Table, you should override this method in order to avoid the overheads associated with the reflective code in JPAUtils.getPrimaryKeyValue(this)

 public Object getPrimaryKeyValue(){
   return getProperty();
 }
 

In the absence of an overriding method, this method provides a generic method to get the value of the primary key. This is especially useful for calls to em.find(object) from within abstract classes

Overrides:
getPrimaryKeyValue in class GenericBean
Returns:
JPAUtils#getPrimaryKeyValue(this)
See Also:
RowInterface.getPrimaryKeyValue()

setUserId

public void setUserId(java.lang.Long userId)
Specified by:
setUserId in interface User

getUserId

public java.lang.Long getUserId()
Specified by:
getUserId in interface User

setUserName

public void setUserName(java.lang.String userName)
Specified by:
setUserName in interface User

getUserName

public java.lang.String getUserName()
Specified by:
getUserName in interface User

setShaPassword

public void setShaPassword(java.lang.String shaPassword)

getShaPassword

public java.lang.String getShaPassword()

setEmail

public void setEmail(java.lang.String email)
Specified by:
setEmail in interface User

getEmail

public java.lang.String getEmail()
Specified by:
getEmail in interface User

setSalutation

public void setSalutation(java.lang.String salutation)
Specified by:
setSalutation in interface User

getSalutation

public java.lang.String getSalutation()
Specified by:
getSalutation in interface User
Specified by:
getSalutation in interface UserIdentity

setFirstName

public void setFirstName(java.lang.String firstName)
Specified by:
setFirstName in interface User

getFirstName

public java.lang.String getFirstName()
Specified by:
getFirstName in interface User
Specified by:
getFirstName in interface UserIdentity

setLastName

public void setLastName(java.lang.String lastName)
Specified by:
setLastName in interface User

getLastName

public java.lang.String getLastName()
Specified by:
getLastName in interface User
Specified by:
getLastName in interface UserIdentity

setTitle

public void setTitle(java.lang.String title)
Specified by:
setTitle in interface User

getTitle

public java.lang.String getTitle()
Specified by:
getTitle in interface User
Specified by:
getTitle in interface UserIdentity

setCompany

public void setCompany(java.lang.String company)
Specified by:
setCompany in interface User

getCompany

public java.lang.String getCompany()
Specified by:
getCompany in interface User
Specified by:
getCompany in interface UserIdentity

setAddress1

public void setAddress1(java.lang.String address1)
Specified by:
setAddress1 in interface User

getAddress1

public java.lang.String getAddress1()
Specified by:
getAddress1 in interface User
Specified by:
getAddress1 in interface UserIdentity

setAddress2

public void setAddress2(java.lang.String address2)
Specified by:
setAddress2 in interface User

getAddress2

public java.lang.String getAddress2()
Specified by:
getAddress2 in interface User
Specified by:
getAddress2 in interface UserIdentity

setCity

public void setCity(java.lang.String city)
Specified by:
setCity in interface User

getCity

public java.lang.String getCity()
Specified by:
getCity in interface User
Specified by:
getCity in interface UserIdentity

setState

public void setState(java.lang.String state)
Specified by:
setState in interface User

getState

public java.lang.String getState()
Specified by:
getState in interface User
Specified by:
getState in interface UserIdentity

setZip

public void setZip(java.lang.String zip)
Specified by:
setZip in interface User

getZip

public java.lang.String getZip()
Specified by:
getZip in interface User
Specified by:
getZip in interface UserIdentity

setCounty

public void setCounty(java.lang.String county)
Specified by:
setCounty in interface User

getCounty

public java.lang.String getCounty()
Specified by:
getCounty in interface User
Specified by:
getCounty in interface UserIdentity

setPhoneNumber

public void setPhoneNumber(java.lang.String phoneNumber)
Specified by:
setPhoneNumber in interface User

getPhoneNumber

public java.lang.String getPhoneNumber()
Specified by:
getPhoneNumber in interface User
Specified by:
getPhoneNumber in interface UserIdentity

getFormattedPhoneNumber

public java.lang.String getFormattedPhoneNumber()

setSettings

public void setSettings(char[] settings)
Specified by:
setSettings in interface User

getSettings

public char[] getSettings()
Specified by:
getSettings in interface User

setGroupList

public void setGroupList(java.util.List<GroupBean> groups)

setGroups

public void setGroups(java.util.List<Group> groups)
Specified by:
setGroups in interface User

getGroupList

public java.util.List<GroupBean> getGroupList()

getGroups

public java.util.List<Group> getGroups()
Specified by:
getGroups in interface User

getGroupNames

public java.lang.String getGroupNames()

addGroupBean

public GroupBean addGroupBean(GroupBean groupBean)

removeGroupBean

public GroupBean removeGroupBean(GroupBean groupBean)

setRoleList

public void setRoleList(java.util.List<RoleBean> roles)

setRoles

public void setRoles(java.util.List<Role> roles)
Specified by:
setRoles in interface User

getRoleList

public java.util.List<RoleBean> getRoleList()

getRoles

public java.util.List<Role> getRoles()
Specified by:
getRoles in interface User

getRoleNames

public java.lang.String getRoleNames()

addRoleBean

public RoleBean addRoleBean(RoleBean roleBean)

removeRoleBean

public RoleBean removeRoleBean(RoleBean roleBean)

setPermissionList

public void setPermissionList(java.util.List<PermissionBean> permissions)

setPermissions

public void setPermissions(java.util.List<Permission> permissions)
Specified by:
setPermissions in interface User

getPermissionList

public java.util.List<PermissionBean> getPermissionList()

getPermissions

public java.util.List<Permission> getPermissions()
Specified by:
getPermissions in interface User

getPermissionNames

public java.lang.String getPermissionNames()

getAllPermissions

public java.util.List<java.lang.String> getAllPermissions()

getAllPermissionNames

public java.lang.String getAllPermissionNames()

addPermissionBean

public PermissionBean addPermissionBean(PermissionBean permissionBean)

removePermissionBean

public PermissionBean removePermissionBean(PermissionBean permissionBean)

setPropertiesList

public void setPropertiesList(java.util.List<UserPropertiesBean> properties)

setProperties

public void setProperties(java.util.List<UserProperties> properties)
Specified by:
setProperties in interface User

getPropertiesList

public java.util.List<UserPropertiesBean> getPropertiesList()

getProperties

public java.util.List<UserProperties> getProperties()
Specified by:
getProperties in interface User

addUserPropertiesBean

public UserPropertiesBean addUserPropertiesBean(UserPropertiesBean userPropertiesBean)

removeUserPropertiesBean

public UserPropertiesBean removeUserPropertiesBean(UserPropertiesBean userPropertiesBean)

getPropertiesAsArray

public java.lang.Object[] getPropertiesAsArray()

getFullName

public java.lang.String getFullName()
Specified by:
getFullName in interface User
Specified by:
getFullName in interface UserIdentity

getFullNameLF

public java.lang.String getFullNameLF()
Specified by:
getFullNameLF in interface User

getName

public java.lang.String getName()
Specified by:
getName in interface UserIdentity

hashCode

public int hashCode()
Overrides:
hashCode in class GenericBean

setCreated

public void setCreated(java.util.Date created)
Specified by:
setCreated in interface User

getCreated

public java.util.Date getCreated()
Specified by:
getCreated in interface User

setLockedOut

public void setLockedOut(java.util.Date lockedOut)
Specified by:
setLockedOut in interface User

getLockedOut

public java.util.Date getLockedOut()
Specified by:
getLockedOut in interface User

setStatus

public void setStatus(java.lang.String status)
Specified by:
setStatus in interface User

getStatus

public java.lang.String getStatus()
Specified by:
getStatus in interface User

setAdminNote

public void setAdminNote(java.lang.String adminNotes)
Specified by:
setAdminNote in interface User

getAdminNote

public java.lang.String getAdminNote()
Specified by:
getAdminNote in interface User

equals

public boolean equals(java.lang.Object obj)
Overrides:
equals in class GenericBean
Returns:
true or false if reference values are all equal
See Also:
GenericBean.compareTo(Object)

isUserInGroup

public boolean isUserInGroup(java.lang.String groupName)
Description copied from interface: User
Determines if the user is in the specified group.

Example:

if(user.isUserInRole("Sumerset County") {
//Do something permission-y
}

Specified by:
isUserInGroup in interface User
Parameters:
groupName - Group name to check against. Case-sensitive.
Returns:
true if the user is part of the specified group.

hasRole

public boolean hasRole(java.lang.String roleName)
Description copied from interface: User
Determines if the user has the specified role.


Example:
if(user.hasRole("Updater") {
//Do something permission-y
}

Specified by:
hasRole in interface User
Parameters:
roleName - Role name to check against. Case-sensitive.
Returns:
true if the user has the specified permission.

hasPermission

public boolean hasPermission(java.lang.String permissionName)
Description copied from interface: User
Determines if the user has the specified permission.


Example:
if(user.hasPermission("Updater") {
//Do something permission-y
}

Specified by:
hasPermission in interface User
Parameters:
permissionName - permission name to check against. Case-sensitive.
Returns:
true if the user has the specified permission.

isDisabled

public boolean isDisabled()