public class MNResourceHandler extends D1ResourceHandler
Modifier and Type | Field and Description |
---|---|
protected static java.lang.String |
RESOURCE_ERROR |
protected static java.lang.String |
RESOURCE_GENERATE_ID |
protected static java.lang.String |
RESOURCE_META_CHANGED |
protected static java.lang.String |
RESOURCE_MONITOR |
protected static java.lang.String |
RESOURCE_NODE |
protected static java.lang.String |
RESOURCE_PACKAGE |
protected static java.lang.String |
RESOURCE_PUBLISH |
protected static java.lang.String |
RESOURCE_REPLICAS |
protected static java.lang.String |
RESOURCE_REPLICATE |
protected static java.lang.String |
RESOURCE_TOKEN |
protected static java.lang.String |
RESOURCE_VIEWS |
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, response, servletContext, session
Constructor and Description |
---|
MNResourceHandler(javax.servlet.ServletContext servletContext,
javax.servlet.http.HttpServletRequest request,
javax.servlet.http.HttpServletResponse response)
Initializes new instance by setting servlet context,request and response
|
Modifier and Type | Method and Description |
---|---|
protected org.dataone.service.exceptions.SynchronizationFailed |
collectSynchronizationFailed() |
protected void |
getObject(java.lang.String pid)
Implements REST version of DataONE CRUD API --> get
|
protected void |
getPackage(java.lang.String pid)
Retrieve data package as Bagit zip
|
protected void |
getSystemMetadataObject(java.lang.String pid)
Retrieve System Metadata
|
void |
handle(byte httpVerb)
This function is called from REST API servlet and handles each request to the servlet
|
protected boolean |
isD1Enabled()
subclasses should provide a more useful implementation
|
protected void |
publish(java.lang.String pid) |
protected void |
putObject(java.lang.String trailingPid,
java.lang.String action)
Inserts or updates the object
|
collectMultipartFiles, collectMultipartParams, decode, findBoundaryString, getTempDirectory, initMultipartParams, initParams, parseTrailing, printError, serializeException
protected static final java.lang.String RESOURCE_MONITOR
protected static final java.lang.String RESOURCE_REPLICATE
protected static final java.lang.String RESOURCE_REPLICAS
protected static final java.lang.String RESOURCE_NODE
protected static final java.lang.String RESOURCE_ERROR
protected static final java.lang.String RESOURCE_META_CHANGED
protected static final java.lang.String RESOURCE_GENERATE_ID
protected static final java.lang.String RESOURCE_PUBLISH
protected static final java.lang.String RESOURCE_PACKAGE
protected static final java.lang.String RESOURCE_VIEWS
protected static final java.lang.String RESOURCE_TOKEN
public MNResourceHandler(javax.servlet.ServletContext servletContext, javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response)
protected boolean isD1Enabled()
D1ResourceHandler
isD1Enabled
in class D1ResourceHandler
public void handle(byte httpVerb)
handle
in class D1ResourceHandler
httpVerb
- (GET, POST, PUT or DELETE)protected void getObject(java.lang.String 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.InvalidRequest, org.dataone.service.exceptions.NotImplemented, java.io.IOException, org.dataone.exceptions.MarshallingException, org.dataone.service.exceptions.InsufficientResources
pid
- 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
org.dataone.service.exceptions.InsufficientResources
protected void getPackage(java.lang.String 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, java.io.IOException, org.dataone.service.exceptions.InvalidRequest
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.InvalidToken
java.io.IOException
org.dataone.service.exceptions.InvalidRequest
protected void publish(java.lang.String 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, java.io.IOException, org.dataone.exceptions.MarshallingException, org.dataone.service.exceptions.InvalidRequest, org.dataone.service.exceptions.IdentifierNotUnique, org.dataone.service.exceptions.UnsupportedType, org.dataone.service.exceptions.InsufficientResources, org.dataone.service.exceptions.InvalidSystemMetadata
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
java.io.IOException
org.dataone.exceptions.MarshallingException
org.dataone.service.exceptions.InvalidRequest
org.dataone.service.exceptions.IdentifierNotUnique
org.dataone.service.exceptions.UnsupportedType
org.dataone.service.exceptions.InsufficientResources
org.dataone.service.exceptions.InvalidSystemMetadata
protected void getSystemMetadataObject(java.lang.String 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.InvalidRequest, org.dataone.service.exceptions.NotImplemented, java.io.IOException, org.dataone.exceptions.MarshallingException
pid
- 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
protected void putObject(java.lang.String trailingPid, java.lang.String action) throws org.dataone.service.exceptions.ServiceFailure, org.dataone.service.exceptions.InvalidRequest, org.dataone.exceptions.MarshallingException, org.dataone.service.exceptions.InvalidToken, 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.NotFound, java.io.IOException, java.lang.InstantiationException, java.lang.IllegalAccessException
pid
- - 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.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.IdentifierNotUnique
org.dataone.service.exceptions.NotAuthorized
org.dataone.service.exceptions.InvalidToken
org.dataone.service.exceptions.NotFound
java.io.IOException
java.lang.IllegalAccessException
java.lang.InstantiationException
protected org.dataone.service.exceptions.SynchronizationFailed collectSynchronizationFailed() throws java.io.IOException, org.dataone.service.exceptions.ServiceFailure, org.dataone.service.exceptions.InvalidRequest, org.dataone.exceptions.MarshallingException, java.lang.InstantiationException, java.lang.IllegalAccessException, javax.xml.parsers.ParserConfigurationException, org.xml.sax.SAXException
java.io.IOException
org.dataone.service.exceptions.ServiceFailure
org.dataone.service.exceptions.InvalidRequest
org.dataone.exceptions.MarshallingException
java.lang.InstantiationException
java.lang.IllegalAccessException
javax.xml.parsers.ParserConfigurationException
org.xml.sax.SAXException
Copyright © 2020 Regents of the University of California. All Rights Reserved.