Class ProcessServiceImpl

    • Constructor Detail

      • ProcessServiceImpl

        public ProcessServiceImpl()
    • Method Detail

      • create

        public Process create​(Context context,
                              EPerson ePerson,
                              String scriptName,
                              List<DSpaceCommandLineParameter> parameters)
                       throws SQLException
        Description copied from interface: ProcessService
        This method will create a Process object in the database
        Specified by:
        create in interface ProcessService
        Parameters:
        context - The relevant DSpace context
        ePerson - The ePerson for which this process will be created on
        scriptName - The script name to be used for the process
        parameters - The parameters to be used for the process
        Returns:
        The created process
        Throws:
        SQLException - If something goes wrong
      • find

        public Process find​(Context context,
                            int processId)
                     throws SQLException
        Description copied from interface: ProcessService
        This method will retrieve a Process object from the Database with the given ID
        Specified by:
        find in interface ProcessService
        Parameters:
        context - The relevant DSpace context
        processId - The process id on which we'll search for in the database
        Returns:
        The process that holds the given process id
        Throws:
        SQLException - If something goes wrong
      • findAll

        public List<Process> findAll​(Context context)
                              throws SQLException
        Description copied from interface: ProcessService
        Returns a list of all Process objects in the database
        Specified by:
        findAll in interface ProcessService
        Parameters:
        context - The relevant DSpace context
        Returns:
        The list of all Process objects in the Database
        Throws:
        SQLException - If something goes wrong
      • findAll

        public List<Process> findAll​(Context context,
                                     int limit,
                                     int offset)
                              throws SQLException
        Description copied from interface: ProcessService
        Returns a list of all Process objects in the database
        Specified by:
        findAll in interface ProcessService
        Parameters:
        context - The relevant DSpace context
        limit - The limit for the amount of Processes returned
        offset - The offset for the Processes to be returned
        Returns:
        The list of all Process objects in the Database
        Throws:
        SQLException - If something goes wrong
      • findAllSortByScript

        public List<Process> findAllSortByScript​(Context context)
                                          throws SQLException
        Description copied from interface: ProcessService
        Returns a list of all Process objects in the database sorted by script name
        Specified by:
        findAllSortByScript in interface ProcessService
        Parameters:
        context - The relevant DSpace context
        Returns:
        The list of all Process objects in the database sorted by script name
        Throws:
        SQLException - If something goes wrong
      • findAllSortByStartTime

        public List<Process> findAllSortByStartTime​(Context context)
                                             throws SQLException
        Description copied from interface: ProcessService
        Returns a list of all Process objects in the database sorted by start time The most recent one will be shown first
        Specified by:
        findAllSortByStartTime in interface ProcessService
        Parameters:
        context - The relevant DSpace context
        Returns:
        The list of all Process objects sorted by start time
        Throws:
        SQLException - If something goes wrong
      • start

        public void start​(Context context,
                          Process process)
                   throws SQLException
        Description copied from interface: ProcessService
        This method will perform the logic needed to update the Process object in the database to represent a started state. A started state refers to ProcessStatus.RUNNING
        Specified by:
        start in interface ProcessService
        Parameters:
        context - The relevant DSpace context
        process - The Process object to be updated
        Throws:
        SQLException - If something goes wrong
      • fail

        public void fail​(Context context,
                         Process process)
                  throws SQLException
        Description copied from interface: ProcessService
        This method will perform the logic needed to update the Process object in the database to represent a failed state
        Specified by:
        fail in interface ProcessService
        Parameters:
        context - The relevant DSpace context
        process - The Process object to be updated
        Throws:
        SQLException - If something goes wrong
      • complete

        public void complete​(Context context,
                             Process process)
                      throws SQLException
        Description copied from interface: ProcessService
        This method will perform the logic needed to update the Process object in the database to represent a complete state
        Specified by:
        complete in interface ProcessService
        Parameters:
        context - The relevant DSpace context
        process - The Process object to be updated
        Throws:
        SQLException - If something goes wrong
      • delete

        public void delete​(Context context,
                           Process process)
                    throws SQLException
        Description copied from interface: ProcessService
        This method will delete the given Process object from the database
        Specified by:
        delete in interface ProcessService
        Parameters:
        context - The relevant DSpace context
        process - The Process object to be deleted
        Throws:
        SQLException - If something goes wrong
      • update

        public void update​(Context context,
                           Process process)
                    throws SQLException
        Description copied from interface: ProcessService
        This method will be used to update the given Process object in the database
        Specified by:
        update in interface ProcessService
        Parameters:
        context - The relevant DSpace context
        process - The Process object to be updated
        Throws:
        SQLException - If something goes wrong
      • getParameters

        public List<DSpaceCommandLineParameter> getParameters​(Process process)
        Description copied from interface: ProcessService
        This method will retrieve the list of parameters from the Process in its String format and it will parse these parameters to a list of DSpaceCommandLineParameter objects for better usability throughout DSpace
        Specified by:
        getParameters in interface ProcessService
        Parameters:
        process - The Process object for which we'll return the parameters
        Returns:
        The list of parsed parameters from the Process object
      • countTotal

        public int countTotal​(Context context)
                       throws SQLException
        Description copied from interface: ProcessService
        Returns the total amount of Process objects in the dataase
        Specified by:
        countTotal in interface ProcessService
        Parameters:
        context - The relevant DSpace context
        Returns:
        An integer that describes the amount of Process objects in the database
        Throws:
        SQLException - If something goes wrong