public class CNResourceHandler extends D1ResourceHandler
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
RESOURCE_FORMATS |
protected static java.lang.String |
RESOURCE_OWNER |
protected static java.lang.String |
RESOURCE_REPLICATION_AUTHORIZED |
protected static java.lang.String |
RESOURCE_REPLICATION_META |
protected static java.lang.String |
RESOURCE_REPLICATION_NOTIFY |
protected static java.lang.String |
RESOURCE_REPLICATION_POLICY |
protected static java.lang.String |
RESOURCE_RESERVE
CN-specific operations
|
protected static java.lang.String |
RESOURCE_RESOLVE |
DELETE, FUNCTION_NAME_INSERT, FUNCTION_NAME_UPDATE, GET, handler, HEAD, logMetacat, MAX_UPLOAD_SIZE, multipartparams, params, POST, PUT, request, RESOURCE_ACCESS_RULES, RESOURCE_BASE_URL, RESOURCE_IS_AUTHORIZED, RESOURCE_LOG, RESOURCE_META, RESOURCE_OBJECTS, RESOURCE_QUERY, RESOURCE_VIEWS, response, servletContext, session
Constructor and Description |
---|
CNResourceHandler(javax.servlet.ServletContext servletContext,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response) |
Modifier and Type | Method and Description |
---|---|
boolean |
deleteReplica(java.lang.String pid)
Delete the replica entry with the given nodeId for the given pid
|
protected void |
getObject(java.lang.String guid)
Implements REST version of DataONE CRUD API --> get
|
protected void |
getSystemMetadataObject(java.lang.String guid)
Implements REST version of DataONE CRUD API --> getSystemMetadata
|
void |
handle(byte httpVerb)
This function is called from REST API servlet and handles each request to
the servlet
|
boolean |
isNodeAuthorized(java.lang.String pid)
Pass the request to get node replication authorization to CNodeService
|
protected void |
putObject(java.lang.String action)
Earthgrid API > Put Service >Put Function : calls MetacatHandler >
handleInsertOrUpdateAction
|
protected void |
registerSystemMetadata()
Register System Metadata without data or metadata object
|
protected void |
setAccess(java.lang.String pid)
set the access perms on a document
|
boolean |
setObsoletedBy(java.lang.String pid)
Update the system metadata for a given pid, setting it to be obsoleted
by the obsoletedByPid
|
boolean |
setReplicationPolicy(java.lang.String pid)
Pass the request to set the replication policy to CNodeService
|
boolean |
setReplicationStatus(java.lang.String pid)
Pass the request to set the replication status to CNodeService
|
boolean |
updateReplicationMetadata(java.lang.String pid)
Pass the request to update the replication metadata to CNodeService
|
collectMultipartFiles, collectMultipartParams, decode, findBoundaryString, getTempDirectory, initMultipartParams, initParams, isD1Enabled, parseTrailing, printError, serializeException
protected static final java.lang.String RESOURCE_RESERVE
protected static final java.lang.String RESOURCE_FORMATS
protected static final java.lang.String RESOURCE_RESOLVE
protected static final java.lang.String RESOURCE_OWNER
protected static final java.lang.String RESOURCE_REPLICATION_POLICY
protected static final java.lang.String RESOURCE_REPLICATION_META
protected static final java.lang.String RESOURCE_REPLICATION_AUTHORIZED
protected static final java.lang.String RESOURCE_REPLICATION_NOTIFY
public CNResourceHandler(javax.servlet.ServletContext servletContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
public void handle(byte httpVerb)
handle
in class D1ResourceHandler
httpVerb
- (GET, POST, PUT or DELETE)protected void getObject(java.lang.String guid) throws org.dataone.service.exceptions.InvalidToken, org.dataone.service.exceptions.ServiceFailure, org.dataone.service.exceptions.NotAuthorized, org.dataone.service.exceptions.NotFound, org.dataone.service.exceptions.InvalidRequest, org.dataone.service.exceptions.NotImplemented, java.io.IOException
guid
- ID of data object to be readorg.dataone.service.exceptions.NotImplemented
org.dataone.service.exceptions.InvalidRequest
org.dataone.service.exceptions.NotFound
org.dataone.service.exceptions.NotAuthorized
org.dataone.service.exceptions.ServiceFailure
org.dataone.service.exceptions.InvalidToken
java.io.IOException
protected void getSystemMetadataObject(java.lang.String guid) throws org.dataone.service.exceptions.InvalidToken, org.dataone.service.exceptions.ServiceFailure, org.dataone.service.exceptions.NotAuthorized, org.dataone.service.exceptions.NotFound, org.dataone.service.exceptions.InvalidRequest, org.dataone.service.exceptions.NotImplemented, java.io.IOException, org.dataone.exceptions.MarshallingException
guid
- ID of data object to be readorg.dataone.service.exceptions.NotImplemented
org.dataone.service.exceptions.InvalidRequest
org.dataone.service.exceptions.NotFound
org.dataone.service.exceptions.NotAuthorized
org.dataone.service.exceptions.ServiceFailure
org.dataone.service.exceptions.InvalidToken
java.io.IOException
org.dataone.exceptions.MarshallingException
protected void putObject(java.lang.String action) throws org.dataone.service.exceptions.ServiceFailure, org.dataone.service.exceptions.InvalidRequest, org.dataone.service.exceptions.IdentifierNotUnique, org.dataone.exceptions.MarshallingException, org.dataone.service.exceptions.InvalidToken, org.dataone.service.exceptions.NotAuthorized, org.dataone.service.exceptions.UnsupportedType, org.dataone.service.exceptions.InsufficientResources, org.dataone.service.exceptions.InvalidSystemMetadata, org.dataone.service.exceptions.NotImplemented, java.io.IOException, java.lang.InstantiationException, java.lang.IllegalAccessException
guid
- - ID of data object to be inserted or updated. If action is
update, the pid is the existing pid. If insert, the pid is the
new oneorg.dataone.service.exceptions.InvalidRequest
org.dataone.service.exceptions.ServiceFailure
org.dataone.service.exceptions.IdentifierNotUnique
org.dataone.exceptions.MarshallingException
org.dataone.service.exceptions.NotImplemented
org.dataone.service.exceptions.InvalidSystemMetadata
org.dataone.service.exceptions.InsufficientResources
org.dataone.service.exceptions.UnsupportedType
org.dataone.service.exceptions.NotAuthorized
org.dataone.service.exceptions.InvalidToken
java.io.IOException
java.lang.IllegalAccessException
java.lang.InstantiationException
protected void registerSystemMetadata() throws org.dataone.service.exceptions.ServiceFailure, org.dataone.service.exceptions.InvalidRequest, java.io.IOException, org.apache.commons.fileupload.FileUploadException, org.dataone.exceptions.MarshallingException, org.dataone.service.exceptions.NotImplemented, org.dataone.service.exceptions.NotAuthorized, org.dataone.service.exceptions.InvalidSystemMetadata, java.lang.InstantiationException, java.lang.IllegalAccessException, org.dataone.service.exceptions.InvalidToken
pid
- identifier for System Metadata entryorg.dataone.exceptions.MarshallingException
org.apache.commons.fileupload.FileUploadException
java.io.IOException
org.dataone.service.exceptions.InvalidRequest
org.dataone.service.exceptions.ServiceFailure
org.dataone.service.exceptions.InvalidSystemMetadata
org.dataone.service.exceptions.NotAuthorized
org.dataone.service.exceptions.NotImplemented
java.lang.IllegalAccessException
java.lang.InstantiationException
org.dataone.service.exceptions.InvalidToken
protected void setAccess(java.lang.String pid) throws org.dataone.exceptions.MarshallingException, 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, java.io.IOException, java.lang.InstantiationException, java.lang.IllegalAccessException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException, org.dataone.service.exceptions.VersionMismatch
org.dataone.exceptions.MarshallingException
org.dataone.service.exceptions.InvalidRequest
org.dataone.service.exceptions.NotImplemented
org.dataone.service.exceptions.NotAuthorized
org.dataone.service.exceptions.NotFound
org.dataone.service.exceptions.ServiceFailure
org.dataone.service.exceptions.InvalidToken
java.lang.IllegalAccessException
java.lang.InstantiationException
java.io.IOException
org.xml.sax.SAXException
javax.xml.parsers.ParserConfigurationException
org.dataone.service.exceptions.VersionMismatch
public boolean isNodeAuthorized(java.lang.String 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
pid
- the identifier of the object to get authorization to replicateorg.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
public boolean setReplicationPolicy(java.lang.String pid) 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, java.io.IOException, java.lang.InstantiationException, java.lang.IllegalAccessException, org.dataone.exceptions.MarshallingException, org.dataone.service.exceptions.VersionMismatch
pid
- the identifier of the object to set the replication policy onorg.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
java.io.IOException
java.lang.InstantiationException
java.lang.IllegalAccessException
org.dataone.exceptions.MarshallingException
org.dataone.service.exceptions.VersionMismatch
public boolean setObsoletedBy(java.lang.String pid) 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, java.lang.InstantiationException, java.lang.IllegalAccessException, org.dataone.service.exceptions.VersionMismatch
pid
- 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
java.lang.InstantiationException
java.lang.IllegalAccessException
org.dataone.service.exceptions.VersionMismatch
public boolean deleteReplica(java.lang.String pid) 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, java.lang.InstantiationException, java.lang.IllegalAccessException, org.dataone.service.exceptions.VersionMismatch
pid
- 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
java.lang.InstantiationException
java.lang.IllegalAccessException
org.dataone.service.exceptions.VersionMismatch
public boolean setReplicationStatus(java.lang.String pid) 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
pid
- the identifier of the object to set the replication status onorg.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
org.dataone.exceptions.MarshallingException
java.lang.IllegalAccessException
java.lang.InstantiationException
java.io.IOException
public boolean updateReplicationMetadata(java.lang.String pid) 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, org.dataone.service.exceptions.VersionMismatch, java.lang.InstantiationException, java.lang.IllegalAccessException, java.io.IOException, org.dataone.exceptions.MarshallingException
pid
- the identifier of the object to update the replication
metadata onorg.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
org.dataone.service.exceptions.VersionMismatch
org.dataone.exceptions.MarshallingException
java.io.IOException
java.lang.IllegalAccessException
java.lang.InstantiationException
Copyright © 2020 Regents of the University of California. All Rights Reserved.