Compare commits
7 Commits
217b507d6a
...
703ec28715
Author | SHA1 | Date |
---|---|---|
Francesco Mangiacrapa | 703ec28715 | |
Roberto Cirillo | a17553d642 | |
Roberto Cirillo | d5f6afc2c9 | |
Roberto Cirillo | 9c493501f8 | |
Roberto Cirillo | b63ad74730 | |
Roberto Cirillo | dde4ff1fa8 | |
Roberto Cirillo | 1b5d41b22f |
4
pom.xml
4
pom.xml
|
@ -58,13 +58,13 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.contentmanagement</groupId>
|
<groupId>org.gcube.contentmanagement</groupId>
|
||||||
<artifactId>storage-manager-wrapper</artifactId>
|
<artifactId>storage-manager-wrapper</artifactId>
|
||||||
<version>[2.6.1-SNAPSHOT, 3.0.0-SNAPSHOT)</version>
|
<version>[3.0.0-SNAPSHOT, 4.0.0-SNAPSHOT)</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.contentmanagement</groupId>
|
<groupId>org.gcube.contentmanagement</groupId>
|
||||||
<artifactId>storage-manager-core</artifactId>
|
<artifactId>storage-manager-core</artifactId>
|
||||||
<version>[2.0.0,3.0.0-SNAPSHOT)</version>
|
<version>[3.0.0-SNAPSHOT,4.0.0-SNAPSHOT)</version>
|
||||||
<exclusions>
|
<exclusions>
|
||||||
<exclusion>
|
<exclusion>
|
||||||
<artifactId>slf4j-nop</artifactId>
|
<artifactId>slf4j-nop</artifactId>
|
||||||
|
|
|
@ -340,14 +340,20 @@ public class StorageIDResolver {
|
||||||
* @return the storage client instance
|
* @return the storage client instance
|
||||||
*/
|
*/
|
||||||
protected static IClient getStorageClientInstance(MemoryType memory) {
|
protected static IClient getStorageClientInstance(MemoryType memory) {
|
||||||
if ((!Objects.isNull(storageManagerClient)) && (storageManagerClient.getGcubeMemoryType().equals(memory)))
|
if ((!Objects.isNull(storageManagerClient)) && (storageManagerClient.getGcubeMemoryType().toString() == memory.toString())) {
|
||||||
|
LOG.debug("reusing the same storage-client object");
|
||||||
return storageManagerClient;
|
return storageManagerClient;
|
||||||
else {
|
}else {
|
||||||
if(!Objects.isNull(storageManagerClient)) {
|
if(!Objects.isNull(storageManagerClient)) {
|
||||||
LOG.debug("going to close an old storage-client instance");
|
LOG.debug("going to close an old storage-client instance on "+storageManagerClient.getGcubeMemoryType());
|
||||||
|
try {
|
||||||
storageManagerClient.forceClose();
|
storageManagerClient.forceClose();
|
||||||
|
LOG.debug("storage-client closed");
|
||||||
|
}catch(Exception e) {
|
||||||
|
LOG.warn("Some problem occurred during the close operation:"+e.getMessage()+" Going to open another connection");
|
||||||
}
|
}
|
||||||
LOG.debug("initializing a new storage-client instance");
|
}
|
||||||
|
LOG.debug("initializing a new storage-client instance on "+memory);
|
||||||
storageManagerClient=new StorageClient(StorageIDResolver.class.getName(), StorageIDResolver.class.getSimpleName(), STORAGEID_RESOLVER, STORAGE_ACCESS_TYPE, memory, STORAGE_BACKEND_TYPE).getClient();
|
storageManagerClient=new StorageClient(StorageIDResolver.class.getName(), StorageIDResolver.class.getSimpleName(), STORAGEID_RESOLVER, STORAGE_ACCESS_TYPE, memory, STORAGE_BACKEND_TYPE).getClient();
|
||||||
return storageManagerClient;
|
return storageManagerClient;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue