Skip to content

Commit

Permalink
Upgrade Azure Blobstore fromi legacy azure-sdk (11.0) to latest (12.2…
Browse files Browse the repository at this point in the history
…7.0)

Add azure storage blob 12.27.0 dependencies using the azure-sdk-bom:1.2.25

Upgrade azure blobstore dependencies to latest from the root pom

Run Azurite-based integration tests against the latest Docker image
version, remove legacy.

Migrate to `com.azure:blobstorage:12.x`. The upgrade
tries to do a 1:1 migration to the new azure-sdk API (in its blocking
falvor) as much as possible, so that the integration tests serve to
avoid regressions.

A couple remarks:

* There's no way to close the HTTPClient so AzureClient does not
  implement Closeable anymore.
* Fix a bug in DeleteManager that always reported 0 objects deleted

Upgrade `com.microsoft.azure:azure-storage-blob` to
`com.azure:azure-storage-blob`.
  • Loading branch information
groldan committed Aug 29, 2024
1 parent 8d1146e commit 8e4059d
Show file tree
Hide file tree
Showing 16 changed files with 466 additions and 905 deletions.
13 changes: 10 additions & 3 deletions geowebcache/azureblob/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -19,10 +19,17 @@
</dependency>

<dependency>
<groupId>com.microsoft.azure</groupId>
<groupId>com.azure</groupId>
<artifactId>azure-storage-blob</artifactId>
<!-- at the time of writing 11.0.1 was available but pom on repoes was corrupted -->
<version>11.0.0</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-blob-batch</artifactId>
</dependency>
<dependency>
<!-- The azure-identity dependency is needed for passwordless connections to Azure services. -->
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
</dependency>

<dependency>
Expand Down

Large diffs are not rendered by default.

Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ public class AzureBlobStoreData {
private String accountName;
private String accountKey;
private Integer maxConnections;
private Boolean useHTTPS;
private boolean useHTTPS;
private String proxyHost;
private Integer proxyPort;
private String proxyUsername;
Expand Down Expand Up @@ -113,11 +113,11 @@ public void setMaxConnections(Integer maxConnections) {
this.maxConnections = maxConnections;
}

public Boolean isUseHTTPS() {
public boolean isUseHTTPS() {
return useHTTPS;
}

public void setUseHTTPS(Boolean useHTTPS) {
public void setUseHTTPS(boolean useHTTPS) {
this.useHTTPS = useHTTPS;
}

Expand All @@ -137,6 +137,7 @@ public void setProxyPort(Integer proxyPort) {
this.proxyPort = proxyPort;
}

/** unused */
public String getProxyUsername() {
return proxyUsername;
}
Expand All @@ -145,6 +146,7 @@ public void setProxyUsername(String proxyUsername) {
this.proxyUsername = proxyUsername;
}

/** unused */
public String getProxyPassword() {
return proxyPassword;
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ public class AzureBlobStoreInfo extends BlobStoreInfo {

private String maxConnections;

private Boolean useHTTPS = true;
private boolean useHTTPS = true;

private String proxyHost;

Expand Down Expand Up @@ -139,7 +139,7 @@ public Boolean isUseHTTPS() {
}

/** @param useHTTPS whether to use HTTPS (true) or HTTP (false) when talking to Azure */
public void setUseHTTPS(Boolean useHTTPS) {
public void setUseHTTPS(boolean useHTTPS) {
this.useHTTPS = useHTTPS;
}

Expand Down Expand Up @@ -260,7 +260,7 @@ public int hashCode() {
result = prime * result + ((proxyPort == null) ? 0 : proxyPort.hashCode());
result = prime * result + ((proxyUsername == null) ? 0 : proxyUsername.hashCode());
result = prime * result + ((serviceURL == null) ? 0 : serviceURL.hashCode());
result = prime * result + ((useHTTPS == null) ? 0 : useHTTPS.hashCode());
result = prime * result + (useHTTPS ? 1 : 0);
return result;
}

Expand Down Expand Up @@ -300,9 +300,7 @@ public boolean equals(Object obj) {
if (serviceURL == null) {
if (other.serviceURL != null) return false;
} else if (!serviceURL.equals(other.serviceURL)) return false;
if (useHTTPS == null) {
if (other.useHTTPS != null) return false;
} else if (!useHTTPS.equals(other.useHTTPS)) return false;
if (useHTTPS != other.useHTTPS) return false;
return true;
}

Expand Down
Loading

0 comments on commit 8e4059d

Please sign in to comment.