first commit for ExternalManaged Folder
This commit is contained in:
parent
c249caafe6
commit
1eb24317e1
2
pom.xml
2
pom.xml
|
@ -18,7 +18,7 @@
|
|||
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>storagehub-model</artifactId>
|
||||
<version>1.0.10-SNAPSHOT</version>
|
||||
<version>1.1.0-SNAPSHOT</version>
|
||||
<name>storagehub-model</name>
|
||||
|
||||
<dependencyManagement>
|
||||
|
|
|
@ -5,5 +5,5 @@ import org.gcube.common.storagehub.model.items.nodes.Content;
|
|||
public abstract class AbstractFileItem extends Item{
|
||||
|
||||
public abstract Content getContent();
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -1,25 +1,14 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes;
|
||||
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.AttributeRootNode;
|
||||
import org.gcube.common.storagehub.model.annotations.NodeAttribute;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@AllArgsConstructor
|
||||
@AttributeRootNode(value="nthl:externalRepostiory")
|
||||
public class ExternalRepository {
|
||||
public class ExternalFolder extends FolderItem {
|
||||
|
||||
@Attribute("hl:pluginName")
|
||||
String plugin;
|
||||
|
@ -27,6 +16,4 @@ public class ExternalRepository {
|
|||
@JsonIgnore
|
||||
@NodeAttribute(value=PARAMETERS_NAME)
|
||||
Metadata metadata = new Metadata();
|
||||
|
||||
|
||||
}
|
|
@ -1,9 +1,6 @@
|
|||
package org.gcube.common.storagehub.model.items;
|
||||
|
||||
import org.gcube.common.storagehub.model.NodeConstants;
|
||||
import org.gcube.common.storagehub.model.annotations.NodeAttribute;
|
||||
import org.gcube.common.storagehub.model.annotations.RootNode;
|
||||
import org.gcube.common.storagehub.model.items.nodes.ExternalRepository;
|
||||
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
|
@ -13,11 +10,5 @@ import lombok.NoArgsConstructor;
|
|||
public class FolderItem extends Item {
|
||||
|
||||
|
||||
@NodeAttribute(value =NodeConstants.EXTERNALREPOSITORY_NAME)
|
||||
ExternalRepository externalRepository;
|
||||
|
||||
public boolean isExternalRoot() {
|
||||
return externalRepository != null;
|
||||
}
|
||||
|
||||
}
|
||||
|
|
|
@ -1,11 +0,0 @@
|
|||
package org.gcube.common.storagehub.model.plugins;
|
||||
|
||||
import org.gcube.common.storagehub.model.items.FolderItem;
|
||||
|
||||
public interface ExternalFolderManager {
|
||||
|
||||
void onFolderCreated(String relPath, FolderItem folder);
|
||||
|
||||
void onDeleteFolder(String relPath);
|
||||
|
||||
}
|
|
@ -0,0 +1,21 @@
|
|||
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 {
|
||||
|
||||
StorageBackend getStorageBackend();
|
||||
|
||||
boolean manageVersion();
|
||||
|
||||
void onCreatedFolder(FolderItem folder);
|
||||
|
||||
void onDeletingFolder(FolderItem folder);
|
||||
|
||||
void onMovedFolder(FolderItem movedFolder);
|
||||
|
||||
void onCopiedFolder(FolderItem copiedFolder);
|
||||
|
||||
}
|
||||
|
|
@ -3,12 +3,13 @@ package org.gcube.common.storagehub.model.plugins;
|
|||
import org.gcube.common.storagehub.model.exceptions.PluginInitializationException;
|
||||
import org.gcube.common.storagehub.model.items.FolderItem;
|
||||
|
||||
public interface ExternalFolderManagerConnector {
|
||||
public interface FolderManagerConnector {
|
||||
|
||||
public default String getName() {
|
||||
return this.getClass().getCanonicalName();
|
||||
}
|
||||
|
||||
ExternalFolderManager connect(FolderItem item, PluginParameters parameters) throws PluginInitializationException;
|
||||
FolderManager connect(FolderItem item, PluginParameters parameters) throws PluginInitializationException;
|
||||
|
||||
|
||||
}
|
|
@ -2,23 +2,26 @@ package org.gcube.common.storagehub.model.storages;
|
|||
|
||||
import java.io.InputStream;
|
||||
|
||||
import org.gcube.common.storagehub.model.items.AbstractFileItem;
|
||||
|
||||
public interface StorageBackend {
|
||||
|
||||
String getName();
|
||||
|
||||
String copy(String idToCopy, String path);
|
||||
String onCopy(AbstractFileItem item);
|
||||
|
||||
String move(String idToMove);
|
||||
String onMove(AbstractFileItem item);
|
||||
|
||||
void onDelete(AbstractFileItem item);
|
||||
|
||||
MetaInfo upload(InputStream stream, String itemPath);
|
||||
|
||||
InputStream getContent(String id);
|
||||
|
||||
InputStream download(String id);
|
||||
|
||||
@Deprecated
|
||||
String getTotalSizeStored();
|
||||
@Deprecated
|
||||
String getTotalItemsCount();
|
||||
|
||||
void delete(String id);
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue