edu.ucsb.nceas.metacat.doi.osti

## Class OstiDOIService

- java.lang.Object
- - edu.ucsb.nceas.metacat.doi.DOIService
  - - edu.ucsb.nceas.metacat.doi.osti.OstiDOIService

-     public class OstiDOIService
      extends DOIService

  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

    Constructors
    Constructor and Description
    `OstiDOIService()` Constructor

  - ### Method Summary

    All Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.dataone.service.types.v1.Identifier` | `generateDOI()` Generate a DOI using the DOI service as configured
    `protected java.lang.String` | `generateOstiMetadata(java.io.InputStream eml, java.lang.String siteUrl)` Generate the OSTI document for the given eml
    `protected java.lang.String` | `generateXMLWithSiteURL(java.lang.String siteURL)` Create a xml file with the site_url element
    `java.lang.String` | `getMetadata(org.dataone.service.types.v1.Identifier doi)` Get the metadata for the given identifier
    `void` | `publishIdentifier(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier identifier)` Make the status of the identifier to be public
    `protected 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`

    - ### Methods inherited from class java.lang.Object

      `clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait`

- - ### Constructor Detail

    - #### OstiDOIService

          public OstiDOIService()

      Constructor

  - ### Method Detail

    - #### generateDOI

          public org.dataone.service.types.v1.Identifier generateDOI()
                                                              throws DOIException,
                                                                     org.dataone.service.exceptions.InvalidRequest

      Generate a DOI using the DOI service as configured
      Specified by:
        `generateDOI` in class `DOIService`
      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,
                                           java.lang.InterruptedException,
                                           org.dataone.service.exceptions.InvalidToken,
                                           org.dataone.service.exceptions.NotFound,
                                           java.io.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 class `DOIService`
      Parameters:
        `identifier` - the identifier to identify the metadata which will be updated
        `sysMeta` - the system metadata associated with the identifier
      Throws:
        `org.dataone.service.exceptions.InvalidRequest`
        `DOIException`
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.ServiceFailure`
        `java.lang.InterruptedException`
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.NotFound`
        `java.io.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 class `DOIService`
      Parameters:
        `session` - the subjects call the method
        `identifer` - 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

          protected java.lang.String generateXMLWithSiteURL(java.lang.String siteURL)

      Create a xml file with the site_url element
      Parameters:
        `siteURL` - the value of the site_url element
      Returns:
        the complete xml string

    - #### generateOstiMetadata

          protected java.lang.String generateOstiMetadata(java.io.InputStream eml,
                                                          java.lang.String siteUrl)
                                                   throws javax.xml.transform.TransformerException

      Generate the OSTI document for the given eml
      Parameters:
        `eml` - the source eml
        `siteUrl` - 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:
        `javax.xml.transform.TransformerException`

    - #### getMetadata

          public java.lang.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`

Copyright © 2023 Regents of the University of California. All Rights Reserved.