Class MNResourceHandler
java.lang.Object
edu.ucsb.nceas.metacat.restservice.D1ResourceHandler
edu.ucsb.nceas.metacat.restservice.v2.MNResourceHandler
MN REST service implementation handler
******************
MNCore
ping() - GET /d1/mn/monitor/ping
log() - GET /d1/mn/log
**getObjectStatistics() - GET /d1/mn/monitor/object
getOperationsStatistics - GET /d1/mn/monitor/event
**getStatus - GET /d1/mn/monitor/status
getCapabilities() - GET /d1/mn/ and /d1/mn/node
MNRead
get() - GET /d1/mn/object/PID
getSystemMetadata() - GET /d1/mn/meta/PID
describe() - HEAD /d1/mn/object/PID
getChecksum() - GET /d1/mn/checksum/PID
listObjects() - GET /d1/mn/object
synchronizationFailed() - POST /d1/mn/error
MNAuthorization
isAuthorized() - GET /d1/mn/isAuthorized/PID
setAccessPolicy() - PUT /d1/mn/accessRules/PID
MNStorage
create() - POST /d1/mn/object/PID
update() - PUT /d1/mn/object/PID
delete() - DELETE /d1/mn/object/PID
archive() - PUT /d1/mn/archive/PID
updateSystemMetadata() - PUT /d1/mn/meta
systemMetadataChanged() - POST /dirtySystemMetadata/PID
MNReplication
replicate() - POST /d1/mn/replicate
getReplica() - GET /d1/mn/replica
MNAdmin
reindex() - PUT /d1/mn/index
updateIdMetadata() - PUT /d1/mn/identifiers
******************
- Author:
- leinfelder
-
Field Summary
FieldsModifier and TypeFieldDescriptionprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final Stringprotected static final StringFields inherited from class edu.ucsb.nceas.metacat.restservice.D1ResourceHandler
ATTACHMENT, auth, authCacheSize, DELETE, enableAppendLdapGroups, enableSessionFromHeader, FUNCTION_NAME_INSERT, FUNCTION_NAME_UPDATE, GET, HEAD, MAX_UPLOAD_SIZE, multipartparams, params, POST, proxyKey, PUT, request, RESOURCE_ACCESS_RULES, RESOURCE_BASE_URL, RESOURCE_IS_AUTHORIZED, RESOURCE_LOG, RESOURCE_META, RESOURCE_OBJECTS, RESOURCE_QUERY, RESOURCE_VIEWS, response, session -
Constructor Summary
ConstructorsConstructorDescriptionMNResourceHandler(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Initializes new instance by setting servlet context,request and response -
Method Summary
Modifier and TypeMethodDescriptionprotected org.dataone.service.exceptions.SynchronizationFailedprotected voidImplements REST version of DataONE CRUD API --> getprotected voidgetPackage(String format, String pid) Retrieve data package as Bagit zipprotected voidRetrieve System Metadatavoidhandle(byte httpVerb) This function is called from REST API servlet and handles each request to the servletprotected booleansubclasses should provide a more useful implementationprotected voidprotected voidpublishIdentifier(String identifier) Make the status of the identifier publicprotected voidInserts or updates the objectprotected voidHandle the reindex requestprotected voidupdateIdMetadata(String pid) Handle the request to update identifiers' (such as DOI) metadata on the third party serviceprotected voidUpdate the system metadata for a specified identifierMethods inherited from class edu.ucsb.nceas.metacat.restservice.D1ResourceHandler
collectMultipartFiles, collectMultipartParams, collectObjectFiles, decode, getSessionFromHeader, getTempDirectory, initMultipartParams, initParams, parseTrailing, printError, serializeException
-
Field Details
-
RESOURCE_MONITOR
- See Also:
-
RESOURCE_REPLICATE
- See Also:
-
RESOURCE_REPLICAS
- See Also:
-
RESOURCE_NODE
- See Also:
-
RESOURCE_ERROR
- See Also:
-
RESOURCE_META_CHANGED
- See Also:
-
RESOURCE_GENERATE_ID
- See Also:
-
RESOURCE_PUBLISH
- See Also:
-
RESOURCE_PACKAGE
- See Also:
-
RESOURCE_TOKEN
- See Also:
-
RESOURCE_WHOAMI
- See Also:
-
RESOURCE_PUBLISH_IDENTIFIER
- See Also:
-
RESOURCE_INDEX
- See Also:
-
RESOURCE_IDENTIFIERS
- See Also:
-
-
Constructor Details
-
MNResourceHandler
public MNResourceHandler(javax.servlet.http.HttpServletRequest request, javax.servlet.http.HttpServletResponse response) Initializes new instance by setting servlet context,request and response- Parameters:
request- the request that the handler will handleresponse- the response that the handler will send back
-
-
Method Details
-
isD1Enabled
protected boolean isD1Enabled()Description copied from class:D1ResourceHandlersubclasses should provide a more useful implementation- Overrides:
isD1Enabledin classD1ResourceHandler- Returns:
-
handle
public void handle(byte httpVerb) This function is called from REST API servlet and handles each request to the servlet- Overrides:
handlein classD1ResourceHandler- Parameters:
httpVerb- (GET, POST, PUT or DELETE)
-
getObject
protected void getObject(String pid) throws org.dataone.service.exceptions.InvalidToken, org.dataone.service.exceptions.ServiceFailure, org.dataone.service.exceptions.NotAuthorized, InterruptedException, org.dataone.service.exceptions.NotFound, org.dataone.service.exceptions.InvalidRequest, org.dataone.service.exceptions.NotImplemented, IOException, org.dataone.exceptions.MarshallingException Implements REST version of DataONE CRUD API --> get- Parameters:
pid- ID of data object to be read- Throws:
org.dataone.service.exceptions.NotImplementedorg.dataone.service.exceptions.InvalidRequestorg.dataone.service.exceptions.NotFoundorg.dataone.service.exceptions.NotAuthorizedorg.dataone.service.exceptions.ServiceFailureorg.dataone.service.exceptions.InvalidTokenIOExceptionorg.dataone.exceptions.MarshallingExceptionInterruptedException
-
getPackage
protected void getPackage(String format, 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, IOException, org.dataone.service.exceptions.InvalidRequest Retrieve data package as Bagit zip- Parameters:
pid-- Throws:
org.dataone.service.exceptions.NotImplementedorg.dataone.service.exceptions.NotFoundorg.dataone.service.exceptions.NotAuthorizedorg.dataone.service.exceptions.ServiceFailureorg.dataone.service.exceptions.InvalidTokenIOExceptionorg.dataone.service.exceptions.InvalidRequest
-
publish
protected void publish(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, 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 - Throws:
org.dataone.service.exceptions.InvalidTokenorg.dataone.service.exceptions.ServiceFailureorg.dataone.service.exceptions.NotAuthorizedorg.dataone.service.exceptions.NotFoundorg.dataone.service.exceptions.NotImplementedIOExceptionorg.dataone.exceptions.MarshallingExceptionorg.dataone.service.exceptions.InvalidRequestorg.dataone.service.exceptions.IdentifierNotUniqueorg.dataone.service.exceptions.UnsupportedTypeorg.dataone.service.exceptions.InsufficientResourcesorg.dataone.service.exceptions.InvalidSystemMetadata
-
publishIdentifier
protected void publishIdentifier(String identifier) throws org.dataone.service.exceptions.InvalidToken, org.dataone.service.exceptions.ServiceFailure, org.dataone.service.exceptions.NotAuthorized, org.dataone.service.exceptions.NotImplemented, org.dataone.service.exceptions.InvalidRequest, org.dataone.service.exceptions.NotFound, org.dataone.service.exceptions.IdentifierNotUnique, org.dataone.service.exceptions.UnsupportedType, org.dataone.service.exceptions.InsufficientResources, org.dataone.service.exceptions.InvalidSystemMetadata, DOIException, IOException, org.dataone.exceptions.MarshallingException Make the status of the identifier public- Parameters:
identifier-- Throws:
org.dataone.service.exceptions.InvalidTokenorg.dataone.service.exceptions.ServiceFailureorg.dataone.service.exceptions.NotAuthorizedorg.dataone.service.exceptions.NotImplementedorg.dataone.service.exceptions.InvalidRequestorg.dataone.service.exceptions.NotFoundorg.dataone.service.exceptions.IdentifierNotUniqueorg.dataone.service.exceptions.UnsupportedTypeorg.dataone.service.exceptions.InsufficientResourcesorg.dataone.service.exceptions.InvalidSystemMetadataDOIExceptionIOExceptionorg.dataone.exceptions.MarshallingException
-
getSystemMetadataObject
protected void getSystemMetadataObject(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, IOException, org.dataone.exceptions.MarshallingException Retrieve System Metadata- Parameters:
pid-- Throws:
org.dataone.service.exceptions.InvalidTokenorg.dataone.service.exceptions.ServiceFailureorg.dataone.service.exceptions.NotAuthorizedorg.dataone.service.exceptions.NotFoundorg.dataone.service.exceptions.InvalidRequestorg.dataone.service.exceptions.NotImplementedIOExceptionorg.dataone.exceptions.MarshallingException
-
putObject
protected void putObject(String trailingPid, 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, IOException, InterruptedException, InstantiationException, IllegalAccessException, NoSuchAlgorithmException, org.apache.commons.fileupload.FileUploadException, InvocationTargetException Inserts or updates the object- Parameters:
trailingPid- the pid part of in the urlaction- indicate that it is insert or update- Throws:
org.dataone.service.exceptions.InvalidRequestorg.dataone.service.exceptions.ServiceFailureorg.dataone.exceptions.MarshallingExceptionorg.dataone.service.exceptions.NotImplementedorg.dataone.service.exceptions.InvalidSystemMetadataorg.dataone.service.exceptions.InsufficientResourcesorg.dataone.service.exceptions.UnsupportedTypeorg.dataone.service.exceptions.IdentifierNotUniqueorg.dataone.service.exceptions.NotAuthorizedorg.dataone.service.exceptions.InvalidTokenorg.dataone.service.exceptions.NotFoundIOExceptionIllegalAccessExceptionInstantiationExceptionorg.apache.commons.fileupload.FileUploadExceptionNoSuchAlgorithmExceptionInterruptedExceptionInvocationTargetException
-
collectSynchronizationFailed
protected org.dataone.service.exceptions.SynchronizationFailed collectSynchronizationFailed() throws IOException, org.dataone.service.exceptions.ServiceFailure, org.dataone.service.exceptions.InvalidRequest, org.dataone.exceptions.MarshallingException, InstantiationException, IllegalAccessException, ParserConfigurationException, SAXException- Throws:
IOExceptionorg.dataone.service.exceptions.ServiceFailureorg.dataone.service.exceptions.InvalidRequestorg.dataone.exceptions.MarshallingExceptionInstantiationExceptionIllegalAccessExceptionParserConfigurationExceptionSAXException
-
updateSystemMetadata
protected void updateSystemMetadata() throws org.dataone.service.exceptions.ServiceFailure, org.dataone.service.exceptions.InvalidRequest, InstantiationException, IllegalAccessException, IOException, org.dataone.exceptions.MarshallingException, org.dataone.service.exceptions.NotImplemented, org.dataone.service.exceptions.NotAuthorized, org.dataone.service.exceptions.InvalidSystemMetadata, org.dataone.service.exceptions.InvalidTokenUpdate the system metadata for a specified identifier- Throws:
org.dataone.service.exceptions.ServiceFailureorg.dataone.service.exceptions.InvalidRequestInstantiationExceptionIllegalAccessExceptionIOExceptionorg.dataone.exceptions.MarshallingExceptionorg.dataone.service.exceptions.NotImplementedorg.dataone.service.exceptions.NotAuthorizedorg.dataone.service.exceptions.InvalidSystemMetadataorg.dataone.service.exceptions.InvalidToken
-
reindex
protected void reindex(String pid) throws org.dataone.service.exceptions.InvalidRequest, org.dataone.service.exceptions.ServiceFailure, org.dataone.service.exceptions.NotAuthorized, org.dataone.service.exceptions.NotImplemented, IOException Handle the reindex request- Parameters:
pid- the pid which will be indexed. It can be null, which means we will do a batch reindex based on the query part- Throws:
org.dataone.service.exceptions.InvalidRequestorg.dataone.service.exceptions.ServiceFailureorg.dataone.service.exceptions.NotAuthorizedorg.dataone.service.exceptions.NotImplementedIOException
-
updateIdMetadata
protected void updateIdMetadata(String pid) throws org.dataone.service.exceptions.ServiceFailure, org.dataone.service.exceptions.NotAuthorized, org.dataone.service.exceptions.InvalidRequest, org.dataone.service.exceptions.NotImplemented, IOException Handle the request to update identifiers' (such as DOI) metadata on the third party service- Parameters:
pid- the pid which will be updated. It can be null, which means we will do a batch of update based on the query part.- Throws:
org.dataone.service.exceptions.ServiceFailureorg.dataone.service.exceptions.NotAuthorizedorg.dataone.service.exceptions.InvalidRequestorg.dataone.service.exceptions.NotImplementedIOException
-