Skip to content

Commit

Permalink
Release 2.11.0
Browse files Browse the repository at this point in the history
  • Loading branch information
IBMeric authored and GitHub Enterprise committed Nov 8, 2021
1 parent dd5b833 commit 736bc71
Show file tree
Hide file tree
Showing 1,418 changed files with 17,922 additions and 7,987 deletions.
14 changes: 14 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
@@ -1,5 +1,19 @@
# CHANGELOG

## 2.11.0

### Content

#### Features

* Versioning Support with Object Expiration
* Abort Multipart Upload Expiration Support

#### Defect Fixes

* Several bug fixes from re-applying AWS patches aligned to version 1.11.687 of the AWS Java SDK
* Legacy notice for `cos-aspera`

## 2.10.1

### Content
Expand Down
8 changes: 4 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -59,10 +59,6 @@ If the Service Credential contain [HMAC keys](https://cloud.ibm.com/docs/service
the client will use those and authenticate using a signature, otherwise the client will use the provided API key to authenticate
using bearer tokens.

## Aspera high-speed transfer

It is now possible to use the IBM Aspera high-speed transfer service as an alternative method to managed transfers of larger objects. The Aspera high-speed transfer service is especially effective across long distances or in environments with high rates of packet loss. For more details, check out the [IBM Cloud documentation](https://cloud.ibm.com/docs/services/cloud-object-storage/basics/aspera.html#using-libraries-and-sdks).

## Archive Tier Support

You can automatically archive objects after a specified length of time or after a specified date. Once archived, a temporary copy of an object can be restored for access as needed. Restore time may take up to 15 hours.
Expand All @@ -81,6 +77,10 @@ Immutable Object Storage does not support Aspera transfers via the SDK to upload

Users can set an archive rule that would allow data restore from an archive in 2 hours or 12 hours.

## LEGACY: Aspera high-speed transfer

Aspera high-speed transfer through the COS SDK using the `cos-aspera` library is now legacy. New users and applications should use the [Aspera Transfer SDK](https://developer.ibm.com/apis/catalog/aspera--aspera-transfer-sdk/Introduction) instead. Existing users should begin new projects with the Aspera Transfer SDK and make plans to migrate existing applications. Users who use S3 for transfers and do not install `cos-aspera` are unaffected.

## Getting help

Feel free to use GitHub issues for tracking bugs and feature requests, but for help please use one of the following resources:
Expand Down
2 changes: 1 addition & 1 deletion ibm-cos-java-sdk-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.ibm.cos</groupId>
<artifactId>ibm-cos-java-sdk-pom</artifactId>
<version>2.10.1</version>
<version>2.11.0</version>
</parent>
<groupId>com.ibm.cos</groupId>
<artifactId>ibm-cos-java-sdk-bom</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion ibm-cos-java-sdk-bundle/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.ibm.cos</groupId>
<artifactId>ibm-cos-java-sdk-pom</artifactId>
<version>2.10.1</version>
<version>2.11.0</version>
</parent>
<groupId>com.ibm.cos</groupId>
<artifactId>ibm-cos-java-sdk-bundle</artifactId>
Expand Down
2 changes: 1 addition & 1 deletion ibm-cos-java-sdk-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
<parent>
<groupId>com.ibm.cos</groupId>
<artifactId>ibm-cos-java-sdk-pom</artifactId>
<version>2.10.1</version>
<version>2.11.0</version>
</parent>
<groupId>com.ibm.cos</groupId>
<artifactId>ibm-cos-java-sdk-core</artifactId>
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2013-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2013-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -14,10 +14,10 @@
*/
package com.ibm.cloud.objectstorage;

import java.util.Map;

import com.ibm.cloud.objectstorage.util.StringUtils;

import java.util.Map;

/**
* Extension of SdkClientException that represents an error response returned
* by an Amazon web service. Receiving an exception of this type indicates that
Expand Down
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
/*
* Copyright 2010-2017 Amazon.com, Inc. or its affiliates. All Rights Reserved.
* Copyright 2010-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved.
*
* Licensed under the Apache License, Version 2.0 (the "License").
* You may not use this file except in compliance with the License.
Expand All @@ -14,11 +14,11 @@
*/
package com.ibm.cloud.objectstorage;

import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;
import static com.ibm.cloud.objectstorage.SDKGlobalConfiguration.PROFILING_SYSTEM_PROPERTY;

import com.ibm.cloud.objectstorage.annotation.SdkInternalApi;
import com.ibm.cloud.objectstorage.annotation.SdkProtectedApi;
import com.ibm.cloud.objectstorage.auth.AWSCredentialsProvider;
import com.ibm.cloud.objectstorage.auth.RegionAwareSigner;
import com.ibm.cloud.objectstorage.auth.Signer;
import com.ibm.cloud.objectstorage.auth.SignerFactory;
Expand All @@ -35,20 +35,23 @@
import com.ibm.cloud.objectstorage.log.CommonsLogFactory;
import com.ibm.cloud.objectstorage.metrics.AwsSdkMetrics;
import com.ibm.cloud.objectstorage.metrics.RequestMetricCollector;
import com.ibm.cloud.objectstorage.monitoring.MonitoringListener;
import com.ibm.cloud.objectstorage.monitoring.internal.ClientSideMonitoringRequestHandler;
import com.ibm.cloud.objectstorage.regions.Region;
import com.ibm.cloud.objectstorage.regions.Regions;
import com.ibm.cloud.objectstorage.util.AWSRequestMetrics;
import com.ibm.cloud.objectstorage.util.AWSRequestMetrics.Field;
import com.ibm.cloud.objectstorage.util.AwsHostNameUtils;
import com.ibm.cloud.objectstorage.util.Classes;
import com.ibm.cloud.objectstorage.util.RuntimeHttpUtils;
import com.ibm.cloud.objectstorage.util.StringUtils;
import com.ibm.cloud.objectstorage.util.AWSRequestMetrics.Field;

import static com.ibm.cloud.objectstorage.SDKGlobalConfiguration.PROFILING_SYSTEM_PROPERTY;

import java.net.URI;
import java.util.Collection;
import java.util.Collections;
import java.util.List;
import java.util.concurrent.CopyOnWriteArrayList;
import org.apache.commons.logging.Log;
import org.apache.commons.logging.LogFactory;

/**
* Abstract base class for Amazon Web Service Java clients.
Expand Down Expand Up @@ -136,6 +139,8 @@ public abstract class AmazonWebServiceClient {
*/
private volatile String endpointPrefix;

private Collection<MonitoringListener> monitoringListeners;

/**
* Constructs a new AmazonWebServiceClient object using the specified
* configuration.
Expand Down Expand Up @@ -163,22 +168,58 @@ public AmazonWebServiceClient(ClientConfiguration clientConfiguration,
}

@SdkProtectedApi
protected AmazonWebServiceClient(ClientConfiguration clientConfiguration,
RequestMetricCollector requestMetricCollector,
protected AmazonWebServiceClient(final ClientConfiguration clientConfiguration,
final RequestMetricCollector requestMetricCollector,
boolean disableStrictHostNameVerification) {
this.clientConfiguration = clientConfiguration;
requestHandler2s = new CopyOnWriteArrayList<RequestHandler2>();
client = new AmazonHttpClient(clientConfiguration,
requestMetricCollector, disableStrictHostNameVerification,
calculateCRC32FromCompressedData());
this(new AwsSyncClientParams() {
@Override
public AWSCredentialsProvider getCredentialsProvider() {
return null;
}

@Override
public ClientConfiguration getClientConfiguration() {
return clientConfiguration;
}

@Override
public RequestMetricCollector getRequestMetricCollector() {
return requestMetricCollector;
}

@Override
public List<RequestHandler2> getRequestHandlers() {
return new CopyOnWriteArrayList<RequestHandler2>();
}

@Override
public MonitoringListener getMonitoringListener() {
return null;
}
}, !disableStrictHostNameVerification);
}

protected AmazonWebServiceClient(AwsSyncClientParams clientParams) {
this(clientParams, null);
}

private AmazonWebServiceClient(AwsSyncClientParams clientParams, Boolean useStrictHostNameVerification) {
this.clientConfiguration = clientParams.getClientConfiguration();
requestHandler2s = clientParams.getRequestHandlers();
client = new AmazonHttpClient(clientConfiguration, clientParams.getRequestMetricCollector(),
!useStrictHostNameVerification(),
calculateCRC32FromCompressedData());
this.requestHandler2s = clientParams.getRequestHandlers();
this.monitoringListeners = new CopyOnWriteArrayList<MonitoringListener>();

useStrictHostNameVerification = useStrictHostNameVerification != null ? useStrictHostNameVerification
: useStrictHostNameVerification();

this.client = new AmazonHttpClient(clientConfiguration,
clientParams.getRequestMetricCollector(),
!useStrictHostNameVerification,
calculateCRC32FromCompressedData());

if (clientParams.getMonitoringListener() != null) {
monitoringListeners.add(clientParams.getMonitoringListener());
}

}

/**
Expand Down Expand Up @@ -225,8 +266,8 @@ protected SignerProvider getSignerProvider() {
* <p>
* For more information on using AWS regions with the AWS SDK for Java, and
* a complete list of all available endpoints for all AWS services, see:
* <a href="http://developer.amazonwebservices.com/connect/entry.jspa?externalID=3912">
* http://developer.amazonwebservices.com/connect/entry.jspa?externalID=3912</a>
* <a href="https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-region-selection.html#region-selection-choose-endpoint">
* https://docs.aws.amazon.com/sdk-for-java/v1/developer-guide/java-dg-region-selection.html#region-selection-choose-endpoint</a>
*
* @param endpoint
* The endpoint (ex: "ec2.amazonaws.com") or a full URL,
Expand All @@ -244,7 +285,7 @@ public void setEndpoint(String endpoint) throws IllegalArgumentException {
checkMutability();
URI uri = toURI(endpoint);
Signer signer = computeSignerByURI(uri, signerRegionOverride, false);
synchronized(this) {
synchronized (this) {
this.isEndpointOverridden = true;
this.endpoint = uri;
this.signerProvider = createSignerProvider(signer);
Expand Down Expand Up @@ -293,7 +334,6 @@ private Signer computeSignerByURI(URI uri, String signerRegionOverride,
}
String service = getServiceNameIntern();
String region = AwsHostNameUtils.parseRegionName(uri.getHost(), service);

return computeSignerByServiceRegion(
service, region, signerRegionOverride, isRegionIdAsSignerParam);
}
Expand All @@ -320,13 +360,13 @@ private Signer computeSignerByServiceRegion(
String serviceName, String regionId,
String signerRegionOverride,
boolean isRegionIdAsSignerParam) {

String signerType = clientConfiguration.getSignerOverride();
Signer signer = signerType == null
? SignerFactory.getSigner(serviceName, regionId)
: SignerFactory.getSignerByTypeAndService(signerType, serviceName)
;
if (signer instanceof RegionAwareSigner) {

if (signer instanceof RegionAwareSigner) {
// Overrides the default region computed
RegionAwareSigner regionAwareSigner = (RegionAwareSigner)signer;
// (signerRegionOverride != null) means that it is likely to be AWS
Expand Down Expand Up @@ -400,10 +440,8 @@ public final void configureRegion(Regions region) {

/**
* Shuts down this client object, releasing any resources that might be held
* open. This is an optional method, and callers are not expected to call
* it, but can if they want to explicitly release any open resources. Once a
* client has been shutdown, it should not be used to make any more
* requests.
* open. If this method is not invoked, resources may be leaked. Once a client
* has been shutdown, it should not be used to make any more requests.
*/
public void shutdown() {
client.shutdown();
Expand Down Expand Up @@ -490,10 +528,10 @@ protected ExecutionContext createExecutionContext(AmazonWebServiceRequest req,
SignerProvider signerProvider) {
boolean isMetricsEnabled = isRequestMetricsEnabled(req) || isProfilingEnabled();
return ExecutionContext.builder()
.withRequestHandler2s(requestHandler2s)
.withUseRequestMetrics(isMetricsEnabled)
.withAwsClient(this)
.withSignerProvider(signerProvider).build();
.withRequestHandler2s(requestHandler2s)
.withUseRequestMetrics(isMetricsEnabled)
.withAwsClient(this)
.withSignerProvider(signerProvider).build();
}

protected final ExecutionContext createExecutionContext(Request<?> req) {
Expand Down Expand Up @@ -581,6 +619,13 @@ public RequestMetricCollector getRequestMetricsCollector() {
return client.getRequestMetricCollector();
}

/**
* Returns {@link MonitoringListener}; or null if there is none.
*/
public Collection<MonitoringListener> getMonitoringListeners() {
return Collections.unmodifiableCollection(monitoringListeners);
}

/**
* Returns the client specific request metric collector if there is one; or
* the one at the AWS SDK level otherwise.
Expand All @@ -596,13 +641,17 @@ protected RequestMetricCollector requestMetricCollector() {
*/
private final RequestMetricCollector findRequestMetricCollector(
RequestMetricCollector reqLevelMetricsCollector) {

RequestMetricCollector requestMetricCollector;

if (reqLevelMetricsCollector != null) {
return reqLevelMetricsCollector;
requestMetricCollector = reqLevelMetricsCollector;
} else if (getRequestMetricsCollector() != null) {
return getRequestMetricsCollector();
requestMetricCollector = getRequestMetricsCollector();
} else {
return AwsSdkMetrics.getRequestMetricCollector();
requestMetricCollector = AwsSdkMetrics.getRequestMetricCollector();
}
return requestMetricCollector;
}

/**
Expand Down Expand Up @@ -900,14 +949,7 @@ public String getSignerOverride() {
return clientConfiguration.getSignerOverride();
}

/**
* Return the client configuration so http calls made outside the Client, but within the SDK,
* can ascertain any options set in original client
*
* @return
* ClientConfiguration
*/
public ClientConfiguration getClientConfiguration() {
return clientConfiguration;
}
public ClientConfiguration getClientConfiguration() {
return new ClientConfiguration(clientConfiguration);
}
}

0 comments on commit 736bc71

Please sign in to comment.