james-server-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From adup...@apache.org
Subject [2/5] james-project git commit: JAMES-2525 refactor ObjectStorageBlobsDAOBuilder as a staged builder
Date Thu, 08 Nov 2018 10:58:09 GMT
JAMES-2525 refactor ObjectStorageBlobsDAOBuilder as a staged builder


Project: http://git-wip-us.apache.org/repos/asf/james-project/repo
Commit: http://git-wip-us.apache.org/repos/asf/james-project/commit/22d30e52
Tree: http://git-wip-us.apache.org/repos/asf/james-project/tree/22d30e52
Diff: http://git-wip-us.apache.org/repos/asf/james-project/diff/22d30e52

Branch: refs/heads/master
Commit: 22d30e52b7e4263a256d482a17e6fc00ad9bed55
Parents: aab0d13
Author: Matthieu Baechler <matthieu@apache.org>
Authored: Wed Nov 7 17:30:26 2018 +0100
Committer: Matthieu Baechler <matthieu@apache.org>
Committed: Wed Nov 7 17:30:26 2018 +0100

----------------------------------------------------------------------
 .../objectstorage/ObjectStorageBlobsDAO.java    |  6 +-
 .../ObjectStorageBlobsDAOBuilder.java           | 73 +++++++++++---------
 .../swift/SwiftKeystone2ObjectStorage.java      |  4 +-
 .../swift/SwiftKeystone3ObjectStorage.java      |  4 +-
 .../swift/SwiftTempAuthObjectStorage.java       |  4 +-
 .../ObjectStorageBlobsDAOContract.java          |  2 +-
 .../ObjectStorageBlobsDAOTest.java              |  2 +-
 ...ystone2ObjectStorageBlobsDAOBuilderTest.java | 10 +--
 ...ystone3ObjectStorageBlobsDAOBuilderTest.java | 10 +--
 ...empAuthObjectStorageBlobsDAOBuilderTest.java | 10 +--
 .../ObjectStorageBlobsDAOProvider.java          |  6 +-
 .../guice/DockerSwiftTestRule.java              |  2 +-
 12 files changed, 75 insertions(+), 58 deletions(-)
----------------------------------------------------------------------


http://git-wip-us.apache.org/repos/asf/james-project/blob/22d30e52/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAO.java
----------------------------------------------------------------------
diff --git a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAO.java
b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAO.java
index 81fb3be..d6ab0ce 100644
--- a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAO.java
+++ b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAO.java
@@ -60,15 +60,15 @@ public class ObjectStorageBlobsDAO implements BlobStore {
         this.payloadCodec = payloadCodec;
     }
 
-    public static ObjectStorageBlobsDAOBuilder builder(SwiftTempAuthObjectStorage.Configuration
testConfig) {
+    public static ObjectStorageBlobsDAOBuilder.RequireContainerName builder(SwiftTempAuthObjectStorage.Configuration
testConfig) {
         return SwiftTempAuthObjectStorage.daoBuilder(testConfig);
     }
 
-    public static ObjectStorageBlobsDAOBuilder builder(SwiftKeystone2ObjectStorage.Configuration
testConfig) {
+    public static ObjectStorageBlobsDAOBuilder.RequireContainerName builder(SwiftKeystone2ObjectStorage.Configuration
testConfig) {
         return SwiftKeystone2ObjectStorage.daoBuilder(testConfig);
     }
 
-    public static ObjectStorageBlobsDAOBuilder builder(SwiftKeystone3ObjectStorage.Configuration
testConfig) {
+    public static ObjectStorageBlobsDAOBuilder.RequireContainerName builder(SwiftKeystone3ObjectStorage.Configuration
testConfig) {
         return SwiftKeystone3ObjectStorage.daoBuilder(testConfig);
     }
 

http://git-wip-us.apache.org/repos/asf/james-project/blob/22d30e52/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOBuilder.java
----------------------------------------------------------------------
diff --git a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOBuilder.java
b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOBuilder.java
index 25534d0..4e5f941 100644
--- a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOBuilder.java
+++ b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOBuilder.java
@@ -29,45 +29,56 @@ import com.google.common.annotations.VisibleForTesting;
 import com.google.common.base.Preconditions;
 
 public class ObjectStorageBlobsDAOBuilder {
-    private final Supplier<BlobStore> supplier;
-    private ContainerName containerName;
-    private BlobId.Factory blobIdFactory;
-    private Optional<PayloadCodec> payloadCodec;
-
-    public ObjectStorageBlobsDAOBuilder(Supplier<BlobStore> supplier) {
-        this.payloadCodec = Optional.empty();
-        this.supplier = supplier;
-    }
 
-    public ObjectStorageBlobsDAOBuilder container(ContainerName containerName) {
-        this.containerName = containerName;
-        return this;
+    public static RequireContainerName forBlobStore(Supplier<BlobStore> supplier) {
+        return containerName -> blobIdFactory -> new ReadyToBuild(supplier, blobIdFactory,
containerName);
     }
 
-    public ObjectStorageBlobsDAOBuilder blobIdFactory(BlobId.Factory blobIdFactory) {
-        this.blobIdFactory = blobIdFactory;
-        return this;
+    @FunctionalInterface
+    public interface RequireContainerName {
+        RequireBlobIdFactory container(ContainerName containerName);
     }
 
-    public ObjectStorageBlobsDAOBuilder payloadCodec(PayloadCodec payloadCodec) {
-        this.payloadCodec = Optional.of(payloadCodec);
-        return this;
-    }
-    
-    public ObjectStorageBlobsDAOBuilder payloadCodec(Optional<PayloadCodec> payloadCodec)
{
-        this.payloadCodec = payloadCodec;
-        return this;
+    @FunctionalInterface
+    public interface RequireBlobIdFactory {
+        ReadyToBuild blobIdFactory(BlobId.Factory blobIdFactory);
     }
 
-    public ObjectStorageBlobsDAO build() {
-        Preconditions.checkState(containerName != null);
-        Preconditions.checkState(blobIdFactory != null);
+    public static class ReadyToBuild {
 
-        return new ObjectStorageBlobsDAO(containerName, blobIdFactory, supplier.get(), payloadCodec.orElse(PayloadCodec.DEFAULT_CODEC));
-    }
+        private final Supplier<BlobStore> supplier;
+        private final ContainerName containerName;
+        private final BlobId.Factory blobIdFactory;
+        private Optional<PayloadCodec> payloadCodec;
+
+        public ReadyToBuild(Supplier<BlobStore> supplier, BlobId.Factory blobIdFactory,
ContainerName containerName) {
+            this.blobIdFactory = blobIdFactory;
+            this.containerName = containerName;
+            this.payloadCodec = Optional.empty();
+            this.supplier = supplier;
+        }
+
+        public ReadyToBuild payloadCodec(PayloadCodec payloadCodec) {
+            this.payloadCodec = Optional.of(payloadCodec);
+            return this;
+        }
 
-    @VisibleForTesting
-    Supplier<BlobStore> getSupplier() {
-        return supplier;
+        public ReadyToBuild payloadCodec(Optional<PayloadCodec> payloadCodec) {
+            this.payloadCodec = payloadCodec;
+            return this;
+        }
+
+        public ObjectStorageBlobsDAO build() {
+            Preconditions.checkState(containerName != null);
+            Preconditions.checkState(blobIdFactory != null);
+
+            return new ObjectStorageBlobsDAO(containerName, blobIdFactory, supplier.get(),
payloadCodec.orElse(PayloadCodec.DEFAULT_CODEC));
+        }
+
+        @VisibleForTesting
+        Supplier<BlobStore> getSupplier() {
+            return supplier;
+        }
     }
+
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/22d30e52/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/swift/SwiftKeystone2ObjectStorage.java
----------------------------------------------------------------------
diff --git a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/swift/SwiftKeystone2ObjectStorage.java
b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/swift/SwiftKeystone2ObjectStorage.java
index fcb1833..7269aef 100644
--- a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/swift/SwiftKeystone2ObjectStorage.java
+++ b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/swift/SwiftKeystone2ObjectStorage.java
@@ -43,8 +43,8 @@ public class SwiftKeystone2ObjectStorage {
     private static final Iterable<Module> JCLOUDS_MODULES =
         ImmutableSet.of(new SLF4JLoggingModule());
 
-    public static ObjectStorageBlobsDAOBuilder daoBuilder(Configuration testConfig) {
-        return new ObjectStorageBlobsDAOBuilder(new BlobStoreBuilder(testConfig));
+    public static ObjectStorageBlobsDAOBuilder.RequireContainerName daoBuilder(Configuration
testConfig) {
+        return ObjectStorageBlobsDAOBuilder.forBlobStore(new BlobStoreBuilder(testConfig));
     }
 
     public static Configuration.Builder configBuilder() {

http://git-wip-us.apache.org/repos/asf/james-project/blob/22d30e52/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/swift/SwiftKeystone3ObjectStorage.java
----------------------------------------------------------------------
diff --git a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/swift/SwiftKeystone3ObjectStorage.java
b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/swift/SwiftKeystone3ObjectStorage.java
index 6262eb9..276629e 100644
--- a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/swift/SwiftKeystone3ObjectStorage.java
+++ b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/swift/SwiftKeystone3ObjectStorage.java
@@ -45,8 +45,8 @@ public class SwiftKeystone3ObjectStorage {
     private static final Iterable<Module> JCLOUDS_MODULES =
         ImmutableSet.of(new SLF4JLoggingModule());
 
-    public static ObjectStorageBlobsDAOBuilder daoBuilder(Configuration testConfig) {
-        return new ObjectStorageBlobsDAOBuilder(new BlobStoreBuilder(testConfig));
+    public static ObjectStorageBlobsDAOBuilder.RequireContainerName daoBuilder(Configuration
testConfig) {
+        return ObjectStorageBlobsDAOBuilder.forBlobStore(new BlobStoreBuilder(testConfig));
     }
 
     public static Configuration.Builder configBuilder() {

http://git-wip-us.apache.org/repos/asf/james-project/blob/22d30e52/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/swift/SwiftTempAuthObjectStorage.java
----------------------------------------------------------------------
diff --git a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/swift/SwiftTempAuthObjectStorage.java
b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/swift/SwiftTempAuthObjectStorage.java
index 631d63d..747e983 100644
--- a/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/swift/SwiftTempAuthObjectStorage.java
+++ b/server/blob/blob-objectstorage/src/main/java/org/apache/james/blob/objectstorage/swift/SwiftTempAuthObjectStorage.java
@@ -44,8 +44,8 @@ public class SwiftTempAuthObjectStorage {
     private static final Iterable<Module> JCLOUDS_MODULES =
         ImmutableSet.of(new SLF4JLoggingModule());
 
-    public static ObjectStorageBlobsDAOBuilder daoBuilder(Configuration testConfig) {
-        return new ObjectStorageBlobsDAOBuilder(new BlobStoreBuilder(testConfig));
+    public static ObjectStorageBlobsDAOBuilder.RequireContainerName daoBuilder(Configuration
testConfig) {
+        return ObjectStorageBlobsDAOBuilder.forBlobStore(new BlobStoreBuilder(testConfig));
     }
 
     public static Configuration.Builder configBuilder() {

http://git-wip-us.apache.org/repos/asf/james-project/blob/22d30e52/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOContract.java
----------------------------------------------------------------------
diff --git a/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOContract.java
b/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOContract.java
index 36501f3..4c0a935 100644
--- a/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOContract.java
+++ b/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOContract.java
@@ -36,7 +36,7 @@ public interface ObjectStorageBlobsDAOContract {
 
     ContainerName containerName();
 
-    default void assertBlobsDAOCanStoreAndRetrieve(ObjectStorageBlobsDAOBuilder builder)
+    default void assertBlobsDAOCanStoreAndRetrieve(ObjectStorageBlobsDAOBuilder.ReadyToBuild
builder)
         throws InterruptedException, ExecutionException, TimeoutException {
         ObjectStorageBlobsDAO dao = builder.build();
         dao.createContainer(containerName());

http://git-wip-us.apache.org/repos/asf/james-project/blob/22d30e52/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOTest.java
----------------------------------------------------------------------
diff --git a/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOTest.java
b/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOTest.java
index 9a66875..83131c3 100644
--- a/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOTest.java
+++ b/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/ObjectStorageBlobsDAOTest.java
@@ -74,7 +74,7 @@ public class ObjectStorageBlobsDAOTest implements BlobStoreContract {
             .tempAuthHeaderPassName(PassHeaderName.of("X-Storage-Pass"))
             .build();
         BlobId.Factory blobIdFactory = blobIdFactory();
-        ObjectStorageBlobsDAOBuilder daoBuilder = ObjectStorageBlobsDAO
+        ObjectStorageBlobsDAOBuilder.ReadyToBuild daoBuilder = ObjectStorageBlobsDAO
             .builder(testConfig)
             .container(containerName)
             .blobIdFactory(blobIdFactory);

http://git-wip-us.apache.org/repos/asf/james-project/blob/22d30e52/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/swift/SwiftKeystone2ObjectStorageBlobsDAOBuilderTest.java
----------------------------------------------------------------------
diff --git a/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/swift/SwiftKeystone2ObjectStorageBlobsDAOBuilderTest.java
b/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/swift/SwiftKeystone2ObjectStorageBlobsDAOBuilderTest.java
index 36e01fe..ce676fa 100644
--- a/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/swift/SwiftKeystone2ObjectStorageBlobsDAOBuilderTest.java
+++ b/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/swift/SwiftKeystone2ObjectStorageBlobsDAOBuilderTest.java
@@ -64,8 +64,9 @@ class SwiftKeystone2ObjectStorageBlobsDAOBuilderTest implements ObjectStorageBlo
 
     @Test
     void containerNameIsMandatoryToBuildBlobsDAO() throws Exception {
-        ObjectStorageBlobsDAOBuilder builder = ObjectStorageBlobsDAO
+        ObjectStorageBlobsDAOBuilder.ReadyToBuild builder = ObjectStorageBlobsDAO
             .builder(testConfig)
+            .container(null)
             .blobIdFactory(new HashBlobId.Factory());
 
         assertThatThrownBy(builder::build).isInstanceOf(IllegalStateException.class);
@@ -73,16 +74,17 @@ class SwiftKeystone2ObjectStorageBlobsDAOBuilderTest implements ObjectStorageBlo
 
     @Test
     void blobIdFactoryIsMandatoryToBuildBlobsDAO() throws Exception {
-        ObjectStorageBlobsDAOBuilder builder = ObjectStorageBlobsDAO
+        ObjectStorageBlobsDAOBuilder.ReadyToBuild builder = ObjectStorageBlobsDAO
             .builder(testConfig)
-            .container(containerName);
+            .container(containerName)
+            .blobIdFactory(null);
 
         assertThatThrownBy(builder::build).isInstanceOf(IllegalStateException.class);
     }
 
     @Test
     public void builtBlobsDAOCanStoreAndRetrieve() throws Exception {
-        ObjectStorageBlobsDAOBuilder builder = ObjectStorageBlobsDAO
+        ObjectStorageBlobsDAOBuilder.ReadyToBuild builder = ObjectStorageBlobsDAO
             .builder(testConfig)
             .container(containerName)
             .blobIdFactory(new HashBlobId.Factory());

http://git-wip-us.apache.org/repos/asf/james-project/blob/22d30e52/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/swift/SwiftKeystone3ObjectStorageBlobsDAOBuilderTest.java
----------------------------------------------------------------------
diff --git a/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/swift/SwiftKeystone3ObjectStorageBlobsDAOBuilderTest.java
b/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/swift/SwiftKeystone3ObjectStorageBlobsDAOBuilderTest.java
index db5edd3..3d3e111 100644
--- a/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/swift/SwiftKeystone3ObjectStorageBlobsDAOBuilderTest.java
+++ b/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/swift/SwiftKeystone3ObjectStorageBlobsDAOBuilderTest.java
@@ -97,8 +97,9 @@ class SwiftKeystone3ObjectStorageBlobsDAOBuilderTest implements ObjectStorageBlo
 
     @Test
     void containerNameIsMandatoryToBuildBlobsDAO() throws Exception {
-        ObjectStorageBlobsDAOBuilder builder = ObjectStorageBlobsDAO
+        ObjectStorageBlobsDAOBuilder.ReadyToBuild builder = ObjectStorageBlobsDAO
             .builder(testConfig)
+            .container(null)
             .blobIdFactory(new HashBlobId.Factory());
 
         assertThatThrownBy(builder::build).isInstanceOf(IllegalStateException.class);
@@ -106,9 +107,10 @@ class SwiftKeystone3ObjectStorageBlobsDAOBuilderTest implements ObjectStorageBlo
 
     @Test
     void blobIdFactoryIsMandatoryToBuildBlobsDAO() throws Exception {
-        ObjectStorageBlobsDAOBuilder builder = ObjectStorageBlobsDAO
+        ObjectStorageBlobsDAOBuilder.ReadyToBuild builder = ObjectStorageBlobsDAO
             .builder(testConfig)
-            .container(containerName);
+            .container(containerName)
+            .blobIdFactory(null);
 
         assertThatThrownBy(builder::build).isInstanceOf(IllegalStateException.class);
     }
@@ -118,7 +120,7 @@ class SwiftKeystone3ObjectStorageBlobsDAOBuilderTest implements ObjectStorageBlo
     public void builtBlobsDAOCanStoreAndRetrieve(String key) throws Exception {
         SwiftKeystone3ObjectStorage.Configuration config =
             configBuilders.get(key).endpoint(dockerSwift.keystoneV3Endpoint()).build();
-        ObjectStorageBlobsDAOBuilder builder = ObjectStorageBlobsDAO
+        ObjectStorageBlobsDAOBuilder.ReadyToBuild builder = ObjectStorageBlobsDAO
             .builder(config)
             .container(containerName)
             .blobIdFactory(new HashBlobId.Factory());

http://git-wip-us.apache.org/repos/asf/james-project/blob/22d30e52/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/swift/SwiftTempAuthObjectStorageBlobsDAOBuilderTest.java
----------------------------------------------------------------------
diff --git a/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/swift/SwiftTempAuthObjectStorageBlobsDAOBuilderTest.java
b/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/swift/SwiftTempAuthObjectStorageBlobsDAOBuilderTest.java
index 7095624..473a70b 100644
--- a/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/swift/SwiftTempAuthObjectStorageBlobsDAOBuilderTest.java
+++ b/server/blob/blob-objectstorage/src/test/java/org/apache/james/blob/objectstorage/swift/SwiftTempAuthObjectStorageBlobsDAOBuilderTest.java
@@ -66,8 +66,9 @@ class SwiftTempAuthObjectStorageBlobsDAOBuilderTest implements ObjectStorageBlob
 
     @Test
     void containerNameIsMandatoryToBuildBlobsDAO() throws Exception {
-        ObjectStorageBlobsDAOBuilder builder = ObjectStorageBlobsDAO
+        ObjectStorageBlobsDAOBuilder.ReadyToBuild builder = ObjectStorageBlobsDAO
             .builder(testConfig)
+            .container(null)
             .blobIdFactory(new HashBlobId.Factory());
 
         assertThatThrownBy(builder::build).isInstanceOf(IllegalStateException.class);
@@ -75,16 +76,17 @@ class SwiftTempAuthObjectStorageBlobsDAOBuilderTest implements ObjectStorageBlob
 
     @Test
     void blobIdFactoryIsMandatoryToBuildBlobsDAO() throws Exception {
-        ObjectStorageBlobsDAOBuilder builder = ObjectStorageBlobsDAO
+        ObjectStorageBlobsDAOBuilder.ReadyToBuild builder = ObjectStorageBlobsDAO
             .builder(testConfig)
-            .container(containerName);
+            .container(containerName)
+            .blobIdFactory(null);
 
         assertThatThrownBy(builder::build).isInstanceOf(IllegalStateException.class);
     }
 
     @Test
     public void builtBlobsDAOCanStoreAndRetrieve() throws Exception {
-        ObjectStorageBlobsDAOBuilder builder = ObjectStorageBlobsDAO
+        ObjectStorageBlobsDAOBuilder.ReadyToBuild builder = ObjectStorageBlobsDAO
             .builder(testConfig)
             .container(containerName)
             .blobIdFactory(new HashBlobId.Factory());

http://git-wip-us.apache.org/repos/asf/james-project/blob/22d30e52/server/container/guice/blob-objectstorage-guice/src/main/java/org/apache/james/modules/objectstorage/ObjectStorageBlobsDAOProvider.java
----------------------------------------------------------------------
diff --git a/server/container/guice/blob-objectstorage-guice/src/main/java/org/apache/james/modules/objectstorage/ObjectStorageBlobsDAOProvider.java
b/server/container/guice/blob-objectstorage-guice/src/main/java/org/apache/james/modules/objectstorage/ObjectStorageBlobsDAOProvider.java
index 9c31555..aba643f 100644
--- a/server/container/guice/blob-objectstorage-guice/src/main/java/org/apache/james/modules/objectstorage/ObjectStorageBlobsDAOProvider.java
+++ b/server/container/guice/blob-objectstorage-guice/src/main/java/org/apache/james/modules/objectstorage/ObjectStorageBlobsDAOProvider.java
@@ -92,23 +92,23 @@ public class ObjectStorageBlobsDAOProvider implements Provider<ObjectStorageBlob
 
     private ObjectStorageBlobsDAO getTempAuthBlobsDao(ContainerName containerName) {
         return ObjectStorageBlobsDAO.builder(SwiftTmpAuthConfigurationReader.readSwiftConfiguration(configuration))
-            .blobIdFactory(blobIdFactory)
             .container(containerName)
+            .blobIdFactory(blobIdFactory)
             .build();
 
     }
 
     private ObjectStorageBlobsDAO getKeystone2BlobsDao(ContainerName containerName) {
         return ObjectStorageBlobsDAO.builder(SwiftKeystone2ConfigurationReader.readSwiftConfiguration(configuration))
-            .blobIdFactory(blobIdFactory)
             .container(containerName)
+            .blobIdFactory(blobIdFactory)
             .build();
     }
 
     private ObjectStorageBlobsDAO getKeystone3Configuration(ContainerName containerName)
{
         return ObjectStorageBlobsDAO.builder(SwiftKeystone3ConfigurationReader.readSwiftConfiguration(configuration))
-            .blobIdFactory(blobIdFactory)
             .container(containerName)
+            .blobIdFactory(blobIdFactory)
             .build();
     }
 }

http://git-wip-us.apache.org/repos/asf/james-project/blob/22d30e52/server/container/guice/blob-objectstorage-guice/src/test/java/org/apache/james/modules/objectstorage/guice/DockerSwiftTestRule.java
----------------------------------------------------------------------
diff --git a/server/container/guice/blob-objectstorage-guice/src/test/java/org/apache/james/modules/objectstorage/guice/DockerSwiftTestRule.java
b/server/container/guice/blob-objectstorage-guice/src/test/java/org/apache/james/modules/objectstorage/guice/DockerSwiftTestRule.java
index 04c7b03..905a6b6 100644
--- a/server/container/guice/blob-objectstorage-guice/src/test/java/org/apache/james/modules/objectstorage/guice/DockerSwiftTestRule.java
+++ b/server/container/guice/blob-objectstorage-guice/src/test/java/org/apache/james/modules/objectstorage/guice/DockerSwiftTestRule.java
@@ -80,8 +80,8 @@ public class DockerSwiftTestRule implements GuiceModuleTestRule {
 
         ContainerName containerName = ContainerName.of(UUID.randomUUID().toString());
         ObjectStorageBlobsDAO dao = SwiftKeystone2ObjectStorage.daoBuilder(configuration)
-            .blobIdFactory(new HashBlobId.Factory())
             .container(containerName)
+            .blobIdFactory(new HashBlobId.Factory())
             .payloadCodec(payloadCodec)
             .build();
 


---------------------------------------------------------------------
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