Package org.dspace.scripts.service
Interface ProcessService
-
- All Known Implementing Classes:
ProcessServiceImpl
public interface ProcessServiceAn interface for the ProcessService with methods regarding the Process workload
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voidcomplete(Context context, Process process)This method will perform the logic needed to update the Process object in the database to represent a complete stateintcountTotal(Context context)Returns the total amount of Process objects in the dataaseProcesscreate(Context context, EPerson ePerson, String scriptName, List<DSpaceCommandLineParameter> parameters)This method will create a Process object in the databasevoiddelete(Context context, Process process)This method will delete the given Process object from the databasevoidfail(Context context, Process process)This method will perform the logic needed to update the Process object in the database to represent a failed stateProcessfind(Context context, int processId)This method will retrieve a Process object from the Database with the given IDList<Process>findAll(Context context)Returns a list of all Process objects in the databaseList<Process>findAll(Context context, int limit, int offset)Returns a list of all Process objects in the databaseList<Process>findAllSortByScript(Context context)Returns a list of all Process objects in the database sorted by script nameList<Process>findAllSortByStartTime(Context context)Returns a list of all Process objects in the database sorted by start time The most recent one will be shown firstList<DSpaceCommandLineParameter>getParameters(Process process)This method will retrieve the list of parameters from the Process in its String format and it will parse these parameters to a list ofDSpaceCommandLineParameterobjects for better usability throughout DSpacevoidstart(Context context, Process process)This method will perform the logic needed to update the Process object in the database to represent a started state.voidupdate(Context context, Process process)This method will be used to update the given Process object in the database
-
-
-
Method Detail
-
create
Process create(Context context, EPerson ePerson, String scriptName, List<DSpaceCommandLineParameter> parameters) throws SQLException
This method will create a Process object in the database- Parameters:
context- The relevant DSpace contextePerson- The ePerson for which this process will be created onscriptName- The script name to be used for the processparameters- The parameters to be used for the process- Returns:
- The created process
- Throws:
SQLException- If something goes wrong
-
find
Process find(Context context, int processId) throws SQLException
This method will retrieve a Process object from the Database with the given ID- Parameters:
context- The relevant DSpace contextprocessId- 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
List<Process> findAll(Context context) throws SQLException
Returns a list of all Process objects in the database- Parameters:
context- The relevant DSpace context- Returns:
- The list of all Process objects in the Database
- Throws:
SQLException- If something goes wrong
-
findAll
List<Process> findAll(Context context, int limit, int offset) throws SQLException
Returns a list of all Process objects in the database- Parameters:
context- The relevant DSpace contextlimit- The limit for the amount of Processes returnedoffset- 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
List<Process> findAllSortByScript(Context context) throws SQLException
Returns a list of all Process objects in the database sorted by script name- 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
List<Process> findAllSortByStartTime(Context context) throws SQLException
Returns a list of all Process objects in the database sorted by start time The most recent one will be shown first- Parameters:
context- The relevant DSpace context- Returns:
- The list of all Process objects sorted by start time
- Throws:
SQLException- If something goes wrong
-
start
void start(Context context, Process process) throws SQLException
This method will perform the logic needed to update the Process object in the database to represent a started state. A started state refers toProcessStatus.RUNNING- Parameters:
context- The relevant DSpace contextprocess- The Process object to be updated- Throws:
SQLException- If something goes wrong
-
fail
void fail(Context context, Process process) throws SQLException
This method will perform the logic needed to update the Process object in the database to represent a failed state- Parameters:
context- The relevant DSpace contextprocess- The Process object to be updated- Throws:
SQLException- If something goes wrong
-
complete
void complete(Context context, Process process) throws SQLException
This method will perform the logic needed to update the Process object in the database to represent a complete state- Parameters:
context- The relevant DSpace contextprocess- The Process object to be updated- Throws:
SQLException- If something goes wrong
-
delete
void delete(Context context, Process process) throws SQLException
This method will delete the given Process object from the database- Parameters:
context- The relevant DSpace contextprocess- The Process object to be deleted- Throws:
SQLException- If something goes wrong
-
update
void update(Context context, Process process) throws SQLException
This method will be used to update the given Process object in the database- Parameters:
context- The relevant DSpace contextprocess- The Process object to be updated- Throws:
SQLException- If something goes wrong
-
getParameters
List<DSpaceCommandLineParameter> getParameters(Process process)
This method will retrieve the list of parameters from the Process in its String format and it will parse these parameters to a list ofDSpaceCommandLineParameterobjects for better usability throughout DSpace- Parameters:
process- The Process object for which we'll return the parameters- Returns:
- The list of parsed parameters from the Process object
-
countTotal
int countTotal(Context context) throws SQLException
Returns the total amount of Process objects in the dataase- 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
-
-