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

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


  engineRequest.setAcl(aclRequest);
  engineRequest.setBucketName(bucketName);

  // [C] Allow an S3Engine to handle the
  // S3SetBucketAccessControlPolicyRequest
  S3Response engineResponse = ServiceProvider.getInstance().getS3Engine()
    .handleRequest(engineRequest);
  response.setStatus(engineResponse.getResultCode());

  }
View Full Code Here


  public void executeDeleteBucket(HttpServletRequest request, HttpServletResponse response) throws IOException
  {
    S3DeleteBucketRequest engineRequest = new S3DeleteBucketRequest();
    engineRequest.setBucketName((String)request.getAttribute(S3Constants.BUCKET_ATTR_KEY));
    S3Response engineResponse = ServiceProvider.getInstance().getS3Engine().handleRequest(engineRequest)
    response.setStatus(engineResponse.getResultCode());
    response.flushBuffer();
  }
View Full Code Here

        engineRequest.setBucketName(bucketName);
        engineRequest.setKey(key);
       
      
      // [C] Allow an S3Engine to handle the S3SetObjectAccessControlPolicyRequest
        S3Response engineResponse = ServiceProvider.getInstance().getS3Engine().handleRequest(engineRequest)
        response.setStatus( engineResponse.getResultCode());
    
  }
View Full Code Here

    // -> 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=" ));
   
    S3Response engineResponse = ServiceProvider.getInstance().getS3Engine().handleRequest( engineRequest );
   
    response.setStatus( engineResponse.getResultCode())
    String version = engineRequest.getVersion();
    if (null != version) response.addHeader( "x-amz-version-id", version );   
  }
View Full Code Here

                        if (key_data.getLength() == 2) {
                            versionID = getTagValue(elements[1], eElement);
                            engineRequest.setVersion(versionID);
                        }

                        S3Response engineResponse = ServiceProvider.getInstance().getS3Engine().handleRequest( engineRequest );
                        int resultCode = engineResponse.getResultCode();
                        String resutlDesc = engineResponse.getResultDescription();
                        if(resultCode == 204) {
                            if (quite) { // show response depending on quite/verbose
                                xmlDeleteResponse.append("<Deleted><Key>"+key_name+"</Key>");
                                if (resutlDesc != null)
                                    xmlDeleteResponse.append(resutlDesc);
                                xmlDeleteResponse.append("</Deleted>");
                            }
                        }
                        else {
                            logger.debug("Error in delete ::" + key_name + " eng response:: " + engineResponse.getResultDescription());
                            xmlDeleteResponse.append("<Error><Key>"+key_name+"</Key>" );
                            if (resutlDesc != null)
                                xmlDeleteResponse.append(resutlDesc);
                            xmlDeleteResponse.append("</Error>");
                        }
View Full Code Here

        engineRequest.setAcl(aclRequest);
        engineRequest.setBucketName(bucketName);

        // [C] Allow an S3Engine to handle the
        // S3SetBucketAccessControlPolicyRequest
        S3Response engineResponse = ServiceProvider.getInstance().getS3Engine()
                .handleRequest(engineRequest);
        response.setStatus(engineResponse.getResultCode());

    }
View Full Code Here

    public void executeDeleteBucket(HttpServletRequest request, HttpServletResponse response) throws IOException
    {
        S3DeleteBucketRequest engineRequest = new S3DeleteBucketRequest();
        engineRequest.setBucketName((String)request.getAttribute(S3Constants.BUCKET_ATTR_KEY));
        S3Response engineResponse = ServiceProvider.getInstance().getS3Engine().handleRequest(engineRequest)
        response.setStatus(engineResponse.getResultCode());
        response.flushBuffer();
    }
View Full Code Here

    response.setGetBucketAccessControlPolicyResponse(toAccessControlPolicy(policy));
    return response;
  }
  public SetBucketAccessControlPolicyResponse setBucketAccessControlPolicy(SetBucketAccessControlPolicy setBucketAccessControlPolicy) {
    S3SetBucketAccessControlPolicyRequest request = new S3SetBucketAccessControlPolicyRequest();
    request.setAccessKey(setBucketAccessControlPolicy.getAWSAccessKeyId());
    request.setRequestTimestamp(setBucketAccessControlPolicy.getTimestamp());
    request.setSignature(setBucketAccessControlPolicy.getSignature());
    request.setBucketName(setBucketAccessControlPolicy.getBucket());
    request.setAcl(toEngineAccessControlList(setBucketAccessControlPolicy.getAccessControlList()));
   
    SetBucketAccessControlPolicyResponse response = new SetBucketAccessControlPolicyResponse();
    return response;
    }
View Full Code Here

        }

        // [B] Obtain the grant request which applies to the acl request string.
        // This latter is supplied as the value of the x-amz-acl header.

        S3SetBucketAccessControlPolicyRequest engineRequest = new S3SetBucketAccessControlPolicyRequest();
        S3Grant grantRequest = new S3Grant();
        S3AccessControlList aclRequest = new S3AccessControlList();

        String aclRequestString = request.getHeader("x-amz-acl");
        OrderedPair<Integer, Integer> accessControlsForBucketOwner = SAclVO.getCannedAccessControls(aclRequestString, "SBucket");
        grantRequest.setPermission(accessControlsForBucketOwner.getFirst());
        grantRequest.setGrantee(accessControlsForBucketOwner.getSecond());
        grantRequest.setCanonicalUserID(owner);
        aclRequest.addGrant(grantRequest);
        engineRequest.setAcl(aclRequest);
        engineRequest.setBucketName(bucketName);

        // [C] Allow an S3Engine to handle the
        // S3SetBucketAccessControlPolicyRequest
        S3Response engineResponse = ServiceProvider.getInstance().getS3Engine()
                .handleRequest(engineRequest);
View Full Code Here

    return response;
  }
  public SetObjectAccessControlPolicyResponse setObjectAccessControlPolicy(SetObjectAccessControlPolicy setObjectAccessControlPolicy)
  { 
    S3SetObjectAccessControlPolicyRequest request = new S3SetObjectAccessControlPolicyRequest();
    request.setAccessKey(setObjectAccessControlPolicy.getAWSAccessKeyId());
    request.setRequestTimestamp(setObjectAccessControlPolicy.getTimestamp());
    request.setSignature(setObjectAccessControlPolicy.getSignature());
    request.setBucketName(setObjectAccessControlPolicy.getBucket());
    request.setKey(setObjectAccessControlPolicy.getKey());
    request.setAcl(toEngineAccessControlList(setObjectAccessControlPolicy.getAccessControlList()));
   
    engine.handleRequest(request);
    SetObjectAccessControlPolicyResponse response = new SetObjectAccessControlPolicyResponse();
    return response;
    }
View Full Code Here

TOP

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

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.