com.redhat.rhn.domain.user.legacy
Class LegacyRhnUserImpl

java.lang.Object
  extended by com.redhat.rhn.domain.BaseDomainHelper
      extended by com.redhat.rhn.domain.user.legacy.LegacyRhnUserImpl
All Implemented Interfaces:
User

public class LegacyRhnUserImpl
extends BaseDomainHelper
implements User

Class UserImpl that reflects the DB representation of web_contact and ancillary tables. DB table: web_contact


Constructor Summary
LegacyRhnUserImpl()
          Create a new empty user
 
Method Summary
 void addChange(StateChange change)
          Add a change to the users stateChanges set
 void addRole(Role label)
          Add a role to this User's Role Set.
 void addServer(Server server)
          Give this user permission to manage a server.
 boolean authenticate(java.lang.String thePassword)
          Authenticate the user
 boolean equals(java.lang.Object other)
          
protected  Address getAddress()
           
 java.lang.String getAddress1()
          Getter for address1
 java.lang.String getAddress2()
          Getter for address2
protected  java.util.Set getAddresses()
          Get the addresses
 java.util.Set getAssociatedServerGroups()
          Retrieves the set of server groups associated to this user.
 java.lang.String getCity()
          Getter for city
 java.lang.String getCompany()
          Gets the current value of company
 java.lang.String getCountry()
          Getter for country
 java.util.Set getDefaultSystemGroupIds()
          Gets the Set of SystemGroup IDs (Long) associated with this User.
 java.lang.String getEmail()
          Gets the current value of email
 int getEmailNotify()
          Gets the current value of emailNotify
 EnterpriseUser getEnterpriseUser()
          Get the EnterpriseUser
 java.lang.String getFax()
          Gets the current value of fax
 java.lang.String getFirstNames()
          Gets the current value of firstNames
 java.util.Set getHiddenPanes()
          Retrieves the set of Pane object instances This method retrieves the
 java.lang.Long getId()
          Gets the current value of id
 java.lang.String getIsPoBox()
          Getter for isPoBox
 java.util.Date getLastLoggedIn()
          Gets the current value of lastLoggedIn
 java.lang.String getLastName()
          Gets the current value of lastName
 java.lang.String getLogin()
          Gets the current value of login
 java.lang.String getLoginUc()
          Gets the current value of loginUc
 java.util.Set getNotificationMethods()
          Get the notification methods set
 Org getOrg()
          helper method to get the associated Org for the user
 int getPageSize()
          Gets the current value of pageSize
 java.lang.String getPassword()
          Gets the current value of password
protected  PersonalInfo getPersonalInfo()
          Return the PersonalInfo object
 java.lang.String getPhone()
          Gets the current value of phone
 java.lang.String getPreferredLocale()
          Returns the user's preferred locale
 java.lang.String getPrefix()
          Gets the current value of prefix
 java.util.Set getRoles()
          Gets the roles assigned to this user.
 java.util.Set<Server> getServers()
          Returns the set of Server's this user has permissions to manage.
 java.lang.String getShowSystemGroupList()
          Gets the current value of showSystemGroupList
 java.lang.String getState()
          Getter for state
 java.util.Set getStateChanges()
          Returns the set of state changes for a user.
 RhnTimeZone getTimeZone()
          Gets the current timezone
 java.lang.String getTitle()
          Gets the current value of title
 boolean getUsePamAuthentication()
          Gets the current value of usePamAuthentication
protected  java.util.Set getUsergroups()
          get the set of usergroups
 UserInfo getUserInfo()
          Get the UserInfo sub object
 java.lang.String getZip()
          Getter for zip
 int hashCode()
          
 boolean hasRole(Role label)
          Check to see if this user has the passed in label in the Collection of Roles assigned to this user
 boolean isDisabled()
          Convenience method to determine whether a user is disabled or not
 void removeRole(Role label)
          Remove a role to this User's Role Set.
 void removeServer(Server server)
          Remover permission for the user to manage this server.
 void resetWasOrgAdmin()
          Reset the wasOrgAdmin value.
protected  void setAddress(Address addIn)
           
 void setAddress1(java.lang.String address1In)
          Setter for address1
 void setAddress2(java.lang.String address2In)
          Setter for address2
protected  void setAddresses(java.util.Set s)
          Set the addresses.
protected  void setAssociatedServerGroups(java.util.Set serverGroups)
          Sets the associatedServerGroups..
 void setCity(java.lang.String cityIn)
          Setter for city
 void setCompany(java.lang.String companyIn)
          Sets the value of company to new value
 void setCountry(java.lang.String countryIn)
          Setter for country
 void setDefaultSystemGroupIds(java.util.Set dsg)
          Updates the User's Default System groups.
 void setEmail(java.lang.String emailIn)
          Sets the value of email to new value
 void setEmailNotify(int emailNotifyIn)
          Sets the value of emailNotify to new value
 void setFax(java.lang.String faxIn)
          Sets the value of fax to new value
 void setFirstNames(java.lang.String firstNamesIn)
          Sets the value of firstNames to new value
 void setHiddenPanes(java.util.Set p)
          Sets the set of PaneObjects instances.
 void setId(java.lang.Long idIn)
          Sets the value of id to new value
 void setIsPoBox(java.lang.String isPoBoxIn)
          Setter for isPoBox
 void setLastLoggedIn(java.util.Date lastLoggedInIn)
          Sets the value of lastLoggedIn to new value
 void setLastName(java.lang.String lastNameIn)
          Sets the value of lastName to new value
 void setLogin(java.lang.String loginIn)
          Sets the value of login to new value
 void setLoginUc(java.lang.String loginUcIn)
          Sets the value of loginUc to new value
 void setNotificationMethods(java.util.Set methodsIn)
          Set the notification method set.
 void setOrg(Org orgIn)
          Associates the user with an Org.
 void setPageSize(int pageSizeIn)
          Sets the value of pageSize to new value
 void setPassword(java.lang.String passwordIn)
          Sets the value of password to new value
protected  void setPersonalInfo(PersonalInfo persIn)
          Set the PersonalInfo object
 void setPhone(java.lang.String phoneIn)
          Sets the value of phone to new value
 void setPreferredLocale(java.lang.String locale)
          Sets the user's preferred locale
 void setPrefix(java.lang.String prefixIn)
          Sets the value of prefix to new value
 void setShowSystemGroupList(java.lang.String showSystemGroupListIn)
          Sets the value of showSystemGroupList to new value
 void setState(java.lang.String stateIn)
          Setter for state
 void setStateChanges(java.util.Set s)
           
 void setTimeZone(RhnTimeZone timeZoneIn)
          Sets the current timezone
 void setTitle(java.lang.String titleIn)
          Sets the value of title to new value
 void setUsePamAuthentication(boolean usePamAuthenticationIn)
          Sets the value of usePamAuthentication to new value
protected  void setUsergroups(java.util.Set ugIn)
          Set the usergroup set
protected  void setUserInfo(UserInfo infoIn)
          Set the UserInfo object
 void setZip(java.lang.String zipIn)
          Setter for zip
 java.lang.String toString()
          Output User to String for debugging
 java.lang.Boolean wasOrgAdmin()
          Determine if this was org admin.
 
Methods inherited from class com.redhat.rhn.domain.BaseDomainHelper
getCreated, getModified, setCreated, setModified
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface com.redhat.rhn.domain.user.User
getCreated, getModified, setCreated, setModified
 

Constructor Detail

LegacyRhnUserImpl

public LegacyRhnUserImpl()
Create a new empty user

Method Detail

getId

public java.lang.Long getId()
Gets the current value of id

Specified by:
getId in interface User
Returns:
long the current value

setId

public void setId(java.lang.Long idIn)
Sets the value of id to new value

Specified by:
setId in interface User
Parameters:
idIn - New value for id

getLogin

public java.lang.String getLogin()
Gets the current value of login

Specified by:
getLogin in interface User
Returns:
String the current value

setLogin

public void setLogin(java.lang.String loginIn)
Sets the value of login to new value

Specified by:
setLogin in interface User
Parameters:
loginIn - New value for login

getLoginUc

public java.lang.String getLoginUc()
Gets the current value of loginUc

Specified by:
getLoginUc in interface User
Returns:
String the current value

setLoginUc

public void setLoginUc(java.lang.String loginUcIn)
Sets the value of loginUc to new value

Specified by:
setLoginUc in interface User
Parameters:
loginUcIn - New value for loginUc

getPassword

public java.lang.String getPassword()
Gets the current value of password

Specified by:
getPassword in interface User
Returns:
String the current value

setPassword

public void setPassword(java.lang.String passwordIn)
Sets the value of password to new value

Specified by:
setPassword in interface User
Parameters:
passwordIn - New value for password

setUsergroups

protected void setUsergroups(java.util.Set ugIn)
Set the usergroup set

Parameters:
ugIn - The new Set of UserGroups to set

getUsergroups

protected java.util.Set getUsergroups()
get the set of usergroups

Returns:
Set of UserGroups

getRoles

public java.util.Set getRoles()
Gets the roles assigned to this user. The Map returned from this method has been decorated with a call to Collections.unmodifiableMap(java.util.Map) in order to enforce the rule that roles are not changeable during runtime. If this requirement changes then we will need to remove this restriction later.

Specified by:
getRoles in interface User
Returns:
Set of Roles that this user has

hasRole

public boolean hasRole(Role label)
Check to see if this user has the passed in label in the Collection of Roles assigned to this user

Specified by:
hasRole in interface User
Parameters:
label - the label used to lookup
Returns:
if the user has the role assigned or not.

addRole

public void addRole(Role label)
Add a role to this User's Role Set.

Specified by:
addRole in interface User
Parameters:
label - The label of the Role you want to add.

removeRole

public void removeRole(Role label)
Remove a role to this User's Role Set.

Specified by:
removeRole in interface User
Parameters:
label - The label of the Role you want to remove.

wasOrgAdmin

public java.lang.Boolean wasOrgAdmin()
Determine if this was org admin.

Returns:
Boolean

resetWasOrgAdmin

public void resetWasOrgAdmin()
Reset the wasOrgAdmin value.


authenticate

public boolean authenticate(java.lang.String thePassword)
Authenticate the user

Specified by:
authenticate in interface User
Parameters:
thePassword - password to check if matches against this User's
Returns:
boolean if the password is correct

setOrg

public void setOrg(Org orgIn)
Associates the user with an Org.

Specified by:
setOrg in interface User
Parameters:
orgIn - Org to be associated to this user.

getOrg

public Org getOrg()
helper method to get the associated Org for the user

Specified by:
getOrg in interface User
Returns:
Org associated with this User

getDefaultSystemGroupIds

public java.util.Set getDefaultSystemGroupIds()
Gets the Set of SystemGroup IDs (Long) associated with this User.

Specified by:
getDefaultSystemGroupIds in interface User
Returns:
Set the current value

setDefaultSystemGroupIds

public void setDefaultSystemGroupIds(java.util.Set dsg)
Updates the User's Default System groups. This

Specified by:
setDefaultSystemGroupIds in interface User
Parameters:
dsg - Set of Long System Group IDs

getPersonalInfo

protected PersonalInfo getPersonalInfo()
Return the PersonalInfo object

Returns:
PersonalInfo object associated with this User

setPersonalInfo

protected void setPersonalInfo(PersonalInfo persIn)
Set the PersonalInfo object

Parameters:
persIn - the PersonalInfo object

setUserInfo

protected void setUserInfo(UserInfo infoIn)
Set the UserInfo object

Parameters:
infoIn - the UserInfo object

getUserInfo

public UserInfo getUserInfo()
Get the UserInfo sub object

Returns:
UserInfo

isDisabled

public boolean isDisabled()
Convenience method to determine whether a user is disabled or not

Specified by:
isDisabled in interface User
Returns:
Returns true if the user is disabled

addChange

public void addChange(StateChange change)
Add a change to the users stateChanges set

Specified by:
addChange in interface User
Parameters:
change - The change to add

getStateChanges

public java.util.Set getStateChanges()
Returns the set of state changes for a user. These consist of disable/enable events in rhnWebContactChangeLog

Specified by:
getStateChanges in interface User
Returns:
Returns the set of stateChanges

setStateChanges

public void setStateChanges(java.util.Set s)
Parameters:
s - The stateChanges to set.

getPageSize

public int getPageSize()
Gets the current value of pageSize

Specified by:
getPageSize in interface User
Returns:
int the current value

setPageSize

public void setPageSize(int pageSizeIn)
Sets the value of pageSize to new value

Specified by:
setPageSize in interface User
Parameters:
pageSizeIn - New value for pageSize

getUsePamAuthentication

public boolean getUsePamAuthentication()
Gets the current value of usePamAuthentication

Specified by:
getUsePamAuthentication in interface User
Returns:
String the current value

setUsePamAuthentication

public void setUsePamAuthentication(boolean usePamAuthenticationIn)
Sets the value of usePamAuthentication to new value

Specified by:
setUsePamAuthentication in interface User
Parameters:
usePamAuthenticationIn - New value for usePamAuthentication

getShowSystemGroupList

public java.lang.String getShowSystemGroupList()
Gets the current value of showSystemGroupList

Specified by:
getShowSystemGroupList in interface User
Returns:
String the current value

setShowSystemGroupList

public void setShowSystemGroupList(java.lang.String showSystemGroupListIn)
Sets the value of showSystemGroupList to new value

Specified by:
setShowSystemGroupList in interface User
Parameters:
showSystemGroupListIn - New value for showSystemGroupList

getLastLoggedIn

public java.util.Date getLastLoggedIn()
Gets the current value of lastLoggedIn

Specified by:
getLastLoggedIn in interface User
Returns:
Date the current value

setLastLoggedIn

public void setLastLoggedIn(java.util.Date lastLoggedInIn)
Sets the value of lastLoggedIn to new value

Specified by:
setLastLoggedIn in interface User
Parameters:
lastLoggedInIn - New value for lastLoggedIn

setPreferredLocale

public void setPreferredLocale(java.lang.String locale)
Sets the user's preferred locale

Specified by:
setPreferredLocale in interface User
Parameters:
locale - overrides browser locale

getPreferredLocale

public java.lang.String getPreferredLocale()
Returns the user's preferred locale

Specified by:
getPreferredLocale in interface User
Returns:
String locale

getPrefix

public java.lang.String getPrefix()
Gets the current value of prefix

Specified by:
getPrefix in interface User
Returns:
String the current value

setPrefix

public void setPrefix(java.lang.String prefixIn)
Sets the value of prefix to new value

Specified by:
setPrefix in interface User
Parameters:
prefixIn - New value for prefix

getFirstNames

public java.lang.String getFirstNames()
Gets the current value of firstNames

Specified by:
getFirstNames in interface User
Returns:
String the current value

setFirstNames

public void setFirstNames(java.lang.String firstNamesIn)
Sets the value of firstNames to new value

Specified by:
setFirstNames in interface User
Parameters:
firstNamesIn - New value for firstNames

getLastName

public java.lang.String getLastName()
Gets the current value of lastName

Specified by:
getLastName in interface User
Returns:
String the current value

setLastName

public void setLastName(java.lang.String lastNameIn)
Sets the value of lastName to new value

Specified by:
setLastName in interface User
Parameters:
lastNameIn - New value for lastName

getCompany

public java.lang.String getCompany()
Gets the current value of company

Specified by:
getCompany in interface User
Returns:
String the current value

setCompany

public void setCompany(java.lang.String companyIn)
Sets the value of company to new value

Specified by:
setCompany in interface User
Parameters:
companyIn - New value for company

getTitle

public java.lang.String getTitle()
Gets the current value of title

Specified by:
getTitle in interface User
Returns:
String the current value

setTitle

public void setTitle(java.lang.String titleIn)
Sets the value of title to new value

Specified by:
setTitle in interface User
Parameters:
titleIn - New value for title

getPhone

public java.lang.String getPhone()
Gets the current value of phone

Specified by:
getPhone in interface User
Returns:
String the current value

setPhone

public void setPhone(java.lang.String phoneIn)
Sets the value of phone to new value

Specified by:
setPhone in interface User
Parameters:
phoneIn - New value for phone

getFax

public java.lang.String getFax()
Gets the current value of fax

Specified by:
getFax in interface User
Returns:
String the current value

setFax

public void setFax(java.lang.String faxIn)
Sets the value of fax to new value

Specified by:
setFax in interface User
Parameters:
faxIn - New value for fax

getEmail

public java.lang.String getEmail()
Gets the current value of email

Specified by:
getEmail in interface User
Returns:
String the current value

setEmail

public void setEmail(java.lang.String emailIn)
Sets the value of email to new value

Specified by:
setEmail in interface User
Parameters:
emailIn - New value for email

getTimeZone

public RhnTimeZone getTimeZone()
Gets the current timezone

Specified by:
getTimeZone in interface User
Returns:
the current timezone

setTimeZone

public void setTimeZone(RhnTimeZone timeZoneIn)
Sets the current timezone

Specified by:
setTimeZone in interface User
Parameters:
timeZoneIn - The timezone to be set

getNotificationMethods

public java.util.Set getNotificationMethods()
Get the notification methods set

Specified by:
getNotificationMethods in interface User
Returns:
Set notification methods

setNotificationMethods

public void setNotificationMethods(java.util.Set methodsIn)
Set the notification method set.

Specified by:
setNotificationMethods in interface User
Parameters:
methodsIn - notification methods

toString

public java.lang.String toString()
Output User to String for debugging

Overrides:
toString in class java.lang.Object
Returns:
String output of the User

equals

public boolean equals(java.lang.Object other)

Overrides:
equals in class java.lang.Object

hashCode

public int hashCode()

Overrides:
hashCode in class java.lang.Object

getAddress1

public java.lang.String getAddress1()
Getter for address1

Specified by:
getAddress1 in interface User
Returns:
Address1

setAddress1

public void setAddress1(java.lang.String address1In)
Setter for address1

Specified by:
setAddress1 in interface User
Parameters:
address1In - New value for address1

getAddress2

public java.lang.String getAddress2()
Getter for address2

Specified by:
getAddress2 in interface User
Returns:
Address2

setAddress2

public void setAddress2(java.lang.String address2In)
Setter for address2

Specified by:
setAddress2 in interface User
Parameters:
address2In - New value for address2

getCity

public java.lang.String getCity()
Getter for city

Specified by:
getCity in interface User
Returns:
City

setCity

public void setCity(java.lang.String cityIn)
Setter for city

Specified by:
setCity in interface User
Parameters:
cityIn - New value for city

getState

public java.lang.String getState()
Getter for state

Specified by:
getState in interface User
Returns:
State

setState

public void setState(java.lang.String stateIn)
Setter for state

Specified by:
setState in interface User
Parameters:
stateIn - New value for state

getZip

public java.lang.String getZip()
Getter for zip

Specified by:
getZip in interface User
Returns:
Zip

setZip

public void setZip(java.lang.String zipIn)
Setter for zip

Specified by:
setZip in interface User
Parameters:
zipIn - New value for zip

getCountry

public java.lang.String getCountry()
Getter for country

Specified by:
getCountry in interface User
Returns:
Country

setCountry

public void setCountry(java.lang.String countryIn)
Setter for country

Specified by:
setCountry in interface User
Parameters:
countryIn - New value for country

getIsPoBox

public java.lang.String getIsPoBox()
Getter for isPoBox

Specified by:
getIsPoBox in interface User
Returns:
isPoBox

setIsPoBox

public void setIsPoBox(java.lang.String isPoBoxIn)
Setter for isPoBox

Specified by:
setIsPoBox in interface User
Parameters:
isPoBoxIn - New value for isPoBox

getEnterpriseUser

public EnterpriseUser getEnterpriseUser()
Get the EnterpriseUser

Specified by:
getEnterpriseUser in interface User
Returns:
enterprise user

getHiddenPanes

public java.util.Set getHiddenPanes()
Retrieves the set of Pane object instances This method retrieves the

Specified by:
getHiddenPanes in interface User
Returns:
Set of panes used by the user

setHiddenPanes

public void setHiddenPanes(java.util.Set p)
Sets the set of PaneObjects instances.

Specified by:
setHiddenPanes in interface User
Parameters:
p - a set of pane objects

setAddress

protected void setAddress(Address addIn)

getAddress

protected Address getAddress()

setAddresses

protected void setAddresses(java.util.Set s)
Set the addresses.

Parameters:
s - the set

getAddresses

protected java.util.Set getAddresses()
Get the addresses

Returns:
Set of addresses

setEmailNotify

public void setEmailNotify(int emailNotifyIn)
Sets the value of emailNotify to new value

Specified by:
setEmailNotify in interface User
Parameters:
emailNotifyIn - New value for emailNotify

getEmailNotify

public int getEmailNotify()
Gets the current value of emailNotify

Specified by:
getEmailNotify in interface User
Returns:
int the current value

getAssociatedServerGroups

public java.util.Set getAssociatedServerGroups()
Retrieves the set of server groups associated to this user. Note: this is NOT getAllServerGroups this is getAssociatedServerGroups Subtle difference here is, if the user is an ORG Admin the return value is an empty list, since all the servergroups are implicitly subscribed. In DB terms the list here directly maps to rhnUserServerGroupPerms

Specified by:
getAssociatedServerGroups in interface User
Returns:
set of server groups

setAssociatedServerGroups

protected void setAssociatedServerGroups(java.util.Set serverGroups)
Sets the associatedServerGroups.. Meant for use by hibernate only (hence protected)

Parameters:
serverGroups - the servergroups to set.

getServers

public java.util.Set<Server> getServers()
Returns the set of Server's this user has permissions to manage.

Specified by:
getServers in interface User
Returns:
set of servers

addServer

public void addServer(Server server)
Give this user permission to manage a server.

Specified by:
addServer in interface User
Parameters:
server - Server to add permission for.

removeServer

public void removeServer(Server server)
Remover permission for the user to manage this server.

Specified by:
removeServer in interface User
Parameters:
server - Server to remove permission for.