Package org.mycore.impex
Class MCRTransferPackagePacker
java.lang.Object
org.mycore.services.packaging.MCRPacker
org.mycore.impex.MCRTransferPackagePacker
Using the
MCRPacker
API to build a MCRTransferPackage
.- Author:
- Matthias Eichner, Silvio Hermann
-
Field Summary
Fields inherited from class org.mycore.services.packaging.MCRPacker
PACKER_CONFIGURATION_PREFIX
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionvoid
should check if all required parameters are set!protected MCRObject
Returns the source object.getTarPath
(MCRTransferPackage transferPackage) Returns the path to the tar archive where the transfer package will be stored.void
pack()
This method will be called and the MCRPacker should start packing according to theMCRPacker.getConfiguration()
andMCRPacker.getParameters()
!void
rollback()
This method can be called in case of error and the MCRPacker should clean up trash fromMCRPacker.pack()
Methods inherited from class org.mycore.services.packaging.MCRPacker
getConfiguration, getParameters
-
Constructor Details
-
MCRTransferPackagePacker
public MCRTransferPackagePacker()
-
-
Method Details
-
checkSetup
Description copied from class:MCRPacker
should check if all required parameters are set!- Specified by:
checkSetup
in classMCRPacker
- Throws:
MCRUsageException
- if parameters are illegal
-
getSource
Returns the source object.- Returns:
- mycore object which should be packed
- Throws:
MCRUsageException
- something went wrong
-
pack
Description copied from class:MCRPacker
This method will be called and the MCRPacker should start packing according to theMCRPacker.getConfiguration()
andMCRPacker.getParameters()
!
WARNING: do all checks for parameters and user access inMCRPacker.checkSetup()
, because the packer is already stored in the DB ifpack
is called and the pack JOB runs a System-User instead of the User who produces the call.- Specified by:
pack
in classMCRPacker
- Throws:
ExecutionException
- Unable to pack
-
rollback
public void rollback()Description copied from class:MCRPacker
This method can be called in case of error and the MCRPacker should clean up trash fromMCRPacker.pack()
-
getTarPath
Returns the path to the tar archive where the transfer package will be stored.- Returns:
- path to the *.tar location
-