storage backend classes updated

This commit is contained in:
lucio 2024-01-19 11:56:04 +01:00
parent 545ad3160a
commit 8e90fb4a90
17 changed files with 25 additions and 47 deletions

View File

@ -16,6 +16,7 @@
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
<attributes>
<attribute name="maven.pomderived" value="true"/>
<attribute name="org.eclipse.jst.component.nondependency" value=""/>
</attributes>
</classpathentry>
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/JavaSE-1.8">

17
pom.xml
View File

@ -42,13 +42,9 @@
<dependency>
<groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId>
<scope>provided</scope>
</dependency>
<dependency>
<groupId>org.gcube.core</groupId>
<artifactId>common-clients</artifactId>
</dependency>
<dependency>
<groupId>com.fasterxml.jackson.core</groupId>
<artifactId>jackson-annotations</artifactId>
@ -74,15 +70,4 @@
</dependencies>
<build>
<plugins>
<plugin>
<artifactId>maven-compiler-plugin</artifactId>
<configuration>
<target>1.8</target>
<source>1.8</source>
</configuration>
</plugin>
</plugins>
</build>
</project>

View File

@ -8,7 +8,7 @@ public class Constants {
public static final String versionPrefix = "_v";
public static final String MONGO_STORAGE = "gcube-mongo";
public static final String DEFAULT_MINIO_STORAGE = "default-gcube-minio";
public static final String DEFAULT_S3_STORAGE = "default-gcube-s3";
}

View File

@ -1,8 +1,6 @@
package org.gcube.common.storagehub.model.exceptions;
import org.gcube.common.clients.delegates.Unrecoverable;
@Unrecoverable
public class BackendGenericError extends StorageHubException{
/**

View File

@ -1,8 +1,5 @@
package org.gcube.common.storagehub.model.exceptions;
import org.gcube.common.clients.delegates.Unrecoverable;
@Unrecoverable
public class IdNotFoundException extends StorageHubException {
/**

View File

@ -1,8 +1,5 @@
package org.gcube.common.storagehub.model.exceptions;
import org.gcube.common.clients.delegates.Unrecoverable;
@Unrecoverable
public class InvalidCallParameters extends StorageHubException {
/**

View File

@ -1,8 +1,5 @@
package org.gcube.common.storagehub.model.exceptions;
import org.gcube.common.clients.delegates.Unrecoverable;
@Unrecoverable
public class InvalidItemException extends StorageHubException {
/**

View File

@ -1,8 +1,5 @@
package org.gcube.common.storagehub.model.exceptions;
import org.gcube.common.clients.delegates.Unrecoverable;
@Unrecoverable
public class ItemAlreadyExistsException extends StorageHubException {
/**

View File

@ -1,8 +1,5 @@
package org.gcube.common.storagehub.model.exceptions;
import org.gcube.common.clients.delegates.Unrecoverable;
@Unrecoverable
public class ItemLockedException extends StorageHubException {
/**

View File

@ -1,8 +1,5 @@
package org.gcube.common.storagehub.model.exceptions;
import org.gcube.common.clients.delegates.Unrecoverable;
@Unrecoverable
public class PluginInitializationException extends StorageHubException {
/**

View File

@ -1,8 +1,5 @@
package org.gcube.common.storagehub.model.exceptions;
import org.gcube.common.clients.delegates.Unrecoverable;
@Unrecoverable
public class PluginNotFoundException extends StorageHubException {
/**

View File

@ -1,8 +1,5 @@
package org.gcube.common.storagehub.model.exceptions;
import org.gcube.common.clients.delegates.Unrecoverable;
@Unrecoverable
public abstract class StorageHubException extends Exception {
/**

View File

@ -1,8 +1,5 @@
package org.gcube.common.storagehub.model.exceptions;
import org.gcube.common.clients.delegates.Unrecoverable;
@Unrecoverable
public class UserNotAuthorizedException extends StorageHubException {
/**

View File

@ -12,4 +12,5 @@ import lombok.Setter;
@RootNode("nthl:externalFolder")
public class ExternalFolder extends FolderItem {
}

View File

@ -18,6 +18,6 @@ import lombok.Setter;
public class FolderItem extends Item {
@NodeAttribute(value= PAYLOADBACKEND)
PayloadBackend backend = new PayloadBackend(Constants.DEFAULT_MINIO_STORAGE, null);
PayloadBackend backend = new PayloadBackend(Constants.DEFAULT_S3_STORAGE, null);
}

View File

@ -7,6 +7,10 @@ public interface StorageBackendFactory {
String getName();
default boolean isSystemStorage() {
return false;
}
StorageBackend create(PayloadBackend payloadConfiguration) throws InvalidCallParameters;

View File

@ -0,0 +1,16 @@
package org.gcube.common.storagehub.model.storages;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.Setter;
@Getter
@Setter
@AllArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class StorageDescriptor {
String name;
}