本文整理汇总了Java中com.amazonaws.services.s3.model.BucketTaggingConfiguration类的典型用法代码示例。如果您正苦于以下问题:Java BucketTaggingConfiguration类的具体用法?Java BucketTaggingConfiguration怎么用?Java BucketTaggingConfiguration使用的例子?那么恭喜您, 这里精选的类代码示例或许可以为您提供帮助。
BucketTaggingConfiguration类属于com.amazonaws.services.s3.model包,在下文中一共展示了BucketTaggingConfiguration类的17个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于我们的系统推荐出更棒的Java代码示例。
示例1: getBucketTaggingConfiguration
import com.amazonaws.services.s3.model.BucketTaggingConfiguration; //导入依赖的package包/类
@Override
public BucketTaggingConfiguration getBucketTaggingConfiguration(GetBucketTaggingConfigurationRequest getBucketTaggingConfigurationRequest) {
getBucketTaggingConfigurationRequest = beforeClientExecution(getBucketTaggingConfigurationRequest);
rejectNull(getBucketTaggingConfigurationRequest, "The request object parameter getBucketTaggingConfigurationRequest must be specifed.");
String bucketName = getBucketTaggingConfigurationRequest.getBucketName();
rejectNull(bucketName, "The bucket name must be specified when retrieving the bucket tagging configuration.");
Request<GetBucketTaggingConfigurationRequest> request = createRequest(bucketName, null, getBucketTaggingConfigurationRequest, HttpMethodName.GET);
request.addParameter("tagging", null);
try {
return invoke(request, new Unmarshallers.BucketTaggingConfigurationUnmarshaller(), bucketName, null);
} catch (AmazonServiceException ase) {
switch (ase.getStatusCode()) {
case 404:
return null;
default:
throw ase;
}
}
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:22,代码来源:AmazonS3Client.java
示例2: createBucketForInstance
import com.amazonaws.services.s3.model.BucketTaggingConfiguration; //导入依赖的package包/类
public Bucket createBucketForInstance(String instanceId, ServiceDefinition service, String planId,
String organizationGuid, String spaceGuid) {
String bucketName = getBucketNameForInstance(instanceId);
logger.info("Creating bucket '{}' for serviceInstanceId '{}'", bucketName, instanceId);
Bucket bucket = s3.createBucket(bucketName, Region.fromValue(region));
// TODO allow for additional, custom tagging options
BucketTaggingConfiguration bucketTaggingConfiguration = new BucketTaggingConfiguration();
TagSet tagSet = new TagSet();
tagSet.setTag("serviceInstanceId", instanceId);
tagSet.setTag("serviceDefinitionId", service.getId());
tagSet.setTag("planId", planId);
tagSet.setTag("organizationGuid", organizationGuid);
tagSet.setTag("spaceGuid", spaceGuid);
bucketTaggingConfiguration.withTagSets(tagSet);
s3.setBucketTaggingConfiguration(bucket.getName(), bucketTaggingConfiguration);
return bucket;
}
开发者ID:cloudfoundry-community,项目名称:s3-cf-service-broker,代码行数:20,代码来源:S3.java
示例3: createServiceInstance
import com.amazonaws.services.s3.model.BucketTaggingConfiguration; //导入依赖的package包/类
private ServiceInstance createServiceInstance(BucketTaggingConfiguration taggingConfiguration) {
// While the Java API has multiple TagSets, it would appear from
// http://docs.aws.amazon.com/AmazonS3/latest/API/RESTBucketPUTtagging.html
// that only one TagSet is supported.
TagSet tagSet = taggingConfiguration.getTagSet();
String serviceInstanceId = tagSet.getTag("serviceInstanceId");
if (serviceInstanceId == null) {
// could occur if someone used this broker AWS ID to a bucket
// outside of the broker process
return null;
}
String serviceDefinitionId = tagSet.getTag("serviceDefinitionId");
String planId = tagSet.getTag("planId");
String organizationGuid = tagSet.getTag("organizationGuid");
String spaceGuid = tagSet.getTag("spaceGuid");
ServiceInstance serviceInstance = new ServiceInstance(serviceInstanceId, serviceDefinitionId, planId,
organizationGuid, spaceGuid, null);
return serviceInstance;
}
开发者ID:cloudfoundry-community,项目名称:s3-cf-service-broker,代码行数:20,代码来源:S3.java
示例4: setBucketTaggingConfiguration
import com.amazonaws.services.s3.model.BucketTaggingConfiguration; //导入依赖的package包/类
@Override
public void setBucketTaggingConfiguration(
SetBucketTaggingConfigurationRequest setBucketTaggingConfigurationRequest) {
setBucketTaggingConfigurationRequest = beforeClientExecution(setBucketTaggingConfigurationRequest);
rejectNull(setBucketTaggingConfigurationRequest,
"The set bucket tagging configuration request object must be specified.");
String bucketName = setBucketTaggingConfigurationRequest.getBucketName();
BucketTaggingConfiguration bucketTaggingConfiguration = setBucketTaggingConfigurationRequest.getTaggingConfiguration();
rejectNull(bucketName,
"The bucket name parameter must be specified when setting bucket tagging configuration.");
rejectNull(bucketTaggingConfiguration,
"The tagging configuration parameter must be specified when setting bucket tagging configuration.");
Request<SetBucketTaggingConfigurationRequest> request = createRequest(bucketName, null, setBucketTaggingConfigurationRequest, HttpMethodName.PUT);
request.addParameter("tagging", null);
byte[] content = new BucketConfigurationXmlFactory().convertToXmlByteArray(bucketTaggingConfiguration);
request.addHeader("Content-Length", String.valueOf(content.length));
request.addHeader("Content-Type", "application/xml");
request.setContent(new ByteArrayInputStream(content));
try {
byte[] md5 = Md5Utils.computeMD5Hash(content);
String md5Base64 = BinaryUtils.toBase64(md5);
request.addHeader("Content-MD5", md5Base64);
} catch ( Exception e ) {
throw new SdkClientException("Couldn't compute md5 sum", e);
}
invoke(request, voidResponseHandler, bucketName, null);
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:33,代码来源:AmazonS3Client.java
示例5: convertToXmlByteArray
import com.amazonaws.services.s3.model.BucketTaggingConfiguration; //导入依赖的package包/类
/**
* Converts the specified {@link BucketTaggingConfiguration} object to an XML fragment that
* can be sent to Amazon S3.
*
* @param config
* The {@link BucketTaggingConfiguration}
*/
/*
* <Tagging>
<TagSet>
<Tag>
<Key>Project</Key>
<Value>Foo</Value>
</Tag>
<Tag>
<Key>User</Key>
<Value>nschnarr</Value>
</Tag>
</TagSet>
</Tagging>
*/
public byte[] convertToXmlByteArray(BucketTaggingConfiguration config) throws SdkClientException {
XmlWriter xml = new XmlWriter();
xml.start("Tagging");
for (TagSet tagset : config.getAllTagSets()) {
writeRule(xml, tagset);
}
xml.end();
return xml.getBytes();
}
开发者ID:IBM,项目名称:ibm-cos-sdk-java,代码行数:35,代码来源:BucketConfigurationXmlFactory.java
示例6: createS3BucketAndTags
import com.amazonaws.services.s3.model.BucketTaggingConfiguration; //导入依赖的package包/类
private void createS3BucketAndTags(Map<String, String> tags) {
this.s3Client.createBucket(TEST_BUCKET_NAME);
TagSet tagSet = new TagSet(tags);
BucketTaggingConfiguration bucketTaggingConfiguration = new
BucketTaggingConfiguration(Collections.singletonList(tagSet));
this.s3Client.setBucketTaggingConfiguration(TEST_BUCKET_NAME, bucketTaggingConfiguration);
}
开发者ID:vmware,项目名称:photon-model,代码行数:10,代码来源:TestAWSEnumerationTask.java
示例7: findServiceInstance
import com.amazonaws.services.s3.model.BucketTaggingConfiguration; //导入依赖的package包/类
public ServiceInstance findServiceInstance(String instanceId) {
String bucketName = getBucketNameForInstance(instanceId);
if (s3.doesBucketExist(bucketName)) {
BucketTaggingConfiguration taggingConfiguration = s3.getBucketTaggingConfiguration(bucketName);
return createServiceInstance(taggingConfiguration);
}
return null;
}
开发者ID:cloudfoundry-community,项目名称:s3-cf-service-broker,代码行数:9,代码来源:S3.java
示例8: getAllServiceInstances
import com.amazonaws.services.s3.model.BucketTaggingConfiguration; //导入依赖的package包/类
public List<ServiceInstance> getAllServiceInstances() {
List<ServiceInstance> serviceInstances = Lists.newArrayList();
for (Bucket bucket : s3.listBuckets()) {
BucketTaggingConfiguration taggingConfiguration = s3.getBucketTaggingConfiguration(bucket.getName());
ServiceInstance serviceInstance = createServiceInstance(taggingConfiguration);
serviceInstances.add(serviceInstance);
}
return serviceInstances;
}
开发者ID:cloudfoundry-community,项目名称:s3-cf-service-broker,代码行数:10,代码来源:S3.java
示例9: getBucketTaggingConfiguration
import com.amazonaws.services.s3.model.BucketTaggingConfiguration; //导入依赖的package包/类
@Override
public BucketTaggingConfiguration getBucketTaggingConfiguration(String bucketName) {
return delegate.getBucketTaggingConfiguration(bucketName);
}
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:AmazonS3Wrapper.java
示例10: setBucketTaggingConfiguration
import com.amazonaws.services.s3.model.BucketTaggingConfiguration; //导入依赖的package包/类
@Override
public void setBucketTaggingConfiguration(String bucketName, BucketTaggingConfiguration bucketTaggingConfiguration) {
delegate.setBucketTaggingConfiguration(bucketName, bucketTaggingConfiguration);
}
开发者ID:justor,项目名称:elasticsearch_my,代码行数:5,代码来源:AmazonS3Wrapper.java
示例11: getBucketTaggingConfiguration
import com.amazonaws.services.s3.model.BucketTaggingConfiguration; //导入依赖的package包/类
@Override
public BucketTaggingConfiguration getBucketTaggingConfiguration(String bucketName) {
return call(() -> getDelegate().getBucketTaggingConfiguration(bucketName));
}
开发者ID:HubSpot,项目名称:S3Decorators,代码行数:5,代码来源:S3Decorator.java
示例12: setBucketTaggingConfiguration
import com.amazonaws.services.s3.model.BucketTaggingConfiguration; //导入依赖的package包/类
@Override
public void setBucketTaggingConfiguration(String bucketName, BucketTaggingConfiguration bucketTaggingConfiguration) {
run(() -> getDelegate().setBucketTaggingConfiguration(bucketName, bucketTaggingConfiguration));
}
开发者ID:HubSpot,项目名称:S3Decorators,代码行数:5,代码来源:S3Decorator.java
示例13: getBucketTaggingConfiguration
import com.amazonaws.services.s3.model.BucketTaggingConfiguration; //导入依赖的package包/类
@Override
public BucketTaggingConfiguration getBucketTaggingConfiguration(String bucketName)
{
return null;
}
开发者ID:y-lan,项目名称:presto,代码行数:6,代码来源:MockAmazonS3.java
示例14: setBucketTaggingConfiguration
import com.amazonaws.services.s3.model.BucketTaggingConfiguration; //导入依赖的package包/类
@Override
public void setBucketTaggingConfiguration(String bucketName, BucketTaggingConfiguration bucketTaggingConfiguration)
{
}
开发者ID:y-lan,项目名称:presto,代码行数:5,代码来源:MockAmazonS3.java
示例15: createTags
import com.amazonaws.services.s3.model.BucketTaggingConfiguration; //导入依赖的package包/类
public void createTags(String bucketName, TagSet tags) {
logger.info("tag s3 bucket, bucketName={}", bucketName);
s3.setBucketTaggingConfiguration(bucketName, new BucketTaggingConfiguration().withTagSets(tags));
}
开发者ID:neowu,项目名称:cmn-project,代码行数:5,代码来源:S3.java
示例16: getBucketTaggingConfiguration
import com.amazonaws.services.s3.model.BucketTaggingConfiguration; //导入依赖的package包/类
@Override
public BucketTaggingConfiguration getBucketTaggingConfiguration(String bucketName) {
// TODO Auto-generated method stub
return null;
}
开发者ID:DemandCube,项目名称:Scribengin,代码行数:6,代码来源:AmazonS3Mock.java
示例17: setBucketTaggingConfiguration
import com.amazonaws.services.s3.model.BucketTaggingConfiguration; //导入依赖的package包/类
@Override
public void setBucketTaggingConfiguration(String bucketName, BucketTaggingConfiguration bucketTaggingConfiguration) {
// TODO Auto-generated method stub
}
开发者ID:DemandCube,项目名称:Scribengin,代码行数:6,代码来源:AmazonS3Mock.java
注:本文中的com.amazonaws.services.s3.model.BucketTaggingConfiguration类示例整理自Github/MSDocs等源码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。 |
请发表评论