Examples of SBucketDao


Examples of com.cloud.bridge.persist.dao.SBucketDao

    String key = request.getKey();
    long contentLength = request.getContentLength();
    S3MetaDataEntry[] meta = request.getMetaEntries();
    S3AccessControlList acl = request.getAcl();
   
    SBucketDao bucketDao = new SBucketDao();
    SBucket bucket = bucketDao.getByName(bucketName);
    if (bucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist");
   

    // -> is the caller allowed to write the object?
    //  -> the allocObjectItem checks for the bucket policy PutObject permissions
View Full Code Here

Examples of com.cloud.bridge.persist.dao.SBucketDao

    String key = request.getKey();
    long contentLength = request.getContentLength();
    S3MetaDataEntry[] meta = request.getMetaEntries();
    S3AccessControlList acl = request.getAcl();
   
    SBucketDao bucketDao = new SBucketDao();
    SBucket bucket = bucketDao.getByName(bucketName);
    if(bucket == null) throw new NoSuchObjectException("Bucket " + bucketName + " does not exist");
   
    // -> is the caller allowed to write the object? 
    //  -> the allocObjectItem checks for the bucket policy PutObject permissions
    Tuple<SObject, SObjectItem> tupleObjectItem = allocObjectItem(bucket, key, meta, acl, null);
View Full Code Here

Examples of com.cloud.bridge.persist.dao.SBucketDao

    {
      S3PolicyContext context = null;
     
      // [A] First find the object in the bucket
      S3Response response  = new S3Response();  
      SBucketDao bucketDao = new SBucketDao();
      String bucketName = request.getBucketName();
      SBucket sbucket = bucketDao.getByName( bucketName );
      if(sbucket == null) {
        response.setResultCode(404);
        response.setResultDescription("Bucket " + bucketName + "does not exist");
        return response;
      }
View Full Code Here

Examples of com.cloud.bridge.persist.dao.SBucketDao

    {
      S3PolicyContext context = null;

      // [A] Does the object exist that holds the ACL we are looking for?
      S3AccessControlPolicy policy = new S3AccessControlPolicy()
      SBucketDao bucketDao = new SBucketDao();
      String bucketName = request.getBucketName();
      SBucket sbucket = bucketDao.getByName( bucketName );
      if (sbucket == null)
        throw new NoSuchObjectException("Bucket " + bucketName + " does not exist");
     
      SObjectDao sobjectDao = new SObjectDao();
      String nameKey = request.getKey();
View Full Code Here

Examples of com.cloud.bridge.persist.dao.SBucketDao

    long bytesStart = request.getByteRangeStart();
    long bytesEnd   = request.getByteRangeEnd();
      int resultCode  = 200;

      // [A] Verify that the bucket and the object exist
    SBucketDao bucketDao = new SBucketDao();
    String bucketName = request.getBucketName();
    SBucket sbucket = bucketDao.getByName(bucketName);
    if (sbucket == null) {
      response.setResultCode(404);
      response.setResultDescription("Bucket " + request.getBucketName() + " does not exist");
      return response;
    }
View Full Code Here

Examples of com.cloud.bridge.persist.dao.SBucketDao

     */
  public S3Response handleRequest(S3DeleteObjectRequest request)
  {   
    // -> verify that the bucket and object exist
    S3Response response  = new S3Response();
    SBucketDao bucketDao = new SBucketDao();
    String bucketName = request.getBucketName();
    SBucket sbucket = bucketDao.getByName( bucketName );
    if (sbucket == null) {
      response.setResultCode(404);
      response.setResultDescription("Bucket does not exist");
      return response;
    }
View Full Code Here

Examples of com.cloud.bridge.persist.dao.SBucketDao

    temp = request.getParameter("part-number-marker");
      if (null != temp) partMarker = Integer.parseInt( temp );

     
    // -> does the bucket exist, we may need it to verify access permissions
    SBucketDao bucketDao = new SBucketDao();
    SBucket bucket = bucketDao.getByName(bucketName);
    if (bucket == null) {
      logger.error( "listUploadParts failed since " + bucketName + " does not exist" );
        response.setStatus(404);
        return;
    }
View Full Code Here

Examples of com.cloud.bridge.persist.dao.SBucketDao

    String bucketName = (String)request.getAttribute(S3Constants.BUCKET_ATTR_KEY);
    String policy = streamToString( request.getInputStream());
           
    // [A] Is there an owner of an existing policy or bucket?
        BucketPolicyDao policyDao = new BucketPolicyDao();
    SBucketDao bucketDao = new SBucketDao();
    SBucket bucket = bucketDao.getByName( bucketName );
        String owner = null;
       
        if ( null != bucket )
        {
           owner = bucket.getOwnerCanonicalId();
View Full Code Here

Examples of com.cloud.bridge.persist.dao.SBucketDao

  {
    String bucketName = (String)request.getAttribute(S3Constants.BUCKET_ATTR_KEY);

    // [A] Is there an owner of an existing policy or bucket?
        BucketPolicyDao policyDao = new BucketPolicyDao();
    SBucketDao bucketDao = new SBucketDao();
    SBucket bucket = bucketDao.getByName( bucketName );
        String owner = null;
       
        if ( null != bucket )
        {
           owner = bucket.getOwnerCanonicalId();
View Full Code Here

Examples of com.cloud.bridge.persist.dao.SBucketDao

  private void executeDeleteBucketPolicy(HttpServletRequest request, HttpServletResponse response)
  {
    String bucketName = (String)request.getAttribute(S3Constants.BUCKET_ATTR_KEY);
   
    SBucketDao bucketDao = new SBucketDao();
    SBucket bucket = bucketDao.getByName( bucketName );
    if (bucket != null)
    {
        String client = UserContext.current().getCanonicalUserId();
        if (!client.equals( bucket.getOwnerCanonicalId())) {
            response.setStatus(405);
View Full Code Here
TOP
Copyright © 2018 www.massapi.com. 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.