Class UserContainer


  • public class UserContainer
    extends java.lang.Object

    Title: 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
    • 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
      boolean equals​(java.lang.Object obj)  
      boolean getAccountEnabled()
      Returns if the account is currently enabled.
      java.util.Calendar getAccountExpiry()
      Returns user's account expiry date if set.
      int getBandwidthLimit()
      Returns the bandwidth limit the user has been given on the server (in kbps)
      java.lang.String getEmail()
      Returns user's e-mail address
      boolean getFileDeletePermissions()
      Returns the user's default permissions on their home directory files
      boolean getFileModifyPermissions()
      Returns the user's default permissions on their home directory files
      boolean getFileReadPermissions()
      Returns the user's default permissions on their home directory files
      boolean getFileRenamePermissions()
      Returns the user's default permissions on their home directory files
      boolean getFileWritePermissions()
      Returns the user's default permissions on their home directory files
      boolean getFolderDeletePermissions()
      Returns the user's default permissions on their home directory.
      boolean getFolderModifyPermissions()
      Returns the user's default permissions on their home directory.
      boolean getFolderReadPermissions()
      Returns the user's default permissions on their home directory.
      boolean getFolderRenamePermissions()
      Returns the user's default permissions on their home directory.
      boolean getFolderWritePermissions()
      Returns the user's default permissions on their home directory.
      java.lang.String getForceOwnershipGroupname()
      Returns the value used for the group name during force ownership
      java.lang.String getForceOwnershipUsername()
      Returns that value used for the username force ownership.
      java.lang.String getFullName()
      Gets user's real full name
      boolean getHasBandwidthLimit()
      Returns if a bandwidth limit is activated for the user
      boolean getHasQuotaLimit()
      Returns if a quota limit is activated for the user
      java.lang.String getHomeDIR()
      Gets user's home directory on the remote server
      int getPermissionAsInt()
      Return permissions as integer value.
      java.lang.String getPermissionAsString()
      Return permissions as integer value.
      int getPriority()
      Returns a priority value for the user on the server.
      long getQuotaPerDay()
      Quota allocated to the user on a daily basis (bytes)
      long getQuotaUsed()
      Last known quota used
      java.lang.String getUserName()
      Gets unique user login name
      boolean isForceFileOwnershipEnabled()
      Returns whether or not this user has the force file ownership feature enabled
      boolean isForceOwnershipUseCurrentUsername()
      Returns whether or not the user will use it's current username for the force ownership functionality
      void setAccountEnabled​(boolean enabled)
      Sets the account enabled flag.
      void setAccountExpiry​(java.util.Calendar accountExpiry)
      Sets the user's account expiry date.
      void setBandwidthLimit​(int bandWidthLimit)
      Sets the bandwidth limit for the user on the server.
      void setEmail​(java.lang.String emailAddress)
      Sets the user's e-mail address
      void setFileDeletePermissions​(boolean fileDeletePermissions)
      Sets the delete permission on the user's files in their home directory
      void setFileModifyPermissions​(boolean fileModifyPermissions)
      Sets the modify permission on the user's files in their home directory
      void setFileReadPermissions​(boolean fileReadPermissions)
      Sets the read permission on the user's files in their home directory
      void setFileRenamePermissions​(boolean fileRenamePermissions)
      Sets the rename permission on the user's files in their home directory
      void setFileWritePermissions​(boolean fileWritePermissions)
      Sets the write permission on the user's files in their home directory
      void setFolderDeletePermissions​(boolean folderDeletePermissions)
      Sets the delete permission on the user's folders in their home directory
      void setFolderModifyPermissions​(boolean folderModifyPermissions)
      Sets the modify permission on the user's folders in their home directory
      void setFolderReadPermissions​(boolean folderReadPermissions)
      Sets the read permission on the user's folders in their home directory
      void setFolderRenamePermissions​(boolean folderRenamePermissions)
      Sets the rename permission on the user's folders in their home directory
      void setFolderWritePermissions​(boolean folderWritePermissions)
      Sets the write permission on the user's folders in their home directory
      void setForceFileOwnershipEnabled​(boolean isForceFileOwnershipEnabled)
      Sets whether or not this user has the force file ownership feature enabled
      void setForceOwnershipGroupname​(java.lang.String forceOwnershipGroupname)
      Sets the value used for the group name during force ownership
      void setForceOwnershipUseCurrentUsername​(boolean forceOwnershipUseCurrentUsername)
      Sets whether or not the user will use it's current username for the force ownership functionality
      void setForceOwnershipUsername​(java.lang.String forceOwnershipUsername)
      Sets the value used for the username force ownership.
      void setFullName​(java.lang.String fullName)
      Sets the user's real full name
      void setHasBandwidthLimit​(boolean imposeBandwidthLimit)
      Sets the flag if bandwidth restrictions are imposed on the user.
      void setHasQuotaLimit​(boolean imposeQuotaLimit)
      Sets if quota limits are activated for this user
      void setHomeDIR​(java.lang.String homeDirectory)
      Sets user's home directory on the remote server
      void setPriority​(int priority)
      Sets the priority value for the user.
      void setQuotaPerDay​(long quotaPerDay)
      Sets the daily quota limit allocated for this user (in bytes)
      java.lang.String toCLIOutput()  
      java.lang.String toString()  
      • Methods inherited from class java.lang.Object

        clone, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
    • 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 InvalidArgumentException
        Sets 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 InvalidArgumentException
        Sets 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 InvalidArgumentException
        Sets 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:
        toString in class java.lang.Object
      • toCLIOutput

        public java.lang.String toCLIOutput()
      • equals

        public boolean equals​(java.lang.Object obj)
        Overrides:
        equals in class java.lang.Object