Compare commits
16 Commits
Author | SHA1 | Date |
---|---|---|
lucio.lelii | be04b3d9ad | |
lucio.lelii | 8809fed6aa | |
Lucio Lelii | a855d15edd | |
lucio.lelii | 42fee4c603 | |
lucio.lelii | d19e3c65a3 | |
lucio.lelii | ff34c20cc4 | |
Lucio Lelii | dbc2e9e82e | |
Lucio Lelii | 6fafe992ba | |
lucio.lelii | 8e752ec43f | |
lucio.lelii | 9a30c20069 | |
lucio.lelii | ec03f8b6c0 | |
lucio.lelii | 2d2ba1c58b | |
lucio.lelii | 456e587aa0 | |
lucio.lelii | 0e9fecdecc | |
lucio.lelii | 1eb24317e1 | |
lucio.lelii | c249caafe6 |
|
@ -7,7 +7,9 @@ org.eclipse.jdt.core.compiler.debug.lineNumber=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
org.eclipse.jdt.core.compiler.debug.localVariable=generate
|
||||||
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
org.eclipse.jdt.core.compiler.debug.sourceFile=generate
|
||||||
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.assertIdentifier=error
|
||||||
|
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
||||||
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
org.eclipse.jdt.core.compiler.problem.enumIdentifier=error
|
||||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
||||||
|
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
|
||||||
org.eclipse.jdt.core.compiler.release=disabled
|
org.eclipse.jdt.core.compiler.release=disabled
|
||||||
org.eclipse.jdt.core.compiler.source=1.8
|
org.eclipse.jdt.core.compiler.source=1.8
|
||||||
|
|
15
CHANGELOG.md
15
CHANGELOG.md
|
@ -3,6 +3,21 @@
|
||||||
All notable changes to this project will be documented in this file.
|
All notable changes to this project will be documented in this file.
|
||||||
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
|
||||||
|
|
||||||
|
## [v1.1.1] - [2021-09-28]
|
||||||
|
|
||||||
|
- solved bug on externalManaged field
|
||||||
|
|
||||||
|
## [v1.1.0] - [2021-04-29]
|
||||||
|
|
||||||
|
- jackson version moved to 2.8.11
|
||||||
|
- model for messages added
|
||||||
|
|
||||||
|
## [v1.0.10] - [2021-03-30]
|
||||||
|
|
||||||
|
- added relateNode to items (only fo internal service use)
|
||||||
|
- external managed folder added
|
||||||
|
|
||||||
|
|
||||||
## [v1.0.9] - [2020-10-07]
|
## [v1.0.9] - [2020-10-07]
|
||||||
|
|
||||||
StorageBackendFacory to support different backend added
|
StorageBackendFacory to support different backend added
|
21
pom.xml
21
pom.xml
|
@ -18,7 +18,7 @@
|
||||||
|
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>storagehub-model</artifactId>
|
<artifactId>storagehub-model</artifactId>
|
||||||
<version>1.0.9</version>
|
<version>1.1.1</version>
|
||||||
<name>storagehub-model</name>
|
<name>storagehub-model</name>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
|
@ -26,32 +26,35 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.distribution</groupId>
|
<groupId>org.gcube.distribution</groupId>
|
||||||
<artifactId>gcube-bom</artifactId>
|
<artifactId>gcube-bom</artifactId>
|
||||||
<version>1.3.1</version>
|
<version>2.0.1</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
</dependencies>
|
</dependencies>
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
|
<properties>
|
||||||
|
<jackson.version>2.8.11</jackson.version>
|
||||||
|
</properties>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
<artifactId>lombok</artifactId>
|
<artifactId>lombok</artifactId>
|
||||||
<version>1.14.8</version>
|
<version>1.14.8</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
|
||||||
<artifactId>jackson-core</artifactId>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.core</groupId>
|
<groupId>org.gcube.core</groupId>
|
||||||
<artifactId>common-clients</artifactId>
|
<artifactId>common-clients</artifactId>
|
||||||
</dependency>
|
</dependency>
|
||||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>com.fasterxml.jackson.core</groupId>
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
<artifactId>jackson-annotations</artifactId>
|
<artifactId>jackson-annotations</artifactId>
|
||||||
|
<version>${jackson.version}</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.slf4j</groupId>
|
<groupId>org.slf4j</groupId>
|
||||||
<artifactId>slf4j-api</artifactId>
|
<artifactId>slf4j-api</artifactId>
|
||||||
|
@ -68,7 +71,7 @@
|
||||||
<version>4.10</version>
|
<version>4.10</version>
|
||||||
<scope>test</scope>
|
<scope>test</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
</dependencies>
|
</dependencies>
|
||||||
|
|
||||||
<build>
|
<build>
|
||||||
|
|
|
@ -2,11 +2,12 @@ package org.gcube.common.storagehub.model;
|
||||||
|
|
||||||
public class NodeConstants {
|
public class NodeConstants {
|
||||||
|
|
||||||
|
public static final String PARAMETERS_NAME ="hl:parameters";
|
||||||
public static final String ACCOUNTING_NAME ="hl:accounting";
|
public static final String ACCOUNTING_NAME ="hl:accounting";
|
||||||
public static final String METADATA_NAME ="hl:metadata";
|
public static final String METADATA_NAME ="hl:metadata";
|
||||||
public static final String OWNER_NAME ="hl:owner";
|
public static final String OWNER_NAME ="hl:owner";
|
||||||
public static final String CONTENT_NAME ="jcr:content";
|
public static final String CONTENT_NAME ="jcr:content";
|
||||||
public static final String USERS_NAME ="hl:users";
|
public static final String USERS_NAME ="hl:users";
|
||||||
|
public static final String EXTERNALREPOSITORY_NAME ="hl:externalRepository";
|
||||||
public static final String PROPERTY_NAME ="hl:property";
|
public static final String PROPERTY_NAME ="hl:property";
|
||||||
}
|
}
|
||||||
|
|
|
@ -13,6 +13,7 @@ import lombok.NoArgsConstructor;
|
||||||
@Data
|
@Data
|
||||||
public class ACL {
|
public class ACL {
|
||||||
|
|
||||||
|
//TODO: modify typo
|
||||||
private String pricipal;
|
private String pricipal;
|
||||||
private List<AccessType> accessTypes= new ArrayList<>();
|
private List<AccessType> accessTypes= new ArrayList<>();
|
||||||
|
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
package org.gcube.common.storagehub.model.exceptions;
|
||||||
|
|
||||||
|
import org.gcube.common.clients.delegates.Unrecoverable;
|
||||||
|
|
||||||
|
@Unrecoverable
|
||||||
|
public class PluginInitializationException extends StorageHubException {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public PluginInitializationException() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public PluginInitializationException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getErrorMessage() {
|
||||||
|
return "invalid parameters for plugin";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStatus() {
|
||||||
|
return 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,32 @@
|
||||||
|
package org.gcube.common.storagehub.model.exceptions;
|
||||||
|
|
||||||
|
import org.gcube.common.clients.delegates.Unrecoverable;
|
||||||
|
|
||||||
|
@Unrecoverable
|
||||||
|
public class PluginNotFoundException extends StorageHubException {
|
||||||
|
|
||||||
|
/**
|
||||||
|
*
|
||||||
|
*/
|
||||||
|
private static final long serialVersionUID = 1L;
|
||||||
|
|
||||||
|
public PluginNotFoundException() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
|
public PluginNotFoundException(String message) {
|
||||||
|
super(message);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public String getErrorMessage() {
|
||||||
|
return "plugin not found";
|
||||||
|
}
|
||||||
|
|
||||||
|
@Override
|
||||||
|
public int getStatus() {
|
||||||
|
return 500;
|
||||||
|
}
|
||||||
|
|
||||||
|
}
|
|
@ -5,5 +5,5 @@ import org.gcube.common.storagehub.model.items.nodes.Content;
|
||||||
public abstract class AbstractFileItem extends Item{
|
public abstract class AbstractFileItem extends Item{
|
||||||
|
|
||||||
public abstract Content getContent();
|
public abstract Content getContent();
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,28 @@
|
||||||
|
package org.gcube.common.storagehub.model.items;
|
||||||
|
|
||||||
|
import static org.gcube.common.storagehub.model.NodeConstants.PARAMETERS_NAME;
|
||||||
|
|
||||||
|
import org.gcube.common.storagehub.model.Metadata;
|
||||||
|
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||||
|
import org.gcube.common.storagehub.model.annotations.NodeAttribute;
|
||||||
|
import org.gcube.common.storagehub.model.annotations.RootNode;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@RootNode("nthl:externalFolder")
|
||||||
|
public class ExternalFolder extends FolderItem {
|
||||||
|
|
||||||
|
@Attribute("hl:pluginName")
|
||||||
|
String managedBy;
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
@NodeAttribute(value=PARAMETERS_NAME)
|
||||||
|
Metadata connectionParameters = new Metadata();
|
||||||
|
}
|
|
@ -2,14 +2,10 @@ package org.gcube.common.storagehub.model.items;
|
||||||
|
|
||||||
import org.gcube.common.storagehub.model.annotations.RootNode;
|
import org.gcube.common.storagehub.model.annotations.RootNode;
|
||||||
|
|
||||||
import lombok.Getter;
|
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
|
||||||
|
|
||||||
|
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Getter
|
|
||||||
@Setter
|
|
||||||
@RootNode("nthl:workspaceItem")
|
@RootNode("nthl:workspaceItem")
|
||||||
public class FolderItem extends Item {
|
public class FolderItem extends Item {
|
||||||
|
|
||||||
|
|
|
@ -1,7 +1,11 @@
|
||||||
package org.gcube.common.storagehub.model.items;
|
package org.gcube.common.storagehub.model.items;
|
||||||
|
|
||||||
|
import static org.gcube.common.storagehub.model.NodeConstants.ACCOUNTING_NAME;
|
||||||
|
import static org.gcube.common.storagehub.model.NodeConstants.METADATA_NAME;
|
||||||
|
import static org.gcube.common.storagehub.model.NodeConstants.OWNER_NAME;
|
||||||
|
|
||||||
import java.util.Calendar;
|
import java.util.Calendar;
|
||||||
import static org.gcube.common.storagehub.model.NodeConstants.*;
|
|
||||||
import org.gcube.common.storagehub.model.Metadata;
|
import org.gcube.common.storagehub.model.Metadata;
|
||||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||||
import org.gcube.common.storagehub.model.annotations.NodeAttribute;
|
import org.gcube.common.storagehub.model.annotations.NodeAttribute;
|
||||||
|
@ -9,31 +13,25 @@ import org.gcube.common.storagehub.model.items.nodes.Accounting;
|
||||||
import org.gcube.common.storagehub.model.items.nodes.Owner;
|
import org.gcube.common.storagehub.model.items.nodes.Owner;
|
||||||
import org.gcube.common.storagehub.model.types.ItemAction;
|
import org.gcube.common.storagehub.model.types.ItemAction;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@AllArgsConstructor
|
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
public class Item {
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
public class Item extends RootItem{
|
||||||
String id;
|
|
||||||
|
|
||||||
String name;
|
|
||||||
|
|
||||||
String path;
|
|
||||||
|
|
||||||
String parentId;
|
|
||||||
|
|
||||||
String parentPath;
|
|
||||||
|
|
||||||
String primaryType;
|
|
||||||
|
|
||||||
boolean trashed;
|
boolean trashed;
|
||||||
|
|
||||||
|
//TODO: remove on next release
|
||||||
|
@JsonIgnore
|
||||||
|
boolean externalManaged = false;
|
||||||
|
|
||||||
boolean shared;
|
boolean shared;
|
||||||
|
|
||||||
boolean locked;
|
boolean locked;
|
||||||
|
|
|
@ -0,0 +1,32 @@
|
||||||
|
package org.gcube.common.storagehub.model.items;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
|
||||||
|
import lombok.EqualsAndHashCode;
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@EqualsAndHashCode(of = "id" )
|
||||||
|
public abstract class RootItem {
|
||||||
|
|
||||||
|
//for service internal use
|
||||||
|
@JsonIgnore
|
||||||
|
transient Object relatedNode;
|
||||||
|
|
||||||
|
String id;
|
||||||
|
|
||||||
|
String name;
|
||||||
|
|
||||||
|
String path;
|
||||||
|
|
||||||
|
String parentId;
|
||||||
|
|
||||||
|
String parentPath;
|
||||||
|
|
||||||
|
String primaryType;
|
||||||
|
|
||||||
|
}
|
|
@ -3,15 +3,16 @@ package org.gcube.common.storagehub.model.items.nodes;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||||
import org.gcube.common.storagehub.model.annotations.ListNodes;
|
import org.gcube.common.storagehub.model.annotations.ListNodes;
|
||||||
import org.gcube.common.storagehub.model.items.nodes.accounting.AccountEntry;
|
import org.gcube.common.storagehub.model.items.nodes.accounting.AccountEntry;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||||
|
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
@Data
|
@Data
|
||||||
@AttributeRootNode("nthl:accountingSet")
|
@AttributeRootNode("nthl:accountingSet")
|
||||||
|
|
|
@ -1,16 +1,14 @@
|
||||||
package org.gcube.common.storagehub.model.items.nodes;
|
package org.gcube.common.storagehub.model.items.nodes;
|
||||||
|
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||||
|
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Getter;
|
import lombok.Getter;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
import lombok.Setter;
|
import lombok.Setter;
|
||||||
|
|
||||||
import java.util.HashMap;
|
|
||||||
import java.util.Map;
|
|
||||||
|
|
||||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
|
||||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
|
||||||
import org.gcube.common.storagehub.model.annotations.MapAttribute;
|
|
||||||
|
|
||||||
@Getter
|
@Getter
|
||||||
@Setter
|
@Setter
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
@ -33,4 +31,7 @@ public class Content {
|
||||||
@Attribute("hl:storageId")
|
@Attribute("hl:storageId")
|
||||||
String storageId;
|
String storageId;
|
||||||
|
|
||||||
|
@JsonIgnore
|
||||||
|
@Attribute("hl:storageName")
|
||||||
|
String managedBy;
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,46 @@
|
||||||
|
package org.gcube.common.storagehub.model.messages;
|
||||||
|
|
||||||
|
import static org.gcube.common.storagehub.model.NodeConstants.OWNER_NAME;
|
||||||
|
|
||||||
|
import java.util.Calendar;
|
||||||
|
|
||||||
|
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||||
|
import org.gcube.common.storagehub.model.annotations.NodeAttribute;
|
||||||
|
import org.gcube.common.storagehub.model.annotations.RootNode;
|
||||||
|
import org.gcube.common.storagehub.model.items.RootItem;
|
||||||
|
import org.gcube.common.storagehub.model.items.nodes.Owner;
|
||||||
|
|
||||||
|
import lombok.Getter;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
import lombok.Setter;
|
||||||
|
|
||||||
|
@Getter
|
||||||
|
@Setter
|
||||||
|
@NoArgsConstructor
|
||||||
|
@RootNode("nthl:itemSentRequest")
|
||||||
|
public class Message extends RootItem{
|
||||||
|
|
||||||
|
boolean withAttachments;
|
||||||
|
|
||||||
|
@NodeAttribute(value=OWNER_NAME)
|
||||||
|
Owner sender;
|
||||||
|
|
||||||
|
@Attribute("hl:subject")
|
||||||
|
String subject;
|
||||||
|
|
||||||
|
@Attribute("hl:body")
|
||||||
|
String body;
|
||||||
|
|
||||||
|
@Attribute("hl:read")
|
||||||
|
boolean read;
|
||||||
|
|
||||||
|
@Attribute("hl:open")
|
||||||
|
boolean opened;
|
||||||
|
|
||||||
|
@Attribute("hl:addresses")
|
||||||
|
String[] addresses;
|
||||||
|
|
||||||
|
@Attribute(value = "jcr:created", isReadOnly=true)
|
||||||
|
Calendar creationTime;
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,23 @@
|
||||||
|
package org.gcube.common.storagehub.model.plugins;
|
||||||
|
|
||||||
|
import org.gcube.common.storagehub.model.items.FolderItem;
|
||||||
|
import org.gcube.common.storagehub.model.storages.StorageBackend;
|
||||||
|
|
||||||
|
public interface FolderManager {
|
||||||
|
|
||||||
|
FolderItem getRootFolder();
|
||||||
|
|
||||||
|
StorageBackend getStorageBackend();
|
||||||
|
|
||||||
|
boolean manageVersion();
|
||||||
|
|
||||||
|
void onCreatedFolder(FolderItem folder);
|
||||||
|
|
||||||
|
void onDeletingFolder(FolderItem folder);
|
||||||
|
|
||||||
|
void onMovedFolder(FolderItem movedFolder);
|
||||||
|
|
||||||
|
void onCopiedFolder(FolderItem copiedFolder);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
package org.gcube.common.storagehub.model.plugins;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
import org.gcube.common.storagehub.model.exceptions.PluginInitializationException;
|
||||||
|
import org.gcube.common.storagehub.model.items.FolderItem;
|
||||||
|
|
||||||
|
public interface FolderManagerConnector {
|
||||||
|
|
||||||
|
public default String getName() {
|
||||||
|
return this.getClass().getCanonicalName();
|
||||||
|
}
|
||||||
|
|
||||||
|
FolderManager connect(FolderItem item, Map<String, Object> parameters) throws PluginInitializationException;
|
||||||
|
|
||||||
|
|
||||||
|
}
|
|
@ -0,0 +1,8 @@
|
||||||
|
package org.gcube.common.storagehub.model.plugins;
|
||||||
|
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public interface PluginParameters {
|
||||||
|
|
||||||
|
Map<String, String> getParameters();
|
||||||
|
}
|
|
@ -3,13 +3,14 @@ package org.gcube.common.storagehub.model.service;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
|
||||||
|
import org.gcube.common.storagehub.model.items.Item;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
import lombok.AllArgsConstructor;
|
||||||
import lombok.Data;
|
import lombok.Data;
|
||||||
import lombok.NoArgsConstructor;
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
import org.gcube.common.storagehub.model.items.Item;
|
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
|
|
|
@ -1,13 +1,13 @@
|
||||||
package org.gcube.common.storagehub.model.service;
|
package org.gcube.common.storagehub.model.service;
|
||||||
|
|
||||||
import lombok.AllArgsConstructor;
|
|
||||||
import lombok.Data;
|
|
||||||
import lombok.NoArgsConstructor;
|
|
||||||
|
|
||||||
import org.gcube.common.storagehub.model.items.Item;
|
import org.gcube.common.storagehub.model.items.Item;
|
||||||
|
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||||
|
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
@Data
|
@Data
|
||||||
@AllArgsConstructor
|
@AllArgsConstructor
|
||||||
@NoArgsConstructor
|
@NoArgsConstructor
|
||||||
|
|
|
@ -2,23 +2,26 @@ package org.gcube.common.storagehub.model.storages;
|
||||||
|
|
||||||
import java.io.InputStream;
|
import java.io.InputStream;
|
||||||
|
|
||||||
|
import org.gcube.common.storagehub.model.items.AbstractFileItem;
|
||||||
|
import org.gcube.common.storagehub.model.items.nodes.Content;
|
||||||
|
|
||||||
public interface StorageBackend {
|
public interface StorageBackend {
|
||||||
|
|
||||||
String getName();
|
String getName();
|
||||||
|
|
||||||
String copy(String idToCopy, String path);
|
String onCopy(AbstractFileItem item);
|
||||||
|
|
||||||
String move(String idToMove);
|
String onMove(AbstractFileItem item);
|
||||||
|
|
||||||
MetaInfo upload(InputStream stream, String itemPath);
|
void onDelete(Content id);
|
||||||
|
|
||||||
InputStream getContent(String id);
|
MetaInfo upload(InputStream stream, String relativePath, String name);
|
||||||
|
|
||||||
|
InputStream download(Content item);
|
||||||
|
|
||||||
@Deprecated
|
@Deprecated
|
||||||
String getTotalSizeStored();
|
String getTotalSizeStored();
|
||||||
@Deprecated
|
@Deprecated
|
||||||
String getTotalItemsCount();
|
String getTotalItemsCount();
|
||||||
|
|
||||||
void delete(String id);
|
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,17 @@
|
||||||
|
package org.gcube.common.storagehub.model.types;
|
||||||
|
|
||||||
|
import java.util.List;
|
||||||
|
import org.gcube.common.storagehub.model.messages.Message;
|
||||||
|
import lombok.AllArgsConstructor;
|
||||||
|
import lombok.Data;
|
||||||
|
import lombok.NoArgsConstructor;
|
||||||
|
|
||||||
|
|
||||||
|
@AllArgsConstructor
|
||||||
|
@NoArgsConstructor
|
||||||
|
@Data
|
||||||
|
public class MessageList {
|
||||||
|
|
||||||
|
List<Message> messages;
|
||||||
|
|
||||||
|
}
|
|
@ -51,5 +51,5 @@ public class PrimaryNodeType {
|
||||||
protected static final String ACCOUNTING = "hl:accounting";
|
protected static final String ACCOUNTING = "hl:accounting";
|
||||||
protected static final String NT_ACCOUNTING = "nthl:accountingSet";
|
protected static final String NT_ACCOUNTING = "nthl:accountingSet";
|
||||||
|
|
||||||
|
protected static final String VERSION_PROPERTY = "hl:version";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue