Package org.mycore.pi.urn.rest
Class MCRURNGranularRESTService
Service for assigning granular URNs to Derivate. You can call it with a Derivate-ID and it will assign a Base-URN for
the Derivate and granular URNs for every file in the Derivate (except IgnoreFileNames). If you then add a file to
Derivate you can call with Derivate-ID and additional path of the file. E.g. mir_derivate_00000060 and /image1.jpg
Inscriber is ignored with this MCRPIService
- IgnoreFileNames
- Comma seperated list of regex file which should not have a urn assigned. Default: mets\\.xml
-
Nested Class Summary
Nested Classes -
Field Summary
Fields inherited from class org.mycore.pi.MCRPIService
GENERATOR_CONFIG_PREFIX, GENERATOR_PROPERTY_KEY, METADATA_SERVICE_CONFIG_PREFIX, METADATA_SERVICE_PROPERTY_KEY, PI_FLAG, REGISTRATION_CONFIG_PREFIX, TRANSLATE_PREFIX
-
Constructor Summary
ConstructorsConstructorDescriptionMCRURNGranularRESTService
(Function<MCRDerivate, Stream<MCRPath>> derivateFileStreamFunc) -
Method Summary
Modifier and TypeMethodDescriptioncreateNewURN
(MCRDerivate deriv) protected void
Should handle deletion of a Object with the PI.Validates everything, registers a new Identifier, inserts the identifier to object metadata and writes a information to the Database.protected void
registerIdentifier
(MCRBase obj, String additional, MCRDNBURN urn) protected void
Should handle updates of a Object with the PI.void
updateFlag
(MCRObjectID id, String additional, MCRPI mcrpi) Methods inherited from class org.mycore.pi.MCRPIService
addFlagToObject, checkConfiguration, getCreationPredicate, getGenerator, getGson, getMetadataService, getNewIdentifier, getPredicateInstance, getProperties, getRegistrationPredicate, getServiceID, getTableEntry, getType, hasFlag, hasFlag, hasRegistrationStarted, init, insertIdentifierToDatabase, isCreated, isRegistered, onDelete, onUpdate, provideRegisterDate, register, register, removeFlagFromObject, requireNotEmptyProperty, setProperties, updateFlagsInDatabase, validateAlreadyCreated, validatePermission, validateRegistration, validateRegistration
-
Constructor Details
-
MCRURNGranularRESTService
public MCRURNGranularRESTService() -
MCRURNGranularRESTService
-
-
Method Details
-
register
public MCRDNBURN register(MCRBase obj, String filePath, boolean updateObject) throws MCRAccessException, MCRActiveLinkException, MCRPersistentIdentifierException Description copied from class:MCRPIService
Validates everything, registers a new Identifier, inserts the identifier to object metadata and writes a information to the Database.- Overrides:
register
in classMCRPIService<MCRDNBURN>
- Parameters:
obj
- the object which has to be identifiedfilePath
- additional information for the persistent identifierupdateObject
- if true this method callsMCRMetadataManager.update(MCRBase)
- Returns:
- the assigned Identifier
- Throws:
MCRAccessException
- the current User doesn't have the rights to insert the Identifier to MetadataMCRActiveLinkException
- theMCRPIMetadataService
letsMCRMetadataManager.update(MCRObject)
throw thisMCRPersistentIdentifierException
- seeorg.mycore.pi.exceptions
-
createNewURN
-
registerIdentifier
protected void registerIdentifier(MCRBase obj, String additional, MCRDNBURN urn) throws MCRPersistentIdentifierException - Specified by:
registerIdentifier
in classMCRPIService<MCRDNBURN>
- Throws:
MCRPersistentIdentifierException
-
delete
protected void delete(MCRDNBURN identifier, MCRBase obj, String additional) throws MCRPersistentIdentifierException Description copied from class:MCRPIService
Should handle deletion of a Object with the PI. E.g. TheMCRDOIService
sets the active flag in Datacite datacentre to false.- Specified by:
delete
in classMCRPIService<MCRDNBURN>
- Parameters:
identifier
- the Identifierobj
- the deleted object- Throws:
MCRPersistentIdentifierException
- to abort deletion of the object or if something went wrong, (e.g.MCRDOIService
throws if not a superuser tries to delete the object)
-
update
protected void update(MCRDNBURN identifier, MCRBase obj, String additional) throws MCRPersistentIdentifierException Description copied from class:MCRPIService
Should handle updates of a Object with the PI. E.g. TheMCRDOIService
sends the updated metadata to the Datacite datacentre.- Specified by:
update
in classMCRPIService<MCRDNBURN>
- Parameters:
identifier
- the Identifierobj
- the deleted object- Throws:
MCRPersistentIdentifierException
- to abort update of the object or if something went wrong.
-
updateFlag
- Overrides:
updateFlag
in classMCRPIService<MCRDNBURN>
-