Class StorageIDResolver


  • @Path("storage")
    public class StorageIDResolver
    extends Object
    The StorageIDResolver is able to give HTTP resolution to storage resource by ID See more at https://gcube.wiki.gcube-system.org/gcube/URI_Resolver#STORAGE-ID_Resolver
    Author:
    Francesco Mangiacrapa at ISTI-CNR (francesco.mangiacrapa@isti.cnr.it) Dec 14, 2018
    • Field Detail

      • storageManagerClient

        protected static org.gcube.contentmanagement.blobstorage.service.IClient storageManagerClient
    • Constructor Detail

      • StorageIDResolver

        public StorageIDResolver()
    • Method Detail

      • getStorageId

        @GET
        @Path("/{storage-id}")
        public javax.ws.rs.core.Response getStorageId​(@Context
                                                      javax.servlet.http.HttpServletRequest req,
                                                      @PathParam("storage-id")
                                                      String storageId,
                                                      @QueryParam("fileName")
                                                      String fileName,
                                                      @QueryParam("contentType")
                                                      String contentType,
                                                      @QueryParam("content-disposition")
                                                      String contentDisposition,
                                                      @QueryParam("validation")
                                                      boolean validation)
                                               throws javax.ws.rs.WebApplicationException
        Gets the storage id.
        Parameters:
        req - the req
        storageId - the storage id
        fileName - the file name
        contentType - the content type
        validation - the validation
        Returns:
        the storage id
        Throws:
        javax.ws.rs.WebApplicationException - the web application exception
      • resolveStorageId

        protected static javax.ws.rs.core.Response resolveStorageId​(javax.servlet.http.HttpServletRequest httpRequest,
                                                                    String storageId,
                                                                    String fileName,
                                                                    String contentType,
                                                                    ConstantsResolver.CONTENT_DISPOSITION_VALUE contentDisposition,
                                                                    boolean validation)
                                                             throws Exception
        Resolve storage id.
        Parameters:
        httpRequest - the http request
        storageId - the storage id
        fileName - the file name
        contentType - the content type
        validation - the validation
        Returns:
        the response
        Throws:
        Exception - the exception
      • httpDoHead

        @HEAD
        @Path("/{storage-id}")
        public javax.ws.rs.core.Response httpDoHead​(@Context
                                                    javax.servlet.http.HttpServletRequest req,
                                                    @PathParam("storage-id")
                                                    String storageId,
                                                    @QueryParam("hproxycheck")
                                                    boolean hproxycheck)
                                             throws javax.ws.rs.WebApplicationException
        Http do head.
        Parameters:
        req - the http request
        storageId - the storage id
        hproxycheck - the hproxycheck
        Returns:
        the response
        Throws:
        javax.ws.rs.WebApplicationException - the web application exception
      • validationPayload

        protected javax.ws.rs.core.Response validationPayload​(javax.servlet.http.HttpServletRequest httpRequest,
                                                              String storageId)
                                                       throws Exception
        Validation payload.
        Parameters:
        httpRequest - the http request
        storageId - the storage id
        Returns:
        the response
        Throws:
        Exception - the exception
      • getStorageClientInstance

        protected static org.gcube.contentmanagement.blobstorage.service.IClient getStorageClientInstance​(org.gcube.contentmanager.storageclient.wrapper.MemoryType memory)
        Get a storage-manager client instance. A new storage instance will be instantied only if the memory type is not the same of the previous one. In this case the old connection will be closed.
        Parameters:
        memoryType - indicates the memory type (Persistent, Volatile or whatever)
        Returns:
        the storage client instance
      • getStorageMetadataFile

        public static StorageMetadataFile getStorageMetadataFile​(org.gcube.contentmanagement.blobstorage.service.IClient iClient,
                                                                 String toSEID)
        Gets the storage metadata file.
        Parameters:
        iClient - the i client
        toSEID - the to SEID
        Returns:
        the storage metadata file