Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 1 addition & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -12,5 +12,4 @@ atlassian-ide-plugin.xml
derby.log
.java-version
oak-shaded-guava/dependency-reduced-pom.xml
.DS_Store
.claude/settings.local.json
pom.xml.versionsBackup

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

where does this come from?

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

it is from maven release, it makes a pom backup and sometimes it fails to delete it

70 changes: 67 additions & 3 deletions oak-blob-cloud-azure/pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -40,10 +40,9 @@
<Import-Package>
com.fasterxml.jackson.annotation;resolution:=optional,
com.fasterxml.jackson.databind*;resolution:=optional,
com.fasterxml.jackson.dataformat.xml;resolution:=optional,
com.fasterxml.jackson.dataformat.xml*;resolution:=optional,
com.fasterxml.jackson.datatype*;resolution:=optional,
com.azure.identity.broker.implementation;resolution:=optional,
com.azure.xml;resolution:=optional,
com.azure.identity.broker*;resolution:=optional,
com.microsoft.aad.msal4jextensions*;resolution:=optional,
com.sun.net.httpserver;resolution:=optional,
sun.misc;resolution:=optional,
Expand All @@ -64,10 +63,14 @@
<DynamicImport-Package>sun.io</DynamicImport-Package>
<Embed-Dependency>
azure-storage,
azure-storage-blob,
azure-storage-common,
azure-storage-internal-avro,
azure-keyvault-core,
azure-core,
azure-identity,
azure-json,
azure-xml,
guava,
jsr305,
reactive-streams,
Expand Down Expand Up @@ -167,19 +170,46 @@
<groupId>com.microsoft.azure</groupId>
<artifactId>azure-keyvault-core</artifactId>
</dependency>

<!-- Azure SDK V12 Blob Storage dependencies -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-blob</artifactId>
<version>12.34.0</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-common</artifactId>
<version>12.33.0</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-storage-internal-avro</artifactId>
<version>12.19.0</version>
</dependency>

<!-- Azure identity and core -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-identity</artifactId>
<version>1.18.3</version>
</dependency>

<!-- Azure identity transitive dependencies -->
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core</artifactId>
<version>1.58.0</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-json</artifactId>
<version>1.5.1</version>
</dependency>
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-xml</artifactId>
<version>1.2.1</version>
</dependency>
<dependency>
<groupId>org.reactivestreams</groupId>
Expand All @@ -188,6 +218,7 @@
<dependency>
<groupId>com.microsoft.azure</groupId>
<artifactId>msal4j</artifactId>
<version>1.23.1</version>
</dependency>
<dependency>
<groupId>io.projectreactor</groupId>
Expand All @@ -200,6 +231,7 @@
<dependency>
<groupId>com.azure</groupId>
<artifactId>azure-core-http-netty</artifactId>
<version>1.16.4</version>
</dependency>
<dependency>
<groupId>io.netty</groupId>
Expand Down Expand Up @@ -281,6 +313,32 @@
<artifactId>nimbus-jose-jwt</artifactId>
</dependency>

<!-- Jackson (provided by OSGi container/AEM) -->
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-core</artifactId>
<version>${jackson.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
<version>${jackson.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-databind</artifactId>
<version>${jackson.version}</version>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.datatype</groupId>
<artifactId>jackson-datatype-jsr310</artifactId>
<version>${jackson.version}</version>
<scope>provided</scope>
</dependency>

<!-- Azure Guava dependency -->
<dependency>
<groupId>com.google.guava</groupId>
Expand Down Expand Up @@ -328,6 +386,12 @@
<artifactId>mockito-core</artifactId>
<scope>test</scope>
</dependency>
<dependency>
<groupId>com.tngtech.archunit</groupId>
<artifactId>archunit-junit4</artifactId>
<version>1.3.0</version>
<scope>test</scope>
</dependency>
<dependency>
<groupId>org.testcontainers</groupId>
<artifactId>testcontainers</artifactId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,16 @@
import org.osgi.framework.ServiceRegistration;
import org.osgi.service.component.ComponentContext;

/**
* Kept for binary compatibility with existing callers. Use {@link AzureDataStoreWrapper} instead.
*
* @deprecated superseded by {@link AzureDataStoreWrapper}, which replaces the dual-service
* (v8/v12) OSGi architecture with a single component that selects the SDK version at activation
* time via JVM property, environment variable, or OSGi configuration; retained only for binary
* compatibility.
*/
@Deprecated(since = "2.3", forRemoval = true)
public abstract class AbstractAzureDataStoreService extends AbstractDataStoreService {

Check warning on line 44 in oak-blob-cloud-azure/src/main/java/org/apache/jackrabbit/oak/blob/cloud/azure/blobstorage/AbstractAzureDataStoreService.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Do not forget to remove this deprecated code someday.

See more on https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&issues=AZ8nvtBDhOILnUTCTv0y&open=AZ8nvtBDhOILnUTCTv0y&pullRequest=2989
private static final String DESCRIPTION = "oak.datastore.description";

private ServiceRegistration delegateReg;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -195,6 +195,14 @@ public CloudBlobContainer getBlobContainer(@Nullable BlobRequestOptions blobRequ
return Utils.getBlobContainer(connectionStringWithAccountKey, containerName, blobRequestOptions);
}

public boolean deleteContainerIfExists() throws DataStoreException {
try {
return getBlobContainer().deleteIfExists();
} catch (StorageException e) {
throw new DataStoreException("Failed to delete container " + containerName, e);
}
}

@NotNull
private CloudBlobContainer getBlobContainerFromServicePrincipals(@Nullable BlobRequestOptions blobRequestOptions) throws DataStoreException {
StorageCredentialsToken storageCredentialsToken = getStorageCredentials();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -20,14 +20,20 @@
package org.apache.jackrabbit.oak.blob.cloud.azure.blobstorage;

import org.apache.jackrabbit.oak.stats.StatisticsProvider;
import org.osgi.service.component.annotations.Component;
import org.osgi.service.component.annotations.ConfigurationPolicy;
import org.osgi.service.component.annotations.Reference;

@Component(configurationPolicy = ConfigurationPolicy.REQUIRE, name = AzureDataStoreService.NAME)
/**
* Kept for binary compatibility with existing callers. Not an active OSGi component —
* {@link AzureDataStoreWrapper} owns the {@code AzureDataStore} PID. Use
* {@link AzureDataStoreWrapper} instead.
*
* @deprecated superseded by {@link AzureDataStoreWrapper}, which replaces the dual-service
* (v8/v12) OSGi architecture with a single component that selects the SDK version at activation
* time via JVM property, environment variable, or OSGi configuration; retained only for binary
* compatibility.
*/
@Deprecated(since = "2.3", forRemoval = true)
public class AzureDataStoreService extends AbstractAzureDataStoreService {

Check warning on line 35 in oak-blob-cloud-azure/src/main/java/org/apache/jackrabbit/oak/blob/cloud/azure/blobstorage/AzureDataStoreService.java

View check run for this annotation

SonarQubeCloud / SonarCloud Code Analysis

Do not forget to remove this deprecated code someday.

See more on https://sonarcloud.io/project/issues?id=org.apache.jackrabbit%3Ajackrabbit-oak&issues=AZ8nvtAahOILnUTCTv0w&open=AZ8nvtAahOILnUTCTv0w&pullRequest=2989

@Reference
private StatisticsProvider statisticsProvider;

public static final String NAME = "org.apache.jackrabbit.oak.plugins.blob.datastore.AzureDataStore";
Expand Down
Loading
Loading