Package com.cloud.bridge.service.core.s3

Examples of com.cloud.bridge.service.core.s3.S3GetObjectRequest


    private void executeHeadObject(HttpServletRequest request, HttpServletResponse response) throws IOException
    {
        String bucket = (String) request.getAttribute(S3Constants.BUCKET_ATTR_KEY);
        String key    = (String) request.getAttribute(S3Constants.OBJECT_ATTR_KEY);

        S3GetObjectRequest engineRequest = new S3GetObjectRequest();
        engineRequest.setBucketName(bucket);
        engineRequest.setKey(key);
        engineRequest.setInlineData(true);    // -> need to set so we get ETag etc returned
        engineRequest.setReturnData(true);
        engineRequest.setReturnMetadata(true);
        engineRequest = setRequestByteRange( request, engineRequest );

        // -> is this a request for a specific version of the object?  look for "versionId=" in the query string
        String queryString = request.getQueryString();
        if (null != queryString) engineRequest.setVersion( returnParameter( queryString, "versionId=" ));

        S3GetObjectResponse engineResponse = ServiceProvider.getInstance().getS3Engine().handleRequest( engineRequest );   
        response.setStatus( engineResponse.getResultCode());

        //bucket lookup for non-existance key
View Full Code Here


    private void executeGetObject(HttpServletRequest request, HttpServletResponse response) throws IOException {
        String bucket = (String)request.getAttribute(S3Constants.BUCKET_ATTR_KEY);
        String key = (String)request.getAttribute(S3Constants.OBJECT_ATTR_KEY);

        S3GetObjectRequest engineRequest = new S3GetObjectRequest();
        engineRequest.setBucketName(bucket);
        engineRequest.setKey(key);
        engineRequest.setInlineData(true);
        engineRequest.setReturnData(true);
        //engineRequest.setReturnMetadata(true);
        engineRequest = setRequestByteRange(request, engineRequest);

        // -> is this a request for a specific version of the object?  look for "versionId=" in the query string
        String queryString = request.getQueryString();
        if (null != queryString)
            engineRequest.setVersion(returnParameter(queryString, "versionId="));

        S3GetObjectResponse engineResponse = ServiceProvider.getInstance().getS3Engine().handleRequest(engineRequest);
        response.setStatus(engineResponse.getResultCode());

        if (engineResponse.getResultCode() >= 400) {
View Full Code Here

    private void executeHeadObject(HttpServletRequest request, HttpServletResponse response) throws IOException {
        String bucket = (String)request.getAttribute(S3Constants.BUCKET_ATTR_KEY);
        String key = (String)request.getAttribute(S3Constants.OBJECT_ATTR_KEY);

        S3GetObjectRequest engineRequest = new S3GetObjectRequest();
        engineRequest.setBucketName(bucket);
        engineRequest.setKey(key);
        engineRequest.setInlineData(true);    // -> need to set so we get ETag etc returned
        engineRequest.setReturnData(true);
        engineRequest.setReturnMetadata(true);
        engineRequest = setRequestByteRange(request, engineRequest);

        // -> is this a request for a specific version of the object?  look for "versionId=" in the query string
        String queryString = request.getQueryString();
        if (null != queryString)
            engineRequest.setVersion(returnParameter(queryString, "versionId="));

        S3GetObjectResponse engineResponse = ServiceProvider.getInstance().getS3Engine().handleRequest(engineRequest);
        response.setStatus(engineResponse.getResultCode());

        //bucket lookup for non-existance key
View Full Code Here

    public GetObjectExtendedResponse getObjectExtended(GetObjectExtended getObjectExtended) {
        return toGetObjectExtendedResponse(engine.handleRequest(toEngineGetObjectRequest(getObjectExtended)));
    }

    private S3GetObjectRequest toEngineGetObjectRequest(GetObject getObject) {
        S3GetObjectRequest request = new S3GetObjectRequest();

        request.setAccessKey(getObject.getAWSAccessKeyId());
        request.setRequestTimestamp(getObject.getTimestamp());
        request.setSignature(getObject.getSignature());
        request.setBucketName(getObject.getBucket());
        request.setKey(getObject.getKey());
        request.setReturnData(getObject.getGetData());
        request.setReturnMetadata(getObject.getGetMetadata());
        request.setInlineData(getObject.getInlineData());
        return request;
    }
View Full Code Here

        request.setInlineData(getObject.getInlineData());
        return request;
    }

    private S3GetObjectRequest toEngineGetObjectRequest(GetObjectExtended getObjectExtended) {
        S3GetObjectRequest request = new S3GetObjectRequest();
        request.setAccessKey(getObjectExtended.getAWSAccessKeyId());
        request.setRequestTimestamp(getObjectExtended.getTimestamp());
        request.setSignature(getObjectExtended.getSignature());
        request.setBucketName(getObjectExtended.getBucket());
        request.setKey(getObjectExtended.getKey());
        request.setReturnData(getObjectExtended.getGetData());
        request.setReturnMetadata(getObjectExtended.getGetMetadata());
        request.setInlineData(getObjectExtended.getInlineData());

        S3ConditionalHeaders conds = new S3ConditionalHeaders();
        conds.setModifiedSince(getObjectExtended.getIfModifiedSince());
        conds.setUnModifiedSince(getObjectExtended.getIfUnmodifiedSince());
        conds.setMatch(getObjectExtended.getIfMatch());
        conds.setNoneMatch(getObjectExtended.getIfNoneMatch());
        request.setConditions(conds);

        request.setByteRangeStart(getObjectExtended.getByteRangeStart());
        request.setByteRangeEnd(getObjectExtended.getByteRangeEnd());
        request.setReturnCompleteObjectOnConditionFailure(getObjectExtended.getReturnCompleteObjectOnConditionFailure());
        return request;
    }
View Full Code Here

    return toGetObjectExtendedResponse(engine.handleRequest(toEngineGetObjectRequest(getObjectExtended)));
    }
 
  private S3GetObjectRequest toEngineGetObjectRequest(GetObject getObject)
  {
    S3GetObjectRequest request = new S3GetObjectRequest();
   
    request.setAccessKey(getObject.getAWSAccessKeyId());
    request.setRequestTimestamp(getObject.getTimestamp());
    request.setSignature(getObject.getSignature());
    request.setBucketName(getObject.getBucket());
    request.setKey(getObject.getKey());
    request.setReturnData(getObject.getGetData());
    request.setReturnMetadata(getObject.getGetMetadata());
    request.setInlineData(getObject.getInlineData());
    return request;
  }
View Full Code Here

    request.setInlineData(getObject.getInlineData());
    return request;
  }
 
  private S3GetObjectRequest toEngineGetObjectRequest(GetObjectExtended getObjectExtended) {
    S3GetObjectRequest request = new S3GetObjectRequest();
    request.setAccessKey(getObjectExtended.getAWSAccessKeyId());
    request.setRequestTimestamp(getObjectExtended.getTimestamp());
    request.setSignature(getObjectExtended.getSignature());
    request.setBucketName(getObjectExtended.getBucket());
    request.setKey(getObjectExtended.getKey());
    request.setReturnData(getObjectExtended.getGetData());
    request.setReturnMetadata(getObjectExtended.getGetMetadata());
    request.setInlineData(getObjectExtended.getInlineData());
   
    S3ConditionalHeaders conds = new S3ConditionalHeaders();
    conds.setModifiedSince(getObjectExtended.getIfModifiedSince());
    conds.setUnModifiedSince(getObjectExtended.getIfUnmodifiedSince());
    conds.setMatch(getObjectExtended.getIfMatch());
    conds.setNoneMatch(getObjectExtended.getIfNoneMatch());
    request.setConditions(conds);

    request.setByteRangeStart(getObjectExtended.getByteRangeStart());
    request.setByteRangeEnd(getObjectExtended.getByteRangeEnd());
    request.setReturnCompleteObjectOnConditionFailure(getObjectExtended.getReturnCompleteObjectOnConditionFailure());
    return request;
  }
View Full Code Here

  private void executeGetObject(HttpServletRequest request, HttpServletResponse response) throws IOException
  {
    String   bucket    = (String) request.getAttribute(S3Constants.BUCKET_ATTR_KEY);
    String   key       = (String) request.getAttribute(S3Constants.OBJECT_ATTR_KEY);
 
    S3GetObjectRequest engineRequest = new S3GetObjectRequest();
    engineRequest.setBucketName(bucket);
    engineRequest.setKey(key);
    engineRequest.setInlineData(true);
    engineRequest.setReturnData(true)
    //engineRequest.setReturnMetadata(true);
    engineRequest = setRequestByteRange( request, engineRequest );

    // -> is this a request for a specific version of the object?  look for "versionId=" in the query string
    String queryString = request.getQueryString();
    if (null != queryString) engineRequest.setVersion( returnParameter( queryString, "versionId=" ));

    S3GetObjectResponse engineResponse = ServiceProvider.getInstance().getS3Engine().handleRequest( engineRequest );     
    response.setStatus( engineResponse.getResultCode());
   
    String deleteMarker = engineResponse.getDeleteMarker();
View Full Code Here

  private void executeHeadObject(HttpServletRequest request, HttpServletResponse response) throws IOException
  {
    String bucket = (String) request.getAttribute(S3Constants.BUCKET_ATTR_KEY);
    String key    = (String) request.getAttribute(S3Constants.OBJECT_ATTR_KEY);
     
    S3GetObjectRequest engineRequest = new S3GetObjectRequest();
    engineRequest.setBucketName(bucket);
    engineRequest.setKey(key);
    engineRequest.setInlineData(true);    // -> need to set so we get ETag etc returned
    engineRequest.setReturnData(true);
    engineRequest.setReturnMetadata(true);
    engineRequest = setRequestByteRange( request, engineRequest );
   
    // -> is this a request for a specific version of the object?  look for "versionId=" in the query string
    String queryString = request.getQueryString();
    if (null != queryString) engineRequest.setVersion( returnParameter( queryString, "versionId=" ));

    S3GetObjectResponse engineResponse = ServiceProvider.getInstance().getS3Engine().handleRequest( engineRequest );   
    response.setStatus( engineResponse.getResultCode());
   
    String deleteMarker = engineResponse.getDeleteMarker();
View Full Code Here

  {
    String   bucket    = (String) request.getAttribute(S3Constants.BUCKET_ATTR_KEY);
    String   key       = (String) request.getAttribute(S3Constants.OBJECT_ATTR_KEY);
   
 
    S3GetObjectRequest engineRequest = new S3GetObjectRequest();
    engineRequest.setBucketName(bucket);
    engineRequest.setKey(key);
    engineRequest.setInlineData(true);
    engineRequest.setReturnData(true)
    //engineRequest.setReturnMetadata(true);
    engineRequest = setRequestByteRange( request, engineRequest );

    // -> is this a request for a specific version of the object?  look for "versionId=" in the query string
    String queryString = request.getQueryString();
    if (null != queryString) engineRequest.setVersion( returnParameter( queryString, "versionId=" ));

    S3GetObjectResponse engineResponse = ServiceProvider.getInstance().getS3Engine().handleRequest( engineRequest );     
    response.setStatus( engineResponse.getResultCode());
   
    if (engineResponse.getResultCode()  >=400 ) {
View Full Code Here

TOP

Related Classes of com.cloud.bridge.service.core.s3.S3GetObjectRequest

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.