Example usage for com.amazonaws.services.s3.model BucketAccelerateConfiguration BucketAccelerateConfiguration

List of usage examples for com.amazonaws.services.s3.model BucketAccelerateConfiguration BucketAccelerateConfiguration

Introduction

In this page you can find the example usage for com.amazonaws.services.s3.model BucketAccelerateConfiguration BucketAccelerateConfiguration.

Prototype

public BucketAccelerateConfiguration(BucketAccelerateStatus status) 

Source Link

Document

Creates a new bucket accelerate configuration object with the specified status.

Usage

From source file:com.hpe.caf.worker.datastore.s3.S3DataStore.java

License:Apache License

public S3DataStore(final S3DataStoreConfiguration s3DataStoreConfiguration) {
    if (s3DataStoreConfiguration == null) {
        throw new ArgumentException("s3DataStoreConfiguration was null.");
    }// w w  w  .ja v  a  2 s  .co m

    ClientConfiguration clientCfg = new ClientConfiguration();

    if (!StringUtils.isNullOrEmpty(s3DataStoreConfiguration.getProxyHost())) {
        clientCfg.setProtocol(Protocol.valueOf(s3DataStoreConfiguration.getProxyProtocol()));
        clientCfg.setProxyHost(s3DataStoreConfiguration.getProxyHost());
        clientCfg.setProxyPort(s3DataStoreConfiguration.getProxyPort());
    }
    AWSCredentials credentials = new BasicAWSCredentials(s3DataStoreConfiguration.getAccessKey(),
            s3DataStoreConfiguration.getSecretKey());
    bucketName = s3DataStoreConfiguration.getBucketName();
    amazonS3Client = new AmazonS3Client(credentials, clientCfg);
    amazonS3Client.setBucketAccelerateConfiguration(new SetBucketAccelerateConfigurationRequest(bucketName,
            new BucketAccelerateConfiguration(BucketAccelerateStatus.Enabled)));
}