|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||
java.lang.Objectorg.proteios.core.BasicItem<UserData>
org.proteios.core.User
public class User
This class is used to represent a user in Proteios.
| 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. |
static String |
ROOT
The system id for the User representing the root account. |
static Item |
TYPE
The type of item represented by this class. |
| Fields inherited from interface org.proteios.core.Nameable |
|---|
MAX_DESCRIPTION_LENGTH, MAX_NAME_LENGTH |
| Method Summary | |
|---|---|
String |
getAddress()
Get the address for the user, or null if unknown. |
static User |
getById(DbControl dc,
int id)
Get a User item when you know the ID. |
String |
getDescription()
Get the description for the item. |
long |
getDiskUsage(QuotaType quotaType,
Location location)
Get the used number of bytes for the specified quota type and location. |
String |
getEmail()
Get the email address to the user, or null if unknown. |
Date |
getExpirationDate()
Get the expire date of the account. |
String |
getExternalId()
Get the external id for the user account. |
String |
getFax()
Get the fax number to the user, or null if unknown. |
ItemQuery<Group> |
getGroups()
Get a query that returns the groups where this user is a member. |
Directory |
getHomeDirectory()
Get the home Directory for this user. |
String |
getLogin()
Get the login for the user account. |
ItemQuery<Message> |
getMessages()
Get a query that returns all messages for the user. |
String |
getName()
Get the name of the item. |
String |
getOrganisation()
Get the organisation this user works for, or null if unknown. |
String |
getPhone()
Get the phone number to the user, or null if unknown. |
ItemQuery<Project> |
getProjects()
Get a query that returns the projects where this user is a member. |
static ItemQuery<User> |
getQuery()
Get a query configured to retrieve users. |
Quota |
getQuota()
Get the Quota that applies to the user. |
Group |
getQuotaGroup()
Get the Group whose Quota also applies to the user. |
ItemQuery<Role> |
getRoles()
Get a query that returns the roles where this user is a member. |
String |
getSystemId()
Get the system id for the item. |
Item |
getType()
Get the type of item represented by the object. |
String |
getUrl()
Get the URL to the user's homepage, or null if unknown. |
boolean |
isDisabled()
Check if this account has been disabled. |
boolean |
isMultiuserAccount()
Check if the user account is a multiuser account or not. |
boolean |
isRemoved()
Check if the removed flag is set for this item. |
boolean |
isSystemItem()
Check if the item is a system item or not. |
boolean |
isUsed()
Checks if: any Ownable item is owned by this user
A user can also be referenced from groups, roles, projects, item keys,
sessions and settings, but those references are automatically deleted if
the user is deleted and aren't inclued in this check. |
void |
setAddress(String address)
Set the address for the user, or null if unknown. |
void |
setBase1Password(String md5Password)
Set the encrypted password from Proteios 1. |
void |
setDescription(String description)
Set the description for the item. |
void |
setDisabled(boolean disabled)
Disables or enables the account. |
void |
setEmail(String email)
Set the email address to the user, or null if unknown. |
void |
setExpirationDate(Date expirationDate)
Sets the expiration date of the account. |
void |
setExternalId(String externalId)
Set the external id for the user account. |
void |
setFax(String fax)
Set the fax number to the user, or null if unknown. |
void |
setHomeDirectory(Directory homeDirectory)
Set the home directory for the user. |
void |
setLogin(String login)
Set the login for the user account. |
void |
setMultiuserAccount(boolean multiuserAccount)
Sets if the user account is multiuser account. |
void |
setName(String name)
Set the name of the item. |
void |
setOrganisation(String organisation)
Set the organisation this user works for, or null if unknown. |
void |
setPassword(String password)
Set the password. |
void |
setPhone(String phone)
Set the phone number to the user, or null if unknown. |
void |
setQuota(Quota quota)
Set the quota for the user. |
void |
setQuotaGroup(Group quotaGroup)
Set the group whose quota should be checked for disk consuming items. |
void |
setRemoved(boolean removed)
Set the removed flag for this item. |
void |
setUrl(String url)
Set the URL to the user's homepage, or null if unknown. |
| Methods inherited from class org.proteios.core.BasicItem |
|---|
checkPermission, equals, getDbControl, getId, getPermissions, getSessionControl, getVersion, hashCode, hasPermission, isDetached, isInDatabase, toString |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Methods inherited from interface org.proteios.core.Identifiable |
|---|
getId, getVersion |
| Methods inherited from interface org.proteios.core.AccessControlled |
|---|
checkPermission, hasPermission |
| Methods inherited from interface java.security.Principal |
|---|
equals, hashCode, toString |
| Field Detail |
|---|
public static final Item TYPE
Item.USER,
getType()public static final String ROOT
User representing the root account.
The root user has full access to everything in Proteios.
public static final int MAX_EXTERNAL_ID_LENGTH
setExternalId(String),
Constant Field Valuespublic static final int MAX_LOGIN_LENGTH
setLogin(String),
Constant Field Valuespublic static final int MAX_ORGANISATION_LENGTH
setOrganisation(String),
Constant Field Valuespublic static final int MAX_ADDRESS_LENGTH
setAddress(String),
Constant Field Valuespublic static final int MAX_PHONE_LENGTH
setPhone(String),
Constant Field Valuespublic static final int MAX_FAX_LENGTH
setFax(String),
Constant Field Valuespublic static final int MAX_EMAIL_LENGTH
setEmail(String),
Constant Field Valuespublic static final int MAX_URL_LENGTH
setUrl(String),
Constant Field Values| Method Detail |
|---|
public static User getById(DbControl dc,
int id)
throws ItemNotFoundException,
PermissionDeniedException,
BaseException
User item when you know the ID.
dc - The DbControl which will be used for permission
checking and database access.id - The ID of the item to load
User item
ItemNotFoundException - If an item with the specified ID is not
found
PermissionDeniedException - If the logged in user doesn't have
Permission.READ permission to the item
BaseException - If there is another errorpublic static ItemQuery<User> getQuery()
Everyone group is not considered since all users
automatically are members to that group.
ItemQuery objectpublic Item getType()
IdentifiableItem enumeration.
getType in interface Identifiablepublic String getName()
Nameable
getName in interface PrincipalgetName in interface NameableString with the name of the item
public void setName(String name)
throws PermissionDeniedException,
InvalidDataException
NameableNameable.MAX_NAME_LENGTH constant.
setName in interface Nameablename - The new name for the item
PermissionDeniedException - If the logged in user doesn't
have write permission
InvalidDataException - If the name is null or longer
than specified by the Nameable.MAX_NAME_LENGTH constantpublic String getDescription()
Nameable
getDescription in interface NameableString with a description of the item
public void setDescription(String description)
throws PermissionDeniedException,
InvalidDataException
NameableNameable.MAX_DESCRIPTION_LENGTH constant.
setDescription in interface Nameabledescription - The new description for the item
PermissionDeniedException - If the logged in user doesn't
have write permission
InvalidDataException - If the description longer
than specified by the Nameable.MAX_DESCRIPTION_LENGTH constantpublic boolean isRemoved()
Removable
isRemoved in interface Removable
public void setRemoved(boolean removed)
throws PermissionDeniedException
Removable
setRemoved in interface Removableremoved - TRUE if the item should be flagged as removed,
FALSE otherwise
PermissionDeniedException - If the logged in user doesn't
have Permission.DELETE permission for setting the flag
to TRUE or Permission.WRITE permission for setting the
flag to FALSEpublic String getSystemId()
SystemItem
getSystemId in interface SystemItempublic boolean isSystemItem()
SystemItem
isSystemItem in interface SystemItem
public boolean isUsed()
throws BaseException
Ownable item is owned by this user
isUsed in class BasicItem<UserData>BaseException
public void setPassword(String password)
throws PermissionDeniedException,
InvalidDataException
PermissionDeniedException - If the logged in user doesn't have
restricted_write permission
InvalidDataException - If the new password is null
public void setBase1Password(String md5Password)
throws PermissionDeniedException,
BaseException
PermissionDeniedException unless the logged in user is the root
and the user account is a newly created account.
md5Password - The MD5 password from a Proteios 1 installation
PermissionDeniedException - If it is not a new user or root isn't
logged in
BaseExceptionpublic Date getExpirationDate()
public void setExpirationDate(Date expirationDate)
throws PermissionDeniedException
PermissionDeniedException - If the logged in user doesn't have
write permissionpublic boolean isDisabled()
public void setDisabled(boolean disabled)
throws PermissionDeniedException
disabled - TRUE to disabled the account, FALSE to enabled it
PermissionDeniedException - If the logged in user doesn't have
write permissionisDisabled()public boolean isMultiuserAccount()
public void setMultiuserAccount(boolean multiuserAccount)
throws PermissionDeniedException
PermissionDeniedException - If the logged in user doesn't have
write permissionpublic String getExternalId()
public void setExternalId(String externalId)
throws PermissionDeniedException,
InvalidDataException,
BaseException
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If the new value is longer than
MAX_EXTERNAL_ID_LENGTH
BaseException - If there is another errorpublic String getLogin()
public void setLogin(String login)
throws PermissionDeniedException,
InvalidDataException
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If the new value is null or longer than
MAX_LOGIN_LENGTHpublic String getOrganisation()
public void setOrganisation(String organisation)
throws PermissionDeniedException,
InvalidDataException
PermissionDeniedException - If the logged in user doesn't have
restricted write permission
InvalidDataException - If the new value is longer than
MAX_ORGANISATION_LENGTHpublic String getAddress()
public void setAddress(String address)
throws PermissionDeniedException,
InvalidDataException
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If the new value is longer than
MAX_ADDRESS_LENGTHpublic String getPhone()
public void setPhone(String phone)
throws PermissionDeniedException,
InvalidDataException
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If the new value is longer than
MAX_PHONE_LENGTHpublic String getFax()
public void setFax(String fax)
throws PermissionDeniedException,
InvalidDataException
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If the new value is longer than
MAX_FAX_LENGTHpublic String getEmail()
public void setEmail(String email)
throws PermissionDeniedException,
InvalidDataException
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If the new value is longer than
MAX_EMAIL_LENGTHpublic String getUrl()
public void setUrl(String url)
throws PermissionDeniedException,
InvalidDataException
PermissionDeniedException - If the logged in user doesn't have
write permission
InvalidDataException - If the new value is longer than
MAX_URL_LENGTH
public Quota getQuota()
throws PermissionDeniedException,
BaseException
Quota that applies to the user.
Quota item
PermissionDeniedException - If the logged in user doesn't have
Permission.READ permission to the item
BaseException
public void setQuota(Quota quota)
throws PermissionDeniedException,
InvalidDataException
quota - The new Quota
InvalidDataException - If the quota is null
PermissionDeniedException - If the logged in user doesn't have
Permission.WRITE permission for the user or
Permission.USE permission for the quota
public Group getQuotaGroup()
throws PermissionDeniedException,
BaseException
Group whose Quota also applies to the user.
Group item, or null if no group has been
specified
PermissionDeniedException - If the logged in user doesn't have
Permission.READ permission to the item
BaseException
public void setQuotaGroup(Group quotaGroup)
throws PermissionDeniedException
quotaGroup - The new Group
PermissionDeniedException - If the logged in user doesn't have
Permission.WRITE permission for the user or
Permission.USE permission for the group
public long getDiskUsage(QuotaType quotaType,
Location location)
throws BaseException
quotaType - The QuotaTypelocation - The location
BaseException
public Directory getHomeDirectory()
throws PermissionDeniedException,
BaseException
Directory for this user.
Directory item, or null if no home directory has
been specified
PermissionDeniedException - If the logged in user doesn't have
Permission.READ permission to the directory
BaseException
public void setHomeDirectory(Directory homeDirectory)
throws PermissionDeniedException,
InvalidDataException
homeDirectory - The new home Directory
PermissionDeniedException - If the logged in user doesn't have
Permission.WRITE permission for the user or
Permission.USE permission for the directory
InvalidDataException - If the home directory is not a subdirectory
to /root/homepublic ItemQuery<Role> getRoles()
Role.getQuery()public ItemQuery<Group> getGroups()
Group.getQuery()public ItemQuery<Project> getProjects()
Project.getQuery()public ItemQuery<Message> getMessages()
ItemQuery objectMessage.getQuery(User)
|
Last update: 2011-06-23 | |||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||