Package services.gui

Class ResultRemover


  • @Singleton
    public class ResultRemover
    extends java.lang.Object
    Service class that removes ComponentResults or StudyResults. It's used by controllers or other services.
    • Method Summary

      All Methods Instance Methods Concrete Methods 
      Modifier and Type Method Description
      void removeComponentResults​(java.util.List<java.lang.Long> componentResultIdList, User user, boolean removeEmptyStudyResults)
      Retrieves all ComponentResults that correspond to the IDs in the given String, checks them and if yes, removes them.
      void removeStudyResults​(java.util.List<java.lang.Long> studyResultIdList, User user)
      Retrieves all StudyResults that correspond to the IDs in the given String, checks if the given user is allowed to remove them and if yes, removes them.
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • removeComponentResults

        public void removeComponentResults​(java.util.List<java.lang.Long> componentResultIdList,
                                           User user,
                                           boolean removeEmptyStudyResults)
                                    throws NotFoundException,
                                           ForbiddenException
        Retrieves all ComponentResults that correspond to the IDs in the given String, checks them and if yes, removes them. Ignores IDs that do not point to a result. Removes result upload files.
        Parameters:
        componentResultIdList - List of IDs of ComponentResults
        user - For each ComponentResult it will be checked that the given user is a user of the study that the ComponentResult belongs to.
        Throws:
        NotFoundException
        ForbiddenException
      • removeStudyResults

        public void removeStudyResults​(java.util.List<java.lang.Long> studyResultIdList,
                                       User user)
                                throws NotFoundException,
                                       ForbiddenException
        Retrieves all StudyResults that correspond to the IDs in the given String, checks if the given user is allowed to remove them and if yes, removes them. Removes result upload files.
        Parameters:
        studyResultIdList - List of IDs of StudyResults.
        user - For each StudyResult it will be checked that the given user is a user of the study that the StudyResult belongs too.
        Throws:
        NotFoundException
        ForbiddenException