Last active
August 29, 2015 14:11
-
-
Save mdoering/a48969081957c13b4d36 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
package org.gbif.registry.doi; | |
import org.gbif.api.model.common.DOI; | |
import org.gbif.doi.metadata.datacite.DataCiteMetadata; | |
import java.util.UUID; | |
/** | |
* Registry internal service that guarantees to issue unique new DOIs and deals with scheduling | |
* DOI metadata updates and registration via RabbitMQ. | |
*/ | |
public interface DoiGenerator { | |
/** | |
* Generates a new unique GBIF dataset DOI. | |
* The new DOI is unknown to DataCite still and only lives in the GBIF registry which guarantees it to be unique. | |
* @return the new DOI | |
*/ | |
DOI newDatasetDOI(); | |
/** | |
* Generates a new unique GBIF download DOI. | |
* The new DOI is unknown to DataCite still and only lives in the GBIF registry which guarantees it to be unique. | |
* @return the new DOI | |
*/ | |
DOI newDownloadDOI(); | |
/** | |
* Schedules a DOI metadata update with DataCite and registers the DOI if needed. | |
* For subsequent calls with the same DOI only the metadata in DataCite will be updated. | |
* If it is called for the very first time the DOI will also be properly registered with DataCite. | |
* | |
* @param doi the GBIF DOI to register | |
* @param metadata the metadata to post to datacite. Mandatory fields are validated immediately | |
* @param datasetKey the dataset key to derive the target URL from | |
* | |
* @throws IllegalArgumentException in case the metadata is missing mandatory fields or the DOI is not a GBIF one | |
*/ | |
void register(DOI doi, DataCiteMetadata metadata, UUID datasetKey) throws IllegalArgumentException; | |
/** | |
* Schedules a DOI metadata update with DataCite and registers the DOI if needed. | |
* For subsequent calls with the same DOI only the metadata in DataCite will be updated. | |
* If it is called for the very first time the DOI will also be properly registered with DataCite. | |
* | |
* @param doi the GBIF DOI to register | |
* @param metadata the metadata to post to datacite. Mandatory fields are validated immediately | |
* @param downloadKey the download key to derive the target URL from | |
* | |
* @throws IllegalArgumentException in case the metadata is missing mandatory fields or the DOI is not a GBIF one | |
*/ | |
void register(DOI doi, DataCiteMetadata metadata, String downloadKey) throws IllegalArgumentException; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Is there any reason not to do this more generically?
DOI newDOI();
void register(DOI doi, DataCiteMetadata metadata, URI target);