Package org.dspace.scripts.handler.impl
Class CommandLineDSpaceRunnableHandler
java.lang.Object
org.dspace.scripts.handler.impl.CommandLineDSpaceRunnableHandler
- All Implemented Interfaces:
DSpaceRunnableHandler
This is an implementation for the CommandLineDSpaceRunnables which means that these implementations
are used by DSpaceRunnables which are called from the CommandLine
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptiongetFileStream(Context context, String fileName) This method will grab the InputStream for the file defined by the given file name.This method will return a List of UUIDs for the special groups associated with the processId contained by specific implementations of this interface.voidThis method handles the completion of the scriptvoidThis method handles an exception thrown by the scriptvoidhandleException(String message) This method handles an exception thrown by the scriptvoidhandleException(String message, Exception e) This method handles an exception thrown by the scriptvoidThis method will perform the debug logging of the message givenvoidThis method will perform the error logging of the message givenvoidThis method will perform the error logging of the message given along with a stack tracevoidThis method will perform the info logging of the message givenvoidlogWarning(String message) This method will perform the warning logging of the message givenvoidThis method will print the help for the options and namevoidstart()This method handles the start of the scriptvoidwriteFilestream(Context context, String fileName, InputStream inputStream, String type) This method will write the InputStream to either a file on the filesystem or a bitstream in the database depending on whether it's coming from a CommandLine call or REST call respectively
-
Constructor Details
-
CommandLineDSpaceRunnableHandler
public CommandLineDSpaceRunnableHandler()
-
-
Method Details
-
start
public void start()Description copied from interface:DSpaceRunnableHandlerThis method handles the start of the script- Specified by:
startin interfaceDSpaceRunnableHandler
-
handleCompletion
public void handleCompletion()Description copied from interface:DSpaceRunnableHandlerThis method handles the completion of the script- Specified by:
handleCompletionin interfaceDSpaceRunnableHandler
-
handleException
Description copied from interface:DSpaceRunnableHandlerThis method handles an exception thrown by the script- Specified by:
handleExceptionin interfaceDSpaceRunnableHandler- Parameters:
e- The exception thrown by the script
-
handleException
Description copied from interface:DSpaceRunnableHandlerThis method handles an exception thrown by the script- Specified by:
handleExceptionin interfaceDSpaceRunnableHandler- Parameters:
message- The String message for the exception thrown by the script
-
handleException
Description copied from interface:DSpaceRunnableHandlerThis method handles an exception thrown by the script- Specified by:
handleExceptionin interfaceDSpaceRunnableHandler- Parameters:
message- The String message for the exception thrown by the scripte- The exception thrown by the script
-
logDebug
Description copied from interface:DSpaceRunnableHandlerThis method will perform the debug logging of the message given- Specified by:
logDebugin interfaceDSpaceRunnableHandler- Parameters:
message- The message to be logged as debug
-
logInfo
Description copied from interface:DSpaceRunnableHandlerThis method will perform the info logging of the message given- Specified by:
logInfoin interfaceDSpaceRunnableHandler- Parameters:
message- The message to be logged as info
-
logWarning
Description copied from interface:DSpaceRunnableHandlerThis method will perform the warning logging of the message given- Specified by:
logWarningin interfaceDSpaceRunnableHandler- Parameters:
message- The message to be logged as warning
-
logError
Description copied from interface:DSpaceRunnableHandlerThis method will perform the error logging of the message given- Specified by:
logErrorin interfaceDSpaceRunnableHandler- Parameters:
message- The message to be logged as an error
-
logError
Description copied from interface:DSpaceRunnableHandlerThis method will perform the error logging of the message given along with a stack trace- Specified by:
logErrorin interfaceDSpaceRunnableHandler- Parameters:
message- The message to be logged as an errorthrowable- The original exception
-
printHelp
Description copied from interface:DSpaceRunnableHandlerThis method will print the help for the options and name- Specified by:
printHelpin interfaceDSpaceRunnableHandler- Parameters:
options- The options for the scriptname- The name of the script
-
getFileStream
Description copied from interface:DSpaceRunnableHandlerThis method will grab the InputStream for the file defined by the given file name. The exact implementation will differ based on whether it's a REST call or CommandLine call. The REST Call will look for Bitstreams in the Database whereas the CommandLine call will look on the filesystem- Specified by:
getFileStreamin interfaceDSpaceRunnableHandler- Parameters:
context- The relevant DSpace contextfileName- The filename for the file that holds the InputStream- Returns:
- The InputStream for the file defined by the given file name
- Throws:
IOException- If something goes wrong
-
writeFilestream
public void writeFilestream(Context context, String fileName, InputStream inputStream, String type) throws IOException Description copied from interface:DSpaceRunnableHandlerThis method will write the InputStream to either a file on the filesystem or a bitstream in the database depending on whether it's coming from a CommandLine call or REST call respectively- Specified by:
writeFilestreamin interfaceDSpaceRunnableHandler- Parameters:
context- The relevant DSpace contextfileName- The filenameinputStream- The inputstream to be writtentype- The type of the file- Throws:
IOException- If something goes wrong
-
getSpecialGroups
Description copied from interface:DSpaceRunnableHandlerThis method will return a List of UUIDs for the special groups associated with the processId contained by specific implementations of this interface. Otherwise, it returns an empty collection.- Specified by:
getSpecialGroupsin interfaceDSpaceRunnableHandler- Returns:
- List containing UUIDs of Special Groups of the associated Process.
-