Examples of SBucketDao


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

      logger.error( "executeGetBucketVersioning - no bucket name given" );
      response.setStatus( 400 );
      return;
    }
   
    SBucketDao bucketDao = new SBucketDao();
    SBucket sbucket = bucketDao.getByName( bucketName );
    if (sbucket == null) {
      response.setStatus( 404 );
      return;
    }
   
View Full Code Here

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

    }
      
      try {
      // -> does not matter what the ACLs say only the owner can turn on versioning on a bucket
          // -> the bucket owner may want to restrict the IP address from which this can occur
      SBucketDao bucketDao = new SBucketDao();
      SBucket sbucket = bucketDao.getByName( bucketName );
   
      String client = UserContext.current().getCanonicalUserId();
      if (!client.equals( sbucket.getOwnerCanonicalId()))
          throw new PermissionDeniedException( "Access Denied - only the owner can turn on versioing on a bucket" );
   
      S3PolicyContext context = new S3PolicyContext( PolicyActions.PutBucketVersioning, bucketName );
        if (PolicyAccess.DENY == S3Engine.verifyPolicy( context )) {
               response.setStatus(403);
               return;
        }

     
           if (versioningStatus.equalsIgnoreCase( "Enabled"  )) sbucket.setVersioningStatus( 1 );
      else if (versioningStatus.equalsIgnoreCase( "Suspended")) sbucket.setVersioningStatus( 2 );
      else {
         logger.error( "executePutBucketVersioning - unknown state: [" + versioningStatus + "]" );
         response.setStatus( 400 );
         return;
        }
      bucketDao.update( sbucket );
     
    } catch( PermissionDeniedException e ) {
      logger.error( "executePutBucketVersioning - failed due to " + e.getMessage(), e);
      throw e;
     
View Full Code Here

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

      // -> upload-id-marker is ignored unless key-marker is also specified
    String uploadIdMarker = request.getParameter("upload-id-marker");
        if (null == keyMarker) uploadIdMarker = null;
     
    // -> 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( "listMultipartUpload failed since " + bucketName + " does not exist" );
        response.setStatus(404);
        return;
    }
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.