Package org.dspace.identifier.service
Interface DOIService
- All Known Implementing Classes:
DOIServiceImpl
public interface DOIService
Service interface class for the
DOI object.
The implementation of this class is responsible for all business logic calls
for the DOI object and is autowired by Spring.- Author:
- kevinvandevelde at atmire.com
-
Method Summary
Modifier and TypeMethodDescriptionCreate a new DOI in storage.voidDeletes the givenDOI.DOIFromExternalFormat(String identifier) Convert an HTTP DOI URL (https://doi.org/10.something) to a "doi:" URI.DOIToExternalForm(String identifier) This method helps to convert a DOI into a URL.Retrieves the full list ofDOIs currently in storage.Find a specific DOI in storage.findDOIByDSpaceObject(Context context, DSpaceObject dso) Find the DOI assigned to a given DSpace Object.findDOIByDSpaceObject(Context context, DSpaceObject dso, List<Integer> statusToExclude) Find the DOI assigned to a given DSpace Object, unless it has one of a given set of statuses.formatIdentifier(String identifier) Recognize format of DOI and return it with leading doi-Scheme.getDOIsByStatus(Context context, List<Integer> statuses) Find all DOIs that have one of a given set of statuses.Get the URL stem of the DOI resolver, e.g.getSimilarDOIsNotInState(Context context, String doiPattern, List<Integer> statuses, boolean dsoIsNotNull) Find all DOIs that are similar to the specified pattern and not in the specified states.voidUpdate a DOI in storage.
-
Method Details
-
update
Update a DOI in storage.- Parameters:
context- current DSpace session.doi- the DOI to persist.- Throws:
SQLException- passed through.
-
create
Create a new DOI in storage.- Parameters:
context- current DSpace session.- Returns:
- the new DOI.
- Throws:
SQLException- passed through.
-
delete
Deletes the givenDOI.- Parameters:
context- current DSpace session.- Throws:
SQLException- passed through.
-
findAll
Retrieves the full list ofDOIs currently in storage.- Parameters:
context- current DSpace session.- Returns:
- The list of all DOIs currently in storage.
- Throws:
SQLException- passed through.
-
findByDoi
Find a specific DOI in storage.- Parameters:
context- current DSpace session.doi- string representation of the DOI.- Returns:
- the DOI object found.
- Throws:
SQLException- passed through, can mean none found.
-
findDOIByDSpaceObject
Find the DOI assigned to a given DSpace Object.- Parameters:
context- current DSpace session.dso- The DSpace Object.- Returns:
- the DSO's DOI.
- Throws:
SQLException- passed through.
-
findDOIByDSpaceObject
DOI findDOIByDSpaceObject(Context context, DSpaceObject dso, List<Integer> statusToExclude) throws SQLException Find the DOI assigned to a given DSpace Object, unless it has one of a given set of statuses.- Parameters:
context- current DSpace context.dso- the DSpace Object.statusToExclude- uninteresting statuses.- Returns:
- the DSO's DOI.
- Throws:
SQLException- passed through.
-
DOIToExternalForm
This method helps to convert a DOI into a URL. It takes DOIs in one of the following formats and returns it as URL (f.e. http://dx.doi.org/10.123/456). Allowed formats are:- doi:10.123/456
- 10.123/456
- http://dx.doi.org/10.123/456
- Parameters:
identifier- A DOI that should be returned in external form.- Returns:
- A String containing a URL to the official DOI resolver.
- Throws:
IllegalArgumentException- If identifier is null or an empty String.IdentifierException- If identifier could not be recognized as valid DOI.
-
DOIFromExternalFormat
Convert an HTTP DOI URL (https://doi.org/10.something) to a "doi:" URI.- Parameters:
identifier- HTTP URL- Returns:
- DOI URI
- Throws:
DOIIdentifierException- ifidentifieris not recognizable.
-
formatIdentifier
Recognize format of DOI and return it with leading doi-Scheme.- Parameters:
identifier- Identifier to format, following format are accepted: f.e. 10.123/456, doi:10.123/456, http://dx.doi.org/10.123/456.- Returns:
- Given Identifier with DOI-Scheme, f.e. doi:10.123/456.
- Throws:
IllegalArgumentException- If identifier is empty or null.DOIIdentifierException- If DOI could not be recognized.
-
getDOIsByStatus
Find all DOIs that have one of a given set of statuses.- Parameters:
context- current DSpace session.statuses- desired statuses.- Returns:
- all DOIs having any of the given statuses.
- Throws:
SQLException- passed through.
-
getSimilarDOIsNotInState
List<DOI> getSimilarDOIsNotInState(Context context, String doiPattern, List<Integer> statuses, boolean dsoIsNotNull) throws SQLException Find all DOIs that are similar to the specified pattern and not in the specified states.- Parameters:
context- DSpace contextdoiPattern- The pattern, e.g. "10.5072/123.%"statuses- The statuses the DOI should not be in, @{link DOIIdentifierProvider.DELETED}.dsoIsNotNull- Boolean whether all DOIs should be excluded where the DSpaceObject is NULL.- Returns:
- null or a list of DOIs
- Throws:
SQLException- if database error
-
getResolver
String getResolver()Get the URL stem of the DOI resolver, e.g. "https://doi.org/".- Returns:
- URL to the DOI resolver.
-