Class QuotaManager


  • public class QuotaManager
    extends Object
    • Field Detail

      • totalSize

        protected long totalSize
      • workerThread

        protected Thread workerThread
      • workerExecutionTime

        protected long workerExecutionTime
      • statsTimestamp

        protected Date statsTimestamp
    • Method Detail

      • getInstance

        public static QuotaManager getInstance()
        Returns the Singleton instance
        Returns:
        the QuotaManager
      • getTotalSize

        public long getTotalSize()
        Retuns the total size in bytes from all workspaces or 0L if it fails.
        Returns:
        the total size
      • forceAsyncScan

        public void forceAsyncScan​(boolean storeSettingsAfterwards)
        Starts an async scan of all workspaces, also deletes workspaces which are too old
        Parameters:
        storeSettingsAfterwards - if set to true, the main properties will be stored after the scan
      • getWorkspaceSize

        public long getWorkspaceSize​(Workspace workspace)
        Returns the size in bytes of all archives together in the workspace or 0L if it fails.
        Parameters:
        workspace - the workspace
        Returns:
        the size in bytes of all archives in the workspace
      • updateWorkspace

        public long updateWorkspace​(String workspaceId)
        Updates the size of the workspace or removes the result from the cache, if the workspace is not available anymore
        Parameters:
        workspaceId - id of the workspace
        Returns:
        the new size of the workspace
      • getStats

        public StatisticData getStats()
        Gets the statistics on the page.
        Returns:
        the stats
      • getUserStats

        public StatisticData getUserStats​(UserManager user)
        Gets the user stats.
        Parameters:
        user - the user
        Returns:
        the user stats
      • updateWorkspace

        public long updateWorkspace​(Workspace workspace)
        Updates the size of the workspace
        Parameters:
        workspace - the workspace
        Returns:
        updated size of the workspace