META-INF.rewrite.change-config-types.yml Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of v2-migration Show documentation
Show all versions of v2-migration Show documentation
Contains OpenRewrite recipes to help users migrate from the AWS SDK for Java v1 to the AWS SDK for Java v2
#
# Copyright 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.
# A copy of the License is located at
#
# http://aws.amazon.com/apache2.0
#
# or in the "license" file accompanying this file. This file is distributed
# on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
# express or implied. See the License for the specific language governing
# permissions and limitations under the License.
#
## TODO: support retry policy, signer and throttledRetries
## TODO: handle http settings renaming for async HTTP client
---
type: specs.openrewrite.org/v1beta/recipe
name: software.amazon.awssdk.v2migration.ChangeConfigTypes
displayName: Change config related classes from v1 to v2
description: Change config related classes from v1 to v2.
recipeList:
- org.openrewrite.java.ChangeMethodName:
methodPattern: com.amazonaws.ClientConfiguration withRequestTimeout(int)
newMethodName: withApiCallAttemptTimeout
- org.openrewrite.java.ChangeMethodName:
methodPattern: com.amazonaws.ClientConfiguration setRequestTimeout(int)
newMethodName: withApiCallAttemptTimeout
- software.amazon.awssdk.v2migration.NumberToDuration:
methodPattern: com.amazonaws.ClientConfiguration withApiCallAttemptTimeout(int)
- org.openrewrite.java.ChangeMethodName:
methodPattern: com.amazonaws.ClientConfiguration withClientExecutionTimeout(int)
newMethodName: withApiCallTimeout
- org.openrewrite.java.ChangeMethodName:
methodPattern: com.amazonaws.ClientConfiguration setClientExecutionTimeout(int)
newMethodName: withApiCallTimeout
- software.amazon.awssdk.v2migration.NumberToDuration:
methodPattern: com.amazonaws.ClientConfiguration withApiCallTimeout(int)
- software.amazon.awssdk.v2migration.NumberToDuration:
methodPattern: com.amazonaws.ClientConfiguration withConnectionTimeout(int)
- software.amazon.awssdk.v2migration.NumberToDuration:
methodPattern: com.amazonaws.ClientConfiguration withSocketTimeout(int)
- org.openrewrite.java.ChangeMethodName:
methodPattern: com.amazonaws.ClientConfiguration withConnectionMaxIdleMillis(long)
newMethodName: withConnectionMaxIdleTime
- software.amazon.awssdk.v2migration.NumberToDuration:
methodPattern: com.amazonaws.ClientConfiguration withConnectionMaxIdleTime(long)
- org.openrewrite.java.ChangeMethodName:
methodPattern: com.amazonaws.ClientConfiguration withConnectionTTL(long)
newMethodName: withConnectionTimeToLive
- software.amazon.awssdk.v2migration.NumberToDuration:
methodPattern: com.amazonaws.ClientConfiguration withConnectionTimeToLive(long)
- org.openrewrite.java.ChangeMethodName:
methodPattern: com.amazonaws.ClientConfiguration withRetryMode(..)
newMethodName: withRetryPolicy
- org.openrewrite.java.ChangeMethodName:
methodPattern: com.amazonaws.ClientConfiguration setRetryMode(..)
newMethodName: withRetryPolicy
- org.openrewrite.java.ChangeMethodName:
methodPattern: com.amazonaws.ClientConfiguration withHeader(String, String)
newMethodName: withPutHeader
- org.openrewrite.java.ChangeMethodName:
methodPattern: com.amazonaws.ClientConfiguration setHeader(String, String)
newMethodName: withPutHeader
## Add comment to unsupported options
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration setMaxConsecutiveRetriesBeforeThrottling(int)
comment: maxConsecutiveRetriesBeforeThrottling is deprecated and not supported in v2. Consider removing it or using a custom RetryPolicy.
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration withMaxConsecutiveRetriesBeforeThrottling(int)
comment: maxConsecutiveRetriesBeforeThrottling is deprecated and not supported in v2. Consider removing it or using a custom RetryPolicy.
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration setCacheResponseMetadata(boolean)
comment: cacheResponseMetadata is deprecated and not supported in v2. Consider removing it.
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration withCacheResponseMetadata(boolean)
comment: cacheResponseMetadata is deprecated and not supported in v2. Consider removing it.
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration withDisableHostPrefixInjection(boolean)
comment: disableHostPrefixInjection is deprecated and not supported removed in v2. Consider removing it.
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration setDisableHostPrefixInjection(boolean)
comment: disableHostPrefixInjection is deprecated and not supported in v2. Consider removing it.
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration setDnsResolver(..)
comment: dnsResolver is not supported in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration withDnsResolver(..)
comment: dnsResolver is not supported in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration setGzip(boolean)
comment: gzip is not supported in v2 tracking in https://github.com/aws/aws-sdk-java-v2/issues/866. Consider removing it.
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration withGzip(boolean)
comment: gzip is not supported in v2 tracking in https://github.com/aws/aws-sdk-java-v2/issues/866. Consider removing it.
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration setLocalAddress(..)
comment: localAddress is not supported in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration withLocalAddress(..)
comment: localAddress is not supported in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration setSecureRandom(.*)
comment: secureRandom is not supported in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration withSecureRandom(.*)
comment: secureRandom is supported in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration setUseExpectContinue(boolean)
comment: useExpectContinue is removed in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration withUseExpectContinue(boolean)
comment: useExpectContinue is removed in v2. Please submit a feature request https://github.com/aws/aws-sdk-java-v2/issues
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration withProtocol(.*)
comment: protocol is deprecated and not supported in v2. Consider using endpointOverride to specify HTTP scheme.
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration setProtocol(.*)
comment: protocol is deprecated and not supported in v2. Consider using endpointOverride to specify HTTP scheme.
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration withUserAgent(String)
comment: userAgent override is a request-level config in v2. See https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/RequestOverrideConfiguration.Builder.html#addApiName(software.amazon.awssdk.core.ApiName).
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration setUserAgent(String)
comment: userAgent override is a request-level config in v2. See https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/RequestOverrideConfiguration.Builder.html#addApiName(software.amazon.awssdk.core.ApiName).
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration withUserAgentPrefix(String)
comment: userAgentPrefix override is a request-level config in v2. See https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/RequestOverrideConfiguration.Builder.html#addApiName(software.amazon.awssdk.core.ApiName).
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration setUserAgentPrefix(String)
comment: userAgentPrefix override is a request-level config in v2. See https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/RequestOverrideConfiguration.Builder.html#addApiName(software.amazon.awssdk.core.ApiName).
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration withUserAgentSuffix(String)
comment: userAgentSuffix override is a request-level config in v2. See https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/RequestOverrideConfiguration.Builder.html#addApiName(software.amazon.awssdk.core.ApiName).
- software.amazon.awssdk.v2migration.AddCommentToMethod:
methodPattern: com.amazonaws.ClientConfiguration setUserAgentSuffix(String)
comment: userAgentSuffix override is a request-level config in v2. See https://sdk.amazonaws.com/java/api/latest/software/amazon/awssdk/core/RequestOverrideConfiguration.Builder.html#addApiName(software.amazon.awssdk.core.ApiName).
## The following change needs to be the last step
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: com.amazonaws.ClientConfiguration
newFullyQualifiedTypeName: software.amazon.awssdk.core.client.config.ClientOverrideConfiguration
- org.openrewrite.java.ChangeType:
oldFullyQualifiedTypeName: com.amazonaws.retry.RetryMode
newFullyQualifiedTypeName: software.amazon.awssdk.core.retry.RetryMode