edu.ucsb.nceas.metacat.dataone

## Class CNodeService

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

- All Implemented Interfaces:
    org.dataone.service.cn.v2.CNAuthorization, org.dataone.service.cn.v2.CNCore, org.dataone.service.cn.v2.CNRead, org.dataone.service.cn.v2.CNReplication, org.dataone.service.cn.v2.CNView

      public class CNodeService
      extends D1NodeService
      implements org.dataone.service.cn.v2.CNAuthorization, org.dataone.service.cn.v2.CNCore, org.dataone.service.cn.v2.CNRead, org.dataone.service.cn.v2.CNReplication, org.dataone.service.cn.v2.CNView

  Represents Metacat's implementation of the DataONE Coordinating Node service API. Methods implement the various CN* interfaces, and methods common to both Member Node and Coordinating Node interfaces are found in the D1NodeService super class.

- - ### Field Summary

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

    - ### 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.cn.v2.CNCore

      `SERVICE_VERSION`

  - ### Method Summary

    All Methods Static Methods Instance Methods Concrete Methods
    Modifier and Type | Method and Description
    --- | ---
    `org.dataone.service.types.v1.ObjectFormatIdentifier` | `addFormat(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.ObjectFormatIdentifier formatId, org.dataone.service.types.v2.ObjectFormat format)`
    `org.dataone.service.types.v1.Identifier` | `archive(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid)` Archives an object from the Coordinating Node
    `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 a science metadata object.
    `org.dataone.service.types.v1.Identifier` | `delete(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid)` Deletes an object from the Coordinating Node
    `boolean` | `deleteReplicationMetadata(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid, org.dataone.service.types.v1.NodeReference nodeId, long serialVersion)` Deletes the replica from the given Member Node NOTE: MN.delete() may be an "archive" operation.
    `org.dataone.service.types.v1.Identifier` | `generateIdentifier(org.dataone.service.types.v1.Session session, java.lang.String scheme, java.lang.String fragment)`
    `org.dataone.service.types.v2.Node` | `getCapabilities()`
    `org.dataone.service.types.v1.Checksum` | `getChecksum(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid)` Return the checksum of the object given the identifier
    `org.dataone.service.types.v2.ObjectFormat` | `getFormat(org.dataone.service.types.v1.ObjectFormatIdentifier fmtid)` Returns the object format registered in the DataONE Object Format Vocabulary for the given format identifier
    `static CNodeService` | `getInstance(javax.servlet.http.HttpServletRequest request)` singleton accessor
    `org.dataone.service.types.v1_1.QueryEngineDescription` | `getQueryEngineDescription(org.dataone.service.types.v1.Session session, java.lang.String queryEngine)`
    `boolean` | `hasReservation(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Subject subject, org.dataone.service.types.v1.Identifier pid)` Checks whether the pid is reserved by the subject in the session param If the reservation is held on the pid by the subject, we return true.
    `boolean` | `isNodeAuthorized(org.dataone.service.types.v1.Session originatingNodeSession, org.dataone.service.types.v1.Subject targetNodeSubject, org.dataone.service.types.v1.Identifier pid)` Verify that a replication task is authorized by comparing the target node's Subject (from the X.509 certificate-derived Session) with the list of subjects in the known, pending replication tasks map.
    `org.dataone.service.types.v1.ChecksumAlgorithmList` | `listChecksumAlgorithms()` Returns a list of checksum algorithms that are supported by DataONE.
    `org.dataone.service.types.v2.ObjectFormatList` | `listFormats()` Returns a list of all object formats registered in the DataONE Object Format Vocabulary
    `org.dataone.service.types.v2.NodeList` | `listNodes()` Returns a list of nodes that have been registered with the DataONE infrastructure
    `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 formatid, org.dataone.service.types.v1.NodeReference nodeId, org.dataone.service.types.v1.Identifier identifier, java.lang.Integer start, java.lang.Integer count)`
    `org.dataone.service.types.v1_1.QueryEngineList` | `listQueryEngines(org.dataone.service.types.v1.Session session)`
    `void` | `notifyReplicaNodes(org.dataone.service.types.v2.SystemMetadata currentSystemMetadata)` Notify replica Member Nodes of system metadata changes for a given pid
    `java.io.InputStream` | `query(org.dataone.service.types.v1.Session session, java.lang.String queryEngine, java.lang.String query)`
    `org.dataone.service.types.v1.Identifier` | `registerSystemMetadata(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid, org.dataone.service.types.v2.SystemMetadata sysmeta)` Provides a mechanism for adding system metadata independently of its associated object, such as when adding system metadata for data objects.
    `org.dataone.service.types.v1.Identifier` | `reserveIdentifier(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid)` Given an optional scope and format, reserves and returns an identifier within that scope and format that is unique and will not be used by any other sessions.
    `org.dataone.service.types.v1.ObjectLocationList` | `resolve(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid)` Resolve the location of a given object
    `org.dataone.service.types.v1.ObjectList` | `search(org.dataone.service.types.v1.Session session, java.lang.String queryType, java.lang.String query)` Metacat does not implement this method at the CN level
    `boolean` | `setAccessPolicy(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid, org.dataone.service.types.v1.AccessPolicy accessPolicy, long serialVersion)` Set access for a given object using the object identifier and a Subject under a given Session.
    `boolean` | `setObsoletedBy(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid, org.dataone.service.types.v1.Identifier obsoletedByPid, long serialVersion)` Set the obsoletedBy attribute in System Metadata
    `boolean` | `setReplicationPolicy(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid, org.dataone.service.types.v1.ReplicationPolicy policy, long serialVersion)` Set the replication policy for an object given the object identifier It only is applied to objects whose authoritative mn is a v1 node.
    `boolean` | `setReplicationStatus(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid, org.dataone.service.types.v1.NodeReference targetNode, org.dataone.service.types.v1.ReplicationStatus status, org.dataone.service.exceptions.BaseException failure)` Set the replication status for an object given the object identifier
    `org.dataone.service.types.v1.Identifier` | `setRightsHolder(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid, org.dataone.service.types.v1.Subject userId, long serialVersion)` Changes ownership (RightsHolder) of the specified object to the subject specified by userId
    `boolean` | `synchronize(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid)`
    `boolean` | `updateReplicationMetadata(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid, org.dataone.service.types.v1.Replica replica, long serialVersion)` Full replacement of replication metadata in the system metadata for the specified object, changes date system metadata modified
    `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, get, getCNNodeList, getLogRecords, getPIDForSID, getSession, getSystemMetadata, 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.cn.v2.CNAuthorization

      `isAuthorized`

    - ### Methods inherited from interface org.dataone.service.cn.v2.CNCore

      `getLogRecords, ping`

    - ### Methods inherited from interface org.dataone.service.cn.v2.CNRead

      `describe, get, getSystemMetadata`

    - ### Methods inherited from interface org.dataone.service.cn.v2.CNView

      `listViews, view`

- - ### Field Detail

    - #### V2V1MISSMATCH

          public static final java.lang.String V2V1MISSMATCH

      See Also:
        Constant Field Values

  - ### Method Detail

    - #### getInstance

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

      singleton accessor

    - #### setReplicationPolicy

          public boolean setReplicationPolicy(org.dataone.service.types.v1.Session session,
                                              org.dataone.service.types.v1.Identifier pid,
                                              org.dataone.service.types.v1.ReplicationPolicy policy,
                                              long serialVersion)
                                       throws org.dataone.service.exceptions.NotImplemented,
                                              org.dataone.service.exceptions.NotFound,
                                              org.dataone.service.exceptions.NotAuthorized,
                                              org.dataone.service.exceptions.ServiceFailure,
                                              org.dataone.service.exceptions.InvalidRequest,
                                              org.dataone.service.exceptions.InvalidToken,
                                              org.dataone.service.exceptions.VersionMismatch

      Set the replication policy for an object given the object identifier It only is applied to objects whose authoritative mn is a v1 node.
      Specified by:
        `setReplicationPolicy` in interface `org.dataone.service.cn.v2.CNReplication`
      Parameters:
        `session` - - the Session object containing the credentials for the Subject
        `pid` - - the object identifier for the given object
        `policy` - - the replication policy to be applied
      Returns:
        true or false
      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.VersionMismatch`
        `org.dataone.service.exceptions.NotFound`
        `org.dataone.service.exceptions.InvalidToken`

    - #### deleteReplicationMetadata

          public boolean deleteReplicationMetadata(org.dataone.service.types.v1.Session session,
                                                   org.dataone.service.types.v1.Identifier pid,
                                                   org.dataone.service.types.v1.NodeReference nodeId,
                                                   long serialVersion)
                                            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.VersionMismatch

      Deletes the replica from the given Member Node NOTE: MN.delete() may be an "archive" operation. TBD.
      Specified by:
        `deleteReplicationMetadata` in interface `org.dataone.service.cn.v2.CNReplication`
      Parameters:
        `session` -
        `pid` -
        `nodeId` -
        `serialVersion` -
      Returns:
      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.VersionMismatch`

    - #### delete

          public org.dataone.service.types.v1.Identifier delete(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

      Deletes an object from the Coordinating Node
      Specified by:
        `delete` in interface `org.dataone.service.cn.v2.CNCore`
      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`

    - #### 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 from the Coordinating Node
      Specified by:
        `archive` in interface `org.dataone.service.cn.v2.CNCore`
      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`

    - #### setObsoletedBy

          public boolean setObsoletedBy(org.dataone.service.types.v1.Session session,
                                        org.dataone.service.types.v1.Identifier pid,
                                        org.dataone.service.types.v1.Identifier obsoletedByPid,
                                        long serialVersion)
                                 throws org.dataone.service.exceptions.NotImplemented,
                                        org.dataone.service.exceptions.NotFound,
                                        org.dataone.service.exceptions.NotAuthorized,
                                        org.dataone.service.exceptions.ServiceFailure,
                                        org.dataone.service.exceptions.InvalidRequest,
                                        org.dataone.service.exceptions.InvalidToken,
                                        org.dataone.service.exceptions.VersionMismatch

      Set the obsoletedBy attribute in System Metadata
      Specified by:
        `setObsoletedBy` in interface `org.dataone.service.cn.v2.CNCore`
      Parameters:
        `session` -
        `pid` -
        `obsoletedByPid` -
        `serialVersion` -
      Returns:
      Throws:
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.NotFound`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.InvalidRequest`
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.VersionMismatch`

    - #### setReplicationStatus

          public boolean setReplicationStatus(org.dataone.service.types.v1.Session session,
                                              org.dataone.service.types.v1.Identifier pid,
                                              org.dataone.service.types.v1.NodeReference targetNode,
                                              org.dataone.service.types.v1.ReplicationStatus status,
                                              org.dataone.service.exceptions.BaseException failure)
                                       throws org.dataone.service.exceptions.ServiceFailure,
                                              org.dataone.service.exceptions.NotImplemented,
                                              org.dataone.service.exceptions.InvalidToken,
                                              org.dataone.service.exceptions.NotAuthorized,
                                              org.dataone.service.exceptions.InvalidRequest,
                                              org.dataone.service.exceptions.NotFound

      Set the replication status for an object given the object identifier
      Specified by:
        `setReplicationStatus` in interface `org.dataone.service.cn.v2.CNReplication`
      Parameters:
        `session` - - the Session object containing the credentials for the Subject
        `pid` - - the object identifier for the given object
        `status` - - the replication status to be applied
      Returns:
        true or false
      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.InvalidToken`
        `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)
                                                            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 checksum of the object given the identifier
      Specified by:
        `getChecksum` in interface `org.dataone.service.cn.v2.CNRead`
      Parameters:
        `session` - - the Session object containing the credentials for the Subject
        `pid` - - the object identifier for the given object
      Returns:
        checksum - the checksum of the 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`

    - #### resolve

          public org.dataone.service.types.v1.ObjectLocationList resolve(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

      Resolve the location of a given object
      Specified by:
        `resolve` in interface `org.dataone.service.cn.v2.CNRead`
      Parameters:
        `session` - - the Session object containing the credentials for the Subject
        `pid` - - the object identifier for the given object
      Returns:
        objectLocationList - the list of nodes known to contain the 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`

    - #### search

          public org.dataone.service.types.v1.ObjectList search(org.dataone.service.types.v1.Session session,
                                                                java.lang.String queryType,
                                                                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

      Metacat does not implement this method at the CN level
      Specified by:
        `search` in interface `org.dataone.service.cn.v2.CNRead`
      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`

    - #### getFormat

          public org.dataone.service.types.v2.ObjectFormat getFormat(org.dataone.service.types.v1.ObjectFormatIdentifier fmtid)
                                                              throws org.dataone.service.exceptions.ServiceFailure,
                                                                     org.dataone.service.exceptions.NotFound,
                                                                     org.dataone.service.exceptions.NotImplemented

      Returns the object format registered in the DataONE Object Format Vocabulary for the given format identifier
      Specified by:
        `getFormat` in interface `org.dataone.service.cn.v2.CNCore`
      Parameters:
        `fmtid` - - the identifier of the format requested
      Returns:
        objectFormat - the object format requested
      Throws:
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotFound`
        `org.dataone.service.exceptions.InsufficientResources`
        `org.dataone.service.exceptions.NotImplemented`

    - #### addFormat

          public org.dataone.service.types.v1.ObjectFormatIdentifier addFormat(org.dataone.service.types.v1.Session session,
                                                                               org.dataone.service.types.v1.ObjectFormatIdentifier formatId,
                                                                               org.dataone.service.types.v2.ObjectFormat format)
                                                                        throws org.dataone.service.exceptions.ServiceFailure,
                                                                               org.dataone.service.exceptions.NotFound,
                                                                               org.dataone.service.exceptions.NotImplemented,
                                                                               org.dataone.service.exceptions.NotAuthorized,
                                                                               org.dataone.service.exceptions.InvalidToken

      Specified by:
        `addFormat` in interface `org.dataone.service.cn.v2.CNCore`
      Throws:
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotFound`
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.InvalidToken`

    - #### listFormats

          public org.dataone.service.types.v2.ObjectFormatList listFormats()
                                                                    throws org.dataone.service.exceptions.ServiceFailure,
                                                                           org.dataone.service.exceptions.NotImplemented

      Returns a list of all object formats registered in the DataONE Object Format Vocabulary
      Specified by:
        `listFormats` in interface `org.dataone.service.cn.v2.CNCore`
      Returns:
        objectFormatList - The list of object formats registered in the DataONE Object Format Vocabulary
      Throws:
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.InsufficientResources`

    - #### listNodes

          public org.dataone.service.types.v2.NodeList listNodes()
                                                          throws org.dataone.service.exceptions.NotImplemented,
                                                                 org.dataone.service.exceptions.ServiceFailure

      Returns a list of nodes that have been registered with the DataONE infrastructure
      Specified by:
        `listNodes` in interface `org.dataone.service.cn.v2.CNCore`
      Returns:
        nodeList - List of nodes from the registry
      Throws:
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotImplemented`

    - #### registerSystemMetadata

          public org.dataone.service.types.v1.Identifier registerSystemMetadata(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

      Provides a mechanism for adding system metadata independently of its associated object, such as when adding system metadata for data objects.
      Specified by:
        `registerSystemMetadata` in interface `org.dataone.service.cn.v2.CNCore`
      Parameters:
        `session` - - the Session object containing the credentials for the Subject
        `pid` - - The identifier of the object to register the system metadata against
        `sysmeta` - - The system metadata to be registered
      Returns:
        true if the registration succeeds
      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`

    - #### reserveIdentifier

          public org.dataone.service.types.v1.Identifier reserveIdentifier(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.IdentifierNotUnique,
                                                                           org.dataone.service.exceptions.NotImplemented,
                                                                           org.dataone.service.exceptions.InvalidRequest

      Given an optional scope and format, reserves and returns an identifier within that scope and format that is unique and will not be used by any other sessions.
      Specified by:
        `reserveIdentifier` in interface `org.dataone.service.cn.v2.CNCore`
      Parameters:
        `session` - - the Session object containing the credentials for the Subject
        `pid` - - The identifier of the object to register the system metadata against
        `scope` - - An optional string to be used to qualify the scope of the identifier namespace, which is applied differently depending on the format requested. If scope is not supplied, a default scope will be used.
        `format` - - The optional name of the identifier format to be used, drawn from a DataONE-specific vocabulary of identifier format names, including several common syntaxes such as DOI, LSID, UUID, and LSRN, among others. If the format is not supplied by the caller, the CN service will use a default identifier format, which may change over time.
      Returns:
        true if the registration succeeds
      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.NotImplemented`
        `org.dataone.service.exceptions.InvalidRequest`

    - #### 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.cn.v2.CNCore`
      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`

    - #### hasReservation

          public boolean hasReservation(org.dataone.service.types.v1.Session session,
                                        org.dataone.service.types.v1.Subject subject,
                                        org.dataone.service.types.v1.Identifier pid)
                                 throws org.dataone.service.exceptions.InvalidToken,
                                        org.dataone.service.exceptions.ServiceFailure,
                                        org.dataone.service.exceptions.NotFound,
                                        org.dataone.service.exceptions.NotAuthorized,
                                        org.dataone.service.exceptions.NotImplemented,
                                        org.dataone.service.exceptions.InvalidRequest

      Checks whether the pid is reserved by the subject in the session param If the reservation is held on the pid by the subject, we return true.
      Specified by:
        `hasReservation` in interface `org.dataone.service.cn.v2.CNCore`
      Parameters:
        `session` - - the Session object containing the Subject
        `pid` - - The identifier to check
      Returns:
        true if the reservation exists for the subject/pid
      Throws:
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotFound` - - when the pid is not found (in use or in reservation)
        `org.dataone.service.exceptions.NotAuthorized` - - when the subject does not hold a reservation on the pid
        `org.dataone.service.exceptions.IdentifierNotUnique` - - when the pid is in use
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.InvalidRequest`

    - #### setRightsHolder

          public org.dataone.service.types.v1.Identifier setRightsHolder(org.dataone.service.types.v1.Session session,
                                                                         org.dataone.service.types.v1.Identifier pid,
                                                                         org.dataone.service.types.v1.Subject userId,
                                                                         long serialVersion)
                                                                  throws org.dataone.service.exceptions.InvalidToken,
                                                                         org.dataone.service.exceptions.ServiceFailure,
                                                                         org.dataone.service.exceptions.NotFound,
                                                                         org.dataone.service.exceptions.NotAuthorized,
                                                                         org.dataone.service.exceptions.NotImplemented,
                                                                         org.dataone.service.exceptions.InvalidRequest,
                                                                         org.dataone.service.exceptions.VersionMismatch

      Changes ownership (RightsHolder) of the specified object to the subject specified by userId
      Specified by:
        `setRightsHolder` in interface `org.dataone.service.cn.v2.CNAuthorization`
      Parameters:
        `session` - - the Session object containing the credentials for the Subject
        `pid` - - Identifier of the object to be modified
        `userId` - - The subject that will be taking ownership of the specified object.
      Returns:
        pid - the identifier of the modified object
      Throws:
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.NotFound`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.InvalidRequest`
        `org.dataone.service.exceptions.VersionMismatch`

    - #### isNodeAuthorized

          public boolean isNodeAuthorized(org.dataone.service.types.v1.Session originatingNodeSession,
                                          org.dataone.service.types.v1.Subject targetNodeSubject,
                                          org.dataone.service.types.v1.Identifier pid)
                                   throws org.dataone.service.exceptions.NotImplemented,
                                          org.dataone.service.exceptions.NotAuthorized,
                                          org.dataone.service.exceptions.InvalidToken,
                                          org.dataone.service.exceptions.ServiceFailure,
                                          org.dataone.service.exceptions.NotFound,
                                          org.dataone.service.exceptions.InvalidRequest

      Verify that a replication task is authorized by comparing the target node's Subject (from the X.509 certificate-derived Session) with the list of subjects in the known, pending replication tasks map.
      Specified by:
        `isNodeAuthorized` in interface `org.dataone.service.cn.v2.CNReplication`
      Parameters:
        `originatingNodeSession` - - Session information that contains the identity of the calling user
        `targetNodeSubject` - - Subject identifying the target node
        `pid` - - the identifier of the object to be replicated
        `replicatePermission` - - the execute permission to be granted
      Throws:
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.InvalidRequest`
        `org.dataone.service.exceptions.NotFound`

    - #### 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

      Adds a new object to the Node, where the object is a science metadata object.
      Specified by:
        `create` in interface `org.dataone.service.cn.v2.CNCore`
      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`

    - #### setAccessPolicy

          public boolean setAccessPolicy(org.dataone.service.types.v1.Session session,
                                         org.dataone.service.types.v1.Identifier pid,
                                         org.dataone.service.types.v1.AccessPolicy accessPolicy,
                                         long serialVersion)
                                  throws org.dataone.service.exceptions.InvalidToken,
                                         org.dataone.service.exceptions.ServiceFailure,
                                         org.dataone.service.exceptions.NotFound,
                                         org.dataone.service.exceptions.NotAuthorized,
                                         org.dataone.service.exceptions.NotImplemented,
                                         org.dataone.service.exceptions.InvalidRequest,
                                         org.dataone.service.exceptions.VersionMismatch

      Set access for a given object using the object identifier and a Subject under a given Session. This method only applies the objects whose authoritative mn is a v1 node.
      Specified by:
        `setAccessPolicy` in interface `org.dataone.service.cn.v2.CNAuthorization`
      Parameters:
        `session` - - the Session object containing the credentials for the Subject
        `pid` - - the object identifier for the given object to apply the policy
        `policy` - - the access policy to be applied
      Returns:
        true if the application of the policy succeeds
      Throws:
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotFound`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.InvalidRequest`
        `org.dataone.service.exceptions.VersionMismatch`

    - #### updateReplicationMetadata

          public boolean updateReplicationMetadata(org.dataone.service.types.v1.Session session,
                                                   org.dataone.service.types.v1.Identifier pid,
                                                   org.dataone.service.types.v1.Replica replica,
                                                   long serialVersion)
                                            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.NotFound,
                                                   org.dataone.service.exceptions.VersionMismatch

      Full replacement of replication metadata in the system metadata for the specified object, changes date system metadata modified
      Specified by:
        `updateReplicationMetadata` in interface `org.dataone.service.cn.v2.CNReplication`
      Parameters:
        `session` - - the Session object containing the credentials for the Subject
        `pid` - - the object identifier for the given object to apply the policy
        `replica` - - the replica to be updated
      Returns:
      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.NotFound`
        `org.dataone.service.exceptions.VersionMismatch`

    - #### 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 formatid,
                                                                     org.dataone.service.types.v1.NodeReference nodeId,
                                                                     org.dataone.service.types.v1.Identifier identifier,
                                                                     java.lang.Integer start,
                                                                     java.lang.Integer count)
                                                              throws org.dataone.service.exceptions.InvalidRequest,
                                                                     org.dataone.service.exceptions.InvalidToken,
                                                                     org.dataone.service.exceptions.NotAuthorized,
                                                                     org.dataone.service.exceptions.NotImplemented,
                                                                     org.dataone.service.exceptions.ServiceFailure

      Specified by:
        `listObjects` in interface `org.dataone.service.cn.v2.CNRead`
      Throws:
        `org.dataone.service.exceptions.InvalidRequest`
        `org.dataone.service.exceptions.InvalidToken`
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.ServiceFailure`

    - #### listChecksumAlgorithms

          public org.dataone.service.types.v1.ChecksumAlgorithmList listChecksumAlgorithms()
                                                                                    throws org.dataone.service.exceptions.ServiceFailure,
                                                                                           org.dataone.service.exceptions.NotImplemented

      Returns a list of checksum algorithms that are supported by DataONE.
      Specified by:
        `listChecksumAlgorithms` in interface `org.dataone.service.cn.v2.CNCore`
      Returns:
        cal the list of checksum algorithms
      Throws:
        `org.dataone.service.exceptions.ServiceFailure`
        `org.dataone.service.exceptions.NotImplemented`

    - #### notifyReplicaNodes

          public void notifyReplicaNodes(org.dataone.service.types.v2.SystemMetadata currentSystemMetadata)

      Notify replica Member Nodes of system metadata changes for a given pid
      Parameters:
        `currentSystemMetadata` - - the up to date system metadata

    - #### 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. Note: the serial version and the replica list in the new system metadata will be ignored and the old values will be kept.
      Specified by:
        `updateSystemMetadata` in interface `org.dataone.service.cn.v2.CNCore`
      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`

    - #### synchronize

          public boolean synchronize(org.dataone.service.types.v1.Session session,
                                     org.dataone.service.types.v1.Identifier pid)
                              throws org.dataone.service.exceptions.NotAuthorized,
                                     org.dataone.service.exceptions.InvalidRequest,
                                     org.dataone.service.exceptions.NotImplemented

      Specified by:
        `synchronize` in interface `org.dataone.service.cn.v2.CNCore`
      Throws:
        `org.dataone.service.exceptions.NotAuthorized`
        `org.dataone.service.exceptions.InvalidRequest`
        `org.dataone.service.exceptions.NotImplemented`

    - #### getQueryEngineDescription

          public org.dataone.service.types.v1_1.QueryEngineDescription getQueryEngineDescription(org.dataone.service.types.v1.Session session,
                                                                                                 java.lang.String queryEngine)
                                                                                          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.cn.v2.CNRead`
      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.cn.v2.CNRead`
      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 queryEngine,
                                           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.cn.v2.CNRead`
      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`

    - #### getCapabilities

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

      Specified by:
        `getCapabilities` in interface `org.dataone.service.cn.v2.CNCore`
      Throws:
        `org.dataone.service.exceptions.NotImplemented`
        `org.dataone.service.exceptions.ServiceFailure`

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