added payload backend to folder
This commit is contained in:
parent
8b64b3ed06
commit
7aff397939
|
@ -6,6 +6,6 @@ public class Constants {
|
|||
public static final String versionPrefix = "_v";
|
||||
public static final String mongoStorageConstant = "gcube-mongo";
|
||||
|
||||
|
||||
public static final String s3StorageConstant = "gcube-s3";
|
||||
|
||||
}
|
||||
|
|
|
@ -22,12 +22,14 @@ public class NodeConstants {
|
|||
public static final String LASTACTION = "hl:lastAction";
|
||||
public static final String HIDDEN = "hl:hidden";
|
||||
|
||||
public static final String EXTERNALFOLDERPLUGIN ="hl:pluginName";
|
||||
public static final String PAYLOADBACKEND ="hl:payloadBackend";
|
||||
|
||||
public static final String SHAREDFOLDERPRIVILEGE = "hl:privilege";
|
||||
public static final String VREFOLDERCHECK = "hl:isVreFolder";
|
||||
public static final String DISPLAYNAME = "hl:displayName";
|
||||
|
||||
public static final String UNIQUEID = "hl:uuid";
|
||||
public static final String PARAMETERS = "hl:parameters";
|
||||
|
||||
public static final String CONTENTSIZE = "hl:size";
|
||||
public static final String CONTENTDATA ="jcr:data";
|
||||
|
@ -42,4 +44,5 @@ public class NodeConstants {
|
|||
public static final String OWNERNODETYPE = "nthl:user";
|
||||
public static final String GENERICFILETYPE = "nthl:externalFile";
|
||||
public static final String CONTENTFILETYPE = "nthl:file";
|
||||
public static final String PAYLOADBACKENDTYPE = "nthl:payloadbackend";
|
||||
}
|
||||
|
|
|
@ -1,14 +1,7 @@
|
|||
package org.gcube.common.storagehub.model.items;
|
||||
|
||||
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;
|
||||
import org.gcube.common.storagehub.model.annotations.RootNode;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
@ -19,10 +12,4 @@ import lombok.Setter;
|
|||
@RootNode("nthl:externalFolder")
|
||||
public class ExternalFolder extends FolderItem {
|
||||
|
||||
@Attribute(EXTERNALFOLDERPLUGIN)
|
||||
String managedBy;
|
||||
|
||||
@JsonIgnore
|
||||
@NodeAttribute(value=PARAMETERS_NAME)
|
||||
Metadata connectionParameters = new Metadata();
|
||||
}
|
||||
|
|
|
@ -1,14 +1,22 @@
|
|||
package org.gcube.common.storagehub.model.items;
|
||||
|
||||
import static org.gcube.common.storagehub.model.NodeConstants.PAYLOADBACKEND;
|
||||
|
||||
import org.gcube.common.storagehub.model.annotations.Attribute;
|
||||
import org.gcube.common.storagehub.model.annotations.RootNode;
|
||||
import org.gcube.common.storagehub.model.items.nodes.PayloadBackend;
|
||||
|
||||
import lombok.Getter;
|
||||
import lombok.NoArgsConstructor;
|
||||
import lombok.Setter;
|
||||
|
||||
|
||||
@Getter
|
||||
@Setter
|
||||
@NoArgsConstructor
|
||||
@RootNode("nthl:workspaceItem")
|
||||
public class FolderItem extends Item {
|
||||
|
||||
|
||||
@Attribute(PAYLOADBACKEND)
|
||||
PayloadBackend backend;
|
||||
|
||||
}
|
||||
|
|
|
@ -0,0 +1,23 @@
|
|||
package org.gcube.common.storagehub.model.items.nodes;
|
||||
|
||||
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.AttributeRootNode;
|
||||
import org.gcube.common.storagehub.model.annotations.NodeAttribute;
|
||||
import com.fasterxml.jackson.annotation.JsonIgnore;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@NoArgsConstructor
|
||||
@Data
|
||||
@AttributeRootNode(PAYLOADBACKENDTYPE)
|
||||
public class PayloadBackend {
|
||||
|
||||
@Attribute(STORAGENAME)
|
||||
String storageName;
|
||||
|
||||
@JsonIgnore
|
||||
@NodeAttribute(value=PARAMETERS)
|
||||
Metadata parameters = new Metadata();
|
||||
}
|
|
@ -1,8 +1,12 @@
|
|||
package org.gcube.common.storagehub.model.storages;
|
||||
|
||||
import lombok.AllArgsConstructor;
|
||||
import lombok.Data;
|
||||
import lombok.NoArgsConstructor;
|
||||
|
||||
@Data
|
||||
@AllArgsConstructor
|
||||
@NoArgsConstructor
|
||||
public class MetaInfo {
|
||||
|
||||
long size;
|
||||
|
|
|
@ -2,18 +2,17 @@ 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);
|
||||
MetaInfo onCopy(Content content, String newParentPath, String newName);
|
||||
|
||||
String onMove(AbstractFileItem item);
|
||||
MetaInfo onMove(Content content, String newParentPath);
|
||||
|
||||
void onDelete(Content id);
|
||||
void onDelete(Content content);
|
||||
|
||||
MetaInfo upload(InputStream stream, String relativePath, String name);
|
||||
|
||||
|
|
|
@ -1,9 +1,13 @@
|
|||
package org.gcube.common.storagehub.model.storages;
|
||||
|
||||
public interface StorageBackendFactory<S extends StorageBackend> {
|
||||
import org.gcube.common.storagehub.model.Metadata;
|
||||
import org.gcube.common.storagehub.model.exceptions.InvalidCallParameters;
|
||||
|
||||
public interface StorageBackendFactory {
|
||||
|
||||
String getName();
|
||||
|
||||
S create(String parameter);
|
||||
StorageBackend create(Metadata parameter) throws InvalidCallParameters;
|
||||
|
||||
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue