Package org.mycore.services.packaging
Class MCRPacker
java.lang.Object
org.mycore.services.packaging.MCRPacker
- Direct Known Subclasses:
MCRTransferPackagePacker
Base class for every Packer. You should implement
pack()
and rollback()
.
The will be initialized two times. One time to just call checkSetup()
and one time to pack()
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract void
should check if all required parameters are set!abstract void
pack()
This method will be called and the MCRPacker should start packing according to thegetConfiguration()
andgetParameters()
!abstract void
rollback()
This method can be called in case of error and the MCRPacker should clean up trash frompack()
-
Field Details
-
PACKER_CONFIGURATION_PREFIX
- See Also:
-
-
Constructor Details
-
MCRPacker
public MCRPacker()
-
-
Method Details
-
checkSetup
should check if all required parameters are set!- Throws:
MCRUsageException
- if parameters are illegalMCRAccessException
- if the Users doesn't have the rights to use the Packer
-
pack
This method will be called and the MCRPacker should start packing according to thegetConfiguration()
andgetParameters()
!
WARNING: do all checks for parameters and user access incheckSetup()
, 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.- Throws:
ExecutionException
- Unable to pack
-
rollback
public abstract void rollback()This method can be called in case of error and the MCRPacker should clean up trash frompack()
-
getConfiguration
- Returns:
- a unmodifiable map with all properties (MCR.Packaging.Packer.MyPackerID. prefix will be removed from key) of this packer-id.
-
getParameters
- Returns:
- a unmodifiable map with parameters of a specific
MCRPackerJobAction
.
-