restored close method

This commit is contained in:
Roberto Cirillo 2022-09-07 17:10:08 +02:00
parent 83bc9fbc2e
commit 904bf0bc17
4 changed files with 36 additions and 7 deletions

View File

@ -1,5 +1,9 @@
# Changelog for storage-manager-core # Changelog for storage-manager-core
## [v2.9.2-SNAPSHOT] 2022-09-07
* restored close() method to IClient
* add slf4j-simple dependency with test scope
## [v2.9.1] 2022-06-28 ## [v2.9.1] 2022-06-28
* update to version 2.9.1 in order to have a fixed bom in the latest version of the range * update to version 2.9.1 in order to have a fixed bom in the latest version of the range

14
pom.xml
View File

@ -8,7 +8,7 @@
</parent> </parent>
<groupId>org.gcube.contentmanagement</groupId> <groupId>org.gcube.contentmanagement</groupId>
<artifactId>storage-manager-core</artifactId> <artifactId>storage-manager-core</artifactId>
<version>2.9.1</version> <version>2.9.2-SNAPSHOT</version>
<properties> <properties>
<distroDirectory>${project.basedir}/distro</distroDirectory> <distroDirectory>${project.basedir}/distro</distroDirectory>
</properties> </properties>
@ -53,11 +53,11 @@
<artifactId>commons-codec</artifactId> <artifactId>commons-codec</artifactId>
<version>1.8</version> <version>1.8</version>
</dependency> </dependency>
<!-- <dependency> --> <dependency>
<!-- <groupId>org.slf4j</groupId> --> <groupId>org.slf4j</groupId>
<!-- <artifactId>slf4j-simple</artifactId> --> <artifactId>slf4j-simple</artifactId>
<!-- <version>1.7.32</version> --> <version>1.7.32</version>
<!-- <scope>test</scope> --> <scope>test</scope>
<!-- </dependency> --> </dependency>
</dependencies> </dependencies>
</project> </project>

View File

@ -209,6 +209,11 @@ public RemoteResourceComplexInfo getMetaFile();
*/ */
public void forceClose(); public void forceClose();
/**
* close the connections to backend storage system. Method restored for backward compatibility
*/
public void close();
public RemoteResource getUrl(boolean forceCreation); public RemoteResource getUrl(boolean forceCreation);

View File

@ -929,6 +929,26 @@ public class ServiceEngine implements IClient {
} }
} }
@Override
public void close(){
currentOperation="close";
file.setOwner(owner);
getMyFile().setRemoteResource(REMOTE_RESOURCE.PATH);
setMyFile(file);
service.setResource(getMyFile());
service.setTypeOperation("forceclose");
try {
if(((file.getInputStream() != null) || (file.getOutputStream()!=null)) || ((file.getLocalPath() != null) || (file.getRemotePath() != null)))
service.startOperation(file,file.getRemotePath(), owner, primaryBackend, Costants.DEFAULT_CHUNK_OPTION, getContext(), isReplaceOption());
else{
logger.error("parameters incompatible ");
}
} catch (Throwable t) {
logger.error("get()", t.getCause());
throw new RemoteBackendException(" Error in "+currentOperation+" operation ", t.getCause());
}
}
public String getServiceClass() { public String getServiceClass() {