Compare commits
20 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 | |
lucio.lelii | 4c129ed264 | |
lucio.lelii | 2e9445c085 | |
Lucio Lelii | 05304fe4c0 | |
Lucio Lelii | 1cae1af75b |
|
@ -0,0 +1 @@
|
|||
/target/
|
|
@ -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.sourceFile=generate
|
||||
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.forbiddenReference=warning
|
||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
|
||||
org.eclipse.jdt.core.compiler.release=disabled
|
||||
org.eclipse.jdt.core.compiler.source=1.8
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
# Changelog
|
||||
|
||||
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).
|
||||
|
||||
## [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]
|
||||
|
||||
StorageBackendFacory to support different backend added
|
|
@ -0,0 +1,26 @@
|
|||
# Acknowledgments
|
||||
|
||||
The projects leading to this software have received funding from a series of European Union programmes including:
|
||||
|
||||
- the Sixth Framework Programme for Research and Technological Development
|
||||
- [DILIGENT](https://cordis.europa.eu/project/id/004260) (grant no. 004260).
|
||||
- the Seventh Framework Programme for research, technological development and demonstration
|
||||
- [D4Science](https://cordis.europa.eu/project/id/212488) (grant no. 212488);
|
||||
- [D4Science-II](https://cordis.europa.eu/project/id/239019) (grant no.239019);
|
||||
- [ENVRI](https://cordis.europa.eu/project/id/283465) (grant no. 283465);
|
||||
- [iMarine](https://cordis.europa.eu/project/id/283644) (grant no. 283644);
|
||||
- [EUBrazilOpenBio](https://cordis.europa.eu/project/id/288754) (grant no. 288754).
|
||||
- the H2020 research and innovation programme
|
||||
- [SoBigData](https://cordis.europa.eu/project/id/654024) (grant no. 654024);
|
||||
- [PARTHENOS](https://cordis.europa.eu/project/id/654119) (grant no. 654119);
|
||||
- [EGI-Engage](https://cordis.europa.eu/project/id/654142) (grant no. 654142);
|
||||
- [ENVRI PLUS](https://cordis.europa.eu/project/id/654182) (grant no. 654182);
|
||||
- [BlueBRIDGE](https://cordis.europa.eu/project/id/675680) (grant no. 675680);
|
||||
- [PerformFISH](https://cordis.europa.eu/project/id/727610) (grant no. 727610);
|
||||
- [AGINFRA PLUS](https://cordis.europa.eu/project/id/731001) (grant no. 731001);
|
||||
- [DESIRA](https://cordis.europa.eu/project/id/818194) (grant no. 818194);
|
||||
- [ARIADNEplus](https://cordis.europa.eu/project/id/823914) (grant no. 823914);
|
||||
- [RISIS 2](https://cordis.europa.eu/project/id/824091) (grant no. 824091);
|
||||
- [EOSC-Pillar](https://cordis.europa.eu/project/id/857650) (grant no. 857650);
|
||||
- [Blue Cloud](https://cordis.europa.eu/project/id/862409) (grant no. 862409);
|
||||
- [SoBigData-PlusPlus](https://cordis.europa.eu/project/id/871042) (grant no. 871042);
|
|
@ -1,4 +1,4 @@
|
|||
#European Union Public Licence V.1.1
|
||||
#European Union Public Licence V.1.2
|
||||
|
||||
##*EUPL © the European Community 2007*
|
||||
|
||||
|
@ -12,7 +12,7 @@ The Original Work is provided under the terms of this Licence when the Licensor
|
|||
(as defined below) has placed the following notice immediately following the
|
||||
copyright notice for the Original Work:
|
||||
|
||||
**Licensed under the EUPL V.1.1**
|
||||
**Licensed under the EUPL V.1.2**
|
||||
|
||||
or has expressed by any other mean his willingness to license under the EUPL.
|
||||
|
||||
|
|
|
@ -1,6 +1,6 @@
|
|||
# Storage Hub Model
|
||||
|
||||
StorageHub implements the gCube Workspace feature
|
||||
Implements the gCube Workspace model
|
||||
|
||||
## Structure of the project
|
||||
|
||||
|
|
|
@ -1,8 +0,0 @@
|
|||
<ReleaseNotes>
|
||||
<Changeset component="storagehub-model-1.0.5" date="2019-07-29">
|
||||
<Change>External link item added</Change>
|
||||
</Changeset>
|
||||
<Changeset component="storagehub-model-1.0.0" date="2018-05-15">
|
||||
<Change>First Release</Change>
|
||||
</Changeset>
|
||||
</ReleaseNotes>
|
|
@ -1,31 +0,0 @@
|
|||
<assembly
|
||||
xmlns="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0"
|
||||
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
||||
xsi:schemaLocation="http://maven.apache.org/plugins/maven-assembly-plugin/assembly/1.1.0 http://maven.apache.org/xsd/assembly-1.1.0.xsd">
|
||||
<id>servicearchive</id>
|
||||
<formats>
|
||||
<format>tar.gz</format>
|
||||
</formats>
|
||||
<baseDirectory>/</baseDirectory>
|
||||
<fileSets>
|
||||
<fileSet>
|
||||
<directory>.</directory>
|
||||
<outputDirectory>/</outputDirectory>
|
||||
<useDefaultExcludes>true</useDefaultExcludes>
|
||||
<includes>
|
||||
<include>README</include>
|
||||
<include>LICENSE</include>
|
||||
<include>changelog.xml</include>
|
||||
<include>profile.xml</include>
|
||||
</includes>
|
||||
<fileMode>755</fileMode>
|
||||
<filtered>true</filtered>
|
||||
</fileSet>
|
||||
</fileSets>
|
||||
<files>
|
||||
<file>
|
||||
<source>target/${build.finalName}.jar</source>
|
||||
<outputDirectory>/${artifactId}</outputDirectory>
|
||||
</file>
|
||||
</files>
|
||||
</assembly>
|
22
pom.xml
22
pom.xml
|
@ -18,7 +18,7 @@
|
|||
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>storagehub-model</artifactId>
|
||||
<version>1.0.5</version>
|
||||
<version>1.1.1</version>
|
||||
<name>storagehub-model</name>
|
||||
|
||||
<dependencyManagement>
|
||||
|
@ -26,32 +26,35 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.distribution</groupId>
|
||||
<artifactId>gcube-bom</artifactId>
|
||||
<version>1.3.1</version>
|
||||
<version>2.0.1</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
</dependencies>
|
||||
</dependencyManagement>
|
||||
|
||||
|
||||
<properties>
|
||||
<jackson.version>2.8.11</jackson.version>
|
||||
</properties>
|
||||
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.14.8</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-core</artifactId>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.gcube.core</groupId>
|
||||
<artifactId>common-clients</artifactId>
|
||||
</dependency>
|
||||
<!-- https://mvnrepository.com/artifact/com.fasterxml.jackson.core/jackson-annotations -->
|
||||
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
<artifactId>jackson-annotations</artifactId>
|
||||
<version>${jackson.version}</version>
|
||||
</dependency>
|
||||
|
||||
<dependency>
|
||||
<groupId>org.slf4j</groupId>
|
||||
<artifactId>slf4j-api</artifactId>
|
||||
|
@ -68,14 +71,13 @@
|
|||
<version>4.10</version>
|
||||
<scope>test</scope>
|
||||
</dependency>
|
||||
|
||||
|
||||
</dependencies>
|
||||
|
||||
<build>
|
||||
<plugins>
|
||||
<plugin>
|
||||
<artifactId>maven-compiler-plugin</artifactId>
|
||||
<version>2.3.2</version>
|
||||
<configuration>
|
||||
<target>1.8</target>
|
||||
<source>1.8</source>
|
||||
|
|
|
@ -2,11 +2,12 @@ package org.gcube.common.storagehub.model;
|
|||
|
||||
public class NodeConstants {
|
||||
|
||||
|
||||
public static final String PARAMETERS_NAME ="hl:parameters";
|
||||
public static final String ACCOUNTING_NAME ="hl:accounting";
|
||||
public static final String METADATA_NAME ="hl:metadata";
|
||||
public static final String OWNER_NAME ="hl:owner";
|
||||
public static final String CONTENT_NAME ="jcr:content";
|
||||
public static final String USERS_NAME ="hl:users";
|
||||
public static final String EXTERNALREPOSITORY_NAME ="hl:externalRepository";
|
||||
public static final String PROPERTY_NAME ="hl:property";
|
||||
}
|
||||
|
|
|
@ -13,6 +13,7 @@ import lombok.NoArgsConstructor;
|
|||
@Data
|
||||
public class ACL {
|
||||
|
||||
//TODO: modify typo
|
||||
private String pricipal;
|
||||
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 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 lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
|
||||
@NoArgsConstructor
|
||||
@Getter
|
||||
@Setter
|
||||
@RootNode("nthl:workspaceItem")
|
||||
public class FolderItem extends Item {
|
||||
|
||||
|
|
|
@ -1,7 +1,11 @@
|
|||
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 static org.gcube.common.storagehub.model.NodeConstants.*;
|
||||
|
||||
import org.gcube.common.storagehub.model.Metadata;
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
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.types.ItemAction;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class Item {
|
||||
|
||||
String id;
|
||||
|
||||
String name;
|
||||
|
||||
String path;
|
||||
|
||||
String parentId;
|
||||
|
||||
String parentPath;
|
||||
|
||||
String primaryType;
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class Item extends RootItem{
|
||||
|
||||
boolean trashed;
|
||||
|
||||
//TODO: remove on next release
|
||||
@JsonIgnore
|
||||
boolean externalManaged = false;
|
||||
|
||||
boolean shared;
|
||||
|
||||
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.List;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.AttributeRootNode;
|
||||
import org.gcube.common.storagehub.model.annotations.ListNodes;
|
||||
import org.gcube.common.storagehub.model.items.nodes.accounting.AccountEntry;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@AttributeRootNode("nthl:accountingSet")
|
||||
|
|
|
@ -1,16 +1,14 @@
|
|||
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.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
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
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
|
@ -33,4 +31,7 @@ public class Content {
|
|||
@Attribute("hl: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.List;
|
||||
|
||||
import org.gcube.common.storagehub.model.items.Item;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
import org.gcube.common.storagehub.model.items.Item;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
|
|
|
@ -1,13 +1,13 @@
|
|||
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 com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
|
|
|
@ -2,23 +2,26 @@ package org.gcube.common.storagehub.model.storages;
|
|||
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.gcube.common.storagehub.model.items.AbstractFileItem;
|
||||
import org.gcube.common.storagehub.model.items.nodes.Content;
|
||||
|
||||
public interface StorageBackend {
|
||||
|
||||
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
|
||||
String getTotalSizeStored();
|
||||
@Deprecated
|
||||
String getTotalItemsCount();
|
||||
|
||||
void delete(String id);
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,9 @@
|
|||
package org.gcube.common.storagehub.model.storages;
|
||||
|
||||
public interface StorageBackendFactory<S extends StorageBackend> {
|
||||
|
||||
String getName();
|
||||
|
||||
S create(String parameter);
|
||||
|
||||
}
|
|
@ -31,6 +31,6 @@ public enum ItemAction {
|
|||
/**
|
||||
* The item has been updates.
|
||||
*/
|
||||
UPDATED;
|
||||
UPDATED;
|
||||
|
||||
}
|
||||
|
|
|
@ -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 NT_ACCOUNTING = "nthl:accountingSet";
|
||||
|
||||
|
||||
protected static final String VERSION_PROPERTY = "hl:version";
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue