public void setSpaceLifecycle ( String bucketName , BucketLifecycleConfiguration config ) { boolean success = false ; int maxLoops = 6 ; for ( int loops = 0 ; ! success && loops < maxLoops ; loops ++ ) { try { s3Client . deleteBucketLifecycleConfiguration ( bucketName ) ; s3Client . setBucketLifecycleConfiguration ( bucketName , config ) ; success = true ; } catch ( NotFoundException e ) { success = false ; wait ( loops ) ; } } if ( ! success ) { throw new StorageException ( "Lifecycle policy for bucket " + bucketName + " could not be applied. The space cannot be found." ) ; } }
Sets a lifecycle policy on an S3 bucket based on the given configuration