Package 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 inherited from class edu.ucsb.nceas.metacat.dataone.D1NodeService
DELETEDMESSAGE, handler, ipAddress, MAXIMUM_DB_RECORD_COUNT, METADATA, request, session2, userAgent
Fields inherited from interface org.dataone.service.cn.v2.CNCore
SERVICE_VERSION
-
Method Summary
Modifier and TypeMethodDescriptionorg.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 Nodeorg.dataone.service.types.v1.Identifier
create
(org.dataone.service.types.v1.Session session, org.dataone.service.types.v1.Identifier pid, 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 Nodeboolean
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, String scheme, String fragment) org.dataone.service.types.v2.Node
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 identifierorg.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 identifierstatic CNodeService
getInstance
(javax.servlet.http.HttpServletRequest request) singleton accessororg.dataone.service.types.v1_1.QueryEngineDescription
getQueryEngineDescription
(org.dataone.service.types.v1.Session session, 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
Returns a list of checksum algorithms that are supported by DataONE.org.dataone.service.types.v2.ObjectFormatList
Returns a list of all object formats registered in the DataONE Object Format Vocabularyorg.dataone.service.types.v2.NodeList
Returns a list of nodes that have been registered with the DataONE infrastructureorg.dataone.service.types.v1.ObjectList
listObjects
(org.dataone.service.types.v1.Session session, Date startTime, Date endTime, org.dataone.service.types.v1.ObjectFormatIdentifier formatid, org.dataone.service.types.v1.NodeReference nodeId, org.dataone.service.types.v1.Identifier identifier, Integer start, 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 pidorg.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 objectorg.dataone.service.types.v1.ObjectList
Metacat does not implement this method at the CN levelboolean
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 Metadataboolean
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 identifierorg.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 userIdboolean
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 modifiedboolean
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, create, delete, describe, equals, existsInObsoletedBy, existsInObsoletes, expandPermissions, get, getCNNodeList, getIpAddress, getLogRecords, getPIDForSID, getSession, getSystemMetadata, getSystemMetadataForPID, getUserAgent, isAccessControlDirty, isAuthorized, isInAllowList, isScienceMetadata, isValidIdentifier, listNodesBySubject, listObjects, listViews, listViews, objectExists, ping, removeSolrIndex, removeSystemMetaAndIdentifier, setIpAddress, setSession, setUserAgent, 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 Details
-
V2V1MISSMATCH
- See Also:
-
-
Method Details
-
getInstance
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 interfaceorg.dataone.service.cn.v2.CNReplication
- Parameters:
session
- - the Session object containing the credentials for the Subjectpid
- - the object identifier for the given objectpolicy
- - 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 interfaceorg.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 interfaceorg.dataone.service.cn.v2.CNCore
- Parameters:
session
- - the Session object containing the credentials for the Subjectpid
- - 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
-
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 interfaceorg.dataone.service.cn.v2.CNCore
- Parameters:
session
- - the Session object containing the credentials for the Subjectpid
- - 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 interfaceorg.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 interfaceorg.dataone.service.cn.v2.CNReplication
- Parameters:
session
- - the Session object containing the credentials for the Subjectpid
- - the object identifier for the given objectstatus
- - 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 interfaceorg.dataone.service.cn.v2.CNRead
- Parameters:
session
- - the Session object containing the credentials for the Subjectpid
- - 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 interfaceorg.dataone.service.cn.v2.CNRead
- Parameters:
session
- - the Session object containing the credentials for the Subjectpid
- - 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, String queryType, 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 interfaceorg.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 interfaceorg.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 interfaceorg.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.NotImplementedReturns a list of all object formats registered in the DataONE Object Format Vocabulary- Specified by:
listFormats
in interfaceorg.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.ServiceFailureReturns a list of nodes that have been registered with the DataONE infrastructure- Specified by:
listNodes
in interfaceorg.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 interfaceorg.dataone.service.cn.v2.CNCore
- Parameters:
session
- - the Session object containing the credentials for the Subjectpid
- - The identifier of the object to register the system metadata againstsysmeta
- - 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 interfaceorg.dataone.service.cn.v2.CNCore
- Parameters:
session
- - the Session object containing the credentials for the Subjectpid
- - The identifier of the object to register the system metadata againstscope
- - 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, String scheme, 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 interfaceorg.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 interfaceorg.dataone.service.cn.v2.CNCore
- Parameters:
session
- - the Session object containing the Subjectpid
- - 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 pidorg.dataone.service.exceptions.IdentifierNotUnique
- - when the pid is in useorg.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 interfaceorg.dataone.service.cn.v2.CNAuthorization
- Parameters:
session
- - the Session object containing the credentials for the Subjectpid
- - Identifier of the object to be modifieduserId
- - 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 interfaceorg.dataone.service.cn.v2.CNReplication
- Parameters:
originatingNodeSession
- - Session information that contains the identity of the calling usertargetNodeSubject
- - Subject identifying the target nodepid
- - the identifier of the object to be replicatedreplicatePermission
- - 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, 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 interfaceorg.dataone.service.cn.v2.CNCore
- Parameters:
session
- - the Session object containing the credentials for the Subjectpid
- - The object identifier to be createdobject
- - the object bytessysmeta
- - 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 interfaceorg.dataone.service.cn.v2.CNAuthorization
- Parameters:
session
- - the Session object containing the credentials for the Subjectpid
- - the object identifier for the given object to apply the policypolicy
- - 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 interfaceorg.dataone.service.cn.v2.CNReplication
- Parameters:
session
- - the Session object containing the credentials for the Subjectpid
- - the object identifier for the given object to apply the policyreplica
- - 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, Date startTime, Date endTime, org.dataone.service.types.v1.ObjectFormatIdentifier formatid, org.dataone.service.types.v1.NodeReference nodeId, org.dataone.service.types.v1.Identifier identifier, Integer start, 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 interfaceorg.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.NotImplementedReturns a list of checksum algorithms that are supported by DataONE.- Specified by:
listChecksumAlgorithms
in interfaceorg.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 interfaceorg.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 interfaceorg.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, 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 interfaceorg.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 interfaceorg.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 InputStream query(org.dataone.service.types.v1.Session session, String queryEngine, 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 interfaceorg.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 interfaceorg.dataone.service.cn.v2.CNCore
- Throws:
org.dataone.service.exceptions.NotImplemented
org.dataone.service.exceptions.ServiceFailure
-