change storage-manager-core range; add forceClose method

This commit is contained in:
Roberto Cirillo 2021-10-14 10:14:38 +02:00
parent a1d14dcc90
commit a63695d803
2 changed files with 13 additions and 3 deletions

View File

@ -32,7 +32,7 @@
<dependency>
<groupId>org.gcube.contentmanagement</groupId>
<artifactId>storage-manager-core</artifactId>
<version>[3.0.0-SNAPSHOT, 4.0.0-SNAPSHOT)</version>
<version>[4.0.0-SNAPSHOT, 5.0.0-SNAPSHOT)</version>
</dependency>
<!-- <dependency> -->
<!-- <groupId>software.amazon.awssdk</groupId> -->

View File

@ -46,6 +46,7 @@ public class S3PluginManager extends TransportManager {
private String token;
@Override
public String getName() {
return "S3";
@ -62,10 +63,11 @@ public class S3PluginManager extends TransportManager {
initBackend(server,user,pass, memoryType,dbNames, writeConcern, readConcern, token, region);
}
@Override
public void initBackend(String[] server, String accessKey, String secretAccessKey, MemoryType memoryType, String[] dbNames,
String writeConcern, String readConcern, String token, String region) {
this.memoryType=memoryType;
AwsSessionCredentials awsCreds =null;
if(!Objects.isNull(getToken()))
awsCreds = AwsSessionCredentials.create(accessKey, secretAccessKey, token);
@ -213,6 +215,12 @@ public class S3PluginManager extends TransportManager {
}
@Override
public void forceClose() {
s3.close();
}
@Override
public void setFileProperty(String remotePath, String propertyField, String propertyValue) {
throw new RemoteBackendException("method not implemented yet on s3 plugin");
@ -243,5 +251,7 @@ public class S3PluginManager extends TransportManager {
}
}