Package unlimited.fc.server.api
Class UserContainer
- java.lang.Object
-
- unlimited.fc.server.api.UserContainer
-
public class UserContainer extends java.lang.ObjectTitle: FileCatalyst Direct Server API
Description: Container class that holds user data. Shell class used when multiple user parameters must be modified at the same time by ServerAPI. Allows manipulation without exposing the inner User classes to the ServerAPI.
Copyright: Copyright (c) 2009
Company: Unlimi-Tech Software Inc.
- Since:
- v2.7.1
- Version:
- 1.0
- Author:
- Christian Charette
-
-
Field Summary
Fields Modifier and Type Field Description static intUSERPRIORITY_HIGHHigh user prioritystatic intUSERPRIORITY_LOWLow user priority.static intUSERPRIORITY_MEDIUMMedium user priority (default value)
-
Constructor Summary
Constructors Constructor Description UserContainer(unlimited.fc.entity.user.User existingUser)Constructor.UserContainer(unlimited.fc.entity.user.UserData existingUser)Constructor.UserContainer(unlimited.fc.rest.server.model.UserModel existingUser)Constructor.
-
Method Summary
All Methods Instance Methods Concrete Methods Modifier and Type Method Description booleanequals(java.lang.Object obj)booleangetAccountEnabled()Returns if the account is currently enabled.java.util.CalendargetAccountExpiry()Returns user's account expiry date if set.intgetBandwidthLimit()Returns the bandwidth limit the user has been given on the server (in kbps)java.lang.StringgetEmail()Returns user's e-mail addressbooleangetFileDeletePermissions()Returns the user's default permissions on their home directory filesbooleangetFileModifyPermissions()Returns the user's default permissions on their home directory filesbooleangetFileReadPermissions()Returns the user's default permissions on their home directory filesbooleangetFileRenamePermissions()Returns the user's default permissions on their home directory filesbooleangetFileWritePermissions()Returns the user's default permissions on their home directory filesbooleangetFolderDeletePermissions()Returns the user's default permissions on their home directory.booleangetFolderModifyPermissions()Returns the user's default permissions on their home directory.booleangetFolderReadPermissions()Returns the user's default permissions on their home directory.booleangetFolderRenamePermissions()Returns the user's default permissions on their home directory.booleangetFolderWritePermissions()Returns the user's default permissions on their home directory.java.lang.StringgetForceOwnershipGroupname()Returns the value used for the group name during force ownershipjava.lang.StringgetForceOwnershipUsername()Returns that value used for the username force ownership.java.lang.StringgetFullName()Gets user's real full namebooleangetHasBandwidthLimit()Returns if a bandwidth limit is activated for the userbooleangetHasQuotaLimit()Returns if a quota limit is activated for the userjava.lang.StringgetHomeDIR()Gets user's home directory on the remote serverintgetPermissionAsInt()Return permissions as integer value.java.lang.StringgetPermissionAsString()Return permissions as integer value.intgetPriority()Returns a priority value for the user on the server.longgetQuotaPerDay()Quota allocated to the user on a daily basis (bytes)longgetQuotaUsed()Last known quota usedjava.lang.StringgetUserName()Gets unique user login namebooleanisForceFileOwnershipEnabled()Returns whether or not this user has the force file ownership feature enabledbooleanisForceOwnershipUseCurrentUsername()Returns whether or not the user will use it's current username for the force ownership functionalityvoidsetAccountEnabled(boolean enabled)Sets the account enabled flag.voidsetAccountExpiry(java.util.Calendar accountExpiry)Sets the user's account expiry date.voidsetBandwidthLimit(int bandWidthLimit)Sets the bandwidth limit for the user on the server.voidsetEmail(java.lang.String emailAddress)Sets the user's e-mail addressvoidsetFileDeletePermissions(boolean fileDeletePermissions)Sets the delete permission on the user's files in their home directoryvoidsetFileModifyPermissions(boolean fileModifyPermissions)Sets the modify permission on the user's files in their home directoryvoidsetFileReadPermissions(boolean fileReadPermissions)Sets the read permission on the user's files in their home directoryvoidsetFileRenamePermissions(boolean fileRenamePermissions)Sets the rename permission on the user's files in their home directoryvoidsetFileWritePermissions(boolean fileWritePermissions)Sets the write permission on the user's files in their home directoryvoidsetFolderDeletePermissions(boolean folderDeletePermissions)Sets the delete permission on the user's folders in their home directoryvoidsetFolderModifyPermissions(boolean folderModifyPermissions)Sets the modify permission on the user's folders in their home directoryvoidsetFolderReadPermissions(boolean folderReadPermissions)Sets the read permission on the user's folders in their home directoryvoidsetFolderRenamePermissions(boolean folderRenamePermissions)Sets the rename permission on the user's folders in their home directoryvoidsetFolderWritePermissions(boolean folderWritePermissions)Sets the write permission on the user's folders in their home directoryvoidsetForceFileOwnershipEnabled(boolean isForceFileOwnershipEnabled)Sets whether or not this user has the force file ownership feature enabledvoidsetForceOwnershipGroupname(java.lang.String forceOwnershipGroupname)Sets the value used for the group name during force ownershipvoidsetForceOwnershipUseCurrentUsername(boolean forceOwnershipUseCurrentUsername)Sets whether or not the user will use it's current username for the force ownership functionalityvoidsetForceOwnershipUsername(java.lang.String forceOwnershipUsername)Sets the value used for the username force ownership.voidsetFullName(java.lang.String fullName)Sets the user's real full namevoidsetHasBandwidthLimit(boolean imposeBandwidthLimit)Sets the flag if bandwidth restrictions are imposed on the user.voidsetHasQuotaLimit(boolean imposeQuotaLimit)Sets if quota limits are activated for this uservoidsetHomeDIR(java.lang.String homeDirectory)Sets user's home directory on the remote servervoidsetPriority(int priority)Sets the priority value for the user.voidsetQuotaPerDay(long quotaPerDay)Sets the daily quota limit allocated for this user (in bytes)java.lang.StringtoCLIOutput()java.lang.StringtoString()
-
-
-
Field Detail
-
USERPRIORITY_LOW
public static final int USERPRIORITY_LOW
Low user priority.- See Also:
- Constant Field Values
-
USERPRIORITY_MEDIUM
public static final int USERPRIORITY_MEDIUM
Medium user priority (default value)- See Also:
- Constant Field Values
-
USERPRIORITY_HIGH
public static final int USERPRIORITY_HIGH
High user priority- See Also:
- Constant Field Values
-
-
Constructor Detail
-
UserContainer
public UserContainer(unlimited.fc.entity.user.User existingUser)
Constructor. Loads the user default values up if found.- Parameters:
data- .username String unique username- Throws:
InvalidArgumentException- exception thrown if user cannot be found
-
UserContainer
public UserContainer(unlimited.fc.entity.user.UserData existingUser)
Constructor. Loads the user default values up if found.- Parameters:
data- .username String unique username- Throws:
InvalidArgumentException- exception thrown if user cannot be found
-
UserContainer
public UserContainer(unlimited.fc.rest.server.model.UserModel existingUser)
Constructor. Loads the user default values up if found.- Parameters:
data- .username String unique username- Throws:
InvalidArgumentException- exception thrown if user cannot be found
-
-
Method Detail
-
getUserName
public java.lang.String getUserName()
Gets unique user login name- Returns:
- String user login name
-
getFullName
public java.lang.String getFullName()
Gets user's real full name- Returns:
- String user's full name.
-
setFullName
public void setFullName(java.lang.String fullName)
Sets the user's real full name- Parameters:
fullName- String
-
getHomeDIR
public java.lang.String getHomeDIR()
Gets user's home directory on the remote server- Returns:
- String Home directory on server file system
-
setHomeDIR
public void setHomeDIR(java.lang.String homeDirectory)
Sets user's home directory on the remote server- Parameters:
homeDirectory- String Home directory path on server file system
-
getEmail
public java.lang.String getEmail()
Returns user's e-mail address- Returns:
- String e-mail address of user. Null if no value set.
-
setEmail
public void setEmail(java.lang.String emailAddress)
Sets the user's e-mail address- Parameters:
emailAddress- String Email address
-
getAccountExpiry
public java.util.Calendar getAccountExpiry()
Returns user's account expiry date if set.- Returns:
- Calendar user's account expiry date. Null if does not have an expiry date.
-
setAccountExpiry
public void setAccountExpiry(java.util.Calendar accountExpiry)
Sets the user's account expiry date.- Parameters:
accountExpiry- Calendar Date when account automatically expires. Set to null for no expiry.
-
getAccountEnabled
public boolean getAccountEnabled()
Returns if the account is currently enabled.- Returns:
- boolean true if account is enabled, false if disabled.
-
setAccountEnabled
public void setAccountEnabled(boolean enabled)
Sets the account enabled flag.- Parameters:
enabled- boolean set to true to enable the account, false to disable it.
-
getPermissionAsInt
public int getPermissionAsInt()
Return permissions as integer value.- Returns:
-
getPermissionAsString
public java.lang.String getPermissionAsString()
Return permissions as integer value.- Returns:
-
getFileReadPermissions
public boolean getFileReadPermissions()
Returns the user's default permissions on their home directory files- Returns:
- boolean Returns true if user has read permission on their files.
-
setFileReadPermissions
public void setFileReadPermissions(boolean fileReadPermissions)
Sets the read permission on the user's files in their home directory- Parameters:
fileReadPermissions- boolean
-
getFileWritePermissions
public boolean getFileWritePermissions()
Returns the user's default permissions on their home directory files- Returns:
- boolean Returns true if user has write permission on their files.
-
setFileWritePermissions
public void setFileWritePermissions(boolean fileWritePermissions)
Sets the write permission on the user's files in their home directory- Parameters:
fileWritePermissions- boolean
-
getFileModifyPermissions
public boolean getFileModifyPermissions()
Returns the user's default permissions on their home directory files- Returns:
- boolean Returns true if user has modify/append permission on their files.
-
setFileModifyPermissions
public void setFileModifyPermissions(boolean fileModifyPermissions)
Sets the modify permission on the user's files in their home directory- Parameters:
fileModifyPermissions- boolean
-
getFileDeletePermissions
public boolean getFileDeletePermissions()
Returns the user's default permissions on their home directory files- Returns:
- boolean Returns true if user has delete permission on their files.
-
setFileDeletePermissions
public void setFileDeletePermissions(boolean fileDeletePermissions)
Sets the delete permission on the user's files in their home directory- Parameters:
fileDeletePermissions- boolean
-
getFileRenamePermissions
public boolean getFileRenamePermissions()
Returns the user's default permissions on their home directory files- Returns:
- boolean Returns true if user has rename permission on their files.
-
setFileRenamePermissions
public void setFileRenamePermissions(boolean fileRenamePermissions)
Sets the rename permission on the user's files in their home directory- Parameters:
fileRenamePermissions- boolean
-
getFolderReadPermissions
public boolean getFolderReadPermissions()
Returns the user's default permissions on their home directory.- Returns:
- boolean Returns true if user has read permission (list) on folders.
-
setFolderReadPermissions
public void setFolderReadPermissions(boolean folderReadPermissions)
Sets the read permission on the user's folders in their home directory- Parameters:
folderReadPermissions- boolean
-
getFolderWritePermissions
public boolean getFolderWritePermissions()
Returns the user's default permissions on their home directory.- Returns:
- boolean Returns true if user has write permission on folders.
-
setFolderWritePermissions
public void setFolderWritePermissions(boolean folderWritePermissions)
Sets the write permission on the user's folders in their home directory- Parameters:
folderWritePermissions- boolean
-
getFolderModifyPermissions
public boolean getFolderModifyPermissions()
Returns the user's default permissions on their home directory.- Returns:
- boolean Returns true if user has modify permission on folders.
-
setFolderModifyPermissions
public void setFolderModifyPermissions(boolean folderModifyPermissions)
Sets the modify permission on the user's folders in their home directory- Parameters:
folderModifyPermissions- boolean
-
getFolderDeletePermissions
public boolean getFolderDeletePermissions()
Returns the user's default permissions on their home directory.- Returns:
- boolean Returns true if user has delete permission on folders.
-
setFolderDeletePermissions
public void setFolderDeletePermissions(boolean folderDeletePermissions)
Sets the delete permission on the user's folders in their home directory- Parameters:
folderDeletePermissions- boolean
-
getFolderRenamePermissions
public boolean getFolderRenamePermissions()
Returns the user's default permissions on their home directory.- Returns:
- boolean Returns true if user has rename permission on folders.
-
setFolderRenamePermissions
public void setFolderRenamePermissions(boolean folderRenamePermissions)
Sets the rename permission on the user's folders in their home directory- Parameters:
folderRenamePermissions- boolean
-
getPriority
public int getPriority()
Returns a priority value for the user on the server.- Returns:
- int Value between 1 (low) and 10 (high)
-
setPriority
public void setPriority(int priority) throws InvalidArgumentExceptionSets the priority value for the user. Value must be between 1 (low) to 10 (high)- Parameters:
priority- int value between 1 (low) to 10 (high)- Throws:
InvalidArgumentException- Value given is not 1 through 10
-
getBandwidthLimit
public int getBandwidthLimit()
Returns the bandwidth limit the user has been given on the server (in kbps)- Returns:
- int bandwidth available to the user in kbps
-
setBandwidthLimit
public void setBandwidthLimit(int bandWidthLimit) throws InvalidArgumentExceptionSets the bandwidth limit for the user on the server.- Parameters:
bandWidthLimit- long bandwidth value in kbps- Throws:
InvalidArgumentException- bandwidth value is invalid
-
getHasBandwidthLimit
public boolean getHasBandwidthLimit()
Returns if a bandwidth limit is activated for the user- Returns:
- boolean if bandwidth limits are enabled.
-
setHasBandwidthLimit
public void setHasBandwidthLimit(boolean imposeBandwidthLimit)
Sets the flag if bandwidth restrictions are imposed on the user.- Parameters:
imposeBandwidthLimit- boolean
-
getHasQuotaLimit
public boolean getHasQuotaLimit()
Returns if a quota limit is activated for the user- Returns:
- boolean if quotas are enabled.
-
setHasQuotaLimit
public void setHasQuotaLimit(boolean imposeQuotaLimit)
Sets if quota limits are activated for this user- Parameters:
imposeQuotaLimit- boolean
-
getQuotaPerDay
public long getQuotaPerDay()
Quota allocated to the user on a daily basis (bytes)- Returns:
- long Daily bytes allocated to the user before quotas are enforced.
-
setQuotaPerDay
public void setQuotaPerDay(long quotaPerDay) throws InvalidArgumentExceptionSets the daily quota limit allocated for this user (in bytes)- Parameters:
quotaPerDay- long daily quota limit in bytes.- Throws:
InvalidArgumentException- if the quota per day is an invalid number
-
getQuotaUsed
public long getQuotaUsed()
Last known quota used- Returns:
- long number of bytes used so far.
-
isForceFileOwnershipEnabled
public boolean isForceFileOwnershipEnabled()
Returns whether or not this user has the force file ownership feature enabled- Returns:
- the isForceFileOwnershipEnabled
-
setForceFileOwnershipEnabled
public void setForceFileOwnershipEnabled(boolean isForceFileOwnershipEnabled)
Sets whether or not this user has the force file ownership feature enabled- Parameters:
isForceFileOwnershipEnabled- the isForceFileOwnershipEnabled to set
-
isForceOwnershipUseCurrentUsername
public boolean isForceOwnershipUseCurrentUsername()
Returns whether or not the user will use it's current username for the force ownership functionality- Returns:
- the forceOwnershipUseCurrentUsername
-
setForceOwnershipUseCurrentUsername
public void setForceOwnershipUseCurrentUsername(boolean forceOwnershipUseCurrentUsername)
Sets whether or not the user will use it's current username for the force ownership functionality- Parameters:
forceOwnershipUseCurrentUsername- the forceOwnershipUseCurrentUsername to set
-
getForceOwnershipUsername
public java.lang.String getForceOwnershipUsername()
Returns that value used for the username force ownership. Ignored if useCurrentUsername is enabled- Returns:
- the forceOwnershipUsername
-
setForceOwnershipUsername
public void setForceOwnershipUsername(java.lang.String forceOwnershipUsername)
Sets the value used for the username force ownership.- Parameters:
forceOwnershipUsername- the forceOwnershipUsername to set
-
getForceOwnershipGroupname
public java.lang.String getForceOwnershipGroupname()
Returns the value used for the group name during force ownership- Returns:
- the forceOwnershipGroupname
-
setForceOwnershipGroupname
public void setForceOwnershipGroupname(java.lang.String forceOwnershipGroupname)
Sets the value used for the group name during force ownership- Parameters:
forceOwnershipGroupname- the forceOwnershipGroupname to set
-
toString
public java.lang.String toString()
- Overrides:
toStringin classjava.lang.Object
-
toCLIOutput
public java.lang.String toCLIOutput()
-
equals
public boolean equals(java.lang.Object obj)
- Overrides:
equalsin classjava.lang.Object
-
-