Search in sources :

Example 36 with ResourceNotFoundException

use of com.pspace.ifs.ksan.objmanager.ObjManagerException.ResourceNotFoundException in project ksan by infinistor.

the class S3Request method getObjectWithVersionId.

protected Metadata getObjectWithVersionId(String bucket, String object, String versionId) throws GWException {
    Metadata objMeta = null;
    try {
        setObjManager();
        objMeta = objManager.getObjectWithVersionId(bucket, object, versionId);
    } catch (ResourceNotFoundException e) {
        logger.info(GWConstants.LOG_REQUEST_NOT_FOUND_IN_DB, bucket, object);
        throw new GWException(GWErrorCode.NO_SUCH_KEY, s3Parameter);
    } catch (Exception e) {
        PrintStack.logging(logger, e);
        throw new GWException(GWErrorCode.SERVER_ERROR, s3Parameter);
    } finally {
        try {
            releaseObjManager();
        } catch (Exception e) {
            PrintStack.logging(logger, e);
            throw new GWException(GWErrorCode.SERVER_ERROR, s3Parameter);
        }
    }
    return objMeta;
}
Also used : Metadata(com.pspace.ifs.ksan.objmanager.Metadata) GWException(com.pspace.ifs.ksan.gw.exception.GWException) ResourceNotFoundException(com.pspace.ifs.ksan.objmanager.ObjManagerException.ResourceNotFoundException) GWException(com.pspace.ifs.ksan.gw.exception.GWException) ResourceAlreadyExistException(com.pspace.ifs.ksan.objmanager.ObjManagerException.ResourceAlreadyExistException) XMLStreamException(javax.xml.stream.XMLStreamException) ResourceNotFoundException(com.pspace.ifs.ksan.objmanager.ObjManagerException.ResourceNotFoundException) JsonProcessingException(com.fasterxml.jackson.core.JsonProcessingException) JsonMappingException(com.fasterxml.jackson.databind.JsonMappingException)

Aggregations

ResourceNotFoundException (com.pspace.ifs.ksan.objmanager.ObjManagerException.ResourceNotFoundException)36 ResourceAlreadyExistException (com.pspace.ifs.ksan.objmanager.ObjManagerException.ResourceAlreadyExistException)11 SQLException (java.sql.SQLException)11 GWException (com.pspace.ifs.ksan.gw.exception.GWException)10 JsonProcessingException (com.fasterxml.jackson.core.JsonProcessingException)8 JsonMappingException (com.fasterxml.jackson.databind.JsonMappingException)8 Metadata (com.pspace.ifs.ksan.objmanager.Metadata)8 XMLStreamException (javax.xml.stream.XMLStreamException)8 IOException (java.io.IOException)6 InvalidParameterException (java.security.InvalidParameterException)5 Document (org.bson.Document)5 AllServiceOfflineException (com.pspace.ifs.ksan.objmanager.ObjManagerException.AllServiceOfflineException)4 Iterator (java.util.Iterator)4 Bucket (com.pspace.ifs.ksan.objmanager.Bucket)3 ArrayList (java.util.ArrayList)3 FindIterable (com.mongodb.client.FindIterable)2 MQResponse (com.pspace.ifs.ksan.mq.MQResponse)2 ObjManager (com.pspace.ifs.ksan.objmanager.ObjManager)2 ObjManagerUtil (com.pspace.ifs.ksan.objmanager.ObjManagerUtil)2 NoSuchAlgorithmException (java.security.NoSuchAlgorithmException)2