Compare commits

..

1 Commits

Author SHA1 Message Date
lucio e475873840 version cleaned for release 2020-01-22 17:18:43 +01:00
31 changed files with 100 additions and 361 deletions

1
.gitignore vendored
View File

@ -1 +0,0 @@
/target/

View File

@ -7,9 +7,7 @@ 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

View File

@ -1,23 +0,0 @@
# 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

View File

@ -1,26 +0,0 @@
# 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);

View File

@ -1,4 +1,4 @@
#European Union Public Licence V.1.2
#European Union Public Licence V.1.1
##*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.2**
**Licensed under the EUPL V.1.1**
or has expressed by any other mean his willingness to license under the EUPL.

View File

@ -1,6 +1,6 @@
# Storage Hub Model
Implements the gCube Workspace model
StorageHub implements the gCube Workspace feature
## Structure of the project

8
changelog.xml Normal file
View File

@ -0,0 +1,8 @@
<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>

31
descriptor.xml Normal file
View File

@ -0,0 +1,31 @@
<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>

24
pom.xml
View File

@ -18,7 +18,7 @@
<groupId>org.gcube.common</groupId>
<artifactId>storagehub-model</artifactId>
<version>1.1.1</version>
<version>1.0.6</version>
<name>storagehub-model</name>
<dependencyManagement>
@ -26,35 +26,32 @@
<dependency>
<groupId>org.gcube.distribution</groupId>
<artifactId>gcube-bom</artifactId>
<version>2.0.1</version>
<version>LATEST</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>
@ -71,13 +68,14 @@
<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>
@ -85,4 +83,4 @@
</plugin>
</plugins>
</build>
</project>
</project>

View File

@ -2,12 +2,11 @@ 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";
}

View File

@ -13,7 +13,6 @@ import lombok.NoArgsConstructor;
@Data
public class ACL {
//TODO: modify typo
private String pricipal;
private List<AccessType> accessTypes= new ArrayList<>();

View File

@ -1,32 +0,0 @@
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;
}
}

View File

@ -1,32 +0,0 @@
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;
}
}

View File

@ -5,5 +5,5 @@ import org.gcube.common.storagehub.model.items.nodes.Content;
public abstract class AbstractFileItem extends Item{
public abstract Content getContent();
}

View File

@ -1,28 +0,0 @@
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();
}

View File

@ -2,10 +2,14 @@ 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 {

View File

@ -1,11 +1,7 @@
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;
@ -13,25 +9,31 @@ 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 com.fasterxml.jackson.annotation.JsonIgnore;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import lombok.AllArgsConstructor;
import lombok.Getter;
import lombok.NoArgsConstructor;
import lombok.Setter;
@Getter
@Setter
@AllArgsConstructor
@NoArgsConstructor
@JsonIgnoreProperties(ignoreUnknown = true)
public class Item extends RootItem{
public class Item {
String id;
String name;
String path;
String parentId;
String parentPath;
String primaryType;
boolean trashed;
//TODO: remove on next release
@JsonIgnore
boolean externalManaged = false;
boolean shared;
boolean locked;

View File

@ -1,32 +0,0 @@
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;
}

View File

@ -3,16 +3,15 @@ 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")

View File

@ -1,14 +1,16 @@
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
@ -31,7 +33,4 @@ public class Content {
@Attribute("hl:storageId")
String storageId;
@JsonIgnore
@Attribute("hl:storageName")
String managedBy;
}

View File

@ -1,46 +0,0 @@
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;
}

View File

@ -1,23 +0,0 @@
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);
}

View File

@ -1,17 +0,0 @@
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;
}

View File

@ -1,8 +0,0 @@
package org.gcube.common.storagehub.model.plugins;
import java.util.Map;
public interface PluginParameters {
Map<String, String> getParameters();
}

View File

@ -3,14 +3,13 @@ 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

View File

@ -1,13 +1,13 @@
package org.gcube.common.storagehub.model.service;
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
@NoArgsConstructor

View File

@ -2,26 +2,23 @@ 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 onCopy(AbstractFileItem item);
String copy(String idToCopy, String path);
String onMove(AbstractFileItem item);
String move(String idToMove);
void onDelete(Content id);
MetaInfo upload(InputStream stream, String itemPath);
MetaInfo upload(InputStream stream, String relativePath, String name);
InputStream download(Content item);
InputStream getContent(String id);
@Deprecated
String getTotalSizeStored();
@Deprecated
String getTotalItemsCount();
void delete(String id);
}

View File

@ -1,9 +0,0 @@
package org.gcube.common.storagehub.model.storages;
public interface StorageBackendFactory<S extends StorageBackend> {
String getName();
S create(String parameter);
}

View File

@ -31,6 +31,6 @@ public enum ItemAction {
/**
* The item has been updates.
*/
UPDATED;
UPDATED;
}

View File

@ -1,17 +0,0 @@
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;
}

View File

@ -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";
}