Skip to content

Commit

Permalink
Move HttpClient5 to own module (#90)
Browse files Browse the repository at this point in the history
Co-authored-by: CharlesDuboisSAP <[email protected]>

Moved the httpclient5 module out of frameworks to its own module within cloudplatform ala. httpclient4.
  • Loading branch information
rnewbigging authored Oct 10, 2023
1 parent ece18b1 commit da3792f
Show file tree
Hide file tree
Showing 26 changed files with 43 additions and 64 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion>
<parent>
<groupId>com.sap.cloud.sdk.frameworks</groupId>
<artifactId>frameworks-parent</artifactId>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-parent</artifactId>
<version>5.0.0-alpha-SNAPSHOT</version>
</parent>
<artifactId>apache-httpclient5</artifactId>
<artifactId>connectivity-apache-httpclient5</artifactId>
<name>Apache version 5 Http Client integration</name>
<description>Integrates the Apache version 5 Http Client with the destination abstraction.</description>
<url>https://sap.github.io/cloud-sdk/docs/java/getting-started</url>
Expand All @@ -16,9 +16,8 @@
</organization>
<licenses>
<license>
<name>SAP DEVELOPER LICENSE AGREEMENT</name>
<url>https://tools.hana.ondemand.com/developer-license-3_1.txt</url>
<distribution>repo</distribution>
<name>The Apache Software License, Version 2.0</name>
<url>https://www.apache.org/licenses/LICENSE-2.0.txt</url>
</license>
</licenses>
<developers>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.sdk.frameworks.apachehttpclient5;
package com.sap.cloud.sdk.cloudplatform.connectivity;

import java.io.ByteArrayInputStream;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.sdk.frameworks.apachehttpclient5;
package com.sap.cloud.sdk.cloudplatform.connectivity;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import org.apache.hc.client5.http.classic.HttpClient;

import com.google.common.annotations.Beta;
import com.sap.cloud.sdk.cloudplatform.connectivity.Destination;
import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestinationProperties;
import com.sap.cloud.sdk.cloudplatform.connectivity.exception.DestinationAccessException;
import com.sap.cloud.sdk.cloudplatform.connectivity.exception.HttpClientInstantiationException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.sdk.frameworks.apachehttpclient5;
package com.sap.cloud.sdk.cloudplatform.connectivity;

import java.time.Duration;

Expand All @@ -11,7 +11,6 @@
import org.apache.hc.client5.http.classic.HttpClient;

import com.google.common.annotations.Beta;
import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestinationProperties;
import com.sap.cloud.sdk.cloudplatform.connectivity.exception.HttpClientInstantiationException;

import io.vavr.control.Try;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.sdk.frameworks.apachehttpclient5;
package com.sap.cloud.sdk.cloudplatform.connectivity;

import java.time.Duration;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,14 @@
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.sdk.frameworks.apachehttpclient5;
package com.sap.cloud.sdk.cloudplatform.connectivity;

import javax.annotation.Nonnull;
import javax.annotation.Nullable;

import org.apache.hc.client5.http.classic.HttpClient;

import com.google.common.annotations.Beta;
import com.sap.cloud.sdk.cloudplatform.connectivity.Destination;
import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestinationProperties;
import com.sap.cloud.sdk.cloudplatform.connectivity.exception.DestinationAccessException;
import com.sap.cloud.sdk.cloudplatform.connectivity.exception.HttpClientInstantiationException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.sdk.frameworks.apachehttpclient5;
package com.sap.cloud.sdk.cloudplatform.connectivity;

import java.time.Duration;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.sdk.frameworks.apachehttpclient5;
package com.sap.cloud.sdk.cloudplatform.connectivity;

import java.io.IOException;
import java.net.URI;
Expand All @@ -18,9 +18,6 @@
import org.apache.hc.core5.io.CloseMode;

import com.google.common.base.Joiner;
import com.sap.cloud.sdk.cloudplatform.connectivity.Header;
import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestinationProperties;
import com.sap.cloud.sdk.cloudplatform.connectivity.UriPathMerger;

import lombok.extern.slf4j.Slf4j;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.sdk.frameworks.apachehttpclient5;
package com.sap.cloud.sdk.cloudplatform.connectivity;

import java.io.File;
import java.io.IOException;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.sdk.frameworks.apachehttpclient5;
package com.sap.cloud.sdk.cloudplatform.connectivity;

import java.time.Duration;
import java.util.Objects;
Expand All @@ -18,8 +18,6 @@
import com.github.benmanes.caffeine.cache.Ticker;
import com.sap.cloud.sdk.cloudplatform.cache.CacheKey;
import com.sap.cloud.sdk.cloudplatform.cache.CacheManager;
import com.sap.cloud.sdk.cloudplatform.connectivity.DestinationUtility;
import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestinationProperties;
import com.sap.cloud.sdk.cloudplatform.connectivity.exception.HttpClientInstantiationException;

import io.vavr.control.Try;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.sdk.frameworks.apachehttpclient5;
package com.sap.cloud.sdk.cloudplatform.connectivity;

import java.io.IOException;
import java.net.URI;
Expand Down Expand Up @@ -32,9 +32,6 @@
import org.apache.hc.core5.http.io.SocketConfig;
import org.apache.hc.core5.util.Timeout;

import com.sap.cloud.sdk.cloudplatform.connectivity.DestinationProperty;
import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestinationProperties;
import com.sap.cloud.sdk.cloudplatform.connectivity.ProxyConfiguration;
import com.sap.cloud.sdk.cloudplatform.connectivity.exception.DestinationAccessException;
import com.sap.cloud.sdk.cloudplatform.connectivity.exception.HttpClientInstantiationException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.sdk.frameworks.apachehttpclient5;
package com.sap.cloud.sdk.cloudplatform.connectivity;

import java.util.Collection;
import java.util.LinkedList;
Expand All @@ -13,7 +13,6 @@

import com.google.common.escape.Escaper;
import com.google.common.net.PercentEscaper;
import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestinationProperties;

import io.vavr.control.Try;
import lombok.extern.slf4j.Slf4j;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.sdk.frameworks.apachehttpclient5;
package com.sap.cloud.sdk.cloudplatform.connectivity;

import java.io.File;
import java.io.IOException;
Expand All @@ -20,8 +20,6 @@
import org.apache.hc.core5.ssl.SSLContextBuilder;

import com.sap.cloud.sdk.cloudplatform.PlatformSslContextProvider;
import com.sap.cloud.sdk.cloudplatform.connectivity.AuthenticationType;
import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestinationProperties;
import com.sap.cloud.sdk.cloudplatform.exception.CloudPlatformException;

import io.vavr.control.Option;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.sdk.frameworks.apachehttpclient5;
package com.sap.cloud.sdk.cloudplatform.connectivity;

import static org.assertj.core.api.Assertions.assertThat;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.sdk.frameworks.apachehttpclient5;
package com.sap.cloud.sdk.cloudplatform.connectivity;

import static org.assertj.core.api.Assertions.assertThatNoException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.sdk.frameworks.apachehttpclient5;
package com.sap.cloud.sdk.cloudplatform.connectivity;

import static org.assertj.core.api.Assertions.assertThatNoException;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.sdk.frameworks.apachehttpclient5;
package com.sap.cloud.sdk.cloudplatform.connectivity;

import static org.assertj.core.api.Assertions.assertThat;

Expand All @@ -20,9 +20,6 @@
import org.junit.Test;

import com.sap.cloud.sdk.cloudplatform.cache.CacheManager;
import com.sap.cloud.sdk.cloudplatform.connectivity.AuthenticationType;
import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination;
import com.sap.cloud.sdk.cloudplatform.connectivity.HttpDestination;
import com.sap.cloud.sdk.testutil.MockUtil;

public class DefaultApacheHttpClient5CacheTest
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
* Copyright (c) 2023 SAP SE or an SAP affiliate company. All rights reserved.
*/

package com.sap.cloud.sdk.frameworks.apachehttpclient5;
package com.sap.cloud.sdk.cloudplatform.connectivity;

import static com.github.tomakehurst.wiremock.client.WireMock.get;
import static com.github.tomakehurst.wiremock.client.WireMock.getRequestedFor;
Expand Down Expand Up @@ -50,8 +50,6 @@
import org.mockito.Mockito;

import com.github.tomakehurst.wiremock.junit.WireMockRule;
import com.sap.cloud.sdk.cloudplatform.connectivity.DefaultHttpDestination;
import com.sap.cloud.sdk.cloudplatform.connectivity.ProxyConfiguration;
import com.sap.cloud.sdk.cloudplatform.security.BasicCredentials;

import io.vavr.control.Option;
Expand Down
1 change: 1 addition & 0 deletions cloudplatform/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,7 @@
<module>connectivity-dwc</module>
<module>connectivity-oauth</module>
<module>connectivity-apache-httpclient4</module>
<module>connectivity-apache-httpclient5</module>
<module>resilience</module>
<module>security</module>
<module>security-scp-cf</module>
Expand Down
4 changes: 2 additions & 2 deletions datamodel/openapi/openapi-core/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -49,8 +49,8 @@
<artifactId>connectivity-apache-httpclient4</artifactId>
</dependency>
<dependency>
<groupId>com.sap.cloud.sdk.frameworks</groupId>
<artifactId>apache-httpclient5</artifactId>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>connectivity-apache-httpclient5</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -47,9 +47,9 @@
import com.fasterxml.jackson.annotation.PropertyAccessor;
import com.fasterxml.jackson.databind.ObjectMapper;
import com.fasterxml.jackson.datatype.jsr310.JavaTimeModule;
import com.sap.cloud.sdk.cloudplatform.connectivity.ApacheHttpClient5Accessor;
import com.sap.cloud.sdk.cloudplatform.connectivity.Destination;
import com.sap.cloud.sdk.cloudplatform.connectivity.HttpClientAccessor;
import com.sap.cloud.sdk.frameworks.apachehttpclient5.ApacheHttpClient5Accessor;
import com.sap.cloud.sdk.services.openapi.apiclient.auth.ApiKeyAuth;
import com.sap.cloud.sdk.services.openapi.apiclient.auth.Authentication;
import com.sap.cloud.sdk.services.openapi.apiclient.auth.HttpBasicAuth;
Expand Down
1 change: 0 additions & 1 deletion frameworks/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,6 @@
</developers>
<modules>
<module>resilience4j</module>
<module>apache-httpclient5</module>
</modules>
<scm>
<connection />
Expand Down
22 changes: 11 additions & 11 deletions module-inventory.json
Original file line number Diff line number Diff line change
Expand Up @@ -131,6 +131,17 @@
"parentArtifactId": "cloudplatform-parent",
"excludeFromBlackDuckScan": false
},
{
"groupId": "com.sap.cloud.sdk.cloudplatform",
"artifactId": "connectivity-apache-httpclient5",
"packaging": "jar",
"releaseAudience": "Public",
"releaseMaturity": "Beta",
"pomFile": "cloudplatform/connectivity-apache-httpclient5/pom.xml",
"parentGroupId": "com.sap.cloud.sdk.cloudplatform",
"parentArtifactId": "cloudplatform-parent",
"excludeFromBlackDuckScan": false
},
{
"groupId": "com.sap.cloud.sdk.cloudplatform",
"artifactId": "connectivity-dwc",
Expand Down Expand Up @@ -505,17 +516,6 @@
"parentArtifactId": "datamodel-parent",
"excludeFromBlackDuckScan": false
},
{
"groupId": "com.sap.cloud.sdk.frameworks",
"artifactId": "apache-httpclient5",
"packaging": "jar",
"releaseAudience": "Public",
"releaseMaturity": "Beta",
"pomFile": "frameworks/apache-httpclient5/pom.xml",
"parentGroupId": "com.sap.cloud.sdk.frameworks",
"parentArtifactId": "frameworks-parent",
"excludeFromBlackDuckScan": false
},
{
"groupId": "com.sap.cloud.sdk.frameworks",
"artifactId": "frameworks-parent",
Expand Down
10 changes: 5 additions & 5 deletions modules-bom/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -85,6 +85,11 @@
<artifactId>connectivity-apache-httpclient4</artifactId>
<version>${sdk.version}</version>
</dependency>
<dependency>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>connectivity-apache-httpclient5</artifactId>
<version>${sdk.version}</version>
</dependency>
<dependency>
<groupId>com.sap.cloud.sdk.cloudplatform</groupId>
<artifactId>cloudplatform-connectivity-scp-cf</artifactId>
Expand Down Expand Up @@ -216,11 +221,6 @@
<artifactId>soap</artifactId>
<version>${sdk.version}</version>
</dependency>
<dependency>
<groupId>com.sap.cloud.sdk.frameworks</groupId>
<artifactId>apache-httpclient5</artifactId>
<version>${sdk.version}</version>
</dependency>
<dependency>
<groupId>com.sap.cloud.sdk.frameworks</groupId>
<artifactId>resilience4j</artifactId>
Expand Down
1 change: 1 addition & 0 deletions release_notes_next_major.md
Original file line number Diff line number Diff line change
Expand Up @@ -128,6 +128,7 @@ blog: https://blogs.sap.com/?p=xxx
As usual, the specific error cause is attached to the exception.
- The following classes have been moved or their modules have been renamed:
- All classes related to the Apache Http Client 4 have been moved from `com.sap.cloud.sdk.cloudplatform:cloudplatform-connectivity` to a new module `com.sap.cloud.sdk.cloudplatform:connectivity-apache-httpclient4`
- All classes related to the Apache Http Client 5 have been moved from `com.sap.cloud.sdk.frameworks:apache-httpclient5` to `com.sap.cloud.sdk.cloudplatform:connectivity-apache-httpclient5`
- The `HttpClientAccessor` and `ApacheHttpClient5Accessor` classes are generalised to accept `Destination` instances, making invocations to `.asHttp()` superfluous when obtaining HTTP clients.
- The `getSslContext()` method was removed from the `CloudPlatform` interface and the implementation was moved to the modules `connectivity-apache-httpclient4` and `connectivity-apache-httpclient5`.
- The OData, OpenAPI and SOAP APIs are generalised to accept instances of `Destination`, making invocations to `.asHttp()` superfluous when executing OData or REST requests.
Expand Down

0 comments on commit da3792f

Please sign in to comment.