Package org.mycore.pi.handle
Class MCREpicService
-
Nested Class Summary
Nested classes/interfaces inherited from class org.mycore.pi.MCRPIJobService
MCRPIJobService.PiJobAction
-
Field Summary
Modifier and TypeFieldDescriptionThis is a alternative to mcr.baseurl mostly for testing purposesThe url to the actual epic api endpoint e.g. https://epic.grnet.gr/api/v2/, http://pid.gwdg.de/static final String
The Index which should be used in the handle object.The Type which should be used in the Handle Object.static final String
The password which will be used by the epic clientThis can be used to store metadata as a Handle Object.The Username which will be used by the epic clientFields inherited from class org.mycore.pi.MCRPIJobService
CREATION_PREDICATE, JOB_API_USER_PROPERTY, REGISTRATION_PREDICATE
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
-
Method Summary
Modifier and TypeMethodDescriptionprotected void
Should handle deletion of a Object with the PI.protected void
getJobInformation
(Map<String, String> contextParameters) Result of this will be passed toMCRJobAction.name()
protected String
getURLForObject
(String objectId) insertIdentifierToDatabase
(MCRBase obj, String additional, MCRHandle identifier) protected void
registerIdentifier
(MCRBase obj, String additional, MCRHandle pi) protected void
registerJob
(Map<String, String> parameters) protected void
Should handle updates of a Object with the PI.protected void
Methods inherited from class org.mycore.pi.MCRPIJobService
addDeleteJob, addRegisterJob, addUpdateJob, checkConfiguration, getAction, getRegistrationCondition, parseIdentifier, rollbackDeleteJob, rollbackRegisterJob, rollbackUpdateJob, runAsJobUser, updateRegistrationDate, updateStartRegistrationDate, validateJobUserRights
Methods inherited from class org.mycore.pi.MCRPIService
addFlagToObject, getCreationPredicate, getGenerator, getGson, getMetadataService, getNewIdentifier, getPredicateInstance, getProperties, getRegistrationPredicate, getServiceID, getTableEntry, getType, hasFlag, hasFlag, hasRegistrationStarted, init, isCreated, isRegistered, onDelete, onUpdate, provideRegisterDate, register, register, register, removeFlagFromObject, requireNotEmptyProperty, setProperties, updateFlag, updateFlagsInDatabase, validateAlreadyCreated, validatePermission, validateRegistration, validateRegistration
-
Field Details
-
EPIC_KEY
- See Also:
-
OBJECT_ID_KEY
- See Also:
-
username
The Username which will be used by the epic client -
password
The password which will be used by the epic client -
endpoint
The url to the actual epic api endpoint e.g. https://epic.grnet.gr/api/v2/, http://pid.gwdg.de/ -
baseURL
This is a alternative to mcr.baseurl mostly for testing purposes -
transformerID
This can be used to store metadata as a Handle Object. The Transformer will be used to convert the Object to an String. -
metadataType
The Type which should be used in the Handle Object. -
metadataIndex
The Index which should be used in the handle object. -
idLockMap
-
-
Constructor Details
-
MCREpicService
public MCREpicService()
-
-
Method Details
-
insertIdentifierToDatabase
- Overrides:
insertIdentifierToDatabase
in classMCRPIService<MCRHandle>
-
registerIdentifier
protected void registerIdentifier(MCRBase obj, String additional, MCRHandle pi) throws MCRPersistentIdentifierException - Specified by:
registerIdentifier
in classMCRPIService<MCRHandle>
- Throws:
MCRPersistentIdentifierException
-
delete
protected void delete(MCRHandle 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<MCRHandle>
- 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(MCRHandle 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<MCRHandle>
- Parameters:
identifier
- the Identifierobj
- the deleted object- Throws:
MCRPersistentIdentifierException
- to abort update of the object or if something went wrong.
-
deleteJob
- Specified by:
deleteJob
in classMCRPIJobService<MCRHandle>
- Throws:
MCRPersistentIdentifierException
-
updateJob
- Specified by:
updateJob
in classMCRPIJobService<MCRHandle>
- Throws:
MCRPersistentIdentifierException
-
getURLForObject
-
registerJob
- Specified by:
registerJob
in classMCRPIJobService<MCRHandle>
- Throws:
MCRPersistentIdentifierException
-
getJobInformation
Description copied from class:MCRPIJobService
Result of this will be passed toMCRJobAction.name()
- Specified by:
getJobInformation
in classMCRPIJobService<MCRHandle>
- Parameters:
contextParameters
- the parameters of the job- Returns:
- Some Information what this job will do or just
Optional.empty()
, then a default message is generated.
-