Last update: 2011-06-23

org.proteios.core.data
Class UserData

java.lang.Object
  extended by org.proteios.core.data.BasicData
      extended by org.proteios.core.data.UserData
All Implemented Interfaces:
IdentifiableData, NameableData, RemovableData, SystemData

public class UserData
extends BasicData
implements NameableData, RemovableData, SystemData

This class holds information about a user.

Version:
2.0
Author:
Nicklas
See Also:
User
Last modified
$Date: 2010-04-20 14:02:33 +0200 (Tue, 20 Apr 2010) $
Hibernate: class
table="`Users`" lazy="false"

Field Summary
static int MAX_ADDRESS_LENGTH
          The maximum length of the address that can be stored in the database.
static int MAX_EMAIL_LENGTH
          The maximum length of the email address that can be stored in the database.
static int MAX_EXTERNAL_ID_LENGTH
          The maximum length of the external ID that can be stored in the database.
static int MAX_FAX_LENGTH
          The maximum length of the fax that can be stored in the database.
static int MAX_LOGIN_LENGTH
          The maximum length of the login that can be stored in the database.
static int MAX_ORGANISATION_LENGTH
          The maximum length of the organisation that can be stored in the database.
static int MAX_PHONE_LENGTH
          The maximum length of the phone that can be stored in the database.
static int MAX_URL_LENGTH
          The maximum length of the url that can be stored in the database.
 
Fields inherited from interface org.proteios.core.data.NameableData
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH
 
Constructor Summary
UserData()
           
 
Method Summary
 String getAddress()
          Get the address for the user, or null if unknown.
 String getDescription()
          Get the description for the item.
 String getEmail()
          Get the email address to the user, or null if unknown.
 Date getExpirationDate()
          Get the expiration date for this user account, or null if no expiration date is set.
 String getExternalId()
          Get the external ID for the user account.
 String getFax()
          Get the fax number to the user, or null if unknown.
 DirectoryData getHomeDirectory()
          Get the home directory for this user.
 int getId()
          We must override this method because the id must be the same as the id for the password.
 String getLogin()
          Get the login for the user account.
 String getName()
          Get the name of the item.
 String getOrganisation()
          Get the organisation this user works for, or null if unknown.
 PasswordData getPassword()
          Get the PasswordData object which allows you to change the password for the user.
 String getPhone()
          Get the phone number to the user, or null if unknown.
 QuotaData getQuota()
          Get the quota object which holds quota information for this user.
 GroupData getQuotaGroup()
          Get the group this user is sharing quota with, or null if this user only has it's own quota.
 String getSystemId()
          Get the system id for the item.
 String getUrl()
          Get the URL to the user's homepage, or null if unknown.
 boolean isDisabled()
          Check if this account is disabled or enabled.
 boolean isMultiuserAccount()
          Check if this account has enabled the multiuser feature.
 boolean isRemoved()
          Check if the removed flag is set for this item.
 void setAddress(String address)
           
 void setDescription(String description)
          Set the description for the item.
 void setDisabled(boolean disabled)
           
 void setEmail(String email)
           
 void setExpirationDate(Date expirationDate)
           
 void setExternalId(String externalId)
           
 void setFax(String fax)
           
 void setHomeDirectory(DirectoryData homeDirectory)
           
 void setLogin(String login)
           
 void setMultiuserAccount(boolean multiuserAccount)
           
 void setName(String name)
          Set the name of the item.
 void setOrganisation(String organisation)
           
 void setPhone(String phone)
           
 void setQuota(QuotaData quota)
           
 void setQuotaGroup(GroupData quotaGroup)
           
 void setRemoved(boolean removed)
          Set the removed flag for this item.
 void setSystemId(String systemId)
           
 void setUrl(String url)
           
 
Methods inherited from class org.proteios.core.data.BasicData
equals, getVersion, hashCode, toString
 
Methods inherited from class java.lang.Object
clone, finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface org.proteios.core.data.IdentifiableData
getVersion
 

Field Detail

MAX_EXTERNAL_ID_LENGTH

public static final int MAX_EXTERNAL_ID_LENGTH
The maximum length of the external ID that can be stored in the database.

See Also:
setExternalId(String), Constant Field Values

MAX_LOGIN_LENGTH

public static final int MAX_LOGIN_LENGTH
The maximum length of the login that can be stored in the database.

See Also:
setExternalId(String), Constant Field Values

MAX_ORGANISATION_LENGTH

public static final int MAX_ORGANISATION_LENGTH
The maximum length of the organisation that can be stored in the database.

See Also:
setOrganisation(String), Constant Field Values

MAX_ADDRESS_LENGTH

public static final int MAX_ADDRESS_LENGTH
The maximum length of the address that can be stored in the database.

See Also:
setAddress(String), Constant Field Values

MAX_PHONE_LENGTH

public static final int MAX_PHONE_LENGTH
The maximum length of the phone that can be stored in the database.

See Also:
setPhone(String), Constant Field Values

MAX_FAX_LENGTH

public static final int MAX_FAX_LENGTH
The maximum length of the fax that can be stored in the database.

See Also:
setFax(String), Constant Field Values

MAX_EMAIL_LENGTH

public static final int MAX_EMAIL_LENGTH
The maximum length of the email address that can be stored in the database.

See Also:
setEmail(String), Constant Field Values

MAX_URL_LENGTH

public static final int MAX_URL_LENGTH
The maximum length of the url that can be stored in the database.

See Also:
setUrl(String), Constant Field Values
Constructor Detail

UserData

public UserData()
Method Detail

getId

public int getId()
We must override this method because the id must be the same as the id for the password.

Specified by:
getId in interface IdentifiableData
Overrides:
getId in class BasicData
Returns:
The id of the item or 0
Hibernate: id
column="`id`" generator-class="foreign" unsaved-value="0"
Hibernate: generator-param
name="property" value="password"

getName

public String getName()
Description copied from interface: NameableData
Get the name of the item.

Specified by:
getName in interface NameableData
Returns:
A String with the name of the item

setName

public void setName(String name)
Description copied from interface: NameableData
Set the name of the item. The name cannot be null and mustn't be longer than the value specified by the MAX_NAME_LENGTH constant.

Specified by:
setName in interface NameableData
Parameters:
name - The new name for the item

getDescription

public String getDescription()
Description copied from interface: NameableData
Get the description for the item.

Specified by:
getDescription in interface NameableData
Returns:
A String with a description of the item

setDescription

public void setDescription(String description)
Description copied from interface: NameableData
Set the description for the item. The description can be null but mustn't be longer than the value specified by the MAX_DESCRIPTION_LENGTH constant.

Specified by:
setDescription in interface NameableData
Parameters:
description - The new description for the item

isRemoved

public boolean isRemoved()
Description copied from interface: RemovableData
Check if the removed flag is set for this item.

Specified by:
isRemoved in interface RemovableData
Returns:
TRUE if the item is flagged as removed, FALSE otherwise

setRemoved

public void setRemoved(boolean removed)
Description copied from interface: RemovableData
Set the removed flag for this item.

Specified by:
setRemoved in interface RemovableData
Parameters:
removed - TRUE if the item should be flagged as removed, FALSE otherwise

getSystemId

public String getSystemId()
Description copied from interface: SystemData
Get the system id for the item.

Specified by:
getSystemId in interface SystemData
Returns:
The id of the item or null

setSystemId

public void setSystemId(String systemId)

getPassword

public PasswordData getPassword()
Get the PasswordData object which allows you to change the password for the user. This is never null and is automatically deleted when the user a user is deleted.

Hibernate: one-to-one
class="org.proteios.core.data.PasswordData" cascade="all" outer-join="false" constrained="true"

isMultiuserAccount

public boolean isMultiuserAccount()
Check if this account has enabled the multiuser feature.

Hibernate: property
column="`multiuser_account`" type="boolean" not-null="true"

setMultiuserAccount

public void setMultiuserAccount(boolean multiuserAccount)

getExpirationDate

public Date getExpirationDate()
Get the expiration date for this user account, or null if no expiration date is set. Since the date object is mutable it must be copied if it is returned to client applications: return new Date(userdata.getExpirationDate());

Hibernate: property
column="`expiration_date`" type="date" not-null="false"

setExpirationDate

public void setExpirationDate(Date expirationDate)

isDisabled

public boolean isDisabled()
Check if this account is disabled or enabled.

Hibernate: property
column="`disabled`" type="boolean" not-null="true"

setDisabled

public void setDisabled(boolean disabled)

getExternalId

public String getExternalId()
Get the external ID for the user account.

Hibernate: property
column="`external_id`" type="string" length="255" not-null="false" unique="true"

setExternalId

public void setExternalId(String externalId)

getLogin

public String getLogin()
Get the login for the user account.

Hibernate: property
column="`login`" type="string" length="255" not-null="true" unique="true"

setLogin

public void setLogin(String login)

getOrganisation

public String getOrganisation()
Get the organisation this user works for, or null if unknown.

Hibernate: property
column="`organisation`" type="string" length="255"

setOrganisation

public void setOrganisation(String organisation)

getAddress

public String getAddress()
Get the address for the user, or null if unknown.

Hibernate: property
column="`address`" type="string" length="255"

setAddress

public void setAddress(String address)

getPhone

public String getPhone()
Get the phone number to the user, or null if unknown.

Hibernate: property
column="`phone`" type="string" length="255"

setPhone

public void setPhone(String phone)

getFax

public String getFax()
Get the fax number to the user, or null if unknown.

Hibernate: property
column="`fax`" type="string" length="255"

setFax

public void setFax(String fax)

getEmail

public String getEmail()
Get the email address to the user, or null if unknown.

Hibernate: property
column="`email`" type="string" length="255"

setEmail

public void setEmail(String email)

getUrl

public String getUrl()
Get the URL to the user's homepage, or null if unknown.

Hibernate: property
column="`url`" type="string" length="255"

setUrl

public void setUrl(String url)

getQuotaGroup

public GroupData getQuotaGroup()
Get the group this user is sharing quota with, or null if this user only has it's own quota.

See Also:
getQuota()
Hibernate: many-to-one
column="`quotagroup_id`" not-null="false" outer-join="false"

setQuotaGroup

public void setQuotaGroup(GroupData quotaGroup)

getQuota

public QuotaData getQuota()
Get the quota object which holds quota information for this user.

See Also:
getQuotaGroup()
Hibernate: many-to-one
column="`quota_id`" not-null="true" outer-join="false"

setQuota

public void setQuota(QuotaData quota)

getHomeDirectory

public DirectoryData getHomeDirectory()
Get the home directory for this user.

See Also:
getQuota()
Hibernate: many-to-one
column="`homedirectory_id`" not-null="false" outer-join="false"

setHomeDirectory

public void setHomeDirectory(DirectoryData homeDirectory)

Last update: 2011-06-23