use of software.amazon.awssdk.services.s3.model.DeleteBucketResponse in project newrelic-java-agent by newrelic.
the class S3AsyncClient_Instrumentation method deleteBucket.
public CompletableFuture<DeleteBucketResponse> deleteBucket(DeleteBucketRequest deleteBucketRequest) {
String uri = "s3://" + deleteBucketRequest.bucket();
Segment segment = NewRelic.getAgent().getTransaction().startSegment("S3", "deleteBucket");
AgentBridge.getAgent().getTracedMethod().setTrackChildThreads(false);
CompletableFuture<DeleteBucketResponse> result = Weaver.callOriginal();
return result.whenComplete(new S3ResponseResultWrapper<>(segment, uri, "deleteBucket"));
}
use of software.amazon.awssdk.services.s3.model.DeleteBucketResponse in project newrelic-java-agent by newrelic.
the class S3Client_Instrumentation method deleteBucket.
@Trace
public DeleteBucketResponse deleteBucket(DeleteBucketRequest deleteBucketRequest) {
String uri = "s3://" + deleteBucketRequest.bucket();
try {
DeleteBucketResponse deleteBucketResponse = Weaver.callOriginal();
S3MetricUtil.reportExternalMetrics(NewRelic.getAgent().getTracedMethod(), uri, deleteBucketResponse, "deleteBucket");
return deleteBucketResponse;
} catch (Exception e) {
S3MetricUtil.reportExternalMetrics(NewRelic.getAgent().getTracedMethod(), uri, "deleteBucket");
throw e;
}
}
use of software.amazon.awssdk.services.s3.model.DeleteBucketResponse in project jeesuite-libs by vakinge.
the class AwsProvider method delete.
@Override
public boolean delete(String bucketName, String fileKey) {
try {
DeleteBucketRequest deleteBucketRequest = DeleteBucketRequest.builder().bucket(bucketName).build();
DeleteBucketResponse deleteBucketResponse = s3Client.deleteBucket(deleteBucketRequest);
return deleteBucketResponse.sdkHttpResponse().isSuccessful();
} catch (Exception e) {
LOGGER.error("删除Bucket[{}]出错, e={}", bucketName, ExceptionUtils.getMessage(e), e);
}
return false;
}
Aggregations