Package org.dspace.identifier.doi
Interface DOIConnector
-
- All Known Implementing Classes:
DataCiteConnector
public interface DOIConnectorA DOIConnector handles all calls to the API of your DOI registry. A DOIConnector should care about rules of the registration agency. For example, if the registration agency wants us to reserve a DOI before we can register it, the DOIConnector should check if a DOI is reserved. Use aDOIIdentifierException. and set its error code in case of any errors. For the given example you should useDOIIdentifierException.RESERVE_FIRSTas error code.- Author:
- Pascal-Nicolas Becker
-
-
Method Summary
All Methods Instance Methods Abstract Methods Modifier and Type Method Description voiddeleteDOI(Context context, String doi)Sends the DELETE-Request to the DOI registry.booleanisDOIRegistered(Context context, String doi)booleanisDOIReserved(Context context, String doi)voidregisterDOI(Context context, DSpaceObject dso, String doi)Sends a request to the DOI registry to register a DOI.voidreserveDOI(Context context, DSpaceObject dso, String doi)Sends a request to the DOI registry to reserve a DOI.voidupdateMetadata(Context context, DSpaceObject dso, String doi)Sends a request to the DOI registry to update metadata for a DOI.
-
-
-
Method Detail
-
isDOIReserved
boolean isDOIReserved(Context context, String doi) throws DOIIdentifierException
- Throws:
DOIIdentifierException
-
isDOIRegistered
boolean isDOIRegistered(Context context, String doi) throws DOIIdentifierException
- Throws:
DOIIdentifierException
-
deleteDOI
void deleteDOI(Context context, String doi) throws DOIIdentifierException
Sends the DELETE-Request to the DOI registry.This method sends a request to "delete" a DOI. As DOIs are persistent identifiers they should never be deleted. For example, if you send a HTTP DELETE request to the DataCite Metadata API directly, it will set the DOI to inactive.
- Parameters:
context- The relevant DSpace Context.doi- DOI string to "delete"- Throws:
DOIIdentifierException- if DOI error
-
reserveDOI
void reserveDOI(Context context, DSpaceObject dso, String doi) throws DOIIdentifierException
Sends a request to the DOI registry to reserve a DOI. The DOIConnector should check weather this DOI is reserved for another object already. In this case it should throw anDOIIdentifierException. DOIIdentifierException} and set the error code toDOIIdentifierException.DOI_ALREADY_EXISTS.- Parameters:
context- The relevant DSpace Context.dso- DSpace object to associate to the DOIdoi- DOI string to reserve- Throws:
DOIIdentifierException- if DOI error
-
registerDOI
void registerDOI(Context context, DSpaceObject dso, String doi) throws DOIIdentifierException
Sends a request to the DOI registry to register a DOI. The DOIConnector ensures compliance with the workflow of the registration agency. For example, if a DOI has to be reserved before it can be registered the DOIConnector has to check if it is reserved. In this case you can throw anDOIIdentifierException. and set the error code toDOIIdentifierException.RESERVE_FIRST.- Parameters:
context- The relevant DSpace Context.dso- DSpace object to associate to the DOIdoi- DOI string to register- Throws:
DOIIdentifierException- if DOI error
-
updateMetadata
void updateMetadata(Context context, DSpaceObject dso, String doi) throws DOIIdentifierException
Sends a request to the DOI registry to update metadata for a DOI. The DOIConnector should check weather the DOI is reserved or registered for the specified DSpace Object before it sends the metadata update.- Parameters:
context- The relevant DSpace Context.dso- DSpace object associated to the DOIdoi- DOI string to update (metadata)- Throws:
DOIIdentifierException- if DOI error
-
-