Class MNResourceHandler

java.lang.Object
edu.ucsb.nceas.metacat.restservice.D1ResourceHandler
edu.ucsb.nceas.metacat.restservice.v1.MNResourceHandler

public class MNResourceHandler extends D1ResourceHandler
MN REST service implementation handler ****************** MNCore -- DONE 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 -- DONE 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 -- DONE isAuthorized() - GET /d1/mn/isAuthorized/PID setAccessPolicy() - PUT /d1/mn/accessRules/PID MNStorage - DONE create() - POST /d1/mn/object/PID update() - PUT /d1/mn/object/PID delete() - DELETE /d1/mn/object/PID archive() - PUT /d1/mn/archive/PID systemMetadataChanged() - POST /dirtySystemMetadata/PID MNReplication replicate() - POST /d1/mn/replicate getReplica() - GET /d1/mn/replica ******************
Author:
leinfelder
  • Field Details

  • Constructor Details

    • MNResourceHandler

      public 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
  • Method Details

    • isD1Enabled

      protected boolean isD1Enabled()
      Description copied from class: D1ResourceHandler
      subclasses should provide a more useful implementation
      Overrides:
      isD1Enabled in class D1ResourceHandler
      Returns:
    • handle

      public void handle(byte httpVerb)
      This function is called from REST API servlet and handles each request to the servlet
      Overrides:
      handle in class D1ResourceHandler
      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, org.dataone.service.exceptions.NotFound, org.dataone.service.exceptions.InvalidRequest, org.dataone.service.exceptions.NotImplemented, IOException, org.dataone.exceptions.MarshallingException, org.dataone.service.exceptions.InsufficientResources
      Implements REST version of DataONE CRUD API --> get
      Parameters:
      pid - ID of data object to be read
      Throws:
      org.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
      IOException
      org.dataone.exceptions.MarshallingException
      org.dataone.service.exceptions.InsufficientResources
    • getPackage

      protected void getPackage(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.NotImplemented
      org.dataone.service.exceptions.NotFound
      org.dataone.service.exceptions.NotAuthorized
      org.dataone.service.exceptions.ServiceFailure
      org.dataone.service.exceptions.InvalidToken
      IOException
      org.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.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
    • 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.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
    • 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, InstantiationException, IllegalAccessException, NoSuchAlgorithmException, org.apache.commons.fileupload.FileUploadException
      Inserts or updates the object
      Parameters:
      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 one
      Throws:
      org.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
      IOException
      IllegalAccessException
      InstantiationException
      org.apache.commons.fileupload.FileUploadException
      NoSuchAlgorithmException
    • 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:
      IOException
      org.dataone.service.exceptions.ServiceFailure
      org.dataone.service.exceptions.InvalidRequest
      org.dataone.exceptions.MarshallingException
      InstantiationException
      IllegalAccessException
      ParserConfigurationException
      SAXException