diff --git a/CHANGELOG.md b/CHANGELOG.md
index c8323a4..ec14b32 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,9 @@
# Changelog for storage-manager-wrapper
+## [v2.6.0-SNAPSHOT] 2020-11-12
+
+* adding new constructor with the backendType as input parameter
+
## [v2.5.3] 2019-03-20
* Added wrapper for HomeLibrary configuration related to the new preproduction infrastructure
\ No newline at end of file
diff --git a/pom.xml b/pom.xml
index 7a0a79a..e1953bb 100644
--- a/pom.xml
+++ b/pom.xml
@@ -8,7 +8,7 @@
org.gcube.contentmanagement
storage-manager-wrapper
- 2.5.3
+ 2.6.0-SNAPSHOT
scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git
scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git
diff --git a/src/main/java/log4j.properties b/src/main/java/log4j.properties
deleted file mode 100644
index 2a7b243..0000000
--- a/src/main/java/log4j.properties
+++ /dev/null
@@ -1,15 +0,0 @@
-log4j.rootLogger=DEBUG, A1, stdout
-log4j.appender.A1=org.apache.log4j.RollingFileAppender
-log4j.appender.A1.File=log.txt
-log4j.appender.A1.layout=org.apache.log4j.PatternLayout
-log4j.appender.A1.layout.ConversionPattern=%-4r [%t] %-5p %c %x - %m%n
-# ***** Max file size is set to 100KB
-log4j.appender.A1.MaxFileSize=100MB
-# ***** Keep one backup file
-log4j.appender.A1.MaxBackupIndex=1
-
-#CONSOLE
-log4j.appender.stdout=org.apache.log4j.ConsoleAppender
-log4j.appender.stdout.Threshold=INFO
-log4j.appender.stdout.layout=org.apache.log4j.PatternLayout
-log4j.appender.stdout.layout.ConversionPattern=[%t] %-5p %c %d{dd MMM yyyy ;HH:mm:ss.SSS} - %m%n
diff --git a/src/main/java/org/gcube/contentmanager/storageclient/wrapper/BackendType.java b/src/main/java/org/gcube/contentmanager/storageclient/wrapper/BackendType.java
new file mode 100644
index 0000000..f8a8c7a
--- /dev/null
+++ b/src/main/java/org/gcube/contentmanager/storageclient/wrapper/BackendType.java
@@ -0,0 +1,5 @@
+package org.gcube.contentmanager.storageclient.wrapper;
+
+public enum BackendType {
+ MongoDB, S3
+}
diff --git a/src/main/java/org/gcube/contentmanager/storageclient/wrapper/StorageClient.java b/src/main/java/org/gcube/contentmanager/storageclient/wrapper/StorageClient.java
index 8b75d51..60a9b96 100644
--- a/src/main/java/org/gcube/contentmanager/storageclient/wrapper/StorageClient.java
+++ b/src/main/java/org/gcube/contentmanager/storageclient/wrapper/StorageClient.java
@@ -1,6 +1,6 @@
package org.gcube.contentmanager.storageclient.wrapper;
-//import org.gcube.contentmanagement.blobstorage.resource.AccessType;
+import org.gcube.contentmanager.storageclient.wrapper.BackendType;
import org.gcube.contentmanager.storageclient.wrapper.AccessType;
//import org.gcube.contentmanagement.blobstorage.resource.MemoryType;
import org.gcube.contentmanager.storageclient.wrapper.MemoryType;
@@ -96,6 +96,34 @@ public class StorageClient {
}
+ /**
+ * New constructor with another optional argument created for gcube infrastructure internal use.
+ * Available in v1.6.0
+ * It's possible to specify a specific backend.
+ * @param ServiceClass
+ * @param ServiceName
+ * @param owner
+ * @param typeAccess
+ * @param scope
+ */
+ public StorageClient(String serviceClass, String serviceName, String owner, AccessType accessType, BackendType backend){
+ checkScopeProvider();
+ String id=owner;
+ this.owner=owner;
+ this.scopeString=ScopeProvider.instance.get();
+ if(accessType!=null)
+ this.typeAccess=accessType;
+ else throw new RuntimeException("AccessType parameter must be not null");
+ this.memoryType=MemoryType.BOTH;
+ this.serviceClass=serviceClass;
+ this.serviceName=serviceName;
+ this.setBackendType(backend.toString());
+ setClientId(serviceClass, serviceName, id);
+
+ }
+
+
+
/**
* Constructor created for external use
* @param owner
@@ -170,6 +198,35 @@ public class StorageClient {
this.serviceName=serviceName;
setClientId(serviceClass, serviceName, id);
}
+
+
+ /**
+ * Available in v1.6.0
+ * It's possible to specify a specific backend.
+ * @param ServiceClass
+ * @param ServiceName
+ * @param owner
+ * @param typeAccess
+ * @param backend: specify mongodb (default) or s3
+ * @param memory defines the kind of memory: VOLATILE or PERSISTENT
+ * @param scope
+ */
+ public StorageClient(String serviceClass, String serviceName, String owner, AccessType accessType, MemoryType memory, BackendType backend){
+ checkScopeProvider();
+ String id=owner;
+ this.owner=owner;
+ this.scopeString=ScopeProvider.instance.get();
+ if(accessType!=null)
+ this.typeAccess=accessType;
+ else throw new RuntimeException("AccessType parameter must be not null");
+ if(memory!=null)
+ this.memoryType=memory;
+ else throw new RuntimeException("MemoryType parameter must be not null");
+ this.serviceClass=serviceClass;
+ this.serviceName=serviceName;
+ setClientId(serviceClass, serviceName, id);
+ this.setBackendType(backend.toString());
+ }
@@ -370,6 +427,7 @@ public class StorageClient {
public String getBackendType() {
+ logger.debug("backend type returned is "+backendType);
return backendType;
}