Interface FileInfoService

  • All Known Implementing Classes:
    FileInfoServiceImpl

    @Service
    public interface FileInfoService
    Handles meta data for files.
    • Method Detail

      • fetchAllFilesInDirectory

        java.util.List<FileInfo> fetchAllFilesInDirectory​(long dirId)
                                                   throws MopsException
        Lists all files in a specific directory.
        Parameters:
        dirId - directory id
        Returns:
        a list of files in that directory
        Throws:
        MopsException
      • fetchFileInfo

        FileInfo fetchFileInfo​(long fileId)
                        throws MopsException
        Get a file by id.
        Parameters:
        fileId - file id
        Returns:
        a FileInfo object
        Throws:
        MopsException
      • deleteFileInfo

        void deleteFileInfo​(long fileId)
                     throws MopsException
        Delete file from database by id.
        Parameters:
        fileId - file id
        Throws:
        MopsException
      • fetchAllFileInfoIds

        java.util.Set<java.lang.Long> fetchAllFileInfoIds()
                                                   throws MopsException
        Fetches all available FileInfo ids.
        Returns:
        all ids
        Throws:
        MopsException - on error
      • fetchAllOrphanedFileInfos

        java.util.Set<java.lang.Long> fetchAllOrphanedFileInfos()
                                                         throws MopsException
        Fetches all FileInfos which are in non existing directories.
        Returns:
        all ids
        Throws:
        MopsException - on error
      • getStorageUsageInGroup

        long getStorageUsageInGroup​(long groupId)
                             throws MopsException
        Get the total number of bytes used by that group.
        Parameters:
        groupId - group
        Returns:
        bytes used
        Throws:
        MopsException
      • getTotalStorageUsage

        long getTotalStorageUsage()
                           throws MopsException
        Get the total number of bytes used by all groups.
        Returns:
        bytes used
        Throws:
        MopsException
      • getFileCountInGroup

        long getFileCountInGroup​(long groupId)
                          throws MopsException
        Get the total number of files in a group.
        Parameters:
        groupId - group
        Returns:
        file count
        Throws:
        MopsException
      • getTotalFileCount

        long getTotalFileCount()
                        throws MopsException
        Get the total number of files in all groups.
        Returns:
        file count
        Throws:
        MopsException