edu.ucsb.nceas.metacat.doi

## Class DOIService

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

- Direct Known Subclasses:
    EzidDOIService, OstiDOIService

      public abstract class DOIService
      extends java.lang.Object

  An abstract class for the DOI service
  Author:
    tao

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `protected static boolean` | `autoPublishDOI`
    `protected static boolean` | `doiEnabled`
    `protected static java.lang.String` | `password`
    `protected static int` | `PRIMARY_SHOULDER_INDEX`
    `protected static java.lang.String` | `serviceBaseUrl`
    `protected static java.util.HashMap<java.lang.Integer,java.lang.String>` | `shoulderMap`
    `protected static java.lang.String` | `uriTemplate`
    `protected static java.lang.String` | `username`

  - ### Constructor Summary

    Constructors
    Constructor and Description
    `DOIService()` Constructor

  - ### Method Summary

    All Methods Instance Methods Abstract Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `abstract org.dataone.service.types.v1.Identifier` | `generateDOI()` Generate a DOI using the DOI service as configured
    `protected java.lang.String` | `getLandingPage(org.dataone.service.types.v1.Identifier identifier)` Get the landing page url string for the given identifier
    `abstract 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
    `void` | `refreshStatus()` Refresh the status (enable or disable) of the DOI service from property file
    `boolean` | `registerDOI(org.dataone.service.types.v2.SystemMetadata sysmeta)` Submits DOI metadata information about the object to DOI services
    `protected 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.

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

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

- - ### Field Detail

    - #### PRIMARY_SHOULDER_INDEX

          protected static final int PRIMARY_SHOULDER_INDEX

      See Also:
        Constant Field Values

    - #### doiEnabled

          protected static boolean doiEnabled

    - #### serviceBaseUrl

          protected static java.lang.String serviceBaseUrl

    - #### username

          protected static java.lang.String username

    - #### password

          protected static java.lang.String password

    - #### uriTemplate

          protected static java.lang.String uriTemplate

    - #### autoPublishDOI

          protected static boolean autoPublishDOI

    - #### shoulderMap

          protected static java.util.HashMap<java.lang.Integer,java.lang.String> shoulderMap

  - ### Constructor Detail

    - #### DOIService

          public DOIService()

      Constructor

  - ### Method Detail

    - #### refreshStatus

          public void refreshStatus()
                             throws edu.ucsb.nceas.utilities.PropertyNotFoundException

      Refresh the status (enable or disable) of the DOI service from property file
      Throws:
        `edu.ucsb.nceas.utilities.PropertyNotFoundException`

    - #### getLandingPage

          protected java.lang.String getLandingPage(org.dataone.service.types.v1.Identifier identifier)

      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,
                                     java.lang.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`
        `java.lang.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,
                                                    java.lang.InterruptedException,
                                                    org.dataone.service.exceptions.InvalidToken,
                                                    org.dataone.service.exceptions.NotAuthorized,
                                                    org.dataone.service.exceptions.NotFound,
                                                    java.io.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 sid
        `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`

    - #### generateDOI

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

      Generate 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 method
        `identifer` - 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`

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