edu.ucsb.nceas.metacat.dataone

## Class MNodeService

- java.lang.Object
- - edu.ucsb.nceas.metacat.dataone.D1NodeService
  - - edu.ucsb.nceas.metacat.dataone.MNodeService

- All Implemented Interfaces:
    org.dataone.service.mn.tier1.v2.MNCore, org.dataone.service.mn.tier1.v2.MNRead, org.dataone.service.mn.tier2.v2.MNAuthorization, org.dataone.service.mn.tier3.v2.MNStorage, org.dataone.service.mn.tier4.v2.MNReplication, org.dataone.service.mn.v2.MNPackage, org.dataone.service.mn.v2.MNQuery, org.dataone.service.mn.v2.MNView

      public class MNodeService
      extends D1NodeService
      implements org.dataone.service.mn.tier2.v2.MNAuthorization, org.dataone.service.mn.tier1.v2.MNCore, org.dataone.service.mn.tier1.v2.MNRead, org.dataone.service.mn.tier4.v2.MNReplication, org.dataone.service.mn.tier3.v2.MNStorage, org.dataone.service.mn.v2.MNQuery, org.dataone.service.mn.v2.MNView, org.dataone.service.mn.v2.MNPackage

  Represents Metacat's implementation of the DataONE Member Node service API. Methods implement the various MN* interfaces, and methods common to both Member Node and Coordinating Node interfaces are found in the D1NodeService base class. Implements: MNCore.ping() MNCore.getLogRecords() MNCore.getObjectStatistics() MNCore.getOperationStatistics() MNCore.getStatus() MNCore.getCapabilities() MNRead.get() MNRead.getSystemMetadata() MNRead.describe() MNRead.getChecksum() MNRead.listObjects() MNRead.synchronizationFailed() MNAuthorization.isAuthorized() MNAuthorization.setAccessPolicy() MNStorage.create() MNStorage.update() MNStorage.delete() MNStorage.updateSystemMetadata() MNReplication.replicate()

- - ### Field Summary

    Fields
    Modifier and Type | Field and Description
    --- | ---
    `static java.lang.String` | `DOI_SCHEME`
    `static java.lang.String` | `UUID_SCHEME`

    - ### Fields inherited from class edu.ucsb.nceas.metacat.dataone.D1NodeService

      `DELETEDMESSAGE, handler, MAXIMUM_DB_RECORD_COUNT, request, session2`

    - ### Fields inherited from interface org.dataone.service.mn.tier1.v2.MNCore

      `SERVICE_VERSION`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.dataone.service.types.v1.Identifier` | `archive(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid)` Archives an object, where the object is either a data object or a science metadata object.
    `org.dataone.service.types.v1.Identifier` | `create(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid, java.io.InputStream object, org.dataone.service.types.v2.SystemMetadata sysmeta)` Adds a new object to the Node, where the object is either a data object or a science metadata object.
    `org.dataone.service.types.v1.Identifier` | `delete(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier id)` Deletes an object from the Member Node, where the object is either a data object or a science metadata object.
    `java.io.InputStream` | `editScienceMetadata(org.dataone.service.types.v1.Session session, java.io.InputStream object, org.dataone.service.types.v1.Identifier pid, org.dataone.service.types.v1.Identifier newPid, boolean isEML, org.dataone.service.types.v2.SystemMetadata newSysmeta)` Update a science metadata document with its new Identifier
    `org.dataone.service.types.v1.Identifier` | `generateIdentifier(org.dataone.service.types.v1.Session session, java.lang.String scheme, java.lang.String fragment)`
    `java.io.InputStream` | `get(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid)` Return the object identified by the given object identifier
    `org.dataone.service.types.v2.Node` | `getCapabilities()` Return a description of the node's capabilities and services.
    `org.dataone.service.types.v1.Checksum` | `getChecksum(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid, java.lang.String algorithm)` Returns a Checksum for the specified object using an accepted hashing algorithm
    `protected org.dataone.service.types.v1.NodeReference` | `getCurrentNodeId()`
    `static MNodeService` | `getInstance(javax.servlet.http.HttpServletRequest request)` Singleton accessor to get an instance of MNodeService.
    `java.io.InputStream` | `getPackage(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.ObjectFormatIdentifier formatId, org.dataone.service.types.v1.Identifier pid)`
    `org.dataone.service.types.v1_1.QueryEngineDescription` | `getQueryEngineDescription(org.dataone.service.types.v1.Session session, java.lang.String engine)`
    `java.io.InputStream` | `getReplica(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid)` Essentially a get() but with different logging behavior
    `java.io.InputStream` | `getStatus(org.dataone.service.types.v1.Session session)` Get the status of the system.
    `org.dataone.service.types.v2.SystemMetadata` | `getSystemMetadata(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid)` Return the system metadata for a given object
    `protected boolean` | `isAuthoritativeNode(org.dataone.service.types.v1.Identifier pid)` Determine if the current node is the authoritative node for the given pid.
    `protected boolean` | `isReadOnlyMode()` Check if the metacat is in the read-only mode.
    `org.dataone.service.types.v1.ObjectList` | `listObjects(org.dataone.service.types.v1.Session session, java.util.Date startTime, java.util.Date endTime, org.dataone.service.types.v1.ObjectFormatIdentifier objectFormatId, org.dataone.service.types.v1.Identifier identifier, java.lang.Boolean replicaStatus, java.lang.Integer start, java.lang.Integer count)` Retrieve the list of objects present on the MN that match the calling parameters
    `org.dataone.service.types.v1_1.QueryEngineList` | `listQueryEngines(org.dataone.service.types.v1.Session session)`
    `java.util.List<org.dataone.service.types.v1.Identifier>` | `lookupOreFor(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier guid, boolean includeObsolete)` Determines if we already have registered an ORE map for this package NOTE: uses a solr query to locate OREs for the object
    `java.io.InputStream` | `postQuery(org.dataone.service.types.v1.Session session, java.lang.String engine, java.util.HashMap<java.lang.String,java.lang.String[]> params)` Handle the query sent by the http post method
    `org.dataone.service.types.v1.Identifier` | `publish(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier originalIdentifier)` Given an existing Science Metadata PID, this method mints a DOI and updates the original object "publishing" the update with the DOI.
    `java.io.InputStream` | `query(org.dataone.service.types.v1.Session session, java.lang.String engine, java.lang.String query)`
    `protected void` | `removeIdFromIdentifierTable(org.dataone.service.types.v1.Identifier id)`
    `boolean` | `replicate(org.dataone.service.types.v1.Session session, org.dataone.service.types.v2.SystemMetadata sysmeta, org.dataone.service.types.v1.NodeReference sourceNode)` Called by a Coordinating Node to request that the Member Node create a copy of the specified object by retrieving it from another Member Node and storing it locally so that it can be made accessible to the DataONE system.
    `boolean` | `synchronizationFailed(org.dataone.service.types.v1.Session session, org.dataone.service.exceptions.SynchronizationFailed syncFailed)` A callback method used by a CN to indicate to a MN that it cannot complete synchronization of the science metadata identified by pid.
    `boolean` | `systemMetadataChanged(boolean needCheckAuthoriativeNode, org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid, long serialVersion, java.util.Date dateSysMetaLastModified)` A method to notify the Member Node that the authoritative copy of system metadata on the Coordinating Nodes has changed.
    `boolean` | `systemMetadataChanged(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid, long serialVersion, java.util.Date dateSysMetaLastModified)` A method to notify the Member Node that the authoritative copy of system metadata on the Coordinating Nodes has changed.
    `org.dataone.service.types.v1.Identifier` | `update(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid, java.io.InputStream object, org.dataone.service.types.v1.Identifier newPid, org.dataone.service.types.v2.SystemMetadata sysmeta)` Updates an existing object by creating a new object identified by newPid on the Member Node which explicitly obsoletes the object identified by pid through appropriate changes to the SystemMetadata of pid and newPid
    `boolean` | `updateSystemMetadata(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid, org.dataone.service.types.v2.SystemMetadata sysmeta)` Update the system metadata of the specified pid.

    - ### Methods inherited from class edu.ucsb.nceas.metacat.dataone.D1NodeService

      `archiveCNObject, archiveObject, checkSidInModifyingSystemMetadata, checkV1SystemMetaPidExist, delete, describe, existsInObsoletedBy, existsInObsoletes, expandPermissions, getCNNodeList, getLogRecords, getPIDForSID, getSession, getSystemMetadataForPID, insertDataObject, insertOrUpdateDocument, insertSystemMetadata, isAuthorized, isScienceMetadata, isValidIdentifier, listNodesBySubject, listObjects, listViews, listViews, objectExists, ping, removeSolrIndex, removeSystemMetaAndIdentifier, setSession, updateSystemMetadata, updateSystemMetadata, view`

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

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

    - ### Methods inherited from interface org.dataone.service.mn.tier2.v2.MNAuthorization

      `isAuthorized`

    - ### Methods inherited from interface org.dataone.service.mn.tier1.v2.MNCore

      `getLogRecords, ping`

    - ### Methods inherited from interface org.dataone.service.mn.tier1.v2.MNRead

      `describe`

    - ### Methods inherited from interface org.dataone.service.mn.v2.MNView

      `listViews, view`

- - ### Field Detail

    - #### UUID_SCHEME

          public static final java.lang.String UUID_SCHEME

      See Also:
        Constant Field Values

    - #### DOI_SCHEME

          public static final java.lang.String DOI_SCHEME

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getInstance

          public static MNodeService getInstance(javax.servlet.http.HttpServletRequest request)

      Singleton accessor to get an instance of MNodeService.
      Returns:
        instance - the instance of MNodeService

    - #### delete

          public org.dataone.service.types.v1.Identifier delete(org.dataone.service.types.v1.Session session,
                                                                org.dataone.service.types.v1.Identifier id)
                                                         throws org.dataone.service.exceptions.InvalidToken,
                                                                org.dataone.service.exceptions.ServiceFailure,
                                                                org.dataone.service.exceptions.NotAuthorized,
                                                                org.dataone.service.exceptions.NotFound,
                                                                org.dataone.service.exceptions.NotImplemented

      Deletes an object from the Member Node, where the object is either a data object or a science metadata object.
      Specified by:
        `delete` in interface `org.dataone.service.mn.tier3.v2.MNStorage`
      Parameters:
        `session` - - the Session object containing the credentials for the Subject
        `pid` - - The object identifier to be deleted
      Returns:
        pid - the identifier of the object used for the deletion
      Throws:
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.NotFound`
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.InvalidRequest`

    - #### update

          public org.dataone.service.types.v1.Identifier update(org.dataone.service.types.v1.Session session,
                                                                org.dataone.service.types.v1.Identifier pid,
                                                                java.io.InputStream object,
                                                                org.dataone.service.types.v1.Identifier newPid,
                                                                org.dataone.service.types.v2.SystemMetadata sysmeta)
                                                         throws org.dataone.service.exceptions.InvalidToken,
                                                                org.dataone.service.exceptions.ServiceFailure,
                                                                org.dataone.service.exceptions.NotAuthorized,
                                                                org.dataone.service.exceptions.IdentifierNotUnique,
                                                                org.dataone.service.exceptions.UnsupportedType,
                                                                org.dataone.service.exceptions.InsufficientResources,
                                                                org.dataone.service.exceptions.NotFound,
                                                                org.dataone.service.exceptions.InvalidSystemMetadata,
                                                                org.dataone.service.exceptions.NotImplemented,
                                                                org.dataone.service.exceptions.InvalidRequest

      Updates an existing object by creating a new object identified by newPid on the Member Node which explicitly obsoletes the object identified by pid through appropriate changes to the SystemMetadata of pid and newPid
      Specified by:
        `update` in interface `org.dataone.service.mn.tier3.v2.MNStorage`
      Parameters:
        `session` - - the Session object containing the credentials for the Subject
        `pid` - - The identifier of the object to be updated
        `object` - - the new object bytes
        `sysmeta` - - the new system metadata describing the object
      Returns:
        newPid - the identifier of the new object
      Throws:
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.NotFound`
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.IdentifierNotUnique`
        `org.dataone.service.exceptions.UnsupportedType`
        `org.dataone.service.exceptions.InsufficientResources`
        `org.dataone.service.exceptions.InvalidSystemMetadata`
        `org.dataone.service.exceptions.InvalidRequest`

    - #### removeIdFromIdentifierTable

          protected void removeIdFromIdentifierTable(org.dataone.service.types.v1.Identifier id)

    - #### create

          public org.dataone.service.types.v1.Identifier create(org.dataone.service.types.v1.Session session,
                                                                org.dataone.service.types.v1.Identifier pid,
                                                                java.io.InputStream object,
                                                                org.dataone.service.types.v2.SystemMetadata sysmeta)
                                                         throws org.dataone.service.exceptions.InvalidToken,
                                                                org.dataone.service.exceptions.ServiceFailure,
                                                                org.dataone.service.exceptions.NotAuthorized,
                                                                org.dataone.service.exceptions.IdentifierNotUnique,
                                                                org.dataone.service.exceptions.UnsupportedType,
                                                                org.dataone.service.exceptions.InsufficientResources,
                                                                org.dataone.service.exceptions.InvalidSystemMetadata,
                                                                org.dataone.service.exceptions.NotImplemented,
                                                                org.dataone.service.exceptions.InvalidRequest

      Description copied from class: `D1NodeService`
      Adds a new object to the Node, where the object is either a data object or a science metadata object. This method is called by clients to create new data objects on Member Nodes or internally for Coordinating Nodes
      Specified by:
        `create` in interface `org.dataone.service.mn.tier3.v2.MNStorage`
      Overrides:
        `create` in class `D1NodeService`
      Parameters:
        `session` - - the Session object containing the credentials for the Subject
        `pid` - - The object identifier to be created
        `object` - - the object bytes
        `sysmeta` - - the system metadata that describes the object
      Returns:
        pid - the object identifier created
      Throws:
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.IdentifierNotUnique`
        `org.dataone.service.exceptions.UnsupportedType`
        `org.dataone.service.exceptions.InsufficientResources`
        `org.dataone.service.exceptions.InvalidSystemMetadata`
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.InvalidRequest`

    - #### replicate

          public boolean replicate(org.dataone.service.types.v1.Session session,
                                   org.dataone.service.types.v2.SystemMetadata sysmeta,
                                   org.dataone.service.types.v1.NodeReference sourceNode)
                            throws org.dataone.service.exceptions.NotImplemented,
                                   org.dataone.service.exceptions.ServiceFailure,
                                   org.dataone.service.exceptions.NotAuthorized,
                                   org.dataone.service.exceptions.InvalidRequest,
                                   org.dataone.service.exceptions.InsufficientResources,
                                   org.dataone.service.exceptions.UnsupportedType

      Called by a Coordinating Node to request that the Member Node create a copy of the specified object by retrieving it from another Member Node and storing it locally so that it can be made accessible to the DataONE system.
      Specified by:
        `replicate` in interface `org.dataone.service.mn.tier4.v2.MNReplication`
      Parameters:
        `session` - - the Session object containing the credentials for the Subject
        `sysmeta` - - Copy of the CN held system metadata for the object
        `sourceNode` - - A reference to node from which the content should be retrieved. The reference should be resolved by checking the CN node registry.
      Returns:
        true if the replication succeeds
      Throws:
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.UnsupportedType`
        `org.dataone.service.exceptions.InsufficientResources`
        `org.dataone.service.exceptions.InvalidRequest`

    - #### get

          public java.io.InputStream get(org.dataone.service.types.v1.Session session,
                                         org.dataone.service.types.v1.Identifier pid)
                                  throws org.dataone.service.exceptions.InvalidToken,
                                         org.dataone.service.exceptions.ServiceFailure,
                                         org.dataone.service.exceptions.NotAuthorized,
                                         org.dataone.service.exceptions.NotFound,
                                         org.dataone.service.exceptions.NotImplemented

      Return the object identified by the given object identifier
      Specified by:
        `get` in interface `org.dataone.service.mn.tier1.v2.MNRead`
      Overrides:
        `get` in class `D1NodeService`
      Parameters:
        `session` - - the Session object containing the credentials for the Subject
        `pid` - - the object identifier for the given object
      Returns:
        inputStream - the input stream of the given object
      Throws:
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.InvalidRequest`
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.NotFound`

    - #### getChecksum

          public org.dataone.service.types.v1.Checksum getChecksum(org.dataone.service.types.v1.Session session,
                                                                   org.dataone.service.types.v1.Identifier pid,
                                                                   java.lang.String algorithm)
                                                            throws org.dataone.service.exceptions.InvalidToken,
                                                                   org.dataone.service.exceptions.ServiceFailure,
                                                                   org.dataone.service.exceptions.NotAuthorized,
                                                                   org.dataone.service.exceptions.NotFound,
                                                                   org.dataone.service.exceptions.InvalidRequest,
                                                                   org.dataone.service.exceptions.NotImplemented

      Returns a Checksum for the specified object using an accepted hashing algorithm
      Specified by:
        `getChecksum` in interface `org.dataone.service.mn.tier1.v2.MNRead`
      Parameters:
        `session` - - the Session object containing the credentials for the Subject
        `pid` - - the object identifier for the given object
        `algorithm` - - the name of an algorithm that will be used to compute a checksum of the bytes of the object
      Returns:
        checksum - the checksum of the given object
      Throws:
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.NotFound`
        `org.dataone.service.exceptions.InvalidRequest`
        `org.dataone.service.exceptions.NotImplemented`

    - #### getSystemMetadata

          public org.dataone.service.types.v2.SystemMetadata getSystemMetadata(org.dataone.service.types.v1.Session session,
                                                                               org.dataone.service.types.v1.Identifier pid)
                                                                        throws org.dataone.service.exceptions.InvalidToken,
                                                                               org.dataone.service.exceptions.ServiceFailure,
                                                                               org.dataone.service.exceptions.NotAuthorized,
                                                                               org.dataone.service.exceptions.NotFound,
                                                                               org.dataone.service.exceptions.NotImplemented

      Return the system metadata for a given object
      Specified by:
        `getSystemMetadata` in interface `org.dataone.service.mn.tier1.v2.MNRead`
      Overrides:
        `getSystemMetadata` in class `D1NodeService`
      Parameters:
        `session` - - the Session object containing the credentials for the Subject
        `pid` - - the object identifier for the given object
      Returns:
        inputStream - the input stream of the given system metadata object
      Throws:
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.NotFound`
        `org.dataone.service.exceptions.InvalidRequest`
        `org.dataone.service.exceptions.NotImplemented`

    - #### listObjects

          public org.dataone.service.types.v1.ObjectList listObjects(org.dataone.service.types.v1.Session session,
                                                                     java.util.Date startTime,
                                                                     java.util.Date endTime,
                                                                     org.dataone.service.types.v1.ObjectFormatIdentifier objectFormatId,
                                                                     org.dataone.service.types.v1.Identifier identifier,
                                                                     java.lang.Boolean replicaStatus,
                                                                     java.lang.Integer start,
                                                                     java.lang.Integer count)
                                                              throws org.dataone.service.exceptions.NotAuthorized,
                                                                     org.dataone.service.exceptions.InvalidRequest,
                                                                     org.dataone.service.exceptions.NotImplemented,
                                                                     org.dataone.service.exceptions.ServiceFailure,
                                                                     org.dataone.service.exceptions.InvalidToken

      Retrieve the list of objects present on the MN that match the calling parameters
      Specified by:
        `listObjects` in interface `org.dataone.service.mn.tier1.v2.MNRead`
      Parameters:
        `session` - - the Session object containing the credentials for the Subject
        `startTime` - - Specifies the beginning of the time range from which to return object (>=)
        `endTime` - - Specifies the beginning of the time range from which to return object (>=)
        `objectFormat` - - Restrict results to the specified object format
        `replicaStatus` - - Indicates if replicated objects should be returned in the list
        `start` - - The zero-based index of the first value, relative to the first record of the resultset that matches the parameters.
        `count` - - The maximum number of entries that should be returned in the response. The Member Node may return less entries than specified in this value.
      Returns:
        objectList - the list of objects matching the criteria
      Throws:
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.InvalidRequest`
        `org.dataone.service.exceptions.NotImplemented`

    - #### getCapabilities

          public org.dataone.service.types.v2.Node getCapabilities()
                                                            throws org.dataone.service.exceptions.ServiceFailure

      Return a description of the node's capabilities and services.
      Specified by:
        `getCapabilities` in interface `org.dataone.service.mn.tier1.v2.MNCore`
      Returns:
        node - the technical capabilities of the Member Node
      Throws:
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.InvalidRequest`
        `org.dataone.service.exceptions.NotImplemented` - - not thrown by this implementation

    - #### synchronizationFailed

          public boolean synchronizationFailed(org.dataone.service.types.v1.Session session,
                                               org.dataone.service.exceptions.SynchronizationFailed syncFailed)
                                        throws org.dataone.service.exceptions.NotImplemented,
                                               org.dataone.service.exceptions.ServiceFailure,
                                               org.dataone.service.exceptions.NotAuthorized

      A callback method used by a CN to indicate to a MN that it cannot complete synchronization of the science metadata identified by pid. Log the event in the metacat event log.
      Specified by:
        `synchronizationFailed` in interface `org.dataone.service.mn.tier1.v2.MNRead`
      Parameters:
        `session` -
        `syncFailed` -
      Throws:
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.NotImplemented`

    - #### getReplica

          public java.io.InputStream getReplica(org.dataone.service.types.v1.Session session,
                                                org.dataone.service.types.v1.Identifier pid)
                                         throws org.dataone.service.exceptions.NotAuthorized,
                                                org.dataone.service.exceptions.NotImplemented,
                                                org.dataone.service.exceptions.ServiceFailure,
                                                org.dataone.service.exceptions.InvalidToken,
                                                org.dataone.service.exceptions.NotFound

      Essentially a get() but with different logging behavior
      Specified by:
        `getReplica` in interface `org.dataone.service.mn.tier1.v2.MNRead`
      Throws:
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.NotFound`

    - #### systemMetadataChanged

          public boolean systemMetadataChanged(org.dataone.service.types.v1.Session session,
                                               org.dataone.service.types.v1.Identifier pid,
                                               long serialVersion,
                                               java.util.Date dateSysMetaLastModified)
                                        throws org.dataone.service.exceptions.NotImplemented,
                                               org.dataone.service.exceptions.ServiceFailure,
                                               org.dataone.service.exceptions.NotAuthorized,
                                               org.dataone.service.exceptions.InvalidRequest,
                                               org.dataone.service.exceptions.InvalidToken

      A method to notify the Member Node that the authoritative copy of system metadata on the Coordinating Nodes has changed.
      Specified by:
        `systemMetadataChanged` in interface `org.dataone.service.mn.tier1.v2.MNRead`
      Parameters:
        `session` - Session information that contains the identity of the calling user as retrieved from the X.509 certificate which must be traceable to the CILogon service.
        `serialVersion` - The serialVersion of the system metadata
        `dateSysMetaLastModified` - The time stamp for when the system metadata was changed
      Throws:
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.InvalidRequest`
        `org.dataone.service.exceptions.InvalidToken`

    - #### systemMetadataChanged

          public boolean systemMetadataChanged(boolean needCheckAuthoriativeNode,
                                               org.dataone.service.types.v1.Session session,
                                               org.dataone.service.types.v1.Identifier pid,
                                               long serialVersion,
                                               java.util.Date dateSysMetaLastModified)
                                        throws org.dataone.service.exceptions.NotImplemented,
                                               org.dataone.service.exceptions.ServiceFailure,
                                               org.dataone.service.exceptions.NotAuthorized,
                                               org.dataone.service.exceptions.InvalidRequest,
                                               org.dataone.service.exceptions.InvalidToken

      A method to notify the Member Node that the authoritative copy of system metadata on the Coordinating Nodes has changed.
      Parameters:
        `needCheckAuthoriativeNode` - this is for the dataone version 2. In the version 2, there are two scenarios: 1. If the node is the authoritative node, it only accepts serial version and replica list. 2. If the node is a replica, it accepts everything. For the v1, api, the parameter should be false.
        `session` - Session information that contains the identity of the calling user as retrieved from the X.509 certificate which must be traceable to the CILogon service.
        `serialVersion` - The serialVersion of the system metadata
        `dateSysMetaLastModified` - The time stamp for when the system metadata was changed
      Throws:
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.InvalidRequest`
        `org.dataone.service.exceptions.InvalidToken`

    - #### generateIdentifier

          public org.dataone.service.types.v1.Identifier generateIdentifier(org.dataone.service.types.v1.Session session,
                                                                            java.lang.String scheme,
                                                                            java.lang.String fragment)
                                                                     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

      Specified by:
        `generateIdentifier` in interface `org.dataone.service.mn.tier3.v2.MNStorage`
      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`

    - #### getQueryEngineDescription

          public org.dataone.service.types.v1_1.QueryEngineDescription getQueryEngineDescription(org.dataone.service.types.v1.Session session,
                                                                                                 java.lang.String engine)
                                                                                          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.NotFound

      Specified by:
        `getQueryEngineDescription` in interface `org.dataone.service.mn.v2.MNQuery`
      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.NotFound`

    - #### listQueryEngines

          public org.dataone.service.types.v1_1.QueryEngineList listQueryEngines(org.dataone.service.types.v1.Session session)
                                                                          throws org.dataone.service.exceptions.InvalidToken,
                                                                                 org.dataone.service.exceptions.ServiceFailure,
                                                                                 org.dataone.service.exceptions.NotAuthorized,
                                                                                 org.dataone.service.exceptions.NotImplemented

      Specified by:
        `listQueryEngines` in interface `org.dataone.service.mn.v2.MNQuery`
      Throws:
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.NotImplemented`

    - #### query

          public java.io.InputStream query(org.dataone.service.types.v1.Session session,
                                           java.lang.String engine,
                                           java.lang.String query)
                                    throws org.dataone.service.exceptions.InvalidToken,
                                           org.dataone.service.exceptions.ServiceFailure,
                                           org.dataone.service.exceptions.NotAuthorized,
                                           org.dataone.service.exceptions.InvalidRequest,
                                           org.dataone.service.exceptions.NotImplemented,
                                           org.dataone.service.exceptions.NotFound

      Specified by:
        `query` in interface `org.dataone.service.mn.v2.MNQuery`
      Throws:
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.InvalidRequest`
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.NotFound`

    - #### postQuery

          public java.io.InputStream postQuery(org.dataone.service.types.v1.Session session,
                                               java.lang.String engine,
                                               java.util.HashMap<java.lang.String,java.lang.String[]> params)
                                        throws org.dataone.service.exceptions.InvalidToken,
                                               org.dataone.service.exceptions.ServiceFailure,
                                               org.dataone.service.exceptions.NotAuthorized,
                                               org.dataone.service.exceptions.InvalidRequest,
                                               org.dataone.service.exceptions.NotImplemented,
                                               org.dataone.service.exceptions.NotFound

      Handle the query sent by the http post method
      Parameters:
        `session` - identity information of the requester
        `engine` - the query engine will be used. Now we only support solr
        `params` - the query parameters with key/value pairs
      Returns:
      Throws:
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.InvalidRequest`
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.NotFound`

    - #### publish

          public org.dataone.service.types.v1.Identifier publish(org.dataone.service.types.v1.Session session,
                                                                 org.dataone.service.types.v1.Identifier originalIdentifier)
                                                          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,
                                                                 java.io.IOException

      Given an existing Science Metadata PID, this method mints a DOI and updates the original object "publishing" the update with the DOI. This includes updating the ORE map that describes the Science Metadata+data. TODO: ensure all referenced objects allow public read
      Parameters:
        `originalIdentifier` -
        `request` -
      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`
        `java.io.IOException`
      See Also:
        `https://projects.ecoinformatics.org/ecoinfo/issues/6014`

    - #### editScienceMetadata

          public java.io.InputStream editScienceMetadata(org.dataone.service.types.v1.Session session,
                                                         java.io.InputStream object,
                                                         org.dataone.service.types.v1.Identifier pid,
                                                         org.dataone.service.types.v1.Identifier newPid,
                                                         boolean isEML,
                                                         org.dataone.service.types.v2.SystemMetadata newSysmeta)
                                                  throws org.dataone.service.exceptions.ServiceFailure,
                                                         java.io.IOException,
                                                         java.io.UnsupportedEncodingException,
                                                         org.dataone.service.exceptions.InvalidToken,
                                                         org.dataone.service.exceptions.NotAuthorized,
                                                         org.dataone.service.exceptions.NotFound,
                                                         org.dataone.service.exceptions.NotImplemented

      Update a science metadata document with its new Identifier
      Parameters:
        `session` - - the Session object containing the credentials for the Subject
        `object` - - the InputStream for the XML object to be edited
        `pid` - - the Identifier of the XML object to be updated
        `newPid` - = the new Identifier to give to the modified XML doc
      Returns:
        newObject - The InputStream for the modified XML object
      Throws:
        `org.dataone.service.exceptions.ServiceFailure`
        `java.io.IOException`
        `java.io.UnsupportedEncodingException`
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.NotFound`
        `org.dataone.service.exceptions.NotImplemented`

    - #### lookupOreFor

          public java.util.List<org.dataone.service.types.v1.Identifier> lookupOreFor(org.dataone.service.types.v1.Session session,
                                                                                      org.dataone.service.types.v1.Identifier guid,
                                                                                      boolean includeObsolete)

      Determines if we already have registered an ORE map for this package NOTE: uses a solr query to locate OREs for the object
      Parameters:
        `guid` - of the EML/packaging object
      Returns:
        list of resource map identifiers for the given pid

    - #### getPackage

          public java.io.InputStream getPackage(org.dataone.service.types.v1.Session session,
                                                org.dataone.service.types.v1.ObjectFormatIdentifier formatId,
                                                org.dataone.service.types.v1.Identifier pid)
                                         throws org.dataone.service.exceptions.InvalidToken,
                                                org.dataone.service.exceptions.ServiceFailure,
                                                org.dataone.service.exceptions.NotAuthorized,
                                                org.dataone.service.exceptions.InvalidRequest,
                                                org.dataone.service.exceptions.NotImplemented,
                                                org.dataone.service.exceptions.NotFound

      Specified by:
        `getPackage` in interface `org.dataone.service.mn.v2.MNPackage`
      Throws:
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.InvalidRequest`
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.NotFound`

    - #### archive

          public org.dataone.service.types.v1.Identifier archive(org.dataone.service.types.v1.Session session,
                                                                 org.dataone.service.types.v1.Identifier pid)
                                                          throws org.dataone.service.exceptions.InvalidToken,
                                                                 org.dataone.service.exceptions.ServiceFailure,
                                                                 org.dataone.service.exceptions.NotAuthorized,
                                                                 org.dataone.service.exceptions.NotFound,
                                                                 org.dataone.service.exceptions.NotImplemented

      Archives an object, where the object is either a data object or a science metadata object.
      Specified by:
        `archive` in interface `org.dataone.service.mn.tier3.v2.MNStorage`
      Parameters:
        `session` - - the Session object containing the credentials for the Subject
        `pid` - - The object identifier to be archived
      Returns:
        pid - the identifier of the object used for the archiving
      Throws:
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.NotFound`
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.InvalidRequest`

    - #### updateSystemMetadata

          public boolean updateSystemMetadata(org.dataone.service.types.v1.Session session,
                                              org.dataone.service.types.v1.Identifier pid,
                                              org.dataone.service.types.v2.SystemMetadata sysmeta)
                                       throws org.dataone.service.exceptions.NotImplemented,
                                              org.dataone.service.exceptions.NotAuthorized,
                                              org.dataone.service.exceptions.ServiceFailure,
                                              org.dataone.service.exceptions.InvalidRequest,
                                              org.dataone.service.exceptions.InvalidSystemMetadata,
                                              org.dataone.service.exceptions.InvalidToken

      Update the system metadata of the specified pid.
      Specified by:
        `updateSystemMetadata` in interface `org.dataone.service.mn.tier3.v2.MNStorage`
      Throws:
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.InvalidRequest`
        `org.dataone.service.exceptions.InvalidSystemMetadata`
        `org.dataone.service.exceptions.InvalidToken`

    - #### getStatus

          public java.io.InputStream getStatus(org.dataone.service.types.v1.Session session)
                                        throws org.dataone.service.exceptions.NotAuthorized,
                                               org.dataone.service.exceptions.ServiceFailure

      Get the status of the system. this is an unofficial dataone api method. Currently we only reply the size of the index queue. The method will return the input stream of a xml instance. In the future, we need to add a new dataone type to represent the result.
      Parameters:
        `session` -
      Returns:
        the input stream which is the xml presentation of the status report
      Throws:
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.ServiceFailure`

    - #### getCurrentNodeId

          protected org.dataone.service.types.v1.NodeReference getCurrentNodeId()

    - #### isAuthoritativeNode

          protected boolean isAuthoritativeNode(org.dataone.service.types.v1.Identifier pid)
                                         throws org.dataone.service.exceptions.InvalidRequest

      Determine if the current node is the authoritative node for the given pid. (uses HZsysmeta map)
      Throws:
        `org.dataone.service.exceptions.InvalidRequest`

    - #### isReadOnlyMode

          protected boolean isReadOnlyMode()

      Check if the metacat is in the read-only mode.
      Returns:
        true if it is; otherwise false.

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