Class RestDSpaceRunnableHandler
java.lang.Object
org.dspace.app.rest.scripts.handler.impl.RestDSpaceRunnableHandler
- All Implemented Interfaces:
DSpaceRunnableHandler
The
DSpaceRunnableHandler dealing with Scripts started from the REST api-
Constructor Summary
ConstructorsConstructorDescriptionRestDSpaceRunnableHandler(EPerson ePerson, String scriptName, List<DSpaceCommandLineParameter> parameters, Set<Group> specialGroups) This constructor will initialise the handler with the process created from the parameters -
Method Summary
Modifier and TypeMethodDescriptiongetFileStream(Context context, String fileName) getProcess(Context context) This method will return the process created by this handlervoidvoidvoidhandleException(String message) voidhandleException(String message, Exception e) voidvoidvoidvoidvoidlogWarning(String message) voidvoidschedule(DSpaceRunnable script) This method will schedule a process to be run, it will trigger the run method for the Script passed along to this method as well as updating the database logic for the Process representing the execution of this scriptvoidstart()voidwriteFilestream(Context context, String fileName, InputStream inputStream, String type)
-
Constructor Details
-
RestDSpaceRunnableHandler
public RestDSpaceRunnableHandler(EPerson ePerson, String scriptName, List<DSpaceCommandLineParameter> parameters, Set<Group> specialGroups) This constructor will initialise the handler with the process created from the parameters- Parameters:
ePerson- The eperson that creates the processscriptName- The name of the script for which is a process will be createdparameters- The parameters for this processspecialGroups- specialGroups The list of special groups related to eperson creating process at process creation time
-
-
Method Details
-
start
public void start()- Specified by:
startin interfaceDSpaceRunnableHandler
-
handleCompletion
public void handleCompletion()- Specified by:
handleCompletionin interfaceDSpaceRunnableHandler
-
handleException
- Specified by:
handleExceptionin interfaceDSpaceRunnableHandler
-
handleException
- Specified by:
handleExceptionin interfaceDSpaceRunnableHandler
-
handleException
- Specified by:
handleExceptionin interfaceDSpaceRunnableHandler
-
logDebug
- Specified by:
logDebugin interfaceDSpaceRunnableHandler
-
logInfo
- Specified by:
logInfoin interfaceDSpaceRunnableHandler
-
logWarning
- Specified by:
logWarningin interfaceDSpaceRunnableHandler
-
logError
- Specified by:
logErrorin interfaceDSpaceRunnableHandler
-
logError
- Specified by:
logErrorin interfaceDSpaceRunnableHandler
-
printHelp
- Specified by:
printHelpin interfaceDSpaceRunnableHandler
-
getFileStream
public Optional<InputStream> getFileStream(Context context, String fileName) throws IOException, AuthorizeException - Specified by:
getFileStreamin interfaceDSpaceRunnableHandler- Throws:
IOExceptionAuthorizeException
-
writeFilestream
public void writeFilestream(Context context, String fileName, InputStream inputStream, String type) throws IOException, SQLException, AuthorizeException - Specified by:
writeFilestreamin interfaceDSpaceRunnableHandler- Throws:
IOExceptionSQLExceptionAuthorizeException
-
getProcess
This method will return the process created by this handler- Parameters:
context-- Returns:
- The Process database object created by this handler
-
schedule
This method will schedule a process to be run, it will trigger the run method for the Script passed along to this method as well as updating the database logic for the Process representing the execution of this script- Parameters:
script- The script to be ran
-
getSpecialGroups
- Specified by:
getSpecialGroupsin interfaceDSpaceRunnableHandler
-