james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From btell...@apache.org
Subject [james-project] 14/24: JAMES-2708 blobstore.properties should now be blob.properties
Date Thu, 11 Apr 2019 00:33:45 GMT
This is an automated email from the ASF dual-hosted git repository.

btellier pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/james-project.git

commit 9ec1c690c5ecd3f804b62216be43d56c63460ade
Author: Benoit Tellier <btellier@linagora.com>
AuthorDate: Mon Apr 8 16:07:41 2019 +0700

    JAMES-2708 blobstore.properties should now be blob.properties
    
    Fallback for retro-compatibility to previous value.
---
 .../destination/conf/blob.properties}                                | 0
 .../destination/conf/blob.properties}                                | 0
 .../org/apache/james/modules/mailbox/ConfigurationComponent.java     | 5 ++++-
 .../java/org/apache/james/modules/BlobExportMechanismModule.java     | 2 +-
 .../org/apache/james/modules/LocalFileBlobExportMechanismModule.java | 2 +-
 .../james/modules/objectstorage/ObjectStorageDependenciesModule.java | 2 +-
 .../org/apache/james/modules/blobstore/BlobStoreChoosingModule.java  | 2 +-
 7 files changed, 8 insertions(+), 5 deletions(-)

diff --git a/dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/blobstore.properties
b/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/conf/blob.properties
similarity index 100%
rename from dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/blobstore.properties
rename to dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/conf/blob.properties
diff --git a/dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/conf/blobstore.properties
b/dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/blob.properties
similarity index 100%
rename from dockerfiles/run/guice/cassandra-rabbitmq-ldap/destination/conf/blobstore.properties
rename to dockerfiles/run/guice/cassandra-rabbitmq/destination/conf/blob.properties
diff --git a/server/container/guice/blob-api-guice/src/main/java/org/apache/james/modules/mailbox/ConfigurationComponent.java
b/server/container/guice/blob-api-guice/src/main/java/org/apache/james/modules/mailbox/ConfigurationComponent.java
index 4613f15..04f9fa5 100644
--- a/server/container/guice/blob-api-guice/src/main/java/org/apache/james/modules/mailbox/ConfigurationComponent.java
+++ b/server/container/guice/blob-api-guice/src/main/java/org/apache/james/modules/mailbox/ConfigurationComponent.java
@@ -20,5 +20,8 @@
 package org.apache.james.modules.mailbox;
 
 public interface ConfigurationComponent {
-    String NAME = "blobstore";
+    String NAME = "blob";
+    String LEGACY = "blobstore";
+
+    String[] NAMES = new String[] {NAME, LEGACY};
 }
diff --git a/server/container/guice/blob-export-guice/src/main/java/org/apache/james/modules/BlobExportMechanismModule.java
b/server/container/guice/blob-export-guice/src/main/java/org/apache/james/modules/BlobExportMechanismModule.java
index d228615..ae1d6c3 100644
--- a/server/container/guice/blob-export-guice/src/main/java/org/apache/james/modules/BlobExportMechanismModule.java
+++ b/server/container/guice/blob-export-guice/src/main/java/org/apache/james/modules/BlobExportMechanismModule.java
@@ -51,7 +51,7 @@ public class BlobExportMechanismModule extends AbstractModule {
     @Singleton
     BlobExportImplChoice provideChoice(PropertiesProvider propertiesProvider) throws ConfigurationException
{
         try {
-            Configuration configuration = propertiesProvider.getConfiguration(ConfigurationComponent.NAME);
+            Configuration configuration = propertiesProvider.getConfigurations(ConfigurationComponent.NAMES);
             return BlobExportImplChoice.from(configuration)
                 .orElseGet(() -> {
                     LOGGER.warn("No blob export mechanism defined. Defaulting to " + BlobExportImplChoice.LOCAL_FILE.getImplName());
diff --git a/server/container/guice/blob-export-guice/src/main/java/org/apache/james/modules/LocalFileBlobExportMechanismModule.java
b/server/container/guice/blob-export-guice/src/main/java/org/apache/james/modules/LocalFileBlobExportMechanismModule.java
index 7b2f046..fd67431 100644
--- a/server/container/guice/blob-export-guice/src/main/java/org/apache/james/modules/LocalFileBlobExportMechanismModule.java
+++ b/server/container/guice/blob-export-guice/src/main/java/org/apache/james/modules/LocalFileBlobExportMechanismModule.java
@@ -45,7 +45,7 @@ public class LocalFileBlobExportMechanismModule extends AbstractModule {
     @Provides
     LocalFileBlobExportMechanism.Configuration localFileExportConfiguration(PropertiesProvider
propertiesProvider) throws ConfigurationException {
         try {
-            Configuration configuration = propertiesProvider.getConfiguration(ConfigurationComponent.NAME);
+            Configuration configuration = propertiesProvider.getConfigurations(ConfigurationComponent.NAMES);
             return LocalFileBlobExportMechanism.Configuration.from(configuration)
                 .orElseGet(() -> {
                     LOGGER.warn("Missing LocalFileBlobExportMechanism configuration, using
default localFile blob exporting configuration");
diff --git a/server/container/guice/blob-objectstorage-guice/src/main/java/org/apache/james/modules/objectstorage/ObjectStorageDependenciesModule.java
b/server/container/guice/blob-objectstorage-guice/src/main/java/org/apache/james/modules/objectstorage/ObjectStorageDependenciesModule.java
index 56ec3cd..0d725ed 100644
--- a/server/container/guice/blob-objectstorage-guice/src/main/java/org/apache/james/modules/objectstorage/ObjectStorageDependenciesModule.java
+++ b/server/container/guice/blob-objectstorage-guice/src/main/java/org/apache/james/modules/objectstorage/ObjectStorageDependenciesModule.java
@@ -53,7 +53,7 @@ public class ObjectStorageDependenciesModule extends AbstractModule {
     @Singleton
     private ObjectStorageBlobConfiguration getObjectStorageConfiguration(PropertiesProvider
propertiesProvider) throws ConfigurationException {
         try {
-            Configuration configuration = propertiesProvider.getConfiguration(ConfigurationComponent.NAME);
+            Configuration configuration = propertiesProvider.getConfigurations(ConfigurationComponent.NAMES);
             return ObjectStorageBlobConfiguration.from(configuration);
         } catch (FileNotFoundException e) {
             throw new ConfigurationException(ConfigurationComponent.NAME + " configuration
was not found");
diff --git a/server/container/guice/cassandra-rabbitmq-guice/src/main/java/org/apache/james/modules/blobstore/BlobStoreChoosingModule.java
b/server/container/guice/cassandra-rabbitmq-guice/src/main/java/org/apache/james/modules/blobstore/BlobStoreChoosingModule.java
index a8be32e7..a08fd24 100644
--- a/server/container/guice/cassandra-rabbitmq-guice/src/main/java/org/apache/james/modules/blobstore/BlobStoreChoosingModule.java
+++ b/server/container/guice/cassandra-rabbitmq-guice/src/main/java/org/apache/james/modules/blobstore/BlobStoreChoosingModule.java
@@ -61,7 +61,7 @@ public class BlobStoreChoosingModule extends AbstractModule {
     @Singleton
     BlobStoreChoosingConfiguration provideChoosingConfiguration(PropertiesProvider propertiesProvider)
throws ConfigurationException {
         try {
-            Configuration configuration = propertiesProvider.getConfiguration(ConfigurationComponent.NAME);
+            Configuration configuration = propertiesProvider.getConfigurations(ConfigurationComponent.NAMES);
             return BlobStoreChoosingConfiguration.from(configuration);
         } catch (FileNotFoundException e) {
             LOGGER.warn("Could not find " + ConfigurationComponent.NAME + " configuration
file, using cassandra blobstore as the default");


---------------------------------------------------------------------
To unsubscribe, e-mail: server-dev-unsubscribe@james.apache.org
For additional commands, e-mail: server-dev-help@james.apache.org


Mime
View raw message