Package edu.ucsb.nceas.metacat.doi
Class DOIService
java.lang.Object
edu.ucsb.nceas.metacat.doi.DOIService
- Direct Known Subclasses:
EzidDOIService
,OstiDOIService
An abstract class for the DOI service
- Author:
- tao
-
Field Summary
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionabstract org.dataone.service.types.v1.Identifier
Generate a DOI using the DOI service as configuredprotected String
getLandingPage
(org.dataone.service.types.v1.Identifier identifier) Get the landing page url string for the given identifierabstract void
publishIdentifier
(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier identifier) Make the status of the identifier to be publicvoid
Refresh the status (enable or disable) of the DOI service from property fileboolean
registerDOI
(org.dataone.service.types.v2.SystemMetadata sysmeta) Submits DOI metadata information about the object to DOI servicesprotected abstract void
submitDOIMetadata
(org.dataone.service.types.v1.Identifier identifier, org.dataone.service.types.v2.SystemMetadata sysMeta) Submit the doi metadata for the given id.
-
Field Details
-
PRIMARY_SHOULDER_INDEX
protected static final int PRIMARY_SHOULDER_INDEX- See Also:
-
doiEnabled
protected static boolean doiEnabled -
serviceBaseUrl
-
username
-
password
-
uriTemplate
-
autoPublishDOI
protected static boolean autoPublishDOI -
shoulderMap
-
-
Constructor Details
-
DOIService
public DOIService()Constructor
-
-
Method Details
-
refreshStatus
public void refreshStatus() throws edu.ucsb.nceas.utilities.PropertyNotFoundExceptionRefresh the status (enable or disable) of the DOI service from property file- Throws:
edu.ucsb.nceas.utilities.PropertyNotFoundException
-
getLandingPage
Get the landing page url string for the given identifier- Parameters:
identifier
- the identifier which associates the landing page- Returns:
- the url of the landing page
-
registerDOI
public boolean registerDOI(org.dataone.service.types.v2.SystemMetadata sysmeta) throws org.dataone.service.exceptions.InvalidRequest, DOIException, org.dataone.service.exceptions.NotImplemented, org.dataone.service.exceptions.ServiceFailure, InterruptedException, org.dataone.service.exceptions.NotAuthorized, org.dataone.service.exceptions.InvalidToken, org.dataone.service.exceptions.NotFound Submits DOI metadata information about the object to DOI services- Parameters:
sysMeta
-- Returns:
- true if succeeded; false otherwise.
- Throws:
org.dataone.service.exceptions.InvalidRequest
DOIException
org.dataone.service.exceptions.NotImplemented
org.dataone.service.exceptions.ServiceFailure
InterruptedException
org.dataone.service.exceptions.InvalidToken
org.dataone.service.exceptions.NotAuthorized
org.dataone.service.exceptions.NotFound
-
submitDOIMetadata
protected abstract void submitDOIMetadata(org.dataone.service.types.v1.Identifier identifier, org.dataone.service.types.v2.SystemMetadata sysMeta) throws org.dataone.service.exceptions.InvalidRequest, DOIException, org.dataone.service.exceptions.NotImplemented, org.dataone.service.exceptions.ServiceFailure, InterruptedException, org.dataone.service.exceptions.InvalidToken, org.dataone.service.exceptions.NotAuthorized, org.dataone.service.exceptions.NotFound, IOException Submit the doi metadata for the given id. This method is called by the method of registerDOI. Every subclass must have the implementation.- Parameters:
identifier
- id can be either an identifier or a sidsysMeta
- the system metadata associated with the identifier- Throws:
org.dataone.service.exceptions.InvalidRequest
DOIException
org.dataone.service.exceptions.NotImplemented
org.dataone.service.exceptions.ServiceFailure
InterruptedException
org.dataone.service.exceptions.InvalidToken
org.dataone.service.exceptions.NotFound
IOException
org.dataone.service.exceptions.NotAuthorized
-
generateDOI
public abstract org.dataone.service.types.v1.Identifier generateDOI() throws DOIException, org.dataone.service.exceptions.InvalidRequestGenerate a DOI using the DOI service as configured- Returns:
- the identifier which was minted by the DOI service
- Throws:
DOIException
org.dataone.service.exceptions.InvalidRequest
-
publishIdentifier
public abstract void publishIdentifier(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier identifier) throws org.dataone.service.exceptions.InvalidToken, org.dataone.service.exceptions.ServiceFailure, org.dataone.service.exceptions.NotAuthorized, org.dataone.service.exceptions.NotImplemented, org.dataone.service.exceptions.InvalidRequest, org.dataone.service.exceptions.NotFound, org.dataone.service.exceptions.IdentifierNotUnique, org.dataone.service.exceptions.UnsupportedType, org.dataone.service.exceptions.InsufficientResources, org.dataone.service.exceptions.InvalidSystemMetadata, DOIException Make the status of the identifier to be public- Parameters:
session
- the subjects call the methodidentifer
- the identifier of the object which will be published.session
-identifier
-- Throws:
org.dataone.service.exceptions.InvalidToken
org.dataone.service.exceptions.ServiceFailure
org.dataone.service.exceptions.NotAuthorized
org.dataone.service.exceptions.NotImplemented
org.dataone.service.exceptions.InvalidRequest
org.dataone.service.exceptions.NotFound
org.dataone.service.exceptions.IdentifierNotUnique
org.dataone.service.exceptions.UnsupportedType
org.dataone.service.exceptions.InsufficientResources
org.dataone.service.exceptions.InvalidSystemMetadata
DOIException
-