Class StorageIDResolver
- java.lang.Object
-
- org.gcube.datatransfer.resolver.services.StorageIDResolver
-
@Path("storage") public class StorageIDResolver extends ObjectThe 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 Summary
Fields Modifier and Type Field Description protected static StringSTORAGEID_RESOLVERprotected static org.gcube.contentmanagement.blobstorage.service.IClientstorageManagerClient
-
Constructor Summary
Constructors Constructor Description StorageIDResolver()
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description protected static org.gcube.contentmanagement.blobstorage.service.IClientgetStorageClientInstance(org.gcube.contentmanager.storageclient.wrapper.MemoryType memory)Get a storage-manager client instance.javax.ws.rs.core.ResponsegetStorageId(javax.servlet.http.HttpServletRequest req, String storageId, String fileName, String contentType, String contentDisposition, boolean validation)Gets the storage id.static StorageMetadataFilegetStorageMetadataFile(org.gcube.contentmanagement.blobstorage.service.IClient iClient, String toSEID)Gets the storage metadata file.javax.ws.rs.core.ResponsehttpDoHead(javax.servlet.http.HttpServletRequest req, String storageId, boolean hproxycheck)Http do head.protected static javax.ws.rs.core.ResponseresolveStorageId(javax.servlet.http.HttpServletRequest httpRequest, String storageId, String fileName, String contentType, ConstantsResolver.CONTENT_DISPOSITION_VALUE contentDisposition, boolean validation)Resolve storage id.protected javax.ws.rs.core.ResponsevalidationPayload(javax.servlet.http.HttpServletRequest httpRequest, String storageId)Validation payload.
-
-
-
Field Detail
-
STORAGEID_RESOLVER
protected static final String STORAGEID_RESOLVER
- See Also:
- Constant Field Values
-
storageManagerClient
protected static org.gcube.contentmanagement.blobstorage.service.IClient storageManagerClient
-
-
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.WebApplicationExceptionGets the storage id.- Parameters:
req- the reqstorageId- the storage idfileName- the file namecontentType- the content typevalidation- 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 ExceptionResolve storage id.- Parameters:
httpRequest- the http requeststorageId- the storage idfileName- the file namecontentType- the content typevalidation- 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.WebApplicationExceptionHttp do head.- Parameters:
req- the http requeststorageId- the storage idhproxycheck- 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 ExceptionValidation payload.- Parameters:
httpRequest- the http requeststorageId- 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 clienttoSEID- the to SEID- Returns:
- the storage metadata file
-
-