Package edu.ucsb.nceas.metacat.doi.osti
Class OstiDOIService
java.lang.Object
edu.ucsb.nceas.metacat.doi.DOIService
edu.ucsb.nceas.metacat.doi.osti.OstiDOIService
The implementation class for the OSTI
(DOE Office of Scientific and Technical Information) DOI service
Details of OSTI eink: https://www.osti.gov/elink/241-6api.jsp
- Author:
- tao
-
Field Summary
Fields inherited from class edu.ucsb.nceas.metacat.doi.DOIService
autoPublishDOI, doiEnabled, password, PRIMARY_SHOULDER_INDEX, serviceBaseUrl, shoulderMap, uriTemplate, username
-
Constructor Summary
-
Method Summary
Modifier and TypeMethodDescriptionorg.dataone.service.types.v1.Identifier
Generate a DOI using the DOI service as configuredprotected String
generateOstiMetadata
(InputStream eml, String siteUrl) Generate the OSTI document for the given emlprotected String
generateXMLWithSiteURL
(String siteURL) Create a xml file with the site_url elementgetMetadata
(org.dataone.service.types.v1.Identifier doi) Get the metadata for the given identifiervoid
publishIdentifier
(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier identifier) Make the status of the identifier to be publicprotected void
submitDOIMetadata
(org.dataone.service.types.v1.Identifier identifier, org.dataone.service.types.v2.SystemMetadata sysMeta) Submit the metadata in the osti service for a specific identifier(DOI).Methods inherited from class edu.ucsb.nceas.metacat.doi.DOIService
getLandingPage, refreshStatus, registerDOI
-
Constructor Details
-
OstiDOIService
public OstiDOIService()Constructor
-
-
Method Details
-
generateDOI
public org.dataone.service.types.v1.Identifier generateDOI() throws DOIException, org.dataone.service.exceptions.InvalidRequestGenerate a DOI using the DOI service as configured- Specified by:
generateDOI
in classDOIService
- Returns:
- the identifier which was minted by the DOI service
- Throws:
EZIDException
org.dataone.service.exceptions.InvalidRequest
DOIException
-
submitDOIMetadata
protected 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.NotFound, IOException, org.dataone.service.exceptions.NotAuthorized Submit the metadata in the osti service for a specific identifier(DOI). The identifier can be a SID or PID This implementation will be call by the registerMetadata on the super class.- Specified by:
submitDOIMetadata
in classDOIService
- Parameters:
identifier
- the identifier to identify the metadata which will be updatedsysMeta
- 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
-
publishIdentifier
public 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 Make the status of the identifier to be public- Specified by:
publishIdentifier
in classDOIService
- Parameters:
session
- the subjects call the methodidentifer
- the identifier of the object which will be published.- Throws:
org.dataone.service.exceptions.InvalidRequest
org.dataone.service.exceptions.NotImplemented
org.dataone.service.exceptions.NotAuthorized
org.dataone.service.exceptions.ServiceFailure
org.dataone.service.exceptions.InvalidToken
org.dataone.service.exceptions.NotFound
org.dataone.service.exceptions.InvalidSystemMetadata
org.dataone.service.exceptions.InsufficientResources
org.dataone.service.exceptions.UnsupportedType
org.dataone.service.exceptions.IdentifierNotUnique
-
generateXMLWithSiteURL
Create a xml file with the site_url element- Parameters:
siteURL
- the value of the site_url element- Returns:
- the complete xml string
-
generateOstiMetadata
Generate the OSTI document for the given eml- Parameters:
eml
- the source emlsiteUrl
- the site url will be used in the metadata. . If it is null or blank, the xml metadata will have "set_reserved".- Returns:
- the OSTI document for the eml
- Throws:
TransformerException
-
getMetadata
public String getMetadata(org.dataone.service.types.v1.Identifier doi) throws edu.ucsb.nceas.osti_elink.OSTIElinkException, org.dataone.service.exceptions.InvalidRequest Get the metadata for the given identifier- Parameters:
doi
- the identifier to identify the OSTI metadata- Returns:
- the OSTI metadata associated with the identifier
- Throws:
edu.ucsb.nceas.osti_elink.OSTIElinkException
org.dataone.service.exceptions.InvalidRequest
-