JAMES-3803 RemoteDelivery uses different scheduler for dequeuing (#1121) master
authorAdBuch <41142471+AdBuch@users.noreply.github.com>
Fri, 19 Aug 2022 09:18:35 +0000 (11:18 +0200)
committerGitHub <noreply@github.com>
Fri, 19 Aug 2022 09:18:35 +0000 (16:18 +0700)
This is necessary as else in high load a delivery-task can queue in the same thread as the never ending dequeuing-task and stay there forever

341 files changed:
Jenkinsfile
backends-common/opensearch/pom.xml [moved from backends-common/elasticsearch-v7/pom.xml with 89% similarity]
backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/AliasName.java [moved from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/AliasName.java with 97% similarity]
backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/ClientProvider.java [moved from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/ClientProvider.java with 92% similarity]
backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/DeleteByQueryPerformer.java [moved from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/DeleteByQueryPerformer.java with 90% similarity]
backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/DocumentId.java [moved from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/DocumentId.java with 95% similarity]
backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/ElasticSearchConfiguration.java [moved from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/ElasticSearchConfiguration.java with 98% similarity]
backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/ElasticSearchHealthCheck.java [moved from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/ElasticSearchHealthCheck.java with 92% similarity]
backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/ElasticSearchIndexer.java [moved from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/ElasticSearchIndexer.java with 88% similarity]
backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/IndexCreationFactory.java [moved from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/IndexCreationFactory.java with 94% similarity]
backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/IndexName.java [moved from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/IndexName.java with 97% similarity]
backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/ReactorElasticSearchClient.java [moved from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/ReactorElasticSearchClient.java with 72% similarity]
backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/ReadAliasName.java [moved from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/ReadAliasName.java with 96% similarity]
backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/RoutingKey.java [moved from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/RoutingKey.java with 96% similarity]
backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/UpdatedRepresentation.java [moved from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/UpdatedRepresentation.java with 96% similarity]
backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/WriteAliasName.java [moved from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/WriteAliasName.java with 96% similarity]
backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/search/ScrolledSearch.java [moved from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/search/ScrolledSearch.java with 89% similarity]
backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/AliasNameTest.java [moved from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/AliasNameTest.java with 96% similarity]
backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/ClientProviderImplConnectionAuthESIgnoreSSLCheckTest.java [moved from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/ClientProviderImplConnectionAuthESIgnoreSSLCheckTest.java with 85% similarity]
backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/ClientProviderImplConnectionAuthESOverrideTrustStoreTest.java [moved from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/ClientProviderImplConnectionAuthESOverrideTrustStoreTest.java with 90% similarity]
backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/ClientProviderImplConnectionContract.java [moved from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/ClientProviderImplConnectionContract.java with 90% similarity]
backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/ClientProviderImplConnectionNoAuthESTest.java [moved from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/ClientProviderImplConnectionNoAuthESTest.java with 89% similarity]
backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/ClientProviderTest.java [moved from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/ClientProviderTest.java with 97% similarity]
backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/DockerAuthElasticSearchSingleton.java [moved from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/DockerAuthElasticSearchSingleton.java with 96% similarity]
backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/DockerElasticSearch.java [moved from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/DockerElasticSearch.java with 94% similarity]
backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/DockerElasticSearchExtension.java [moved from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/DockerElasticSearchExtension.java with 98% similarity]
backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/DockerElasticSearchRule.java [moved from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/DockerElasticSearchRule.java with 97% similarity]
backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/DockerElasticSearchSingleton.java [moved from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/DockerElasticSearchSingleton.java with 96% similarity]
backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/DocumentIdTest.java [moved from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/DocumentIdTest.java with 97% similarity]
backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/ElasticSearchClusterExtension.java [moved from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/ElasticSearchClusterExtension.java with 98% similarity]
backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/ElasticSearchConfigurationTest.java [moved from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/ElasticSearchConfigurationTest.java with 98% similarity]
backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/ElasticSearchHealthCheckConnectionTest.java [moved from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/ElasticSearchHealthCheckConnectionTest.java with 98% similarity]
backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/ElasticSearchHealthCheckTest.java [moved from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/ElasticSearchHealthCheckTest.java with 87% similarity]
backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/ElasticSearchIndexerTest.java [moved from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/ElasticSearchIndexerTest.java with 96% similarity]
backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/IndexCreationFactoryTest.java [moved from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/IndexCreationFactoryTest.java with 92% similarity]
backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/RoutingKeyTest.java [moved from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/RoutingKeyTest.java with 97% similarity]
backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/search/ScrolledSearchTest.java [moved from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/search/ScrolledSearchTest.java with 89% similarity]
backends-common/opensearch/src/test/resources/auth-es/NginxDockerfile [moved from backends-common/elasticsearch-v7/src/test/resources/auth-es/NginxDockerfile with 100% similarity]
backends-common/opensearch/src/test/resources/auth-es/README.md [moved from backends-common/elasticsearch-v7/src/test/resources/auth-es/README.md with 100% similarity]
backends-common/opensearch/src/test/resources/auth-es/default.crt [moved from backends-common/elasticsearch-v7/src/test/resources/auth-es/default.crt with 100% similarity]
backends-common/opensearch/src/test/resources/auth-es/default.key [moved from backends-common/elasticsearch-v7/src/test/resources/auth-es/default.key with 100% similarity]
backends-common/opensearch/src/test/resources/auth-es/nginx-conf/passwd [moved from backends-common/elasticsearch-v7/src/test/resources/auth-es/nginx-conf/passwd with 100% similarity]
backends-common/opensearch/src/test/resources/auth-es/nginx-conf/reverse_elasticsearch.conf [moved from backends-common/elasticsearch-v7/src/test/resources/auth-es/nginx-conf/reverse_elasticsearch.conf with 100% similarity]
backends-common/opensearch/src/test/resources/auth-es/server.jks [moved from backends-common/elasticsearch-v7/src/test/resources/auth-es/server.jks with 100% similarity]
backends-common/pom.xml
backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/RabbitMQConfiguration.java
backends-common/rabbitmq/src/main/java/org/apache/james/backends/rabbitmq/RabbitMQManagementAPI.java
backends-common/rabbitmq/src/test/java/org/apache/james/backends/rabbitmq/RabbitMQConfigurationTest.java
backends-common/rabbitmq/src/test/java/org/apache/james/backends/rabbitmq/RabbitMQTest.java
mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/task/SolveMailboxInconsistenciesTask.java
mailbox/cassandra/src/main/java/org/apache/james/mailbox/cassandra/mail/task/SolveMessageInconsistenciesTask.java
mailbox/opensearch/example_french_index.json [deleted file]
mailbox/opensearch/pom.xml [moved from mailbox/elasticsearch-v7/pom.xml with 95% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/ElasticSearchMailboxConfiguration.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/ElasticSearchMailboxConfiguration.java with 97% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/IndexAttachments.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/IndexAttachments.java with 96% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/MailboxElasticSearchConstants.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/MailboxElasticSearchConstants.java with 87% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/MailboxIdRoutingKeyFactory.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/MailboxIdRoutingKeyFactory.java with 93% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/MailboxIndexCreationUtil.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/MailboxIndexCreationUtil.java with 84% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/MailboxMappingFactory.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/MailboxMappingFactory.java with 54% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/events/ElasticSearchListeningMessageSearchIndex.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/events/ElasticSearchListeningMessageSearchIndex.java with 87% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/EMailer.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/EMailer.java with 97% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/EMailers.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/EMailers.java with 97% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/HeaderCollection.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/HeaderCollection.java with 99% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/IndexableMessage.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/IndexableMessage.java with 99% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/JsonMessageConstants.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/JsonMessageConstants.java with 97% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/MessageToElasticSearchJson.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/MessageToElasticSearchJson.java with 96% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/MessageUpdateJson.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/MessageUpdateJson.java with 97% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/MimePart.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/MimePart.java with 99% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/MimePartContainerBuilder.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/MimePartContainerBuilder.java with 97% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/MimePartParser.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/MimePartParser.java with 99% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/RootMimePartContainerBuilder.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/RootMimePartContainerBuilder.java with 98% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/SerializableMessage.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/SerializableMessage.java with 95% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/Subjects.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/Subjects.java with 97% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/query/CriterionConverter.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/query/CriterionConverter.java with 94% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/query/DateResolutionFormatter.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/query/DateResolutionFormatter.java with 98% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/query/QueryConverter.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/query/QueryConverter.java with 88% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/query/SortConverter.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/query/SortConverter.java with 89% similarity]
mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/search/ElasticSearchSearcher.java [moved from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/search/ElasticSearchSearcher.java with 85% similarity]
mailbox/opensearch/src/reporting-site/site.xml [moved from mailbox/elasticsearch-v7/src/reporting-site/site.xml with 100% similarity]
mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/ElasticSearchIntegrationTest.java [moved from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/ElasticSearchIntegrationTest.java with 95% similarity]
mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/ElasticSearchMailboxConfigurationTest.java [moved from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/ElasticSearchMailboxConfigurationTest.java with 97% similarity]
mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/MailboxIdRoutingKeyFactoryTest.java [moved from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/MailboxIdRoutingKeyFactoryTest.java with 93% similarity]
mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/events/ElasticSearchListeningMessageSearchIndexTest.java [moved from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/events/ElasticSearchListeningMessageSearchIndexTest.java with 94% similarity]
mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/json/EMailerTest.java [moved from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/json/EMailerTest.java with 96% similarity]
mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/json/EMailersTest.java [moved from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/json/EMailersTest.java with 97% similarity]
mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/json/FieldImpl.java [moved from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/json/FieldImpl.java with 97% similarity]
mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/json/HeaderCollectionTest.java [moved from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/json/HeaderCollectionTest.java with 99% similarity]
mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/json/IndexableMessageTest.java [moved from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/json/IndexableMessageTest.java with 99% similarity]
mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/json/MessageToElasticSearchJsonTest.java [moved from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/json/MessageToElasticSearchJsonTest.java with 99% similarity]
mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/json/MimePartTest.java [moved from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/json/MimePartTest.java with 97% similarity]
mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/json/SubjectsTest.java [moved from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/json/SubjectsTest.java with 97% similarity]
mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/query/DateResolutionFormatterTest.java [moved from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/query/DateResolutionFormatterTest.java with 98% similarity]
mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/query/SearchQueryTest.java [moved from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/query/SearchQueryTest.java with 97% similarity]
mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/search/ElasticSearchSearcherTest.java [moved from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/search/ElasticSearchSearcherTest.java with 87% similarity]
mailbox/opensearch/src/test/resources/eml/bodyMakeTikaToFail.eml [moved from mailbox/elasticsearch-v7/src/test/resources/eml/bodyMakeTikaToFail.eml with 100% similarity]
mailbox/opensearch/src/test/resources/eml/emailWith3Attachments.eml [moved from mailbox/elasticsearch-v7/src/test/resources/eml/emailWith3Attachments.eml with 100% similarity]
mailbox/opensearch/src/test/resources/eml/htmlContent.txt [moved from mailbox/elasticsearch-v7/src/test/resources/eml/htmlContent.txt with 100% similarity]
mailbox/opensearch/src/test/resources/eml/inlined-mixed.eml [moved from mailbox/elasticsearch-v7/src/test/resources/eml/inlined-mixed.eml with 100% similarity]
mailbox/opensearch/src/test/resources/eml/inlined-mixed.json [moved from mailbox/elasticsearch-v7/src/test/resources/eml/inlined-mixed.json with 100% similarity]
mailbox/opensearch/src/test/resources/eml/mailCustomDateHeader.eml [moved from mailbox/elasticsearch-v7/src/test/resources/eml/mailCustomDateHeader.eml with 100% similarity]
mailbox/opensearch/src/test/resources/eml/mailCustomStringHeader.eml [moved from mailbox/elasticsearch-v7/src/test/resources/eml/mailCustomStringHeader.eml with 100% similarity]
mailbox/opensearch/src/test/resources/eml/mailWithHeaders.eml [moved from mailbox/elasticsearch-v7/src/test/resources/eml/mailWithHeaders.eml with 100% similarity]
mailbox/plugin/deleted-messages-vault/src/main/java/org/apache/james/vault/blob/BlobStoreVaultGarbageCollectionTask.java
mailbox/plugin/quota-search-opensearch/pom.xml [moved from mailbox/plugin/quota-search-elasticsearch-v7/pom.xml with 92% similarity]
mailbox/plugin/quota-search-opensearch/src/main/java/org/apache/james/quota/search/opensearch/ElasticSearchQuotaConfiguration.java [moved from mailbox/plugin/quota-search-elasticsearch-v7/src/main/java/org/apache/james/quota/search/elasticsearch/v7/ElasticSearchQuotaConfiguration.java with 96% similarity]
mailbox/plugin/quota-search-opensearch/src/main/java/org/apache/james/quota/search/opensearch/ElasticSearchQuotaSearcher.java [moved from mailbox/plugin/quota-search-elasticsearch-v7/src/main/java/org/apache/james/quota/search/elasticsearch/v7/ElasticSearchQuotaSearcher.java with 82% similarity]
mailbox/plugin/quota-search-opensearch/src/main/java/org/apache/james/quota/search/opensearch/QuotaQueryConverter.java [moved from mailbox/plugin/quota-search-elasticsearch-v7/src/main/java/org/apache/james/quota/search/elasticsearch/v7/QuotaQueryConverter.java with 85% similarity]
mailbox/plugin/quota-search-opensearch/src/main/java/org/apache/james/quota/search/opensearch/QuotaRatioElasticSearchConstants.java [moved from mailbox/plugin/quota-search-elasticsearch-v7/src/main/java/org/apache/james/quota/search/elasticsearch/v7/QuotaRatioElasticSearchConstants.java with 84% similarity]
mailbox/plugin/quota-search-opensearch/src/main/java/org/apache/james/quota/search/opensearch/QuotaRatioMappingFactory.java [moved from mailbox/plugin/quota-search-elasticsearch-v7/src/main/java/org/apache/james/quota/search/elasticsearch/v7/QuotaRatioMappingFactory.java with 69% similarity]
mailbox/plugin/quota-search-opensearch/src/main/java/org/apache/james/quota/search/opensearch/QuotaSearchIndexCreationUtil.java [moved from mailbox/plugin/quota-search-elasticsearch-v7/src/main/java/org/apache/james/quota/search/elasticsearch/v7/QuotaSearchIndexCreationUtil.java with 86% similarity]
mailbox/plugin/quota-search-opensearch/src/main/java/org/apache/james/quota/search/opensearch/UserRoutingKeyFactory.java [moved from mailbox/plugin/quota-search-elasticsearch-v7/src/main/java/org/apache/james/quota/search/elasticsearch/v7/UserRoutingKeyFactory.java with 93% similarity]
mailbox/plugin/quota-search-opensearch/src/main/java/org/apache/james/quota/search/opensearch/events/ElasticSearchQuotaMailboxListener.java [moved from mailbox/plugin/quota-search-elasticsearch-v7/src/main/java/org/apache/james/quota/search/elasticsearch/v7/events/ElasticSearchQuotaMailboxListener.java with 90% similarity]
mailbox/plugin/quota-search-opensearch/src/main/java/org/apache/james/quota/search/opensearch/json/JsonMessageConstants.java [moved from mailbox/plugin/quota-search-elasticsearch-v7/src/main/java/org/apache/james/quota/search/elasticsearch/v7/json/JsonMessageConstants.java with 95% similarity]
mailbox/plugin/quota-search-opensearch/src/main/java/org/apache/james/quota/search/opensearch/json/QuotaRatioAsJson.java [moved from mailbox/plugin/quota-search-elasticsearch-v7/src/main/java/org/apache/james/quota/search/elasticsearch/v7/json/QuotaRatioAsJson.java with 98% similarity]
mailbox/plugin/quota-search-opensearch/src/main/java/org/apache/james/quota/search/opensearch/json/QuotaRatioToElasticSearchJson.java [moved from mailbox/plugin/quota-search-elasticsearch-v7/src/main/java/org/apache/james/quota/search/elasticsearch/v7/json/QuotaRatioToElasticSearchJson.java with 97% similarity]
mailbox/plugin/quota-search-opensearch/src/test/java/org/apache/james/quota/search/opensearch/ElasticSearchQuotaConfigurationTest.java [moved from mailbox/plugin/quota-search-elasticsearch-v7/src/test/java/org/apache/james/quota/search/elasticsearch/v7/ElasticSearchQuotaConfigurationTest.java with 95% similarity]
mailbox/plugin/quota-search-opensearch/src/test/java/org/apache/james/quota/search/opensearch/ElasticSearchQuotaSearchTestSystemExtension.java [moved from mailbox/plugin/quota-search-elasticsearch-v7/src/test/java/org/apache/james/quota/search/elasticsearch/v7/ElasticSearchQuotaSearchTestSystemExtension.java with 90% similarity]
mailbox/plugin/quota-search-opensearch/src/test/java/org/apache/james/quota/search/opensearch/ElasticSearchQuotaSearcherTest.java [moved from mailbox/plugin/quota-search-elasticsearch-v7/src/test/java/org/apache/james/quota/search/elasticsearch/v7/ElasticSearchQuotaSearcherTest.java with 98% similarity]
mailbox/plugin/quota-search-opensearch/src/test/java/org/apache/james/quota/search/opensearch/QuotaQueryConverterTest.java [moved from mailbox/plugin/quota-search-elasticsearch-v7/src/test/java/org/apache/james/quota/search/elasticsearch/v7/QuotaQueryConverterTest.java with 85% similarity]
mailbox/plugin/quota-search-opensearch/src/test/java/org/apache/james/quota/search/opensearch/UserRoutingKeyFactoryTest.java [moved from mailbox/plugin/quota-search-elasticsearch-v7/src/test/java/org/apache/james/quota/search/elasticsearch/v7/UserRoutingKeyFactoryTest.java with 93% similarity]
mailbox/plugin/quota-search-opensearch/src/test/java/org/apache/james/quota/search/opensearch/events/ElasticSearchQuotaMailboxListenerTest.java [moved from mailbox/plugin/quota-search-elasticsearch-v7/src/test/java/org/apache/james/quota/search/elasticsearch/v7/events/ElasticSearchQuotaMailboxListenerTest.java with 83% similarity]
mailbox/plugin/quota-search-opensearch/src/test/java/org/apache/james/quota/search/opensearch/json/QuotaRatioAsJsonTest.java [moved from mailbox/plugin/quota-search-elasticsearch-v7/src/test/java/org/apache/james/quota/search/elasticsearch/v7/json/QuotaRatioAsJsonTest.java with 98% similarity]
mailbox/plugin/quota-search-opensearch/src/test/java/org/apache/james/quota/search/opensearch/json/QuotaRatioToElasticSearchJsonTest.java [moved from mailbox/plugin/quota-search-elasticsearch-v7/src/test/java/org/apache/james/quota/search/elasticsearch/v7/json/QuotaRatioToElasticSearchJsonTest.java with 98% similarity]
mailbox/plugin/quota-search-opensearch/src/test/resources/quotaRatio.json [moved from mailbox/plugin/quota-search-elasticsearch-v7/src/test/resources/quotaRatio.json with 100% similarity]
mailbox/plugin/quota-search-opensearch/src/test/resources/quotaRatioNoDomain.json [moved from mailbox/plugin/quota-search-elasticsearch-v7/src/test/resources/quotaRatioNoDomain.json with 100% similarity]
mailbox/pom.xml
mailbox/scanning-search/src/test/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndexTest.java
mailbox/store/src/main/java/org/apache/james/mailbox/store/StoreMailboxManager.java
mailbox/store/src/main/java/org/apache/james/mailbox/store/search/SimpleMessageSearchIndex.java
mailbox/tools/indexer/src/main/java/org/apache/mailbox/tools/indexer/MessageIdReIndexingTask.java
mpt/impl/imap-mailbox/elasticsearch/pom.xml
mpt/impl/imap-mailbox/elasticsearch/src/test/java/org/apache/james/mpt/imapmailbox/elasticsearch/host/ElasticSearchHostSystem.java
mpt/impl/smtp/cassandra-pulsar/pom.xml
mpt/impl/smtp/cassandra-rabbitmq-object-storage/pom.xml
mpt/impl/smtp/cassandra/pom.xml
pom.xml
server/apps/cassandra-app/pom.xml
server/apps/cassandra-app/src/test/java/org/apache/james/DockerElasticSearchExtension.java
server/apps/cassandra-app/src/test/java/org/apache/james/DockerElasticSearchRule.java
server/apps/cassandra-app/src/test/java/org/apache/james/ESReporterTest.java
server/apps/cassandra-app/src/test/java/org/apache/james/JamesWithNonCompatibleElasticSearchServerTest.java
server/apps/cassandra-app/src/test/java/org/apache/james/modules/TestDockerElasticSearchModule.java
server/apps/distributed-app/docs/modules/ROOT/pages/architecture/index.adoc
server/apps/distributed-app/docs/modules/ROOT/pages/configure/elasticsearch.adoc
server/apps/distributed-app/docs/modules/ROOT/pages/configure/extensions.adoc
server/apps/distributed-app/docs/modules/ROOT/pages/configure/index.adoc
server/apps/distributed-app/docs/modules/ROOT/pages/configure/listeners.adoc
server/apps/distributed-app/docs/modules/ROOT/pages/configure/rabbitmq.adoc
server/apps/distributed-app/docs/modules/ROOT/pages/configure/spam.adoc
server/apps/distributed-app/docs/modules/ROOT/pages/extending/index.adoc
server/apps/distributed-app/docs/modules/ROOT/pages/operate/guide.adoc
server/apps/distributed-app/docs/modules/ROOT/pages/operate/webadmin.adoc
server/apps/distributed-app/docs/modules/ROOT/partials/IsMarkedAsSpam.adoc
server/apps/distributed-app/pom.xml
server/apps/distributed-app/sample-configuration/rabbitmq.properties
server/apps/distributed-pop3-app/pom.xml
server/apps/distributed-pop3-app/sample-configuration/rabbitmq.properties
server/apps/memory-app/src/test/resources/usersrepository.xml [new file with mode: 0644]
server/apps/scaling-pulsar-smtp/pom.xml
server/apps/scaling-pulsar-smtp/src/test/java/org/apache/james/DockerElasticSearchExtension.java
server/apps/scaling-pulsar-smtp/src/test/java/org/apache/james/DockerElasticSearchRule.java
server/apps/scaling-pulsar-smtp/src/test/java/org/apache/james/modules/TestDockerElasticSearchModule.java
server/apps/webadmin-cli/src/test/resources/usersrepository.xml [new file with mode: 0644]
server/blob/blob-s3/src/main/java/org/apache/james/blob/objectstorage/aws/S3BlobStoreDAO.java
server/container/core/pom.xml
server/container/core/src/test/java/org/apache/james/server/core/MimeMessageWrapperTest.java
server/container/guice/cassandra/pom.xml
server/container/guice/common/src/main/java/org/apache/james/modules/CommonServicesModule.java
server/container/guice/common/src/main/java/org/apache/james/modules/ErrorMailRepositoryEmptyHealthCheckModule.java [new file with mode: 0644]
server/container/guice/common/src/main/java/org/apache/james/modules/server/TaskSerializationModule.java
server/container/guice/distributed/src/main/java/org/apache/james/modules/DistributedTaskSerializationModule.java
server/container/guice/elasticsearch/pom.xml
server/container/guice/elasticsearch/src/main/java/org/apache/james/modules/mailbox/ElasticSearchClientModule.java
server/container/guice/elasticsearch/src/main/java/org/apache/james/modules/mailbox/ElasticSearchMailboxModule.java
server/container/guice/elasticsearch/src/main/java/org/apache/james/modules/mailbox/ElasticSearchQuotaSearcherModule.java
server/container/guice/elasticsearch/src/main/java/org/apache/james/modules/mailbox/ElasticSearchStartUpCheck.java
server/container/guice/elasticsearch/src/test/java/org/apache/james/modules/mailbox/ElasticSearchMailboxModuleTest.java
server/container/guice/protocols/webadmin/src/main/java/org/apache/james/modules/server/TaskRoutesModule.java
server/container/guice/protocols/webadmin/src/main/java/org/apache/james/modules/server/WebAdminServerModule.java
server/container/guice/queue/activemq/src/main/java/org/apache/james/modules/queue/activemq/ActiveMQQueueModule.java
server/container/guice/utils/src/main/java/org/apache/james/utils/ExtensionConfiguration.java
server/container/metrics/metrics-es-reporter-v7/pom.xml
server/container/metrics/metrics-es-reporter-v7/src/test/java/org/apache/james/metric/es/v7/DockerElasticSearchExtension.java
server/container/metrics/metrics-es-reporter-v7/src/test/java/org/apache/james/metric/es/v7/ES2ReporterTest.java
server/container/metrics/metrics-es-reporter-v7/src/test/java/org/apache/james/metric/es/v7/ES6ReporterTest.java
server/container/metrics/metrics-es-reporter-v7/src/test/java/org/apache/james/metric/es/v7/ES7ReporterTest.java
server/container/metrics/metrics-es-reporter-v7/src/test/java/org/apache/james/metric/es/v7/ESReporterContract.java
server/container/spring/pom.xml
server/data/data-api/src/test/resources/domainlist.xml [moved from server/data/data-api/src/main/resources/domainlist.xml with 100% similarity]
server/data/data-api/src/test/resources/mailrepositorystore.xml [moved from server/data/data-api/src/main/resources/mailrepositorystore.xml with 100% similarity]
server/data/data-api/src/test/resources/recipientrewritetable.xml [moved from server/data/data-api/src/main/resources/recipientrewritetable.xml with 100% similarity]
server/data/data-api/src/test/resources/sieverepository.xml [moved from server/data/data-api/src/main/resources/sieverepository.xml with 100% similarity]
server/data/data-api/src/test/resources/usersrepository.xml [moved from server/data/data-api/src/main/resources/usersrepository.xml with 100% similarity]
server/data/data-jmap/src/main/java/org/apache/james/jmap/memory/upload/InMemoryUploadRepository.java
server/data/data-jmap/src/main/scala/org/apache/james/jmap/api/identity/CustomIdentityDAO.scala
server/data/data-library/src/main/java/org/apache/james/rrt/lib/CanSendFromImpl.java
server/mailet/integration-testing/src/main/java/org/apache/james/mailets/TemporaryJamesServer.java
server/mailet/integration-testing/src/main/resources/recipientrewritetable.xml [new file with mode: 0644]
server/mailet/integration-testing/src/test/java/org/apache/james/mailets/GatewayRemoteDeliveryIntegrationTest.java
server/mailet/mailets/pom.xml
server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/RemoteDelivery.java
server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/WhiteListManager.java
server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/delivery/SimpleMailStore.java
server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/redirect/MailModifier.java
server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remote/delivery/DeliveryRunnable.java
server/mailet/mailets/src/main/java/org/apache/james/transport/mailets/remote/delivery/MailDelivrerToHost.java
server/mailet/mailets/src/main/java/org/apache/james/transport/matchers/IsMarkedAsSpam.java
server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/redirect/MailModifierTest.java
server/mailet/mailets/src/test/java/org/apache/james/transport/mailets/remote/delivery/RemoteDeliveryTest.java
server/mailet/mailets/src/test/java/org/apache/james/transport/matchers/IsMarkedAsSpamTest.java
server/mailet/rate-limiter-redis/src/test/java/org/apache/james/rate/limiter/DockerRedis.java
server/mailet/rate-limiter/src/test/scala/org/apache/james/rate/limiter/api/RateLimiterContract.scala
server/mailrepository/mailrepository-api/src/main/java/org/apache/james/mailrepository/api/EmptyErrorMailRepositoryHealthCheck.java [new file with mode: 0644]
server/mailrepository/mailrepository-api/src/main/java/org/apache/james/mailrepository/api/MailRepository.java
server/mailrepository/mailrepository-api/src/test/java/org/apache/james/mailrepository/api/EmptyErrorMailRepositoryHealthCheckContract.java [new file with mode: 0644]
server/mailrepository/mailrepository-cassandra/src/main/java/org/apache/james/mailrepository/cassandra/CassandraMailRepository.java
server/mailrepository/mailrepository-memory/src/test/java/org/apache/james/mailrepository/memory/MemoryEmptyErrorMailRepositoryHealthCheckTest.java [new file with mode: 0644]
server/protocols/jmap-draft-integration-testing/rabbitmq-jmap-draft-integration-testing/pom.xml
server/protocols/jmap-rfc-8621-integration-tests/distributed-jmap-rfc-8621-integration-tests/pom.xml
server/protocols/jmap-rfc-8621-integration-tests/distributed-jmap-rfc-8621-integration-tests/src/test/java/org/apache/james/jmap/rfc8621/distributed/DistributedThreadGetMethodTest.java
server/protocols/jmap-rfc-8621-integration-tests/jmap-rfc-8621-integration-tests-common/src/main/scala/org/apache/james/jmap/rfc8621/contract/IdentitySetContract.scala
server/protocols/jmap-rfc-8621-integration-tests/memory-jmap-rfc-8621-integration-tests/src/test/resources/usersrepository.xml [new file with mode: 0644]
server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/pom.xml
server/protocols/webadmin-integration-test/distributed-webadmin-integration-test/src/test/java/org/apache/james/webadmin/integration/rabbitmq/RabbitMQReindexingWithEventDeadLettersTest.java
server/protocols/webadmin-integration-test/webadmin-integration-test-common/pom.xml
server/protocols/webadmin/webadmin-cassandra-data/src/main/java/org/apache/james/webadmin/service/CassandraMappingsSolveInconsistenciesTask.java
server/protocols/webadmin/webadmin-core/pom.xml
server/protocols/webadmin/webadmin-core/src/main/java/org/apache/james/webadmin/dto/DTOModuleInjections.java
server/protocols/webadmin/webadmin-core/src/main/java/org/apache/james/webadmin/utils/ParametersExtractor.java
server/protocols/webadmin/webadmin-mailbox/pom.xml
server/protocols/webadmin/webadmin-mailbox/src/main/java/org/apache/james/webadmin/routes/EventDeadLettersRoutes.java
server/protocols/webadmin/webadmin-mailbox/src/main/java/org/apache/james/webadmin/service/EventDeadLettersRedeliverAllTask.java
server/protocols/webadmin/webadmin-mailbox/src/main/java/org/apache/james/webadmin/service/EventDeadLettersRedeliverAllTaskDTO.java
server/protocols/webadmin/webadmin-mailbox/src/main/java/org/apache/james/webadmin/service/EventDeadLettersRedeliverGroupTask.java
server/protocols/webadmin/webadmin-mailbox/src/main/java/org/apache/james/webadmin/service/EventDeadLettersRedeliverGroupTaskDTO.java
server/protocols/webadmin/webadmin-mailbox/src/main/java/org/apache/james/webadmin/service/EventDeadLettersRedeliverOneTask.java
server/protocols/webadmin/webadmin-mailbox/src/main/java/org/apache/james/webadmin/service/EventDeadLettersRedeliverService.java
server/protocols/webadmin/webadmin-mailbox/src/main/java/org/apache/james/webadmin/service/EventDeadLettersRedeliveryTaskAdditionalInformationDTO.java
server/protocols/webadmin/webadmin-mailbox/src/main/java/org/apache/james/webadmin/service/EventDeadLettersService.java
server/protocols/webadmin/webadmin-mailbox/src/test/java/org/apache/james/webadmin/routes/ElasticSearchQuotaSearchExtension.java
server/protocols/webadmin/webadmin-mailbox/src/test/java/org/apache/james/webadmin/routes/EventDeadLettersRoutesTest.java
server/protocols/webadmin/webadmin-mailbox/src/test/java/org/apache/james/webadmin/routes/MailboxesRoutesTest.java
server/protocols/webadmin/webadmin-mailbox/src/test/java/org/apache/james/webadmin/routes/UserMailboxesRoutesTest.java
server/protocols/webadmin/webadmin-mailbox/src/test/java/org/apache/james/webadmin/service/EventDeadLettersRedeliverTaskTest.java
server/protocols/webadmin/webadmin-mailqueue/src/main/java/org/apache/james/webadmin/service/ClearMailQueueTask.java
server/protocols/webadmin/webadmin-mailqueue/src/main/java/org/apache/james/webadmin/service/DeleteMailsFromMailQueueTask.java
server/protocols/webadmin/webadmin-mailrepository/src/main/java/org/apache/james/webadmin/routes/MailRepositoriesRoutes.java
server/protocols/webadmin/webadmin-mailrepository/src/main/java/org/apache/james/webadmin/service/ClearMailRepositoryTask.java
server/protocols/webadmin/webadmin-mailrepository/src/main/java/org/apache/james/webadmin/service/MailRepositoryStoreService.java
server/protocols/webadmin/webadmin-mailrepository/src/main/java/org/apache/james/webadmin/service/ReprocessingAllMailsTask.java
server/protocols/webadmin/webadmin-mailrepository/src/main/java/org/apache/james/webadmin/service/ReprocessingAllMailsTaskAdditionalInformationDTO.java
server/protocols/webadmin/webadmin-mailrepository/src/main/java/org/apache/james/webadmin/service/ReprocessingAllMailsTaskDTO.java
server/protocols/webadmin/webadmin-mailrepository/src/main/java/org/apache/james/webadmin/service/ReprocessingOneMailTaskAdditionalInformationDTO.java
server/protocols/webadmin/webadmin-mailrepository/src/main/java/org/apache/james/webadmin/service/ReprocessingOneMailTaskDTO.java
server/protocols/webadmin/webadmin-mailrepository/src/main/java/org/apache/james/webadmin/service/ReprocessingService.java
server/protocols/webadmin/webadmin-mailrepository/src/test/java/org/apache/james/webadmin/routes/MailRepositoriesRoutesTest.java
server/protocols/webadmin/webadmin-mailrepository/src/test/java/org/apache/james/webadmin/service/ReprocessingAllMailsTaskTest.java
server/protocols/webadmin/webadmin-mailrepository/src/test/java/org/apache/james/webadmin/service/ReprocessingOneMailTaskTest.java
server/protocols/webadmin/webadmin-mailrepository/src/test/java/org/apache/james/webadmin/service/ReprocessingServiceTest.java
server/queue/queue-activemq/src/main/java/org/apache/james/queue/activemq/ActiveMQHealthCheck.java [new file with mode: 0644]
server/queue/queue-activemq/src/test/java/org/apache/james/queue/activemq/ActiveMQHealthCheckTest.java [new file with mode: 0644]
server/queue/queue-api/pom.xml
server/queue/queue-api/src/main/java/org/apache/james/queue/api/ManageableMailQueue.java
server/queue/queue-api/src/test/java/org/apache/james/queue/api/MailQueueContract.java
server/queue/queue-pulsar/src/test/java/org/apache/james/queue/pulsar/PulsarMailQueueTest.java
server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/Dequeuer.java
server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/RabbitMQMailQueue.java
server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/RabbitMQMailQueueManagement.java
server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/view/api/FakeMailQueueView.java
server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/view/api/MailQueueView.java
server/queue/queue-rabbitmq/src/main/java/org/apache/james/queue/rabbitmq/view/cassandra/CassandraMailQueueView.java
server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/RabbitMQMailQueueTest.java
server/queue/queue-rabbitmq/src/test/java/org/apache/james/queue/rabbitmq/RabbitMqMailQueueFactoryTest.java
server/task/task-api/pom.xml
server/task/task-api/src/main/java/org/apache/james/task/Task.java
server/task/task-api/src/main/scala/org/apache/james/task/TaskExecutionDetails.scala
server/task/task-api/src/test/java/org/apache/james/task/CompletedTask.java
server/task/task-api/src/test/java/org/apache/james/task/FailedTask.java
server/task/task-api/src/test/java/org/apache/james/task/FailsDeserializationTask.java
server/task/task-api/src/test/java/org/apache/james/task/MemoryReferenceTask.java
server/task/task-api/src/test/java/org/apache/james/task/ThrowingTask.java
server/task/task-distributed/src/main/java/org/apache/james/task/eventsourcing/distributed/RabbitMQWorkQueue.java
server/task/task-distributed/src/test/java/org/apache/james/task/eventsourcing/distributed/DistributedTaskManagerTest.java
server/task/task-distributed/src/test/java/org/apache/james/task/eventsourcing/distributed/ImmediateWorker.java
server/task/task-json/src/main/java/org/apache/james/server/task/json/JsonTaskAdditionalInformationSerializer.java
server/task/task-json/src/main/java/org/apache/james/server/task/json/JsonTaskSerializer.java
server/task/task-json/src/main/java/org/apache/james/server/task/json/TaskExtensionModule.java [new file with mode: 0644]
server/task/task-json/src/main/java/org/apache/james/server/task/json/TaskModuleInjectionKeys.java [new file with mode: 0644]
server/task/task-json/src/test/java/org/apache/james/server/task/json/TestTask.java
server/task/task-memory/src/main/java/org/apache/james/task/MemoryTaskManager.java
server/task/task-memory/src/main/java/org/apache/james/task/SerialTaskManagerWorker.java
server/task/task-memory/src/main/java/org/apache/james/task/TaskManagerWorker.java
server/task/task-memory/src/main/scala/org/apache/james/task/eventsourcing/WorkerStatusListener.scala
server/task/task-memory/src/test/java/org/apache/james/task/SerialTaskManagerWorkerTest.java
server/testing/src/main/java/org/apache/james/util/docker/Images.java
server/testing/src/main/java/org/apache/james/utils/FakeSmtp.java
src/adr/0055-rspamd-spam-filtering.md [new file with mode: 0644]
src/adr/0056-opensearch-migration.md [new file with mode: 0644]
src/site/markdown/server/manage-guice-distributed-james.md
src/site/xdoc/server/config-rabbitmq.xml
third-party/pom.xml
third-party/rspamd/README.md [new file with mode: 0644]
third-party/rspamd/docker-compose-distributed.yml [new file with mode: 0644]
third-party/rspamd/docker-compose.yml [new file with mode: 0644]
third-party/rspamd/pom.xml [new file with mode: 0644]
third-party/rspamd/sample-configuration/antivirus.conf [new file with mode: 0644]
third-party/rspamd/sample-configuration/mailetcontainer_distributed.xml [new file with mode: 0644]
third-party/rspamd/sample-configuration/mailetcontainer_memory.xml [new file with mode: 0644]
third-party/rspamd/src/main/java/org/apache/james/rspamd/RSpamDListener.java [new file with mode: 0644]
third-party/rspamd/src/main/java/org/apache/james/rspamd/RSpamDScanner.java [new file with mode: 0644]
third-party/rspamd/src/main/java/org/apache/james/rspamd/client/RSpamDClientConfiguration.java [new file with mode: 0644]
third-party/rspamd/src/main/java/org/apache/james/rspamd/client/RSpamDHttpClient.java [new file with mode: 0644]
third-party/rspamd/src/main/java/org/apache/james/rspamd/exception/RSpamDUnexpectedException.java [new file with mode: 0644]
third-party/rspamd/src/main/java/org/apache/james/rspamd/exception/UnauthorizedException.java [new file with mode: 0644]
third-party/rspamd/src/main/java/org/apache/james/rspamd/model/AnalysisResult.java [new file with mode: 0644]
third-party/rspamd/src/main/java/org/apache/james/rspamd/model/AnalysisResultDeserializer.java [new file with mode: 0644]
third-party/rspamd/src/main/java/org/apache/james/rspamd/module/RSpamDModule.java [new file with mode: 0644]
third-party/rspamd/src/main/java/org/apache/james/rspamd/route/FeedMessageRoute.java [new file with mode: 0644]
third-party/rspamd/src/main/java/org/apache/james/rspamd/task/FeedSpamToRSpamDTask.java [new file with mode: 0644]
third-party/rspamd/src/main/java/org/apache/james/rspamd/task/FeedSpamToRSpamDTaskAdditionalInformationDTO.java [new file with mode: 0644]
third-party/rspamd/src/main/java/org/apache/james/rspamd/task/GetMailboxMessagesService.java [new file with mode: 0644]
third-party/rspamd/src/test/java/org/apache/james/rspamd/DockerClamAV.java [new file with mode: 0644]
third-party/rspamd/src/test/java/org/apache/james/rspamd/DockerRSpamD.java [new file with mode: 0644]
third-party/rspamd/src/test/java/org/apache/james/rspamd/DockerRSpamDExtension.java [new file with mode: 0644]
third-party/rspamd/src/test/java/org/apache/james/rspamd/DockerRSpamDExtensionTest.java [new file with mode: 0644]
third-party/rspamd/src/test/java/org/apache/james/rspamd/RSpamDListenerTest.java [new file with mode: 0644]
third-party/rspamd/src/test/java/org/apache/james/rspamd/RSpamDScannerTest.java [new file with mode: 0644]
third-party/rspamd/src/test/java/org/apache/james/rspamd/client/RSpamDHttpClientTest.java [new file with mode: 0644]
third-party/rspamd/src/test/java/org/apache/james/rspamd/model/AnalysisResultDeserializationTest.java [new file with mode: 0644]
third-party/rspamd/src/test/java/org/apache/james/rspamd/route/FeedMessageRouteTest.java [new file with mode: 0644]
third-party/rspamd/src/test/java/org/apache/james/rspamd/task/FeedSpamToRSpamDTaskAdditionalInformationDTOTest.java [new file with mode: 0644]
third-party/rspamd/src/test/java/org/apache/james/rspamd/task/FeedSpamToRSpamDTaskTest.java [new file with mode: 0644]
third-party/rspamd/src/test/resources/json/feedSpamEmptyPeriod.additionalInformation.json [new file with mode: 0644]
third-party/rspamd/src/test/resources/json/feedSpamNonEmptyPeriod.additionalInformation.json [new file with mode: 0644]
third-party/rspamd/src/test/resources/mail/attachment/inlineNonVirusTextAttachment.eml [new file with mode: 0644]
third-party/rspamd/src/test/resources/mail/attachment/inlineVirusTextAttachment.eml [new file with mode: 0644]
third-party/rspamd/src/test/resources/mail/ham/ham1.eml [new file with mode: 0644]
third-party/rspamd/src/test/resources/mail/spam/spam8.eml [new file with mode: 0644]
third-party/rspamd/src/test/resources/rspamd-config/actions.conf [new file with mode: 0644]
third-party/rspamd/src/test/resources/rspamd-config/antivirus.conf [new file with mode: 0644]
upgrade-instructions.md

index 508e174fd6e82222676c5b6febb4b415637d7d62..ab68ee5a7f88c7f034c46f537e9caa9068759cf9 100644 (file)
@@ -55,6 +55,8 @@ pipeline {
                 logRotator(artifactNumToKeepStr: '10', numToKeepStr: '30')
         )
         disableConcurrentBuilds()
+        // This is better if you want to clean before build
+        skipDefaultCheckout(true)
     }
 
     triggers {
@@ -72,9 +74,7 @@ pipeline {
         stage('Cleanup') {
             steps {
                 echo 'Cleaning up the workspace'
-                deleteDir()
-                echo 'Cleaning up James maven repo dependencies'
-                sh 'rm -rf /home/jenkins/.m2/repository/org/apache/james'
+                cleanWs()
             }
         }
 
@@ -183,9 +183,6 @@ Check console output at "<a href="${env.BUILD_URL}">${env.JOB_NAME} [${env.BRANC
 
         // Send an email, if the last build was not successful and this one is.
         success {
-            // Cleanup the build directory if the build was successful
-            // (in this cae we probably don't have to do any post-build analysis)
-            deleteDir()
             script {
                 if (env.BRANCH_NAME == "master" && (currentBuild.previousBuild != null) && (currentBuild.previousBuild.result != 'SUCCESS')) {
                     emailext(
similarity index 89%
rename from backends-common/elasticsearch-v7/pom.xml
rename to backends-common/opensearch/pom.xml
index abeeee5789a61c48959a6a0ce360c65ab5e3aa3f..c70405d6dfcc502ae28fe0da4ddcf05b296e7d2d 100644 (file)
@@ -25,8 +25,8 @@
         <version>3.8.0-SNAPSHOT</version>
     </parent>
 
-    <artifactId>apache-james-backends-es-v7</artifactId>
-    <name>Apache James :: Backends Common :: ES-V7</name>
+    <artifactId>apache-james-backends-opensearch</artifactId>
+    <name>Apache James :: Backends Common :: OpenSearch</name>
 
     <dependencies>
         <dependency>
             <artifactId>awaitility</artifactId>
         </dependency>
         <dependency>
-            <groupId>org.elasticsearch.client</groupId>
-            <artifactId>elasticsearch-rest-high-level-client</artifactId>
-            <version>7.10.2</version>
-            <exclusions>
-                <exclusion>
-                    <groupId>commons-logging</groupId>
-                    <artifactId>commons-logging</artifactId>
-                </exclusion>
-            </exclusions>
+            <groupId>org.opensearch.client</groupId>
+            <artifactId>opensearch-rest-high-level-client</artifactId>
+            <version>2.1.0</version>
         </dependency>
         <dependency>
             <groupId>org.slf4j</groupId>
similarity index 97%
rename from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/AliasName.java
rename to backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/AliasName.java
index bcd57642be52db93e2cfc2f6f3e99ddcc581937b..c235fb91f58d1b588e03506e0f0aff4fc0e3e612 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import java.util.Objects;
 
similarity index 92%
rename from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/ClientProvider.java
rename to backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/ClientProvider.java
index 3ece144efc6c70062287566aa8a9577389680242..11c3eeed385a8e638cdc168bf470da44631aaa4d 100644 (file)
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import java.io.IOException;
 import java.security.KeyManagementException;
@@ -44,13 +44,9 @@ import org.apache.http.impl.client.BasicCredentialsProvider;
 import org.apache.http.impl.nio.client.HttpAsyncClientBuilder;
 import org.apache.http.ssl.SSLContextBuilder;
 import org.apache.http.ssl.TrustStrategy;
-import org.apache.james.backends.es.v7.ElasticSearchConfiguration.HostScheme;
-import org.apache.james.backends.es.v7.ElasticSearchConfiguration.SSLConfiguration.HostNameVerifier;
-import org.apache.james.backends.es.v7.ElasticSearchConfiguration.SSLConfiguration.SSLTrustStore;
-import org.apache.james.backends.es.v7.ElasticSearchConfiguration.SSLConfiguration.SSLValidationStrategy;
 import org.apache.james.util.concurrent.NamedThreadFactory;
-import org.elasticsearch.client.RestClient;
-import org.elasticsearch.client.RestHighLevelClient;
+import org.opensearch.client.RestClient;
+import org.opensearch.client.RestHighLevelClient;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -85,7 +81,7 @@ public class ClientProvider implements Provider<ReactorElasticSearchClient> {
         }
 
         private void configureHostScheme(HttpAsyncClientBuilder builder) {
-            HostScheme scheme = configuration.getHostScheme();
+            ElasticSearchConfiguration.HostScheme scheme = configuration.getHostScheme();
 
             switch (scheme) {
                 case HTTP:
@@ -118,7 +114,7 @@ public class ClientProvider implements Provider<ReactorElasticSearchClient> {
 
             SSLContextBuilder sslContextBuilder = new SSLContextBuilder();
 
-            SSLValidationStrategy strategy = configuration.getSslConfiguration()
+            ElasticSearchConfiguration.SSLConfiguration.SSLValidationStrategy strategy = configuration.getSslConfiguration()
                 .getStrategy();
 
             switch (strategy) {
@@ -137,7 +133,7 @@ public class ClientProvider implements Provider<ReactorElasticSearchClient> {
         }
 
         private HostnameVerifier hostnameVerifier() {
-            HostNameVerifier hostnameVerifier = configuration.getSslConfiguration()
+            ElasticSearchConfiguration.SSLConfiguration.HostNameVerifier hostnameVerifier = configuration.getSslConfiguration()
                 .getHostNameVerifier();
 
             switch (hostnameVerifier) {
@@ -162,7 +158,7 @@ public class ClientProvider implements Provider<ReactorElasticSearchClient> {
         private SSLContextBuilder applyTrustStore(SSLContextBuilder sslContextBuilder) throws CertificateException, NoSuchAlgorithmException,
             KeyStoreException, IOException {
 
-            SSLTrustStore trustStore = configuration.getSslConfiguration()
+            ElasticSearchConfiguration.SSLConfiguration.SSLTrustStore trustStore = configuration.getSslConfiguration()
                 .getTrustStore()
                 .orElseThrow(() -> new IllegalStateException("SSLTrustStore cannot to be empty"));
 
similarity index 90%
rename from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/DeleteByQueryPerformer.java
rename to backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/DeleteByQueryPerformer.java
index 448c71bbd6d5d539b033aa9026b2f547338104b7..14846851bda4d4c2d90f61c5d2838172992f556f 100644 (file)
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
-import org.elasticsearch.client.RequestOptions;
-import org.elasticsearch.index.query.QueryBuilder;
-import org.elasticsearch.index.reindex.DeleteByQueryRequest;
+import org.opensearch.client.RequestOptions;
+import org.opensearch.index.query.QueryBuilder;
+import org.opensearch.index.reindex.DeleteByQueryRequest;
 
 import reactor.core.publisher.Mono;
 
similarity index 95%
rename from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/DocumentId.java
rename to backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/DocumentId.java
index 9ef64111674ca8eeb96371c409d8341473f2e010..42f650b03b8c63eb979fdbc1ffb8504571b3d799 100644 (file)
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import java.util.Objects;
 
-import org.elasticsearch.common.Strings;
+import org.opensearch.common.Strings;
 
 import com.google.common.base.Preconditions;
 
similarity index 98%
rename from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/ElasticSearchConfiguration.java
rename to backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/ElasticSearchConfiguration.java
index 0292403554f9536378fc32a5e50c9d123f32301d..edee7fd3162f0374b2e01077c27832f6c2829425 100644 (file)
@@ -17,9 +17,9 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
-import static org.apache.james.backends.es.v7.ElasticSearchConfiguration.SSLConfiguration.SSLValidationStrategy.OVERRIDE;
+import static org.apache.james.backends.opensearch.ElasticSearchConfiguration.SSLConfiguration.SSLValidationStrategy.OVERRIDE;
 
 import java.io.File;
 import java.nio.file.Files;
@@ -35,9 +35,9 @@ import java.util.stream.Stream;
 
 import org.apache.commons.configuration2.Configuration;
 import org.apache.commons.configuration2.ex.ConfigurationException;
-import org.apache.james.backends.es.v7.ElasticSearchConfiguration.SSLConfiguration.HostNameVerifier;
-import org.apache.james.backends.es.v7.ElasticSearchConfiguration.SSLConfiguration.SSLTrustStore;
-import org.apache.james.backends.es.v7.ElasticSearchConfiguration.SSLConfiguration.SSLValidationStrategy;
+import org.apache.james.backends.opensearch.ElasticSearchConfiguration.SSLConfiguration.HostNameVerifier;
+import org.apache.james.backends.opensearch.ElasticSearchConfiguration.SSLConfiguration.SSLTrustStore;
+import org.apache.james.backends.opensearch.ElasticSearchConfiguration.SSLConfiguration.SSLValidationStrategy;
 import org.apache.james.util.Host;
 
 import com.google.common.annotations.VisibleForTesting;
similarity index 92%
rename from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/ElasticSearchHealthCheck.java
rename to backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/ElasticSearchHealthCheck.java
index 335f0275d6a207b87af61498f00ca991b6a1dc02..a2b51cf65cb44a74f78192de1d056187df8d8411 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import java.io.IOException;
 import java.util.Set;
@@ -28,9 +28,9 @@ import org.apache.commons.lang3.NotImplementedException;
 import org.apache.james.core.healthcheck.ComponentName;
 import org.apache.james.core.healthcheck.HealthCheck;
 import org.apache.james.core.healthcheck.Result;
-import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest;
-import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
-import org.elasticsearch.client.Requests;
+import org.opensearch.action.admin.cluster.health.ClusterHealthRequest;
+import org.opensearch.action.admin.cluster.health.ClusterHealthResponse;
+import org.opensearch.client.Requests;
 
 import com.google.common.annotations.VisibleForTesting;
 
similarity index 88%
rename from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/ElasticSearchIndexer.java
rename to backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/ElasticSearchIndexer.java
index 552f555f33c2843a37eec23df15d21a654488b44..b3e59e4a05940d75060838132e4f023d151b104e 100644 (file)
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import java.util.List;
 
 import org.apache.commons.lang3.StringUtils;
-import org.elasticsearch.action.bulk.BulkRequest;
-import org.elasticsearch.action.bulk.BulkResponse;
-import org.elasticsearch.action.delete.DeleteRequest;
-import org.elasticsearch.action.get.GetRequest;
-import org.elasticsearch.action.get.GetResponse;
-import org.elasticsearch.action.index.IndexRequest;
-import org.elasticsearch.action.index.IndexResponse;
-import org.elasticsearch.action.update.UpdateRequest;
-import org.elasticsearch.client.RequestOptions;
-import org.elasticsearch.common.ValidationException;
-import org.elasticsearch.common.xcontent.XContentType;
-import org.elasticsearch.index.query.QueryBuilder;
+import org.opensearch.action.bulk.BulkRequest;
+import org.opensearch.action.bulk.BulkResponse;
+import org.opensearch.action.delete.DeleteRequest;
+import org.opensearch.action.get.GetRequest;
+import org.opensearch.action.get.GetResponse;
+import org.opensearch.action.index.IndexRequest;
+import org.opensearch.action.index.IndexResponse;
+import org.opensearch.action.update.UpdateRequest;
+import org.opensearch.client.RequestOptions;
+import org.opensearch.common.ValidationException;
+import org.opensearch.common.xcontent.XContentType;
+import org.opensearch.index.query.QueryBuilder;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
similarity index 94%
rename from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/IndexCreationFactory.java
rename to backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/IndexCreationFactory.java
index 832f51fcf6a926ba3b59650c0f2e87e2106ff797..d5b0dbc0be857383af833328ad694a92c04dd9a3 100644 (file)
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
-import static org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions;
-import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
+import static org.opensearch.action.admin.indices.alias.IndicesAliasesRequest.AliasActions;
+import static org.opensearch.common.xcontent.XContentFactory.jsonBuilder;
 
 import java.io.ByteArrayInputStream;
 import java.io.IOException;
@@ -31,15 +31,15 @@ import java.util.Optional;
 
 import javax.inject.Inject;
 
-import org.elasticsearch.ElasticsearchStatusException;
-import org.elasticsearch.action.admin.indices.alias.IndicesAliasesRequest;
-import org.elasticsearch.action.admin.indices.alias.get.GetAliasesRequest;
-import org.elasticsearch.client.RequestOptions;
-import org.elasticsearch.client.indices.CreateIndexRequest;
-import org.elasticsearch.client.indices.GetIndexRequest;
-import org.elasticsearch.common.Strings;
-import org.elasticsearch.common.xcontent.XContentBuilder;
-import org.elasticsearch.common.xcontent.XContentType;
+import org.opensearch.OpenSearchStatusException;
+import org.opensearch.action.admin.indices.alias.IndicesAliasesRequest;
+import org.opensearch.action.admin.indices.alias.get.GetAliasesRequest;
+import org.opensearch.client.RequestOptions;
+import org.opensearch.client.indices.CreateIndexRequest;
+import org.opensearch.client.indices.GetIndexRequest;
+import org.opensearch.common.Strings;
+import org.opensearch.common.xcontent.XContentBuilder;
+import org.opensearch.common.xcontent.XContentType;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
@@ -217,7 +217,7 @@ public class IndexCreationFactory {
                         request,
                         RequestOptions.DEFAULT);
                 }
-            } catch (ElasticsearchStatusException exception) {
+            } catch (OpenSearchStatusException exception) {
                 if (exception.getMessage().contains(INDEX_ALREADY_EXISTS_EXCEPTION_MESSAGE)) {
                     LOGGER.info("Index [{}] already exists", indexName.getValue());
                 } else {
similarity index 97%
rename from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/IndexName.java
rename to backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/IndexName.java
index b95cc15a74c55ade2ed43c45be5adcf1f6b1292e..19d307bab1c2c39f71e6303c6a333e2393fb0025 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import java.util.Objects;
 
similarity index 72%
rename from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/ReactorElasticSearchClient.java
rename to backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/ReactorElasticSearchClient.java
index c2cff10cbb03a9678b003752465513c27cc96365..8f30539cfa45907e604a47414b0874e27dcfb21b 100644 (file)
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import java.io.IOException;
 import java.util.function.Consumer;
 
-import org.elasticsearch.action.ActionListener;
-import org.elasticsearch.action.admin.cluster.health.ClusterHealthRequest;
-import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
-import org.elasticsearch.action.admin.cluster.storedscripts.DeleteStoredScriptRequest;
-import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptRequest;
-import org.elasticsearch.action.admin.cluster.storedscripts.GetStoredScriptResponse;
-import org.elasticsearch.action.bulk.BulkRequest;
-import org.elasticsearch.action.bulk.BulkResponse;
-import org.elasticsearch.action.delete.DeleteRequest;
-import org.elasticsearch.action.delete.DeleteResponse;
-import org.elasticsearch.action.explain.ExplainRequest;
-import org.elasticsearch.action.explain.ExplainResponse;
-import org.elasticsearch.action.fieldcaps.FieldCapabilitiesRequest;
-import org.elasticsearch.action.fieldcaps.FieldCapabilitiesResponse;
-import org.elasticsearch.action.get.GetRequest;
-import org.elasticsearch.action.get.GetResponse;
-import org.elasticsearch.action.index.IndexRequest;
-import org.elasticsearch.action.index.IndexResponse;
-import org.elasticsearch.action.search.ClearScrollRequest;
-import org.elasticsearch.action.search.ClearScrollResponse;
-import org.elasticsearch.action.search.MultiSearchRequest;
-import org.elasticsearch.action.search.MultiSearchResponse;
-import org.elasticsearch.action.search.SearchRequest;
-import org.elasticsearch.action.search.SearchResponse;
-import org.elasticsearch.action.search.SearchScrollRequest;
-import org.elasticsearch.action.support.master.AcknowledgedResponse;
-import org.elasticsearch.client.IndicesClient;
-import org.elasticsearch.client.RequestOptions;
-import org.elasticsearch.client.RestClient;
-import org.elasticsearch.client.RestHighLevelClient;
-import org.elasticsearch.client.core.MainResponse;
-import org.elasticsearch.index.rankeval.RankEvalRequest;
-import org.elasticsearch.index.rankeval.RankEvalResponse;
-import org.elasticsearch.index.reindex.BulkByScrollResponse;
-import org.elasticsearch.index.reindex.DeleteByQueryRequest;
-import org.elasticsearch.script.mustache.MultiSearchTemplateRequest;
-import org.elasticsearch.script.mustache.MultiSearchTemplateResponse;
-import org.elasticsearch.script.mustache.SearchTemplateRequest;
-import org.elasticsearch.script.mustache.SearchTemplateResponse;
+import org.opensearch.action.ActionListener;
+import org.opensearch.action.admin.cluster.health.ClusterHealthRequest;
+import org.opensearch.action.admin.cluster.health.ClusterHealthResponse;
+import org.opensearch.action.admin.cluster.storedscripts.DeleteStoredScriptRequest;
+import org.opensearch.action.admin.cluster.storedscripts.GetStoredScriptRequest;
+import org.opensearch.action.admin.cluster.storedscripts.GetStoredScriptResponse;
+import org.opensearch.action.bulk.BulkRequest;
+import org.opensearch.action.bulk.BulkResponse;
+import org.opensearch.action.delete.DeleteRequest;
+import org.opensearch.action.delete.DeleteResponse;
+import org.opensearch.action.explain.ExplainRequest;
+import org.opensearch.action.explain.ExplainResponse;
+import org.opensearch.action.fieldcaps.FieldCapabilitiesRequest;
+import org.opensearch.action.fieldcaps.FieldCapabilitiesResponse;
+import org.opensearch.action.get.GetRequest;
+import org.opensearch.action.get.GetResponse;
+import org.opensearch.action.index.IndexRequest;
+import org.opensearch.action.index.IndexResponse;
+import org.opensearch.action.search.ClearScrollRequest;
+import org.opensearch.action.search.ClearScrollResponse;
+import org.opensearch.action.search.MultiSearchRequest;
+import org.opensearch.action.search.MultiSearchResponse;
+import org.opensearch.action.search.SearchRequest;
+import org.opensearch.action.search.SearchResponse;
+import org.opensearch.action.search.SearchScrollRequest;
+import org.opensearch.action.support.master.AcknowledgedResponse;
+import org.opensearch.client.IndicesClient;
+import org.opensearch.client.RequestOptions;
+import org.opensearch.client.RestClient;
+import org.opensearch.client.RestHighLevelClient;
+import org.opensearch.client.core.MainResponse;
+import org.opensearch.index.rankeval.RankEvalRequest;
+import org.opensearch.index.rankeval.RankEvalResponse;
+import org.opensearch.index.reindex.BulkByScrollResponse;
+import org.opensearch.index.reindex.DeleteByQueryRequest;
+import org.opensearch.script.mustache.MultiSearchTemplateRequest;
+import org.opensearch.script.mustache.MultiSearchTemplateResponse;
+import org.opensearch.script.mustache.SearchTemplateRequest;
+import org.opensearch.script.mustache.SearchTemplateResponse;
 
 import reactor.core.publisher.Mono;
 import reactor.core.publisher.MonoSink;
similarity index 96%
rename from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/ReadAliasName.java
rename to backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/ReadAliasName.java
index ad460a2cac22df2c0ccc6b05d20a098295d0a880..5285c87fb2d2a39aa3223cf67bdae4cf9b9e525b 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 public class ReadAliasName extends AliasName {
     public ReadAliasName(String value) {
similarity index 96%
rename from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/RoutingKey.java
rename to backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/RoutingKey.java
index fa84d759dfea64a38dcaaac9c737899c273285ef..bb823f8e9f9a6f30144a0aaa51699524ba5d0f3d 100644 (file)
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import java.util.Objects;
 
-import org.elasticsearch.common.Strings;
+import org.opensearch.common.Strings;
 
 import com.google.common.base.Preconditions;
 
similarity index 96%
rename from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/UpdatedRepresentation.java
rename to backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/UpdatedRepresentation.java
index 0b57dabe5725438e784dbb4ed36f1cd53610d6e7..f221ccd45c17a668abdd29448b8f762846e6ed41 100644 (file)
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import java.util.Objects;
 
-import org.elasticsearch.common.Strings;
+import org.opensearch.common.Strings;
 
 import com.google.common.base.MoreObjects;
 import com.google.common.base.Preconditions;
similarity index 96%
rename from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/WriteAliasName.java
rename to backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/WriteAliasName.java
index 5423d337361426dd83b2942f2004cc25906630a6..7aeabe3d912675121ed03895ebb55f0febed77c4 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 public class WriteAliasName extends AliasName {
     public WriteAliasName(String value) {
similarity index 89%
rename from backends-common/elasticsearch-v7/src/main/java/org/apache/james/backends/es/v7/search/ScrolledSearch.java
rename to backends-common/opensearch/src/main/java/org/apache/james/backends/opensearch/search/ScrolledSearch.java
index 3ca54ab0af9d9a05ac499799dd510bcb69bb6de3..cf50ff30a8c8c4a04b0567145662e3bffb8d2bcb 100644 (file)
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7.search;
+package org.apache.james.backends.opensearch.search;
 
 import java.util.Optional;
 import java.util.concurrent.atomic.AtomicReference;
 import java.util.function.Consumer;
 
-import org.apache.james.backends.es.v7.ReactorElasticSearchClient;
-import org.elasticsearch.action.search.ClearScrollRequest;
-import org.elasticsearch.action.search.SearchRequest;
-import org.elasticsearch.action.search.SearchResponse;
-import org.elasticsearch.action.search.SearchScrollRequest;
-import org.elasticsearch.client.RequestOptions;
-import org.elasticsearch.common.unit.TimeValue;
-import org.elasticsearch.search.SearchHit;
+import org.apache.james.backends.opensearch.ReactorElasticSearchClient;
+import org.opensearch.action.search.ClearScrollRequest;
+import org.opensearch.action.search.SearchRequest;
+import org.opensearch.action.search.SearchResponse;
+import org.opensearch.action.search.SearchScrollRequest;
+import org.opensearch.client.RequestOptions;
+import org.opensearch.common.unit.TimeValue;
+import org.opensearch.search.SearchHit;
 
 import com.github.fge.lambdas.Throwing;
 
similarity index 96%
rename from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/AliasNameTest.java
rename to backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/AliasNameTest.java
index 74fae922360a0a5fe8cb574d38b9fb8f5b9fc1ef..6a0760a64ab6caf7ccc5582e34f2b1b45a83e61c 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import org.junit.jupiter.api.Test;
 
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
-
-import static org.apache.james.backends.es.v7.ElasticSearchClusterExtension.ElasticSearchCluster;
+package org.apache.james.backends.opensearch;
 
 import java.util.Optional;
 
-import org.apache.james.backends.es.v7.ElasticSearchConfiguration.HostScheme;
-import org.apache.james.backends.es.v7.ElasticSearchConfiguration.SSLConfiguration;
+import org.apache.james.backends.opensearch.ElasticSearchConfiguration.HostScheme;
+import org.apache.james.backends.opensearch.ElasticSearchConfiguration.SSLConfiguration;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
 class ClientProviderImplConnectionAuthESIgnoreSSLCheckTest implements ClientProviderImplConnectionContract {
 
     @RegisterExtension
-    static ElasticSearchClusterExtension extension = new ElasticSearchClusterExtension(new ElasticSearchCluster(
+    static ElasticSearchClusterExtension extension = new ElasticSearchClusterExtension(new ElasticSearchClusterExtension.ElasticSearchCluster(
         DockerAuthElasticSearchSingleton.INSTANCE,
         new DockerElasticSearch.WithAuth()));
 
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import java.util.Optional;
 
-import org.apache.james.backends.es.v7.ElasticSearchConfiguration.SSLConfiguration;
-import org.apache.james.backends.es.v7.ElasticSearchConfiguration.SSLConfiguration.SSLTrustStore;
+import org.apache.james.backends.opensearch.ElasticSearchConfiguration.SSLConfiguration;
+import org.apache.james.backends.opensearch.ElasticSearchConfiguration.SSLConfiguration.SSLTrustStore;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
 public class ClientProviderImplConnectionAuthESOverrideTrustStoreTest implements ClientProviderImplConnectionContract {
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import java.util.concurrent.TimeUnit;
 
-import org.apache.james.backends.es.v7.ElasticSearchClusterExtension.ElasticSearchCluster;
+import org.apache.james.backends.opensearch.ElasticSearchClusterExtension.ElasticSearchCluster;
 import org.awaitility.Awaitility;
-import org.elasticsearch.action.search.SearchRequest;
-import org.elasticsearch.client.RequestOptions;
-import org.elasticsearch.index.query.QueryBuilders;
-import org.elasticsearch.search.builder.SearchSourceBuilder;
+import org.opensearch.action.search.SearchRequest;
+import org.opensearch.client.RequestOptions;
+import org.opensearch.index.query.QueryBuilders;
+import org.opensearch.search.builder.SearchSourceBuilder;
 import org.junit.jupiter.api.Test;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
-import org.apache.james.backends.es.v7.ElasticSearchClusterExtension.ElasticSearchCluster;
 import org.junit.jupiter.api.extension.RegisterExtension;
 
 class ClientProviderImplConnectionNoAuthESTest implements ClientProviderImplConnectionContract {
 
     @RegisterExtension
-    static ElasticSearchClusterExtension extension = new ElasticSearchClusterExtension(new ElasticSearchCluster(
+    static ElasticSearchClusterExtension extension = new ElasticSearchClusterExtension(new ElasticSearchClusterExtension.ElasticSearchCluster(
         DockerElasticSearchSingleton.INSTANCE,
         new DockerElasticSearch.NoAuth()));
 }
similarity index 97%
rename from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/ClientProviderTest.java
rename to backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/ClientProviderTest.java
index 31e098389b3b6f2e97e559051070c8932227e52f..78008b28c664c142d9866f723e7f3f1b21c777f5 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 public class DockerAuthElasticSearchSingleton {
     public static DockerElasticSearch INSTANCE = new DockerElasticSearch.WithAuth();
similarity index 94%
rename from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/DockerElasticSearch.java
rename to backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/DockerElasticSearch.java
index de5e5921c1f13e429f5e1d163680eb181555f293..2f37b8820aa5242403b3042de4f4417f13c79661 100644 (file)
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
-import static org.apache.james.backends.es.v7.DockerElasticSearch.Fixture.ES_HTTP_PORT;
-import static org.apache.james.backends.es.v7.DockerElasticSearch.Fixture.ES_MEMORY;
+import static org.apache.james.backends.opensearch.DockerElasticSearch.Fixture.ES_HTTP_PORT;
+import static org.apache.james.backends.opensearch.DockerElasticSearch.Fixture.ES_MEMORY;
 
 import java.net.MalformedURLException;
 import java.net.URL;
@@ -37,8 +37,8 @@ import javax.net.ssl.TrustManager;
 import javax.net.ssl.X509TrustManager;
 
 import org.apache.http.HttpStatus;
-import org.apache.james.backends.es.v7.ElasticSearchConfiguration.Credential;
-import org.apache.james.backends.es.v7.ElasticSearchConfiguration.HostScheme;
+import org.apache.james.backends.opensearch.ElasticSearchConfiguration.Credential;
+import org.apache.james.backends.opensearch.ElasticSearchConfiguration.HostScheme;
 import org.apache.james.util.Host;
 import org.apache.james.util.docker.DockerContainer;
 import org.apache.james.util.docker.Images;
@@ -136,16 +136,18 @@ public interface DockerElasticSearch {
                 .withTmpFs(ImmutableMap.of("/usr/share/elasticsearch/data", "rw,size=200m"))
                 .withExposedPorts(ES_HTTP_PORT)
                 .withEnv("discovery.type", "single-node")
+                .withEnv("DISABLE_INSTALL_DEMO_CONFIG", "true")
+                .withEnv("DISABLE_SECURITY_PLUGIN", "true")
                 .withEnv("ES_JAVA_OPTS", "-Xms" + ES_MEMORY + "m -Xmx" + ES_MEMORY + "m")
                 .withAffinityToContainer()
-                .withName("james-testing-elasticsearch-" + UUID.randomUUID())
+                .withName("james-testing-opensearch-" + UUID.randomUUID())
                 .waitingFor(new HostPortWaitStrategy().withRateLimiter(RateLimiters.TWENTIES_PER_SECOND));
         }
 
         private final DockerContainer eSContainer;
 
         public NoAuth() {
-            this(Images.ELASTICSEARCH_7);
+            this(Images.OPENSEARCH);
         }
 
         public NoAuth(String imageName) {
@@ -206,7 +208,7 @@ public interface DockerElasticSearch {
         private final Network network;
 
         public WithAuth() {
-            this(Images.ELASTICSEARCH_7);
+            this(Images.OPENSEARCH);
         }
 
         WithAuth(String imageName) {
similarity index 98%
rename from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/DockerElasticSearchExtension.java
rename to backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/DockerElasticSearchExtension.java
index c913849aade98403e064d3c325931965d2c81d89..0e0914c0c2d8a126b54f3a4c07e00cd0eeed2d4a 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import org.junit.jupiter.api.extension.AfterEachCallback;
 import org.junit.jupiter.api.extension.BeforeEachCallback;
similarity index 97%
rename from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/DockerElasticSearchRule.java
rename to backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/DockerElasticSearchRule.java
index 3df5f4c59005f86f9b49b9e00804b530a65a1e3e..f4fdbbc46155c37d2f531a56c7d94ac27af31ab5 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import org.junit.rules.ExternalResource;
 
similarity index 96%
rename from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/DockerElasticSearchSingleton.java
rename to backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/DockerElasticSearchSingleton.java
index 89b87e33d059eefb61b384ff2ad748c3ef1c809f..7b5a2a174e15966c9fbbb1fc3984f4f0586c5d81 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 public class DockerElasticSearchSingleton {
     public static DockerElasticSearch INSTANCE = new DockerElasticSearch.NoAuth();
similarity index 97%
rename from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/DocumentIdTest.java
rename to backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/DocumentIdTest.java
index 712495bf15a85672291eef2efe8150f341909ca6..458933e8630986df1c10f897142fda52b86e7139 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import java.util.List;
 import java.util.function.Function;
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -27,10 +27,10 @@ import java.util.Optional;
 import org.apache.commons.configuration2.PropertiesConfiguration;
 import org.apache.commons.configuration2.convert.DefaultListDelimiterHandler;
 import org.apache.commons.configuration2.ex.ConfigurationException;
-import org.apache.james.backends.es.v7.ElasticSearchConfiguration.Credential;
-import org.apache.james.backends.es.v7.ElasticSearchConfiguration.HostScheme;
-import org.apache.james.backends.es.v7.ElasticSearchConfiguration.SSLConfiguration;
-import org.apache.james.backends.es.v7.ElasticSearchConfiguration.SSLConfiguration.SSLTrustStore;
+import org.apache.james.backends.opensearch.ElasticSearchConfiguration.Credential;
+import org.apache.james.backends.opensearch.ElasticSearchConfiguration.HostScheme;
+import org.apache.james.backends.opensearch.ElasticSearchConfiguration.SSLConfiguration;
+import org.apache.james.backends.opensearch.ElasticSearchConfiguration.SSLConfiguration.SSLTrustStore;
 import org.apache.james.util.Host;
 import org.junit.jupiter.api.Nested;
 import org.junit.jupiter.api.Test;
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
similarity index 87%
rename from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/ElasticSearchHealthCheckTest.java
rename to backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/ElasticSearchHealthCheckTest.java
index 4f94cd4f8c879dd1567071a1461af6af94f63115..5242501472705b32047642925276983a76142fcf 100644 (file)
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
-import org.elasticsearch.action.admin.cluster.health.ClusterHealthResponse;
-import org.elasticsearch.cluster.ClusterName;
-import org.elasticsearch.cluster.ClusterState;
-import org.elasticsearch.cluster.block.ClusterBlocks;
-import org.elasticsearch.cluster.health.ClusterHealthStatus;
-import org.elasticsearch.cluster.node.DiscoveryNodes;
-import org.elasticsearch.cluster.routing.RoutingTable;
+import org.opensearch.action.admin.cluster.health.ClusterHealthResponse;
+import org.opensearch.cluster.ClusterName;
+import org.opensearch.cluster.ClusterState;
+import org.opensearch.cluster.block.ClusterBlocks;
+import org.opensearch.cluster.health.ClusterHealthStatus;
+import org.opensearch.cluster.node.DiscoveryNodes;
+import org.opensearch.cluster.routing.RoutingTable;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
 
similarity index 96%
rename from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/ElasticSearchIndexerTest.java
rename to backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/ElasticSearchIndexerTest.java
index c8eea3a64e41dae9eb386af63c49ae987fcb92f9..e57ea95d2e8faa8f56245d3a5e34e8d98884d007 100644 (file)
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatCode;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 import static org.awaitility.Durations.ONE_HUNDRED_MILLISECONDS;
-import static org.elasticsearch.index.query.QueryBuilders.termQuery;
+import static org.opensearch.index.query.QueryBuilders.termQuery;
 
 import java.io.IOException;
 
 import org.awaitility.Awaitility;
 import org.awaitility.Durations;
 import org.awaitility.core.ConditionFactory;
-import org.elasticsearch.action.get.GetResponse;
-import org.elasticsearch.action.search.SearchRequest;
-import org.elasticsearch.client.RequestOptions;
-import org.elasticsearch.index.query.QueryBuilder;
-import org.elasticsearch.index.query.QueryBuilders;
-import org.elasticsearch.search.builder.SearchSourceBuilder;
+import org.opensearch.action.get.GetResponse;
+import org.opensearch.action.search.SearchRequest;
+import org.opensearch.client.RequestOptions;
+import org.opensearch.index.query.QueryBuilder;
+import org.opensearch.index.query.QueryBuilders;
+import org.opensearch.search.builder.SearchSourceBuilder;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
similarity index 92%
rename from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/IndexCreationFactoryTest.java
rename to backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/IndexCreationFactoryTest.java
index 5a17a4679a1416542639c9f41c97fd64076de40f..e7c4d77d88b69214be19e4f44b1d5a66e9f5d9bb 100644 (file)
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
-import static org.apache.james.backends.es.v7.IndexCreationFactory.ANALYZER;
-import static org.apache.james.backends.es.v7.IndexCreationFactory.TOKENIZER;
-import static org.apache.james.backends.es.v7.IndexCreationFactory.TYPE;
+import static org.apache.james.backends.opensearch.IndexCreationFactory.ANALYZER;
+import static org.apache.james.backends.opensearch.IndexCreationFactory.TOKENIZER;
+import static org.apache.james.backends.opensearch.IndexCreationFactory.TYPE;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
-import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
+import static org.opensearch.common.xcontent.XContentFactory.jsonBuilder;
 
 import java.io.IOException;
 import java.util.Optional;
 
-import org.apache.james.backends.es.v7.IndexCreationFactory.IndexCreationCustomElement;
-import org.elasticsearch.ElasticsearchStatusException;
-import org.elasticsearch.common.xcontent.XContentBuilder;
+import org.apache.james.backends.opensearch.IndexCreationFactory.IndexCreationCustomElement;
+import org.opensearch.OpenSearchStatusException;
+import org.opensearch.common.xcontent.XContentBuilder;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
@@ -162,7 +162,7 @@ class IndexCreationFactoryTest {
                     "    }" +
                     "}"))
                 .createIndexAndAliases(client))
-            .isInstanceOf(ElasticsearchStatusException.class);
+            .isInstanceOf(OpenSearchStatusException.class);
     }
 
     @Test
@@ -192,7 +192,7 @@ class IndexCreationFactoryTest {
                     "        }" +
                     "      }"))
                 .createIndexAndAliases(client))
-            .isInstanceOf(ElasticsearchStatusException.class);
+            .isInstanceOf(OpenSearchStatusException.class);
     }
 
     @Test
@@ -232,7 +232,7 @@ class IndexCreationFactoryTest {
                 .useIndex(INDEX_NAME)
                 .addAlias(ALIAS_NAME)
                 .createIndexAndAliases(client, Optional.of(getInvalidIndexSetting()), Optional.empty()))
-            .isInstanceOf(ElasticsearchStatusException.class);
+            .isInstanceOf(OpenSearchStatusException.class);
     }
 
 }
\ No newline at end of file
similarity index 97%
rename from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/RoutingKeyTest.java
rename to backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/RoutingKeyTest.java
index 043e3b52929bfd6cad63f40296b45c20fb09e239..3d7b18b52ac3a629ae0293a03c529d8ac8ba2025 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7;
+package org.apache.james.backends.opensearch;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
similarity index 89%
rename from backends-common/elasticsearch-v7/src/test/java/org/apache/james/backends/es/v7/search/ScrolledSearchTest.java
rename to backends-common/opensearch/src/test/java/org/apache/james/backends/opensearch/search/ScrolledSearchTest.java
index 9249c384d0dc788b0e858f55d295b4be8daab1fd..273d1aa68226fd2c801b1d4417dc8eab8a255fe9 100644 (file)
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.backends.es.v7.search;
+package org.apache.james.backends.opensearch.search;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.awaitility.Awaitility.await;
 
 import java.io.IOException;
 
-import org.apache.james.backends.es.v7.DockerElasticSearchExtension;
-import org.apache.james.backends.es.v7.ElasticSearchConfiguration;
-import org.apache.james.backends.es.v7.IndexCreationFactory;
-import org.apache.james.backends.es.v7.IndexName;
-import org.apache.james.backends.es.v7.ReactorElasticSearchClient;
-import org.apache.james.backends.es.v7.ReadAliasName;
+import org.apache.james.backends.opensearch.DockerElasticSearchExtension;
+import org.apache.james.backends.opensearch.ElasticSearchConfiguration;
+import org.apache.james.backends.opensearch.IndexCreationFactory;
+import org.apache.james.backends.opensearch.IndexName;
+import org.apache.james.backends.opensearch.ReactorElasticSearchClient;
+import org.apache.james.backends.opensearch.ReadAliasName;
 import org.awaitility.Durations;
 import org.awaitility.core.ConditionFactory;
-import org.elasticsearch.action.index.IndexRequest;
-import org.elasticsearch.action.search.SearchRequest;
-import org.elasticsearch.client.RequestOptions;
-import org.elasticsearch.common.unit.TimeValue;
-import org.elasticsearch.index.query.QueryBuilders;
-import org.elasticsearch.search.SearchHit;
-import org.elasticsearch.search.builder.SearchSourceBuilder;
+import org.opensearch.action.index.IndexRequest;
+import org.opensearch.action.search.SearchRequest;
+import org.opensearch.client.RequestOptions;
+import org.opensearch.common.unit.TimeValue;
+import org.opensearch.index.query.QueryBuilders;
+import org.opensearch.search.SearchHit;
+import org.opensearch.search.builder.SearchSourceBuilder;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
index 00defbb168f2e0548b0b0a406f5504937960fe21..f8392c935db0e8babf08ef01289389670dbb2b36 100644 (file)
@@ -35,8 +35,8 @@
 
     <modules>
         <module>cassandra</module>
-        <module>elasticsearch-v7</module>
         <module>jpa</module>
+        <module>opensearch</module>
         <module>pulsar</module>
         <module>rabbitmq</module>
     </modules>
index 75f096fdecb63005a2c82cf682fcf2f16930c6c7..f9f8e42bb61ec54afbde2e8a28f6a8bc330ff1dc 100644 (file)
@@ -306,6 +306,7 @@ public class RabbitMQConfiguration {
     private static final String QUEUE_TTL = "notification.queue.ttl";
     private static final String EVENT_BUS_NOTIFICATION_DURABILITY_ENABLED = "event.bus.notification.durability.enabled";
     private static final String EVENT_BUS_PUBLISH_CONFIRM_ENABLED = "event.bus.publish.confirm.enabled";
+    private static final String VHOST = "vhost";
 
     public static class ManagementCredentials {
 
@@ -402,6 +403,7 @@ public class RabbitMQConfiguration {
         private Optional<Long> queueTTL;
         private Optional<Boolean> eventBusPublishConfirmEnabled;
         private Optional<Boolean> eventBusNotificationDurabilityEnabled;
+        private Optional<String> vhost;
 
         private Builder(URI amqpUri, URI managementUri, ManagementCredentials managementCredentials) {
             this.amqpUri = amqpUri;
@@ -423,6 +425,7 @@ public class RabbitMQConfiguration {
             this.queueTTL = Optional.empty();
             this.eventBusPublishConfirmEnabled = Optional.empty();
             this.eventBusNotificationDurabilityEnabled = Optional.empty();
+            this.vhost = Optional.empty();
         }
 
         public Builder maxRetries(int maxRetries) {
@@ -513,6 +516,11 @@ public class RabbitMQConfiguration {
             return this;
         }
 
+        public Builder vhost(Optional<String> vhost) {
+            this.vhost = vhost;
+            return this;
+        }
+
         public RabbitMQConfiguration build() {
             Preconditions.checkNotNull(amqpUri, "'amqpUri' should not be null");
             Preconditions.checkNotNull(managementUri, "'managementUri' should not be null");
@@ -535,7 +543,8 @@ public class RabbitMQConfiguration {
                     hostsDefaultingToUri(),
                     queueTTL,
                     eventBusPublishConfirmEnabled.orElse(true),
-                    eventBusNotificationDurabilityEnabled.orElse(true));
+                    eventBusNotificationDurabilityEnabled.orElse(true),
+                    vhost);
         }
 
         private List<Host> hostsDefaultingToUri() {
@@ -584,6 +593,8 @@ public class RabbitMQConfiguration {
 
         Optional<Long> queueTTL = Optional.ofNullable(configuration.getLong(QUEUE_TTL, null));
 
+        Optional<String> vhost = Optional.ofNullable(configuration.getString(VHOST, null));
+
         ManagementCredentials managementCredentials = ManagementCredentials.from(configuration);
         return builder()
             .amqpUri(amqpUri)
@@ -598,6 +609,7 @@ public class RabbitMQConfiguration {
             .queueTTL(queueTTL)
             .eventBusNotificationDurabilityEnabled(configuration.getBoolean(EVENT_BUS_NOTIFICATION_DURABILITY_ENABLED, null))
             .eventBusPublishConfirmEnabled(configuration.getBoolean(EVENT_BUS_PUBLISH_CONFIRM_ENABLED, null))
+            .vhost(vhost)
             .build();
     }
 
@@ -668,12 +680,14 @@ public class RabbitMQConfiguration {
     private final Optional<Long> queueTTL;
     private final boolean eventBusPublishConfirmEnabled;
     private final boolean eventBusNotificationDurabilityEnabled;
+    private final Optional<String> vhost;
 
     private RabbitMQConfiguration(URI uri, URI managementUri, ManagementCredentials managementCredentials, int maxRetries, int minDelayInMs,
                                   int connectionTimeoutInMs, int channelRpcTimeoutInMs, int handshakeTimeoutInMs, int shutdownTimeoutInMs,
                                   int networkRecoveryIntervalInMs, Boolean useSsl, Boolean useSslManagement, SSLConfiguration sslConfiguration,
                                   boolean useQuorumQueues, int quorumQueueReplicationFactor, List<Host> hosts, Optional<Long> queueTTL,
-                                  boolean eventBusPublishConfirmEnabled, boolean eventBusNotificationDurabilityEnabled) {
+                                  boolean eventBusPublishConfirmEnabled, boolean eventBusNotificationDurabilityEnabled,
+                                  Optional<String> vhost) {
         this.uri = uri;
         this.managementUri = managementUri;
         this.managementCredentials = managementCredentials;
@@ -693,6 +707,7 @@ public class RabbitMQConfiguration {
         this.queueTTL = queueTTL;
         this.eventBusPublishConfirmEnabled = eventBusPublishConfirmEnabled;
         this.eventBusNotificationDurabilityEnabled = eventBusNotificationDurabilityEnabled;
+        this.vhost = vhost;
     }
 
     public URI getUri() {
@@ -772,6 +787,10 @@ public class RabbitMQConfiguration {
         return eventBusNotificationDurabilityEnabled;
     }
 
+    public Optional<String> getVhost() {
+        return vhost;
+    }
+
     @Override
     public final boolean equals(Object o) {
         if (o instanceof RabbitMQConfiguration) {
@@ -795,7 +814,8 @@ public class RabbitMQConfiguration {
                 && Objects.equals(this.hosts, that.hosts)
                 && Objects.equals(this.queueTTL, that.queueTTL)
                 && Objects.equals(this.eventBusPublishConfirmEnabled, that.eventBusPublishConfirmEnabled)
-                && Objects.equals(this.eventBusNotificationDurabilityEnabled, that.eventBusNotificationDurabilityEnabled);
+                && Objects.equals(this.eventBusNotificationDurabilityEnabled, that.eventBusNotificationDurabilityEnabled)
+                && Objects.equals(this.vhost, that.vhost);
         }
         return false;
     }
@@ -804,6 +824,6 @@ public class RabbitMQConfiguration {
     public final int hashCode() {
         return Objects.hash(uri, managementUri, maxRetries, minDelayInMs, connectionTimeoutInMs, quorumQueueReplicationFactor, useQuorumQueues, hosts,
             channelRpcTimeoutInMs, handshakeTimeoutInMs, shutdownTimeoutInMs, networkRecoveryIntervalInMs, managementCredentials, useSsl, useSslManagement,
-            sslConfiguration, queueTTL, eventBusPublishConfirmEnabled, eventBusNotificationDurabilityEnabled);
+            sslConfiguration, queueTTL, eventBusPublishConfirmEnabled, eventBusNotificationDurabilityEnabled, vhost);
     }
 }
index 5661a4d314a4331f2078dc6592bfd0b308456dc2..59488fbc183d5ff32e1a3b6e773fc707a35bb401 100644 (file)
@@ -435,6 +435,12 @@ public interface RabbitMQManagementAPI {
     @RequestLine("GET /api/queues")
     List<MessageQueue> listQueues();
 
+    @RequestLine("GET /api/queues/{vhost}")
+    List<MessageQueue> listVhostQueues(@Param("vhost") String vhost);
+
+    @RequestLine("PUT /api/vhosts/{vhost}")
+    List<MessageQueue> addVhost(@Param("vhost") String vhost);
+
     @RequestLine(value = "GET /api/queues/{vhost}/{name}", decodeSlash = false)
     MessageQueueDetails queueDetails(@Param("vhost") String vhost, @Param("name") String name);
 
index 49fd7967191058cb19e2c97157cf222165dcf833..32f9a2c2cd30d1cc31f15a089be37e7154809a08 100644 (file)
@@ -455,6 +455,36 @@ class RabbitMQConfigurationTest {
             .isInstanceOf(ConversionException.class);
     }
 
+    @Test
+    void fromShouldReturnEmptyVhostValueByDefault() {
+        PropertiesConfiguration configuration = new PropertiesConfiguration();
+        String amqpUri = "amqp://james:james@rabbitmqhost:5672";
+        configuration.addProperty("uri", amqpUri);
+        String managementUri = "http://james:james@rabbitmqhost:15672/api/";
+        configuration.addProperty("management.uri", managementUri);
+        configuration.addProperty("management.user", DEFAULT_USER);
+        configuration.addProperty("management.password", DEFAULT_PASSWORD_STRING);
+
+        assertThat(RabbitMQConfiguration.from(configuration).getVhost())
+            .isEqualTo(Optional.empty());
+    }
+
+    @Test
+    void fromShouldReturnVhostValueWhenGiven() {
+        PropertiesConfiguration configuration = new PropertiesConfiguration();
+        String amqpUri = "amqp://james:james@rabbitmqhost:5672";
+        configuration.addProperty("uri", amqpUri);
+        String managementUri = "http://james:james@rabbitmqhost:15672/api/";
+        configuration.addProperty("management.uri", managementUri);
+        configuration.addProperty("management.user", DEFAULT_USER);
+        configuration.addProperty("management.password", DEFAULT_PASSWORD_STRING);
+
+        configuration.addProperty("vhost", "test");
+
+        assertThat(RabbitMQConfiguration.from(configuration).getVhost())
+            .isEqualTo(Optional.of("test"));
+    }
+
     @Nested
     class ManagementCredentialsTest {
         @Test
index 5279af943ed3f786ae1badc04bb8650b5a9baf59..55d0e372edb5d78a810435a922db0e23f42a48fc 100644 (file)
@@ -23,6 +23,7 @@ import static org.apache.james.backends.rabbitmq.Constants.AUTO_ACK;
 import static org.apache.james.backends.rabbitmq.Constants.AUTO_DELETE;
 import static org.apache.james.backends.rabbitmq.Constants.DIRECT_EXCHANGE;
 import static org.apache.james.backends.rabbitmq.Constants.DURABLE;
+import static org.apache.james.backends.rabbitmq.Constants.EMPTY_ROUTING_KEY;
 import static org.apache.james.backends.rabbitmq.Constants.EXCLUSIVE;
 import static org.apache.james.backends.rabbitmq.Constants.MULTIPLE;
 import static org.apache.james.backends.rabbitmq.Constants.NO_LOCAL;
@@ -43,6 +44,7 @@ import java.util.List;
 import java.util.Queue;
 import java.util.UUID;
 import java.util.concurrent.ConcurrentLinkedQueue;
+import java.util.concurrent.CountDownLatch;
 import java.util.concurrent.TimeUnit;
 import java.util.concurrent.TimeoutException;
 import java.util.concurrent.atomic.AtomicInteger;
@@ -51,6 +53,7 @@ import java.util.stream.IntStream;
 
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
+import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Nested;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
@@ -68,6 +71,16 @@ import com.rabbitmq.client.DeliverCallback;
 import com.rabbitmq.client.Delivery;
 
 import nl.jqno.equalsverifier.EqualsVerifier;
+import reactor.core.publisher.Flux;
+import reactor.core.publisher.Mono;
+import reactor.core.scheduler.Schedulers;
+import reactor.rabbitmq.BindingSpecification;
+import reactor.rabbitmq.ConsumeOptions;
+import reactor.rabbitmq.ExchangeSpecification;
+import reactor.rabbitmq.OutboundMessage;
+import reactor.rabbitmq.QueueSpecification;
+import reactor.rabbitmq.Receiver;
+import reactor.rabbitmq.Sender;
 
 class RabbitMQTest {
 
@@ -587,6 +600,105 @@ class RabbitMQTest {
 
     }
 
+    @Nested
+    class ConcurrencyTest {
+        private static final String QUEUE_NAME_1 = "TEST1";
+        private static final String EXCHANGE_NAME_1 = "EXCHANGE1";
+
+        @BeforeEach
+        void setup() {
+            Sender sender = rabbitMQExtension.getSender();
+
+            Flux.concat(
+                    sender.declareExchange(ExchangeSpecification.exchange(EXCHANGE_NAME_1)
+                        .durable(true)
+                        .type("direct")),
+                    sender.declareQueue(QueueSpecification.queue(QUEUE_NAME_1)
+                        .durable(DURABLE)
+                        .exclusive(!EXCLUSIVE)
+                        .autoDelete(!AUTO_DELETE)),
+                    sender.bind(BindingSpecification.binding()
+                        .exchange(EXCHANGE_NAME_1)
+                        .queue(QUEUE_NAME_1)
+                        .routingKey(EMPTY_ROUTING_KEY)))
+                .then()
+                .block();
+
+            IntStream.rangeClosed(1, 5)
+                .forEach(i -> sender.send(Mono.just(new OutboundMessage(EXCHANGE_NAME_1, "", String.format("Message + %s", UUID.randomUUID()).getBytes(StandardCharsets.UTF_8))))
+                    .block());
+        }
+
+        @Test
+        void consumingShouldSuccessWhenAckConcurrent() throws Exception {
+            ReceiverProvider receiverProvider = rabbitMQExtension.getReceiverProvider();
+            CountDownLatch countDownLatch = new CountDownLatch(5);
+
+            Flux.using(receiverProvider::createReceiver,
+                    receiver -> receiver.consumeManualAck(QUEUE_NAME_1, new ConsumeOptions()),
+                    Receiver::close)
+                .filter(getResponse -> getResponse.getBody() != null)
+                .concatMap(acknowledgableDelivery -> Mono.fromCallable(() -> {
+                    acknowledgableDelivery.ack(true);
+                    countDownLatch.countDown();
+                    return acknowledgableDelivery;
+                }).subscribeOn(Schedulers.elastic()))
+                .subscribe();
+
+            assertThat(countDownLatch.await(10, TimeUnit.SECONDS)).isTrue();
+        }
+
+        @Test
+        @Disabled("Now, it fail, Because using Flux.take and concatMap")
+        // See https://github.com/reactor/reactor-rabbitmq/issues/176
+        void consumingShouldSuccessWhenAckConcurrentWithFluxTake() throws Exception {
+            ReceiverProvider receiverProvider = rabbitMQExtension.getReceiverProvider();
+            int counter = 5;
+            CountDownLatch countDownLatch = new CountDownLatch(counter);
+
+            Flux.using(receiverProvider::createReceiver,
+                    receiver -> receiver.consumeManualAck(QUEUE_NAME_1, new ConsumeOptions()),
+                    Receiver::close)
+                .filter(getResponse -> getResponse.getBody() != null)
+                .take(counter)
+                .concatMap(acknowledgableDelivery -> Mono.fromCallable(() -> {
+                    acknowledgableDelivery.ack(true);
+                    countDownLatch.countDown();
+                    System.out.println(Thread.currentThread().getName() + ": " + countDownLatch.getCount());
+                    return acknowledgableDelivery;
+                }).subscribeOn(Schedulers.elastic()))
+                .subscribe();
+
+            assertThat(countDownLatch.await(10, TimeUnit.SECONDS)).isTrue();
+        }
+
+
+        @Test
+        @Disabled("Now, sometimes pass, sometimes fail. Because using Flux.take and flatMap, It can be re-produce it by try 'Repeat until failure' of Intellij")
+        // See https://github.com/reactor/reactor-rabbitmq/issues/176
+        void consumingShouldSuccessWhenAckConcurrentWithFluxTakeAndFlatMap() throws Exception {
+            ReceiverProvider receiverProvider = rabbitMQExtension.getReceiverProvider();
+            int counter = 5;
+            CountDownLatch countDownLatch = new CountDownLatch(counter);
+
+            Flux.using(receiverProvider::createReceiver,
+                    receiver -> receiver.consumeManualAck(QUEUE_NAME_1, new ConsumeOptions()),
+                    Receiver::close)
+                .filter(getResponse -> getResponse.getBody() != null)
+                .take(counter)
+                .flatMap(acknowledgableDelivery -> Mono.fromCallable(() -> {
+                    acknowledgableDelivery.ack(true);
+                    countDownLatch.countDown();
+                    System.out.println(Thread.currentThread().getName() + ": " + countDownLatch.getCount());
+                    return acknowledgableDelivery;
+                }).subscribeOn(Schedulers.elastic()))
+                .subscribe();
+
+            assertThat(countDownLatch.await(10, TimeUnit.SECONDS)).isTrue();
+        }
+    }
+
+
     private void closeQuietly(AutoCloseable... closeables) {
         Arrays.stream(closeables).forEach(this::closeQuietly);
     }
index d58e4d60c9c52a9a13df323e3e5d8cecfa275753..8c4d679384dacdf495af87e074959ca145bbbfc1 100644 (file)
@@ -35,7 +35,7 @@ import com.google.common.collect.ImmutableList;
 public class SolveMailboxInconsistenciesTask implements Task {
     static final TaskType SOLVE_MAILBOX_INCONSISTENCIES = TaskType.of("solve-mailbox-inconsistencies");
     public static final Logger LOGGER = LoggerFactory.getLogger(SolveMailboxInconsistenciesTask.class);
-    private SolveMailboxInconsistenciesService.Context context;
+    private final SolveMailboxInconsistenciesService.Context context;
 
     public static class Details implements TaskExecutionDetails.AdditionalInformation {
         private final Instant instant;
index e4e24f03be6dda275638708f7799a1c67ce7fe05..5a5ec7f64d512172465813e156a6ee0f78df5a51 100644 (file)
@@ -101,8 +101,8 @@ public class SolveMessageInconsistenciesTask implements Task {
     }
 
     private final SolveMessageInconsistenciesService service;
-    private Context context;
-    private RunningOptions runningOptions;
+    private final Context context;
+    private final RunningOptions runningOptions;
 
     public SolveMessageInconsistenciesTask(SolveMessageInconsistenciesService service, RunningOptions runningOptions) {
         this.service = service;
diff --git a/mailbox/opensearch/example_french_index.json b/mailbox/opensearch/example_french_index.json
deleted file mode 100644 (file)
index b4a89cc..0000000
+++ /dev/null
@@ -1,247 +0,0 @@
-{
-       "settings": {
-               "number_of_shards": 5,
-               "number_of_replicas": 1,
-               "index.write.wait_for_active_shards": 1,
-               "analysis": {
-                       "normalizer": {
-                               "case_insensitive": {
-                                       "type": "custom",
-                                       "char_filter": [],
-                                       "filter": ["lowercase", "asciifolding"]
-                               }
-                       },
-                       "analyzer": {
-                               "keep_mail_and_url": {
-                                       "tokenizer": "uax_url_email",
-                                       "filter": ["lowercase", "stop"]
-                               },
-                               "keep_mail_and_url_french": {
-                                       "tokenizer": "uax_url_email",
-                                       "filter": ["lowercase", "french_stop", "french_elision", "french_stemmer"]
-                               }
-                       },
-                       "tokenizer": {},
-                       "filter": {
-                               "french_elision": {
-                                       "type": "elision",
-                                       "articles_case": true,
-                                       "articles": [
-                                               "l", "m", "t", "qu", "n", "s",
-                                               "j", "d", "c", "jusqu", "quoiqu",
-                                               "lorsqu", "puisqu"
-                                       ]
-                               },
-                               "french_stop": {
-                                       "type": "stop",
-                                       "stopwords": "_french_"
-                               },
-                               "french_stemmer": {
-                                       "type": "stemmer",
-                                       "language": "light_french"
-                               }
-                       }
-               }
-       },
-       "mappings": {
-               "dynamic": "strict",
-               "_routing": {
-                       "required": true
-               },
-               "properties": {
-                       "messageId": {
-                               "type": "keyword",
-                               "store": true
-                       },
-                       "threadId": {
-                               "type": "keyword"
-                       },
-                       "uid": {
-                               "type": "long",
-                               "store": true
-                       },
-                       "modSeq": {
-                               "type": "long"
-                       },
-                       "size": {
-                               "type": "long"
-                       },
-                       "isAnswered": {
-                               "type": "boolean"
-                       },
-                       "isDeleted": {
-                               "type": "boolean"
-                       },
-                       "isDraft": {
-                               "type": "boolean"
-                       },
-                       "isFlagged": {
-                               "type": "boolean"
-                       },
-                       "isRecent": {
-                               "type": "boolean"
-                       },
-                       "isUnread": {
-                               "type": "boolean"
-                       },
-                       "date": {
-                               "type": "date",
-                               "format": "uuuu-MM-dd'T'HH:mm:ssX||uuuu-MM-dd'T'HH:mm:ssXXX||uuuu-MM-dd'T'HH:mm:ssXXXXX"
-                       },
-                       "sentDate": {
-                               "type": "date",
-                               "format": "uuuu-MM-dd'T'HH:mm:ssX||uuuu-MM-dd'T'HH:mm:ssXXX||uuuu-MM-dd'T'HH:mm:ssXXXXX"
-                       },
-                       "userFlags": {
-                               "type": "keyword",
-                               "normalizer": "case_insensitive"
-                       },
-                       "mediaType": {
-                               "type": "keyword"
-                       },
-                       "subtype": {
-                               "type": "keyword"
-                       },
-                       "from": {
-                               "properties": {
-                                       "name": {
-                                               "type": "text",
-                                               "analyzer": "keep_mail_and_url_french"
-                                       },
-                                       "address": {
-                                               "type": "text",
-                                               "analyzer": "standard",
-                                               "search_analyzer": "keep_mail_and_url",
-                                               "fields": {
-                                                       "raw": {
-                                                               "type": "keyword",
-                                                               "normalizer": "case_insensitive"
-                                                       }
-                                               }
-                                       }
-                               }
-                       },
-                       "headers": {
-                               "type": "nested",
-                               "properties": {
-                                       "name": {
-                                               "type": "keyword"
-                                       },
-                                       "value": {
-                                               "type": "text",
-                                               "analyzer": "keep_mail_and_url"
-                                       }
-                               }
-                       },
-                       "subject": {
-                               "type": "text",
-                               "analyzer": "keep_mail_and_url_french",
-                               "fields": {
-                                       "raw": {
-                                               "type": "keyword",
-                                               "normalizer": "case_insensitive"
-                                       }
-                               }
-                       },
-                       "to": {
-                               "properties": {
-                                       "name": {
-                                               "type": "text",
-                                               "analyzer": "keep_mail_and_url_french"
-                                       },
-                                       "address": {
-                                               "type": "text",
-                                               "analyzer": "standard",
-                                               "search_analyzer": "keep_mail_and_url",
-                                               "fields": {
-                                                       "raw": {
-                                                               "type": "keyword",
-                                                               "normalizer": "case_insensitive"
-                                                       }
-                                               }
-                                       }
-                               }
-                       },
-                       "cc": {
-                               "properties": {
-                                       "name": {
-                                               "type": "text",
-                                               "analyzer": "keep_mail_and_url_french"
-                                       },
-                                       "address": {
-                                               "type": "text",
-                                               "analyzer": "standard",
-                                               "search_analyzer": "keep_mail_and_url",
-                                               "fields": {
-                                                       "raw": {
-                                                               "type": "keyword",
-                                                               "normalizer": "case_insensitive"
-                                                       }
-                                               }
-                                       }
-                               }
-                       },
-                       "bcc": {
-                               "properties": {
-                                       "name": {
-                                               "type": "text",
-                                               "analyzer": "keep_mail_and_url_french"
-                                       },
-                                       "address": {
-                                               "type": "text",
-                                               "analyzer": "standard",
-                                               "search_analyzer": "keep_mail_and_url",
-                                               "fields": {
-                                                       "raw": {
-                                                               "type": "keyword",
-                                                               "normalizer": "case_insensitive"
-                                                       }
-                                               }
-                                       }
-                               }
-                       },
-                       "mailboxId": {
-                               "type": "keyword",
-                               "store": true
-                       },
-                       "mimeMessageID": {
-                               "type": "keyword"
-                       },
-                       "textBody": {
-                               "type": "text",
-                               "analyzer": "french"
-                       },
-                       "htmlBody": {
-                               "type": "text",
-                               "analyzer": "french"
-                       },
-                       "hasAttachment": {
-                               "type": "boolean"
-                       },
-                       "attachments": {
-                               "properties": {
-                                       "fileName": {
-                                               "type": "text",
-                                               "analyzer": "french"
-                                       },
-                                       "textContent": {
-                                               "type": "text",
-                                               "analyzer": "french"
-                                       },
-                                       "mediaType": {
-                                               "type": "keyword"
-                                       },
-                                       "subtype": {
-                                               "type": "keyword"
-                                       },
-                                       "fileExtension": {
-                                               "type": "keyword"
-                                       },
-                                       "contentDisposition": {
-                                               "type": "keyword"
-                                       }
-                               }
-                       }
-               }
-       }
-}
\ No newline at end of file
similarity index 95%
rename from mailbox/elasticsearch-v7/pom.xml
rename to mailbox/opensearch/pom.xml
index 3650cf3204ca491e3b99d652323997a202f9460d..30fa8a29346279e2c66c17f7e2d4a331449751a1 100644 (file)
         <relativePath>../pom.xml</relativePath>
     </parent>
 
-    <artifactId>apache-james-mailbox-elasticsearch-v7</artifactId>
-    <name>Apache James :: Mailbox :: ElasticSearch</name>
-    <description>Apache James Mailbox IMAP search implementation using ElasticSearch</description>
+    <artifactId>apache-james-mailbox-opensearch</artifactId>
+    <name>Apache James :: Mailbox :: Opensearch</name>
+    <description>Apache James Mailbox IMAP search implementation using Opensearch</description>
 
     <dependencies>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>apache-james-backends-es-v7</artifactId>
+            <artifactId>apache-james-backends-opensearch</artifactId>
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>apache-james-backends-es-v7</artifactId>
+            <artifactId>apache-james-backends-opensearch</artifactId>
             <type>test-jar</type>
             <scope>test</scope>
         </dependency>
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7;
+package org.apache.james.mailbox.opensearch;
 
 import java.util.Objects;
 import java.util.Optional;
 
 import org.apache.commons.configuration2.Configuration;
-import org.apache.james.backends.es.v7.IndexName;
-import org.apache.james.backends.es.v7.ReadAliasName;
-import org.apache.james.backends.es.v7.WriteAliasName;
+import org.apache.james.backends.opensearch.IndexName;
+import org.apache.james.backends.opensearch.ReadAliasName;
+import org.apache.james.backends.opensearch.WriteAliasName;
 
 public class ElasticSearchMailboxConfiguration {
 
similarity index 96%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/IndexAttachments.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/IndexAttachments.java
index a66e26d9a46c9388a48f80db5235766e2ea242d7..b7c90d9e60009efde87cfe0f8edaab3aadac2bdd 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7;
+package org.apache.james.mailbox.opensearch;
 
 public enum IndexAttachments {
     NO, YES
similarity index 87%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/MailboxElasticSearchConstants.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/MailboxElasticSearchConstants.java
index ec66fcf2478382300ce993973a10c5fbbc5d0c47..6c2743178f8964b4d220983625d4c98065553fb1 100644 (file)
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7;
+package org.apache.james.mailbox.opensearch;
 
-import org.apache.james.backends.es.v7.IndexName;
-import org.apache.james.backends.es.v7.ReadAliasName;
-import org.apache.james.backends.es.v7.WriteAliasName;
+import org.apache.james.backends.opensearch.IndexName;
+import org.apache.james.backends.opensearch.ReadAliasName;
+import org.apache.james.backends.opensearch.WriteAliasName;
 
 public interface MailboxElasticSearchConstants {
 
similarity index 93%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/MailboxIdRoutingKeyFactory.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/MailboxIdRoutingKeyFactory.java
index 0946944dcae95a8cdd974d58972cb89afa19e886..65b78e7493f190d71d65ed400f48ee22f3fa62cc 100644 (file)
@@ -17,9 +17,9 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7;
+package org.apache.james.mailbox.opensearch;
 
-import org.apache.james.backends.es.v7.RoutingKey;
+import org.apache.james.backends.opensearch.RoutingKey;
 import org.apache.james.mailbox.model.MailboxId;
 
 public class MailboxIdRoutingKeyFactory implements RoutingKey.Factory<MailboxId> {
similarity index 84%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/MailboxIndexCreationUtil.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/MailboxIndexCreationUtil.java
index ab61927f895bc0f0c4224bf6a3905a48961844be..3a686e494dc27053590f43d421fd8f3a87eb97c1 100644 (file)
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7;
+package org.apache.james.mailbox.opensearch;
 
-import org.apache.james.backends.es.v7.ElasticSearchConfiguration;
-import org.apache.james.backends.es.v7.IndexCreationFactory;
-import org.apache.james.backends.es.v7.IndexName;
-import org.apache.james.backends.es.v7.ReactorElasticSearchClient;
-import org.apache.james.backends.es.v7.ReadAliasName;
-import org.apache.james.backends.es.v7.WriteAliasName;
+import org.apache.james.backends.opensearch.ElasticSearchConfiguration;
+import org.apache.james.backends.opensearch.IndexCreationFactory;
+import org.apache.james.backends.opensearch.IndexName;
+import org.apache.james.backends.opensearch.ReactorElasticSearchClient;
+import org.apache.james.backends.opensearch.ReadAliasName;
+import org.apache.james.backends.opensearch.WriteAliasName;
 
 public class MailboxIndexCreationUtil {
 
similarity index 54%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/MailboxMappingFactory.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/MailboxMappingFactory.java
index 0bfb029c49689d7edf3a492c8de4bf7a0f1f09df..91823e9280ddbac04f69a7921484ce0275681ee7 100644 (file)
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7;
-
-import static org.apache.james.backends.es.v7.IndexCreationFactory.ANALYZER;
-import static org.apache.james.backends.es.v7.IndexCreationFactory.BOOLEAN;
-import static org.apache.james.backends.es.v7.IndexCreationFactory.CASE_INSENSITIVE;
-import static org.apache.james.backends.es.v7.IndexCreationFactory.FIELDS;
-import static org.apache.james.backends.es.v7.IndexCreationFactory.FORMAT;
-import static org.apache.james.backends.es.v7.IndexCreationFactory.KEEP_MAIL_AND_URL;
-import static org.apache.james.backends.es.v7.IndexCreationFactory.KEYWORD;
-import static org.apache.james.backends.es.v7.IndexCreationFactory.LONG;
-import static org.apache.james.backends.es.v7.IndexCreationFactory.NESTED;
-import static org.apache.james.backends.es.v7.IndexCreationFactory.NORMALIZER;
-import static org.apache.james.backends.es.v7.IndexCreationFactory.PROPERTIES;
-import static org.apache.james.backends.es.v7.IndexCreationFactory.RAW;
-import static org.apache.james.backends.es.v7.IndexCreationFactory.REQUIRED;
-import static org.apache.james.backends.es.v7.IndexCreationFactory.ROUTING;
-import static org.apache.james.backends.es.v7.IndexCreationFactory.SEARCH_ANALYZER;
-import static org.apache.james.backends.es.v7.IndexCreationFactory.TYPE;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.ATTACHMENTS;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.BCC;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.CC;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.DATE;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.FROM;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.HAS_ATTACHMENT;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.HEADERS;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.HTML_BODY;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.IS_ANSWERED;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.IS_DELETED;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.IS_DRAFT;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.IS_FLAGGED;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.IS_RECENT;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.IS_UNREAD;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.MAILBOX_ID;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.MEDIA_TYPE;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.MESSAGE_ID;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.MIME_MESSAGE_ID;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.MODSEQ;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.SENT_DATE;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.SIZE;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.SUBJECT;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.SUBTYPE;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.TEXT;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.TEXT_BODY;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.THREAD_ID;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.TO;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.UID;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.USER_FLAGS;
-import static org.elasticsearch.common.xcontent.XContentFactory.jsonBuilder;
+package org.apache.james.mailbox.opensearch;
+
+import static org.apache.james.backends.opensearch.IndexCreationFactory.ANALYZER;
+import static org.apache.james.backends.opensearch.IndexCreationFactory.BOOLEAN;
+import static org.apache.james.backends.opensearch.IndexCreationFactory.CASE_INSENSITIVE;
+import static org.apache.james.backends.opensearch.IndexCreationFactory.FIELDS;
+import static org.apache.james.backends.opensearch.IndexCreationFactory.FORMAT;
+import static org.apache.james.backends.opensearch.IndexCreationFactory.KEEP_MAIL_AND_URL;
+import static org.apache.james.backends.opensearch.IndexCreationFactory.KEYWORD;
+import static org.apache.james.backends.opensearch.IndexCreationFactory.LONG;
+import static org.apache.james.backends.opensearch.IndexCreationFactory.NESTED;
+import static org.apache.james.backends.opensearch.IndexCreationFactory.NORMALIZER;
+import static org.apache.james.backends.opensearch.IndexCreationFactory.PROPERTIES;
+import static org.apache.james.backends.opensearch.IndexCreationFactory.RAW;
+import static org.apache.james.backends.opensearch.IndexCreationFactory.REQUIRED;
+import static org.apache.james.backends.opensearch.IndexCreationFactory.ROUTING;
+import static org.apache.james.backends.opensearch.IndexCreationFactory.SEARCH_ANALYZER;
+import static org.apache.james.backends.opensearch.IndexCreationFactory.TYPE;
+import static org.opensearch.common.xcontent.XContentFactory.jsonBuilder;
 
 import java.io.IOException;
 
-import org.apache.james.backends.es.v7.IndexCreationFactory;
-import org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.Attachment;
-import org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.EMailer;
-import org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.HEADER;
-import org.elasticsearch.common.xcontent.XContentBuilder;
+import org.apache.james.backends.opensearch.IndexCreationFactory;
+import org.apache.james.mailbox.opensearch.json.JsonMessageConstants;
+import org.opensearch.common.xcontent.XContentBuilder;
 
 public class MailboxMappingFactory {
     private static final String STANDARD = "standard";
@@ -91,83 +60,83 @@ public class MailboxMappingFactory {
 
                     .startObject(PROPERTIES)
 
-                        .startObject(MESSAGE_ID)
+                        .startObject(JsonMessageConstants.MESSAGE_ID)
                             .field(TYPE, KEYWORD)
                             .field(STORE, true)
                         .endObject()
 
-                        .startObject(THREAD_ID)
+                        .startObject(JsonMessageConstants.THREAD_ID)
                             .field(TYPE, KEYWORD)
                         .endObject()
 
-                        .startObject(UID)
+                        .startObject(JsonMessageConstants.UID)
                             .field(TYPE, LONG)
                             .field(STORE, true)
                         .endObject()
 
-                        .startObject(MODSEQ)
+                        .startObject(JsonMessageConstants.MODSEQ)
                             .field(TYPE, LONG)
                         .endObject()
 
-                        .startObject(SIZE)
+                        .startObject(JsonMessageConstants.SIZE)
                             .field(TYPE, LONG)
                         .endObject()
 
-                        .startObject(IS_ANSWERED)
+                        .startObject(JsonMessageConstants.IS_ANSWERED)
                             .field(TYPE, BOOLEAN)
                         .endObject()
 
-                        .startObject(IS_DELETED)
+                        .startObject(JsonMessageConstants.IS_DELETED)
                             .field(TYPE, BOOLEAN)
                         .endObject()
 
-                        .startObject(IS_DRAFT)
+                        .startObject(JsonMessageConstants.IS_DRAFT)
                             .field(TYPE, BOOLEAN)
                         .endObject()
 
-                        .startObject(IS_FLAGGED)
+                        .startObject(JsonMessageConstants.IS_FLAGGED)
                             .field(TYPE, BOOLEAN)
                         .endObject()
 
-                        .startObject(IS_RECENT)
+                        .startObject(JsonMessageConstants.IS_RECENT)
                             .field(TYPE, BOOLEAN)
                         .endObject()
 
-                        .startObject(IS_UNREAD)
+                        .startObject(JsonMessageConstants.IS_UNREAD)
                             .field(TYPE, BOOLEAN)
                         .endObject()
 
-                        .startObject(DATE)
+                        .startObject(JsonMessageConstants.DATE)
                             .field(TYPE, IndexCreationFactory.DATE)
                             .field(FORMAT, "uuuu-MM-dd'T'HH:mm:ssX||uuuu-MM-dd'T'HH:mm:ssXXX||uuuu-MM-dd'T'HH:mm:ssXXXXX")
                         .endObject()
 
-                        .startObject(SENT_DATE)
+                        .startObject(JsonMessageConstants.SENT_DATE)
                             .field(TYPE, IndexCreationFactory.DATE)
                             .field(FORMAT, "uuuu-MM-dd'T'HH:mm:ssX||uuuu-MM-dd'T'HH:mm:ssXXX||uuuu-MM-dd'T'HH:mm:ssXXXXX")
                         .endObject()
 
-                        .startObject(USER_FLAGS)
+                        .startObject(JsonMessageConstants.USER_FLAGS)
                             .field(TYPE, KEYWORD)
                             .field(NORMALIZER, CASE_INSENSITIVE)
                         .endObject()
 
-                        .startObject(MEDIA_TYPE)
+                        .startObject(JsonMessageConstants.MEDIA_TYPE)
                             .field(TYPE, KEYWORD)
                         .endObject()
 
-                        .startObject(SUBTYPE)
+                        .startObject(JsonMessageConstants.SUBTYPE)
                             .field(TYPE, KEYWORD)
                         .endObject()
 
-                        .startObject(FROM)
+                        .startObject(JsonMessageConstants.FROM)
                             .startObject(PROPERTIES)
-                                .startObject(EMailer.NAME)
-                                    .field(TYPE, TEXT)
+                                .startObject(JsonMessageConstants.EMailer.NAME)
+                                    .field(TYPE, JsonMessageConstants.TEXT)
                                     .field(ANALYZER, KEEP_MAIL_AND_URL)
                                 .endObject()
-                                .startObject(EMailer.ADDRESS)
-                                    .field(TYPE, TEXT)
+                                .startObject(JsonMessageConstants.EMailer.ADDRESS)
+                                    .field(TYPE, JsonMessageConstants.TEXT)
                                     .field(ANALYZER, STANDARD)
                                     .field(SEARCH_ANALYZER, KEEP_MAIL_AND_URL)
                                     .startObject(FIELDS)
@@ -180,21 +149,21 @@ public class MailboxMappingFactory {
                             .endObject()
                         .endObject()
 
-                        .startObject(HEADERS)
+                        .startObject(JsonMessageConstants.HEADERS)
                             .field(TYPE, NESTED)
                             .startObject(PROPERTIES)
-                                .startObject(HEADER.NAME)
+                                .startObject(JsonMessageConstants.HEADER.NAME)
                                     .field(TYPE, KEYWORD)
                                 .endObject()
-                                .startObject(HEADER.VALUE)
-                                    .field(TYPE, TEXT)
+                                .startObject(JsonMessageConstants.HEADER.VALUE)
+                                    .field(TYPE, JsonMessageConstants.TEXT)
                                     .field(ANALYZER, KEEP_MAIL_AND_URL)
                                 .endObject()
                             .endObject()
                         .endObject()
 
-                        .startObject(SUBJECT)
-                            .field(TYPE, TEXT)
+                        .startObject(JsonMessageConstants.SUBJECT)
+                            .field(TYPE, JsonMessageConstants.TEXT)
                             .field(ANALYZER, KEEP_MAIL_AND_URL)
                             .startObject(FIELDS)
                                 .startObject(RAW)
@@ -204,14 +173,14 @@ public class MailboxMappingFactory {
                             .endObject()
                         .endObject()
 
-                        .startObject(TO)
+                        .startObject(JsonMessageConstants.TO)
                             .startObject(PROPERTIES)
-                                .startObject(EMailer.NAME)
-                                    .field(TYPE, TEXT)
+                                .startObject(JsonMessageConstants.EMailer.NAME)
+                                    .field(TYPE, JsonMessageConstants.TEXT)
                                     .field(ANALYZER, KEEP_MAIL_AND_URL)
                                 .endObject()
-                                .startObject(EMailer.ADDRESS)
-                                    .field(TYPE, TEXT)
+                                .startObject(JsonMessageConstants.EMailer.ADDRESS)
+                                    .field(TYPE, JsonMessageConstants.TEXT)
                                     .field(ANALYZER, STANDARD)
                                     .field(SEARCH_ANALYZER, KEEP_MAIL_AND_URL)
                                     .startObject(FIELDS)
@@ -224,14 +193,14 @@ public class MailboxMappingFactory {
                             .endObject()
                         .endObject()
 
-                        .startObject(CC)
+                        .startObject(JsonMessageConstants.CC)
                             .startObject(PROPERTIES)
-                                .startObject(EMailer.NAME)
-                                    .field(TYPE, TEXT)
+                                .startObject(JsonMessageConstants.EMailer.NAME)
+                                    .field(TYPE, JsonMessageConstants.TEXT)
                                     .field(ANALYZER, KEEP_MAIL_AND_URL)
                                 .endObject()
-                                .startObject(EMailer.ADDRESS)
-                                    .field(TYPE, TEXT)
+                                .startObject(JsonMessageConstants.EMailer.ADDRESS)
+                                    .field(TYPE, JsonMessageConstants.TEXT)
                                     .field(ANALYZER, STANDARD)
                                     .field(SEARCH_ANALYZER, KEEP_MAIL_AND_URL)
                                     .startObject(FIELDS)
@@ -244,14 +213,14 @@ public class MailboxMappingFactory {
                             .endObject()
                         .endObject()
 
-                        .startObject(BCC)
+                        .startObject(JsonMessageConstants.BCC)
                             .startObject(PROPERTIES)
-                                .startObject(EMailer.NAME)
-                                    .field(TYPE, TEXT)
+                                .startObject(JsonMessageConstants.EMailer.NAME)
+                                    .field(TYPE, JsonMessageConstants.TEXT)
                                     .field(ANALYZER, KEEP_MAIL_AND_URL)
                                 .endObject()
-                                .startObject(EMailer.ADDRESS)
-                                    .field(TYPE, TEXT)
+                                .startObject(JsonMessageConstants.EMailer.ADDRESS)
+                                    .field(TYPE, JsonMessageConstants.TEXT)
                                     .field(ANALYZER, STANDARD)
                                     .field(SEARCH_ANALYZER, KEEP_MAIL_AND_URL)
                                     .startObject(FIELDS)
@@ -264,49 +233,49 @@ public class MailboxMappingFactory {
                             .endObject()
                         .endObject()
 
-                        .startObject(MAILBOX_ID)
+                        .startObject(JsonMessageConstants.MAILBOX_ID)
                             .field(TYPE, KEYWORD)
                             .field(STORE, true)
                         .endObject()
 
-                        .startObject(MIME_MESSAGE_ID)
+                        .startObject(JsonMessageConstants.MIME_MESSAGE_ID)
                             .field(TYPE, KEYWORD)
                         .endObject()
 
-                        .startObject(TEXT_BODY)
-                            .field(TYPE, TEXT)
+                        .startObject(JsonMessageConstants.TEXT_BODY)
+                            .field(TYPE, JsonMessageConstants.TEXT)
                             .field(ANALYZER, STANDARD)
                         .endObject()
 
-                        .startObject(HTML_BODY)
-                            .field(TYPE, TEXT)
+                        .startObject(JsonMessageConstants.HTML_BODY)
+                            .field(TYPE, JsonMessageConstants.TEXT)
                             .field(ANALYZER, STANDARD)
                         .endObject()
 
-                        .startObject(HAS_ATTACHMENT)
+                        .startObject(JsonMessageConstants.HAS_ATTACHMENT)
                             .field(TYPE, BOOLEAN)
                         .endObject()
 
-                        .startObject(ATTACHMENTS)
+                        .startObject(JsonMessageConstants.ATTACHMENTS)
                             .startObject(PROPERTIES)
-                                .startObject(Attachment.FILENAME)
-                                    .field(TYPE, TEXT)
+                                .startObject(JsonMessageConstants.Attachment.FILENAME)
+                                    .field(TYPE, JsonMessageConstants.TEXT)
                                     .field(ANALYZER, STANDARD)
                                 .endObject()
-                                .startObject(Attachment.TEXT_CONTENT)
-                                    .field(TYPE, TEXT)
+                                .startObject(JsonMessageConstants.Attachment.TEXT_CONTENT)
+                                    .field(TYPE, JsonMessageConstants.TEXT)
                                     .field(ANALYZER, STANDARD)
                                 .endObject()
-                                .startObject(Attachment.MEDIA_TYPE)
+                                .startObject(JsonMessageConstants.Attachment.MEDIA_TYPE)
                                     .field(TYPE, KEYWORD)
                                 .endObject()
-                                .startObject(Attachment.SUBTYPE)
+                                .startObject(JsonMessageConstants.Attachment.SUBTYPE)
                                     .field(TYPE, KEYWORD)
                                 .endObject()
-                                .startObject(Attachment.FILE_EXTENSION)
+                                .startObject(JsonMessageConstants.Attachment.FILE_EXTENSION)
                                     .field(TYPE, KEYWORD)
                                 .endObject()
-                                .startObject(Attachment.CONTENT_DISPOSITION)
+                                .startObject(JsonMessageConstants.Attachment.CONTENT_DISPOSITION)
                                     .field(TYPE, KEYWORD)
                                 .endObject()
                             .endObject()
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.mailbox.elasticsearch.v7.events;
+package org.apache.james.mailbox.opensearch.events;
 
 import static com.google.common.collect.ImmutableList.toImmutableList;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.IS_ANSWERED;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.IS_DELETED;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.IS_DRAFT;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.IS_FLAGGED;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.IS_RECENT;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.IS_UNREAD;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.MAILBOX_ID;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.MESSAGE_ID;
-import static org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants.UID;
-import static org.elasticsearch.index.query.QueryBuilders.termQuery;
+import static org.apache.james.mailbox.opensearch.json.JsonMessageConstants.IS_ANSWERED;
+import static org.apache.james.mailbox.opensearch.json.JsonMessageConstants.IS_DELETED;
+import static org.apache.james.mailbox.opensearch.json.JsonMessageConstants.IS_DRAFT;
+import static org.apache.james.mailbox.opensearch.json.JsonMessageConstants.IS_FLAGGED;
+import static org.apache.james.mailbox.opensearch.json.JsonMessageConstants.IS_RECENT;
+import static org.apache.james.mailbox.opensearch.json.JsonMessageConstants.IS_UNREAD;
+import static org.apache.james.mailbox.opensearch.json.JsonMessageConstants.MAILBOX_ID;
+import static org.apache.james.mailbox.opensearch.json.JsonMessageConstants.MESSAGE_ID;
+import static org.apache.james.mailbox.opensearch.json.JsonMessageConstants.UID;
+import static org.opensearch.index.query.QueryBuilders.termQuery;
 
 import java.util.Collection;
 import java.util.EnumSet;
@@ -41,10 +41,10 @@ import javax.inject.Inject;
 import javax.inject.Named;
 import javax.mail.Flags;
 
-import org.apache.james.backends.es.v7.DocumentId;
-import org.apache.james.backends.es.v7.ElasticSearchIndexer;
-import org.apache.james.backends.es.v7.RoutingKey;
-import org.apache.james.backends.es.v7.UpdatedRepresentation;
+import org.apache.james.backends.opensearch.DocumentId;
+import org.apache.james.backends.opensearch.ElasticSearchIndexer;
+import org.apache.james.backends.opensearch.RoutingKey;
+import org.apache.james.backends.opensearch.UpdatedRepresentation;
 import org.apache.james.events.Group;
 import org.apache.james.mailbox.FlagsBuilder;
 import org.apache.james.mailbox.MailboxManager.MessageCapabilities;
@@ -52,21 +52,21 @@ import org.apache.james.mailbox.MailboxManager.SearchCapabilities;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.MessageUid;
 import org.apache.james.mailbox.SessionProvider;
-import org.apache.james.mailbox.elasticsearch.v7.MailboxElasticSearchConstants;
-import org.apache.james.mailbox.elasticsearch.v7.json.MessageToElasticSearchJson;
-import org.apache.james.mailbox.elasticsearch.v7.search.ElasticSearchSearcher;
 import org.apache.james.mailbox.model.Mailbox;
 import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.model.MessageId;
 import org.apache.james.mailbox.model.SearchQuery;
 import org.apache.james.mailbox.model.UpdatedFlags;
+import org.apache.james.mailbox.opensearch.MailboxElasticSearchConstants;
+import org.apache.james.mailbox.opensearch.json.MessageToElasticSearchJson;
+import org.apache.james.mailbox.opensearch.search.ElasticSearchSearcher;
 import org.apache.james.mailbox.store.MailboxSessionMapperFactory;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.mailbox.store.search.ListeningMessageSearchIndex;
-import org.elasticsearch.action.get.GetResponse;
-import org.elasticsearch.common.document.DocumentField;
-import org.elasticsearch.index.query.TermQueryBuilder;
-import org.elasticsearch.search.SearchHit;
+import org.opensearch.action.get.GetResponse;
+import org.opensearch.common.document.DocumentField;
+import org.opensearch.index.query.TermQueryBuilder;
+import org.opensearch.search.SearchHit;
 import org.slf4j.Logger;
 import org.slf4j.LoggerFactory;
 
similarity index 97%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/EMailer.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/EMailer.java
index fcb480f5c6fd7dac020b3d2d667bb082aeed8e98..f299b0719e2888697957ba51f1af4be92bf78225 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.json;
+package org.apache.james.mailbox.opensearch.json;
 
 import java.util.Objects;
 import java.util.Optional;
similarity index 97%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/EMailers.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/EMailers.java
index 98b8894a2ce20eeb262a6f143ff6088b90a8e59a..d1a572c86bb6d5b499427d50b3e3b7be8d2a9fce 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.json;
+package org.apache.james.mailbox.opensearch.json;
 
 import java.util.Set;
 import java.util.stream.Collectors;
similarity index 99%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/HeaderCollection.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/HeaderCollection.java
index 6a776398b452fd3e3a5d7fea5d0c240eb6f017c3..6055b2412a94bc831af548cbb9118b444e088290 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.json;
+package org.apache.james.mailbox.opensearch.json;
 
 import java.time.ZonedDateTime;
 import java.util.List;
similarity index 99%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/IndexableMessage.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/IndexableMessage.java
index d224b43d56daff63b6a0b14b002616c431282a28..774b9efb06e0ead3760ec1644ae1d5caa1a66dfd 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.json;
+package org.apache.james.mailbox.opensearch.json;
 
 import java.io.IOException;
 import java.time.Instant;
@@ -28,9 +28,9 @@ import java.util.List;
 import java.util.Optional;
 
 import org.apache.james.mailbox.ModSeq;
-import org.apache.james.mailbox.elasticsearch.v7.IndexAttachments;
 import org.apache.james.mailbox.extractor.TextExtractor;
 import org.apache.james.mailbox.model.MessageAttachmentMetadata;
+import org.apache.james.mailbox.opensearch.IndexAttachments;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 import org.apache.james.mailbox.store.search.SearchUtil;
 import org.apache.james.mime4j.MimeException;
similarity index 97%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/JsonMessageConstants.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/JsonMessageConstants.java
index 4883f1243ecb774bcec4c46b1a6eeaa62afb21a0..c77cf55639048b3642e130e871da221d145883e2 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.json;
+package org.apache.james.mailbox.opensearch.json;
 
 public interface JsonMessageConstants {
 
similarity index 96%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/MessageToElasticSearchJson.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/MessageToElasticSearchJson.java
index 564d7500836b8da8cc2a94ebac9b2b332c2137cb..71ab76e7bca44bfda56a9a66df9377c19bdfbfd9 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.json;
+package org.apache.james.mailbox.opensearch.json;
 
 import java.time.ZoneId;
 
@@ -25,8 +25,8 @@ import javax.inject.Inject;
 import javax.mail.Flags;
 
 import org.apache.james.mailbox.ModSeq;
-import org.apache.james.mailbox.elasticsearch.v7.IndexAttachments;
 import org.apache.james.mailbox.extractor.TextExtractor;
+import org.apache.james.mailbox.opensearch.IndexAttachments;
 import org.apache.james.mailbox.store.mail.model.MailboxMessage;
 
 import com.fasterxml.jackson.core.JsonProcessingException;
similarity index 97%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/MessageUpdateJson.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/MessageUpdateJson.java
index 4731ee38fc8b6596e4c0a05c868246e7f1f69c7f..0da0d8cd4f157c8d69f197501574ef68477ca2db 100644 (file)
@@ -19,7 +19,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.json;
+package org.apache.james.mailbox.opensearch.json;
 
 import javax.mail.Flags;
 
similarity index 99%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/MimePart.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/MimePart.java
index 8a286b057d26724828fe0a07a3e8c19fcbde3283..8adf2d8d458192214a50a269f5fa80a45a406552 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.json;
+package org.apache.james.mailbox.opensearch.json;
 
 import java.io.ByteArrayInputStream;
 import java.io.InputStream;
similarity index 97%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/MimePartContainerBuilder.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/MimePartContainerBuilder.java
index 5e4fb1ee896cdbe631af35e3ebf4976a4f0c9860..be742dea292fd6c9609c910243c2b13333bdddcd 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.json;
+package org.apache.james.mailbox.opensearch.json;
 
 import java.io.InputStream;
 import java.nio.charset.Charset;
similarity index 99%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/MimePartParser.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/MimePartParser.java
index ef6c18f50f9de6f9761b1a6d84017f7c57f16fc9..bf4ebe10d499bd80abd628ac14cdc08b31733758 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.json;
+package org.apache.james.mailbox.opensearch.json;
 
 import java.io.IOException;
 import java.nio.charset.Charset;
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.json;
+package org.apache.james.mailbox.opensearch.json;
 
 import java.io.InputStream;
 import java.nio.charset.Charset;
similarity index 95%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/SerializableMessage.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/SerializableMessage.java
index f49a4ef5943eb9d200627e1f5983eae1e98a7efa..e91a295066ea97f0f7bc77666b11a13fd59aeb07 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.json;
+package org.apache.james.mailbox.opensearch.json;
 
 public interface SerializableMessage {
 
similarity index 97%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/json/Subjects.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/json/Subjects.java
index a7fcfeb08c833564b6fbd2055491b050fdefcc16..3a8600521b7270d40e8974271b3d683c9d45ceb2 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.json;
+package org.apache.james.mailbox.opensearch.json;
 
 import java.util.Set;
 
similarity index 94%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/query/CriterionConverter.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/query/CriterionConverter.java
index a79f5657971979c06dced2a05dcc1b39770a5627..1e172ac44620c9db50ccffca5025c4d31d841ce1 100644 (file)
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.query;
+package org.apache.james.mailbox.opensearch.query;
 
-import static org.apache.james.backends.es.v7.IndexCreationFactory.RAW;
-import static org.elasticsearch.index.query.QueryBuilders.boolQuery;
-import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;
-import static org.elasticsearch.index.query.QueryBuilders.matchQuery;
-import static org.elasticsearch.index.query.QueryBuilders.nestedQuery;
-import static org.elasticsearch.index.query.QueryBuilders.rangeQuery;
-import static org.elasticsearch.index.query.QueryBuilders.termQuery;
+import static org.apache.james.backends.opensearch.IndexCreationFactory.RAW;
+import static org.opensearch.index.query.QueryBuilders.boolQuery;
+import static org.opensearch.index.query.QueryBuilders.matchAllQuery;
+import static org.opensearch.index.query.QueryBuilders.matchQuery;
+import static org.opensearch.index.query.QueryBuilders.nestedQuery;
+import static org.opensearch.index.query.QueryBuilders.rangeQuery;
+import static org.opensearch.index.query.QueryBuilders.termQuery;
 
 import java.time.format.DateTimeFormatter;
 import java.util.Arrays;
@@ -39,15 +39,15 @@ import java.util.stream.Stream;
 
 import javax.mail.Flags;
 
-import org.apache.james.mailbox.elasticsearch.v7.json.HeaderCollection;
-import org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants;
 import org.apache.james.mailbox.model.SearchQuery;
 import org.apache.james.mailbox.model.SearchQuery.Criterion;
 import org.apache.james.mailbox.model.SearchQuery.HeaderOperator;
+import org.apache.james.mailbox.opensearch.json.HeaderCollection;
+import org.apache.james.mailbox.opensearch.json.JsonMessageConstants;
 import org.apache.lucene.search.join.ScoreMode;
-import org.elasticsearch.index.query.BoolQueryBuilder;
-import org.elasticsearch.index.query.QueryBuilder;
-import org.elasticsearch.index.query.QueryBuilders;
+import org.opensearch.index.query.BoolQueryBuilder;
+import org.opensearch.index.query.QueryBuilder;
+import org.opensearch.index.query.QueryBuilders;
 
 public class CriterionConverter {
 
similarity index 98%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/query/DateResolutionFormatter.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/query/DateResolutionFormatter.java
index 8548e27684c72b310618c0123c504b2be8a69d18..3c3a78384fb9697542a4ac3c72743d79641701e5 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.query;
+package org.apache.james.mailbox.opensearch.query;
 
 import java.time.ZoneId;
 import java.time.ZonedDateTime;
similarity index 88%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/query/QueryConverter.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/query/QueryConverter.java
index 5dde6ad0993bd53c214292a5e63ce12769883911..1f6a34cf7eb0a1440b0f8d4353b68bc2849ad82b 100644 (file)
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.query;
+package org.apache.james.mailbox.opensearch.query;
 
-import static org.elasticsearch.index.query.QueryBuilders.boolQuery;
-import static org.elasticsearch.index.query.QueryBuilders.termsQuery;
+import static org.opensearch.index.query.QueryBuilders.boolQuery;
+import static org.opensearch.index.query.QueryBuilders.termsQuery;
 
 import java.util.Collection;
 import java.util.List;
@@ -28,11 +28,11 @@ import java.util.Optional;
 
 import javax.inject.Inject;
 
-import org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants;
 import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.model.SearchQuery;
-import org.elasticsearch.index.query.BoolQueryBuilder;
-import org.elasticsearch.index.query.QueryBuilder;
+import org.apache.james.mailbox.opensearch.json.JsonMessageConstants;
+import org.opensearch.index.query.BoolQueryBuilder;
+import org.opensearch.index.query.QueryBuilder;
 
 import com.google.common.collect.ImmutableList;
 
similarity index 89%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/query/SortConverter.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/query/SortConverter.java
index 48db609fb5e20b5581dbe8dfddbc6a711b037a66..e1216a951f9881c3395ebed4da40d7ab8821a3a0 100644 (file)
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.query;
+package org.apache.james.mailbox.opensearch.query;
 
-import org.apache.james.backends.es.v7.IndexCreationFactory;
-import org.apache.james.mailbox.elasticsearch.v7.json.JsonMessageConstants;
+import org.apache.james.backends.opensearch.IndexCreationFactory;
 import org.apache.james.mailbox.model.SearchQuery;
-import org.elasticsearch.search.sort.FieldSortBuilder;
-import org.elasticsearch.search.sort.SortBuilders;
-import org.elasticsearch.search.sort.SortMode;
-import org.elasticsearch.search.sort.SortOrder;
+import org.apache.james.mailbox.opensearch.json.JsonMessageConstants;
+import org.opensearch.search.sort.FieldSortBuilder;
+import org.opensearch.search.sort.SortBuilders;
+import org.opensearch.search.sort.SortMode;
+import org.opensearch.search.sort.SortOrder;
 
 public class SortConverter {
 
similarity index 85%
rename from mailbox/elasticsearch-v7/src/main/java/org/apache/james/mailbox/elasticsearch/v7/search/ElasticSearchSearcher.java
rename to mailbox/opensearch/src/main/java/org/apache/james/mailbox/opensearch/search/ElasticSearchSearcher.java
index c709de687a971383e586647be06aad94872f7806..accd1b0c41a9802b2799d768f290f7c9029166d8 100644 (file)
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.search;
+package org.apache.james.mailbox.opensearch.search;
 
 import java.util.Collection;
 import java.util.List;
 import java.util.Optional;
 
-import org.apache.james.backends.es.v7.AliasName;
-import org.apache.james.backends.es.v7.ReactorElasticSearchClient;
-import org.apache.james.backends.es.v7.ReadAliasName;
-import org.apache.james.backends.es.v7.RoutingKey;
-import org.apache.james.backends.es.v7.search.ScrolledSearch;
-import org.apache.james.mailbox.elasticsearch.v7.query.QueryConverter;
-import org.apache.james.mailbox.elasticsearch.v7.query.SortConverter;
+import org.apache.james.backends.opensearch.AliasName;
+import org.apache.james.backends.opensearch.ReactorElasticSearchClient;
+import org.apache.james.backends.opensearch.ReadAliasName;
+import org.apache.james.backends.opensearch.RoutingKey;
+import org.apache.james.backends.opensearch.search.ScrolledSearch;
 import org.apache.james.mailbox.model.MailboxId;
 import org.apache.james.mailbox.model.SearchQuery;
-import org.elasticsearch.action.search.SearchRequest;
-import org.elasticsearch.common.unit.TimeValue;
-import org.elasticsearch.search.SearchHit;
-import org.elasticsearch.search.builder.SearchSourceBuilder;
+import org.apache.james.mailbox.opensearch.query.QueryConverter;
+import org.apache.james.mailbox.opensearch.query.SortConverter;
+import org.opensearch.action.search.SearchRequest;
+import org.opensearch.common.unit.TimeValue;
+import org.opensearch.search.SearchHit;
+import org.opensearch.search.builder.SearchSourceBuilder;
 
 import reactor.core.publisher.Flux;
 
similarity index 95%
rename from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/ElasticSearchIntegrationTest.java
rename to mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/ElasticSearchIntegrationTest.java
index 0c0eca2818cba7aafdc638012ea4477f45afe3f7..d70a4c71ac959edacc8a9ae5d1a3ad0a190bd1e1 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7;
+package org.apache.james.mailbox.opensearch;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.awaitility.Durations.ONE_HUNDRED_MILLISECONDS;
@@ -27,17 +27,17 @@ import java.nio.charset.StandardCharsets;
 import java.time.ZoneId;
 import java.util.List;
 
-import org.apache.james.backends.es.v7.DockerElasticSearchExtension;
-import org.apache.james.backends.es.v7.ElasticSearchIndexer;
-import org.apache.james.backends.es.v7.ReactorElasticSearchClient;
+import org.apache.james.backends.opensearch.DockerElasticSearchExtension;
+import org.apache.james.backends.opensearch.ElasticSearchIndexer;
+import org.apache.james.backends.opensearch.ReactorElasticSearchClient;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.MailboxSessionUtil;
 import org.apache.james.mailbox.MessageManager;
-import org.apache.james.mailbox.elasticsearch.v7.events.ElasticSearchListeningMessageSearchIndex;
-import org.apache.james.mailbox.elasticsearch.v7.json.MessageToElasticSearchJson;
-import org.apache.james.mailbox.elasticsearch.v7.query.CriterionConverter;
-import org.apache.james.mailbox.elasticsearch.v7.query.QueryConverter;
-import org.apache.james.mailbox.elasticsearch.v7.search.ElasticSearchSearcher;
+import org.apache.james.mailbox.opensearch.events.ElasticSearchListeningMessageSearchIndex;
+import org.apache.james.mailbox.opensearch.json.MessageToElasticSearchJson;
+import org.apache.james.mailbox.opensearch.query.CriterionConverter;
+import org.apache.james.mailbox.opensearch.query.QueryConverter;
+import org.apache.james.mailbox.opensearch.search.ElasticSearchSearcher;
 import org.apache.james.mailbox.inmemory.InMemoryMessageId;
 import org.apache.james.mailbox.inmemory.manager.InMemoryIntegrationResources;
 import org.apache.james.mailbox.model.ComposedMessageId;
@@ -57,11 +57,11 @@ import org.apache.james.util.ClassLoaderUtils;
 import org.awaitility.Awaitility;
 import org.awaitility.Durations;
 import org.awaitility.core.ConditionFactory;
-import org.elasticsearch.action.search.SearchRequest;
-import org.elasticsearch.client.RequestOptions;
-import org.elasticsearch.index.query.QueryBuilder;
-import org.elasticsearch.index.query.QueryBuilders;
-import org.elasticsearch.search.builder.SearchSourceBuilder;
+import org.opensearch.action.search.SearchRequest;
+import org.opensearch.client.RequestOptions;
+import org.opensearch.index.query.QueryBuilder;
+import org.opensearch.index.query.QueryBuilders;
+import org.opensearch.search.builder.SearchSourceBuilder;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.Disabled;
 import org.junit.jupiter.api.Test;
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7;
+package org.apache.james.mailbox.opensearch;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
 import org.apache.commons.configuration2.PropertiesConfiguration;
-import org.apache.james.backends.es.v7.IndexName;
-import org.apache.james.backends.es.v7.ReadAliasName;
-import org.apache.james.backends.es.v7.WriteAliasName;
+import org.apache.james.backends.opensearch.IndexName;
+import org.apache.james.backends.opensearch.ReadAliasName;
+import org.apache.james.backends.opensearch.WriteAliasName;
 import org.junit.jupiter.api.Test;
 
 import nl.jqno.equalsverifier.EqualsVerifier;
similarity index 93%
rename from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/MailboxIdRoutingKeyFactoryTest.java
rename to mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/MailboxIdRoutingKeyFactoryTest.java
index 96453214e28d628bacf6c74ada2428c3f2223c22..4714c243d3ecddfbcb55283c4a1909183f46e3ec 100644 (file)
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7;
+package org.apache.james.mailbox.opensearch;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
-import org.apache.james.backends.es.v7.RoutingKey;
+import org.apache.james.backends.opensearch.RoutingKey;
 import org.apache.james.mailbox.model.TestId;
 import org.junit.jupiter.api.Test;
 
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.mailbox.elasticsearch.v7.events;
+package org.apache.james.mailbox.opensearch.events;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatCode;
@@ -31,9 +31,9 @@ import java.util.Date;
 
 import javax.mail.Flags;
 
-import org.apache.james.backends.es.v7.DockerElasticSearchExtension;
-import org.apache.james.backends.es.v7.ElasticSearchIndexer;
-import org.apache.james.backends.es.v7.ReactorElasticSearchClient;
+import org.apache.james.backends.opensearch.DockerElasticSearchExtension;
+import org.apache.james.backends.opensearch.ElasticSearchIndexer;
+import org.apache.james.backends.opensearch.ReactorElasticSearchClient;
 import org.apache.james.core.Username;
 import org.apache.james.events.Group;
 import org.apache.james.mailbox.Authorizator;
@@ -41,14 +41,6 @@ import org.apache.james.mailbox.DefaultMailboxes;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.MessageUid;
 import org.apache.james.mailbox.ModSeq;
-import org.apache.james.mailbox.elasticsearch.v7.IndexAttachments;
-import org.apache.james.mailbox.elasticsearch.v7.MailboxElasticSearchConstants;
-import org.apache.james.mailbox.elasticsearch.v7.MailboxIdRoutingKeyFactory;
-import org.apache.james.mailbox.elasticsearch.v7.MailboxIndexCreationUtil;
-import org.apache.james.mailbox.elasticsearch.v7.json.MessageToElasticSearchJson;
-import org.apache.james.mailbox.elasticsearch.v7.query.CriterionConverter;
-import org.apache.james.mailbox.elasticsearch.v7.query.QueryConverter;
-import org.apache.james.mailbox.elasticsearch.v7.search.ElasticSearchSearcher;
 import org.apache.james.mailbox.extractor.ParsedContent;
 import org.apache.james.mailbox.extractor.TextExtractor;
 import org.apache.james.mailbox.inmemory.InMemoryMailboxSessionMapperFactory;
@@ -68,6 +60,14 @@ import org.apache.james.mailbox.model.TestMessageId;
 import org.apache.james.mailbox.model.ThreadId;
 import org.apache.james.mailbox.model.UidValidity;
 import org.apache.james.mailbox.model.UpdatedFlags;
+import org.apache.james.mailbox.opensearch.IndexAttachments;
+import org.apache.james.mailbox.opensearch.MailboxElasticSearchConstants;
+import org.apache.james.mailbox.opensearch.MailboxIdRoutingKeyFactory;
+import org.apache.james.mailbox.opensearch.MailboxIndexCreationUtil;
+import org.apache.james.mailbox.opensearch.json.MessageToElasticSearchJson;
+import org.apache.james.mailbox.opensearch.query.CriterionConverter;
+import org.apache.james.mailbox.opensearch.query.QueryConverter;
+import org.apache.james.mailbox.opensearch.search.ElasticSearchSearcher;
 import org.apache.james.mailbox.store.FakeAuthenticator;
 import org.apache.james.mailbox.store.FakeAuthorizator;
 import org.apache.james.mailbox.store.MailboxSessionMapperFactory;
@@ -80,15 +80,15 @@ import org.apache.james.mailbox.store.search.ListeningMessageSearchIndexContract
 import org.awaitility.Awaitility;
 import org.awaitility.Durations;
 import org.awaitility.core.ConditionFactory;
-import org.elasticsearch.action.search.SearchRequest;
-import org.elasticsearch.client.RequestOptions;
-import org.elasticsearch.index.query.QueryBuilder;
-import org.elasticsearch.index.query.QueryBuilders;
-import org.elasticsearch.search.builder.SearchSourceBuilder;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Nested;
 import org.junit.jupiter.api.Test;
 import org.junit.jupiter.api.extension.RegisterExtension;
+import org.opensearch.action.search.SearchRequest;
+import org.opensearch.client.RequestOptions;
+import org.opensearch.index.query.QueryBuilder;
+import org.opensearch.index.query.QueryBuilders;
+import org.opensearch.search.builder.SearchSourceBuilder;
 
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
@@ -208,7 +208,7 @@ class ElasticSearchListeningMessageSearchIndexTest {
 
     @Test
     void deserializeElasticSearchListeningMessageSearchIndexGroup() throws Exception {
-        assertThat(Group.deserialize("org.apache.james.mailbox.elasticsearch.v7.events.ElasticSearchListeningMessageSearchIndex$ElasticSearchListeningMessageSearchIndexGroup"))
+        assertThat(Group.deserialize("org.apache.james.mailbox.opensearch.events.ElasticSearchListeningMessageSearchIndex$ElasticSearchListeningMessageSearchIndexGroup"))
             .isEqualTo(new ElasticSearchListeningMessageSearchIndex.ElasticSearchListeningMessageSearchIndexGroup());
     }
     
similarity index 96%
rename from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/json/EMailerTest.java
rename to mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/json/EMailerTest.java
index 2ace5ec5309980ba8ff65a5b7b0e9e899a56f8df..48c28936e623b1f8d513d5027f17217a0c0b359a 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.json;
+package org.apache.james.mailbox.opensearch.json;
 
 import org.junit.jupiter.api.Test;
 
similarity index 97%
rename from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/json/EMailersTest.java
rename to mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/json/EMailersTest.java
index 93e5800f85874707d25dcd40cfb8033db1fa8a92..8ca87744e3f183d71b6e1da4798d34f0a514aa52 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.json;
+package org.apache.james.mailbox.opensearch.json;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
similarity index 97%
rename from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/json/FieldImpl.java
rename to mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/json/FieldImpl.java
index 10fc337d26c2831549012f7ec94c64f8c18a1087..6a7b25340b77741ac999df282732cebc42bf74a9 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.json;
+package org.apache.james.mailbox.opensearch.json;
 
 import java.util.Objects;
 
similarity index 99%
rename from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/json/HeaderCollectionTest.java
rename to mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/json/HeaderCollectionTest.java
index d8c3f4e141365ef80c0b1978b6921affec162689..c8fee9ca85b03a6446fffea0156fb782c0eaf48c 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.json;
+package org.apache.james.mailbox.opensearch.json;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
similarity index 99%
rename from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/json/IndexableMessageTest.java
rename to mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/json/IndexableMessageTest.java
index c51cdb4929c4d5f8accbe4efea216050a6a03dac..f242cc4cf1ab3928ec8f926a91f3ccb1494d528f 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.json;
+package org.apache.james.mailbox.opensearch.json;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.mockito.ArgumentMatchers.any;
@@ -32,7 +32,7 @@ import javax.mail.Flags;
 
 import org.apache.james.mailbox.MessageUid;
 import org.apache.james.mailbox.ModSeq;
-import org.apache.james.mailbox.elasticsearch.v7.IndexAttachments;
+import org.apache.james.mailbox.opensearch.IndexAttachments;
 import org.apache.james.mailbox.extractor.ParsedContent;
 import org.apache.james.mailbox.extractor.TextExtractor;
 import org.apache.james.mailbox.inmemory.InMemoryMessageId;
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.json;
+package org.apache.james.mailbox.opensearch.json;
 
 import static net.javacrumbs.jsonunit.assertj.JsonAssertions.assertThatJson;
 import static net.javacrumbs.jsonunit.core.Option.IGNORING_ARRAY_ORDER;
@@ -36,7 +36,7 @@ import org.apache.james.core.Username;
 import org.apache.james.mailbox.FlagsBuilder;
 import org.apache.james.mailbox.MessageUid;
 import org.apache.james.mailbox.ModSeq;
-import org.apache.james.mailbox.elasticsearch.v7.IndexAttachments;
+import org.apache.james.mailbox.opensearch.IndexAttachments;
 import org.apache.james.mailbox.extractor.TextExtractor;
 import org.apache.james.mailbox.model.ByteContent;
 import org.apache.james.mailbox.model.MessageId;
similarity index 97%
rename from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/json/MimePartTest.java
rename to mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/json/MimePartTest.java
index 072e8d493bd529a71d029d1c4b9e9913406bf640..38e7246e2a14a996d616a441a6158a5d50c21792 100644 (file)
@@ -16,7 +16,7 @@
  * specific language governing permissions and limitations      *
  * under the License.                                           *
  ****************************************************************/
-package org.apache.james.mailbox.elasticsearch.v7.json;
+package org.apache.james.mailbox.opensearch.json;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
similarity index 97%
rename from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/json/SubjectsTest.java
rename to mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/json/SubjectsTest.java
index 67898e77db36ebfcf7c91499e27405d3572ad3c1..7779df597ba8d7ee94e8a1008e345aca5160fa07 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.json;
+package org.apache.james.mailbox.opensearch.json;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.query;
+package org.apache.james.mailbox.opensearch.query;
 
 import static org.assertj.core.api.Assertions.assertThat;
 
similarity index 97%
rename from mailbox/elasticsearch-v7/src/test/java/org/apache/james/mailbox/elasticsearch/v7/query/SearchQueryTest.java
rename to mailbox/opensearch/src/test/java/org/apache/james/mailbox/opensearch/query/SearchQueryTest.java
index 4b197357472d0d11c90af5d5152b623e1040972f..ec6eee36ae11ba3737d9c2a685c583f6d8f80270 100644 (file)
@@ -17,7 +17,7 @@
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.query;
+package org.apache.james.mailbox.opensearch.query;
 
 import static org.assertj.core.api.Assertions.assertThatThrownBy;
 
@@ -18,7 +18,7 @@
  * under the License.                                           *
  ***************************************************************/
 
-package org.apache.james.mailbox.elasticsearch.v7.search;
+package org.apache.james.mailbox.opensearch.search;
 
 import static org.assertj.core.api.Assertions.assertThat;
 import static org.awaitility.Durations.ONE_HUNDRED_MILLISECONDS;
@@ -29,21 +29,21 @@ import java.time.ZoneId;
 import java.util.List;
 import java.util.stream.IntStream;
 
-import org.apache.james.backends.es.v7.DockerElasticSearchExtension;
-import org.apache.james.backends.es.v7.ElasticSearchIndexer;
-import org.apache.james.backends.es.v7.ReactorElasticSearchClient;
+import org.apache.james.backends.opensearch.DockerElasticSearchExtension;
+import org.apache.james.backends.opensearch.ElasticSearchIndexer;
+import org.apache.james.backends.opensearch.ReactorElasticSearchClient;
 import org.apache.james.core.Username;
 import org.apache.james.mailbox.MailboxSession;
 import org.apache.james.mailbox.MailboxSessionUtil;
 import org.apache.james.mailbox.MessageManager;
-import org.apache.james.mailbox.elasticsearch.v7.IndexAttachments;
-import org.apache.james.mailbox.elasticsearch.v7.MailboxElasticSearchConstants;
-import org.apache.james.mailbox.elasticsearch.v7.MailboxIdRoutingKeyFactory;
-import org.apache.james.mailbox.elasticsearch.v7.MailboxIndexCreationUtil;
-import org.apache.james.mailbox.elasticsearch.v7.events.ElasticSearchListeningMessageSearchIndex;
-import org.apache.james.mailbox.elasticsearch.v7.json.MessageToElasticSearchJson;
-import org.apache.james.mailbox.elasticsearch.v7.query.CriterionConverter;
-import org.apache.james.mailbox.elasticsearch.v7.query.QueryConverter;
+import org.apache.james.mailbox.opensearch.IndexAttachments;
+import org.apache.james.mailbox.opensearch.MailboxElasticSearchConstants;
+import org.apache.james.mailbox.opensearch.MailboxIdRoutingKeyFactory;
+import org.apache.james.mailbox.opensearch.MailboxIndexCreationUtil;
+import org.apache.james.mailbox.opensearch.events.ElasticSearchListeningMessageSearchIndex;
+import org.apache.james.mailbox.opensearch.json.MessageToElasticSearchJson;
+import org.apache.james.mailbox.opensearch.query.CriterionConverter;
+import org.apache.james.mailbox.opensearch.query.QueryConverter;
 import org.apache.james.mailbox.inmemory.InMemoryMailboxManager;
 import org.apache.james.mailbox.inmemory.InMemoryMessageId;
 import org.apache.james.mailbox.inmemory.manager.InMemoryIntegrationResources;
@@ -62,11 +62,11 @@ import org.apache.james.mime4j.dom.Message;
 import org.awaitility.Awaitility;
 import org.awaitility.Durations;
 import org.awaitility.core.ConditionFactory;
-import org.elasticsearch.action.search.SearchRequest;
-import org.elasticsearch.client.RequestOptions;
-import org.elasticsearch.index.query.QueryBuilder;
-import org.elasticsearch.index.query.QueryBuilders;
-import org.elasticsearch.search.builder.SearchSourceBuilder;
+import org.opensearch.action.search.SearchRequest;
+import org.opensearch.client.RequestOptions;
+import org.opensearch.index.query.QueryBuilder;
+import org.opensearch.index.query.QueryBuilders;
+import org.opensearch.search.builder.SearchSourceBuilder;
 import org.junit.jupiter.api.AfterEach;
 import org.junit.jupiter.api.BeforeEach;
 import org.junit.jupiter.api.Test;
index 5a80c614b7da22089dade452c4c63ba9eb6d2383..241008342d6d47394edeacde9a8af2aa70da79a7 100644 (file)
@@ -37,8 +37,6 @@ import org.apache.james.task.TaskType;
 import com.google.common.collect.ImmutableList;
 import com.google.common.collect.ImmutableSet;
 
-import reactor.core.publisher.Flux;
-
 public class BlobStoreVaultGarbageCollectionTask implements Task {
 
     public static class AdditionalInformation implements TaskExecutionDetails.AdditionalInformation {
@@ -69,10 +67,9 @@ public class BlobStoreVaultGarbageCollectionTask implements Task {
     }
 
     static final TaskType TYPE = TaskType.of("deleted-messages-blob-store-based-garbage-collection");
-
-    private final Flux<BucketName> retentionOperation;
-    private final ZonedDateTime beginningOfRetentionPeriod;
     private final Collection<BucketName> deletedBuckets;
+    private final BlobStoreDeletedMessageVault deletedMessageVault;
+    private final ZonedDateTime beginningOfRetentionPeriod;
 
     public static class Factory {
         private final BlobStoreDeletedMessageVault deletedMessageVault;
@@ -89,13 +86,13 @@ public class BlobStoreVaultGarbageCollectionTask implements Task {
 
     private BlobStoreVaultGarbageCollectionTask(BlobStoreDeletedMessageVault deletedMessageVault) {
         this.beginningOfRetentionPeriod = deletedMessageVault.getBeginningOfRetentionPeriod();
-        this.retentionOperation = deletedMessageVault.deleteExpiredMessages(beginningOfRetentionPeriod);
+        this.deletedMessageVault = deletedMessageVault;
         this.deletedBuckets = new ConcurrentLinkedQueue<>();
     }
 
     @Override
     public Result run() {
-        retentionOperation
+        deletedMessageVault.deleteExpiredMessages(beginningOfRetentionPeriod)
             .doOnNext(deletedBuckets::add)
             .then()
             .block();
similarity index 92%
rename from mailbox/plugin/quota-search-elasticsearch-v7/pom.xml
rename to mailbox/plugin/quota-search-opensearch/pom.xml
index 709b9d16d05d61d9110dd8b81e4da0c7c70207ba..3d7118ad21f253faa21e0600cedfa0c26863e738 100644 (file)
         <relativePath>../../pom.xml</relativePath>
     </parent>
 
-    <artifactId>apache-james-mailbox-quota-search-elasticsearch-v7</artifactId>
-    <name>Apache James :: Mailbox :: Plugin :: Quota Search :: ElasticSearch</name>
-    <description>Apache James Mailbox ElasticSearch implementation for quota search</description>
+    <artifactId>apache-james-mailbox-quota-search-opensearch</artifactId>
+    <name>Apache James :: Mailbox :: Plugin :: Quota Search :: Opensearch</name>
+    <description>Apache James Mailbox OpenSearch implementation for quota search</description>
 
     <dependencies>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>apache-james-backends-es-v7</artifactId>
+            <artifactId>apache-james-backends-opensearch</artifactId>
         </dependency>
         <dependency>
             <groupId>${james.groupId}</groupId>
-            <artifactId>apache-james-backends-es-v7</artifactId>
+            <artifactId>apache-james-backends-opensearch</artifactId>
             <type>test-jar</type>
             <scope>test</scope>
         </dependency>
  * under the License.
  */
 
-package org.apache.james.quota.search.elasticsearch.v7;
+package org.apache.james.quota.search.opensearch;
 
 import java.util.Objects;
 import java.util.Optional;
 
 import org.apache.commons.configuration2.Configuration;
-import org.apache.james.backends.es.v7.IndexName;
-import org.apache.james.backends.es.v7.ReadAliasName;
-import org.apache.james.backends.es.v7.WriteAliasName;
+import org.apache.james.backends.opensearch.IndexName;
+import org.apache.james.backends.opensearch.ReadAliasName;
+import org.apache.james.backends.opensearch.WriteAliasName;
 
 public class ElasticSearchQuotaConfiguration {
 
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.quota.search.elasticsearch.v7;
-
-import static org.apache.james.quota.search.elasticsearch.v7.json.JsonMessageConstants.USER;
+package org.apache.james.quota.search.opensearch;
 
 import java.util.List;
 
-import org.apache.james.backends.es.v7.AliasName;
-import org.apache.james.backends.es.v7.ReactorElasticSearchClient;
-import org.apache.james.backends.es.v7.ReadAliasName;
-import org.apache.james.backends.es.v7.search.ScrolledSearch;
+import org.apache.james.backends.opensearch.AliasName;
+import org.apache.james.backends.opensearch.ReactorElasticSearchClient;
+import org.apache.james.backends.opensearch.ReadAliasName;
+import org.apache.james.backends.opensearch.search.ScrolledSearch;
 import org.apache.james.core.Username;
 import org.apache.james.quota.search.QuotaQuery;
 import org.apache.james.quota.search.QuotaSearcher;
-import org.elasticsearch.action.search.SearchRequest;
-import org.elasticsearch.client.RequestOptions;
-import org.elasticsearch.common.unit.TimeValue;
-import org.elasticsearch.search.SearchHit;
-import org.elasticsearch.search.builder.SearchSourceBuilder;
-import org.elasticsearch.search.sort.SortBuilders;
-import org.elasticsearch.search.sort.SortOrder;
+import org.apache.james.quota.search.opensearch.json.JsonMessageConstants;
+import org.opensearch.action.search.SearchRequest;
+import org.opensearch.client.RequestOptions;
+import org.opensearch.common.unit.TimeValue;
+import org.opensearch.search.SearchHit;
+import org.opensearch.search.builder.SearchSourceBuilder;
+import org.opensearch.search.sort.SortBuilders;
+import org.opensearch.search.sort.SortOrder;
 
 import com.google.common.collect.ImmutableList;
 
@@ -101,6 +100,6 @@ public class ElasticSearchQuotaSearcher implements QuotaSearcher {
     private SearchSourceBuilder searchSourceBuilder(QuotaQuery query) {
         return new SearchSourceBuilder()
             .query(quotaQueryConverter.from(query))
-            .sort(SortBuilders.fieldSort(USER).order(SortOrder.ASC));
+            .sort(SortBuilders.fieldSort(JsonMessageConstants.USER).order(SortOrder.ASC));
     }
 }
\ No newline at end of file
  * under the License.                                           *
  ****************************************************************/
 
-package org.apache.james.quota.search.elasticsearch.v7;
+package org.apache.james.quota.search.opensearch;
 
-import static org.apache.james.quota.search.elasticsearch.v7.json.JsonMessageConstants.DOMAIN;
-import static org.apache.james.quota.search.elasticsearch.v7.json.JsonMessageConstants.QUOTA_RATIO;
-import static org.elasticsearch.index.query.QueryBuilders.matchAllQuery;
-import static org.elasticsearch.index.query.QueryBuilders.rangeQuery;
-import static org.elasticsearch.index.query.QueryBuilders.termQuery;
+import static org.apache.james.quota.search.opensearch.json.JsonMessageConstants.DOMAIN;
+import static org.apache.james.quota.search.opensearch.json.JsonMessageConstants.QUOTA_RATIO;
+import static org.opensearch.index.query.QueryBuilders.matchAllQuery;
+import static org.opensearch.index.query.QueryBuilders.rangeQuery;
+import static org.opensearch.index.query.QueryBuilders.termQuery;
 
 import java.util.List;
 import java.util.Map;
@@ -35,10 +35,10 @@ import org.apache.james.quota.search.QuotaClause.HasDomain;
 import org.apache.james.quota.search.QuotaClause.LessThan;
 import org.apache.james.quota.search.QuotaClause.MoreThan;
 import org.apache.james.quota.search.QuotaQuery;
-import org.elasticsearch.index.query.BoolQueryBuilder;
-import org.elasticsearch.index.query.QueryBuilder;
-import org.elasticsearch.index.query.RangeQueryBuilder;
-import org.elasticsearch.index.query.TermQueryBuilder;
+import org.opensearch.index.query.BoolQueryBuilder;
+import org.opensearch.index.query.QueryBuilder;
+import org.opensearch.index.query.RangeQueryBuilder;
+import org.opensearch.ind