refactored classes
This commit is contained in:
parent
99d46e7fc9
commit
b593e5fff9
|
@ -24,9 +24,9 @@ public class WorkspaceFileItemBean {
|
||||||
|
|
||||||
@JsonProperty("parent")
|
@JsonProperty("parent")
|
||||||
@NotNull
|
@NotNull
|
||||||
private SharedFolderBean parent;
|
private WorkspaceFolderBean parent;
|
||||||
|
|
||||||
public WorkspaceFileItemBean(String id, String name, String title, String path, SharedFolderBean parent) {
|
public WorkspaceFileItemBean(String id, String name, String title, String path, WorkspaceFolderBean parent) {
|
||||||
super();
|
super();
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
@ -60,11 +60,11 @@ public class WorkspaceFileItemBean {
|
||||||
this.path = path;
|
this.path = path;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SharedFolderBean getParent() {
|
public WorkspaceFolderBean getParent() {
|
||||||
return parent;
|
return parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setParent(SharedFolderBean parent) {
|
public void setParent(WorkspaceFolderBean parent) {
|
||||||
this.parent = parent;
|
this.parent = parent;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -5,7 +5,7 @@ import javax.validation.constraints.NotNull;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
|
||||||
|
|
||||||
public class SharedFolderBean {
|
public class WorkspaceFolderBean {
|
||||||
|
|
||||||
@JsonProperty("id")
|
@JsonProperty("id")
|
||||||
@NotNull
|
@NotNull
|
||||||
|
@ -35,7 +35,7 @@ public class SharedFolderBean {
|
||||||
@NotNull
|
@NotNull
|
||||||
boolean vreFolder;
|
boolean vreFolder;
|
||||||
|
|
||||||
public SharedFolderBean(String id, String name, String title, String displayName, String path, String parentId, boolean vreFolder) {
|
public WorkspaceFolderBean(String id, String name, String title, String displayName, String path, String parentId, boolean vreFolder) {
|
||||||
super();
|
super();
|
||||||
this.id = id;
|
this.id = id;
|
||||||
this.name = name;
|
this.name = name;
|
||||||
|
@ -111,7 +111,7 @@ public class SharedFolderBean {
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
StringBuilder builder = new StringBuilder();
|
StringBuilder builder = new StringBuilder();
|
||||||
builder.append("SharedFolderBean [id=");
|
builder.append("WorkspaceFolderBean [id=");
|
||||||
builder.append(id);
|
builder.append(id);
|
||||||
builder.append(", name=");
|
builder.append(", name=");
|
||||||
builder.append(name);
|
builder.append(name);
|
|
@ -3,6 +3,6 @@ package org.gcube.social_networking.socialnetworking.model.beans;
|
||||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
|
||||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
public interface WorkspaceNotificationBean {
|
public interface WorkspaceNotification {
|
||||||
|
|
||||||
}
|
}
|
|
@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||||
|
|
||||||
@JsonIgnoreProperties(ignoreUnknown=true)
|
@JsonIgnoreProperties(ignoreUnknown=true)
|
||||||
public class WSAddedItemNotificationBean implements WorkspaceNotificationBean {
|
public class WorkspaceNotificationAddedItem implements WorkspaceNotification {
|
||||||
/**
|
/**
|
||||||
* the username of the user you wish to notify
|
* the username of the user you wish to notify
|
||||||
*/
|
*/
|
||||||
|
@ -21,14 +21,14 @@ public class WSAddedItemNotificationBean implements WorkspaceNotificationBean {
|
||||||
|
|
||||||
@JsonProperty("folderItem")
|
@JsonProperty("folderItem")
|
||||||
@NotNull(message="folderItem cannot be missing")
|
@NotNull(message="folderItem cannot be missing")
|
||||||
private SharedFolderBean folder;
|
private WorkspaceFolderBean folder;
|
||||||
|
|
||||||
public WSAddedItemNotificationBean() {
|
public WorkspaceNotificationAddedItem() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
}
|
}
|
||||||
|
|
||||||
public WSAddedItemNotificationBean(String userIdToNotify, WorkspaceFileItemBean item, SharedFolderBean folder) {
|
public WorkspaceNotificationAddedItem(String userIdToNotify, WorkspaceFileItemBean item, WorkspaceFolderBean folder) {
|
||||||
super();
|
super();
|
||||||
this.userIdToNotify = userIdToNotify;
|
this.userIdToNotify = userIdToNotify;
|
||||||
this.item = item;
|
this.item = item;
|
||||||
|
@ -51,17 +51,17 @@ public class WSAddedItemNotificationBean implements WorkspaceNotificationBean {
|
||||||
this.item = item;
|
this.item = item;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SharedFolderBean getFolder() {
|
public WorkspaceFolderBean getFolder() {
|
||||||
return folder;
|
return folder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFolder(SharedFolderBean folder) {
|
public void setFolder(WorkspaceFolderBean folder) {
|
||||||
this.folder = folder;
|
this.folder = folder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "WSAddedItemNotificationBean [userIdToNotify=" + userIdToNotify + ", item=" + item + ", folder=" + folder
|
return "WorkspaceNotificationAddedItem [userIdToNotify=" + userIdToNotify + ", item=" + item + ", folder=" + folder
|
||||||
+ "]";
|
+ "]";
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -7,13 +7,13 @@ public class WorkspaceNotificationMessage {
|
||||||
private WorkspaceNotificationType type;
|
private WorkspaceNotificationType type;
|
||||||
|
|
||||||
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)
|
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)
|
||||||
private WorkspaceNotificationBean bean;
|
private WorkspaceNotification bean;
|
||||||
|
|
||||||
public WorkspaceNotificationMessage() {
|
public WorkspaceNotificationMessage() {
|
||||||
super();
|
super();
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorkspaceNotificationMessage(WorkspaceNotificationType type, WorkspaceNotificationBean bean) {
|
public WorkspaceNotificationMessage(WorkspaceNotificationType type, WorkspaceNotification bean) {
|
||||||
super();
|
super();
|
||||||
this.type = type;
|
this.type = type;
|
||||||
this.bean = bean;
|
this.bean = bean;
|
||||||
|
@ -23,7 +23,7 @@ public class WorkspaceNotificationMessage {
|
||||||
return type;
|
return type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public WorkspaceNotificationBean getBean() {
|
public WorkspaceNotification getBean() {
|
||||||
return bean;
|
return bean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -31,7 +31,7 @@ public class WorkspaceNotificationMessage {
|
||||||
this.type = type;
|
this.type = type;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setBean(WorkspaceNotificationBean bean) {
|
public void setBean(WorkspaceNotification bean) {
|
||||||
this.bean = bean;
|
this.bean = bean;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||||
|
|
||||||
|
|
||||||
@JsonIgnoreProperties(ignoreUnknown=true)
|
@JsonIgnoreProperties(ignoreUnknown=true)
|
||||||
public class WSSharedFolderNotificationBean implements WorkspaceNotificationBean {
|
public class WorkspaceNotificationSharedFolder implements WorkspaceNotification {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the username of the user you wish to notify
|
* the username of the user you wish to notify
|
||||||
|
@ -19,9 +19,9 @@ public class WSSharedFolderNotificationBean implements WorkspaceNotificationBean
|
||||||
|
|
||||||
@JsonProperty("folderItem")
|
@JsonProperty("folderItem")
|
||||||
@NotNull(message="folderItem cannot be missing")
|
@NotNull(message="folderItem cannot be missing")
|
||||||
private SharedFolderBean folder;
|
private WorkspaceFolderBean folder;
|
||||||
|
|
||||||
public WSSharedFolderNotificationBean(String userIdToNotify, SharedFolderBean folder) {
|
public WorkspaceNotificationSharedFolder(String userIdToNotify, WorkspaceFolderBean folder) {
|
||||||
super();
|
super();
|
||||||
this.userIdToNotify = userIdToNotify;
|
this.userIdToNotify = userIdToNotify;
|
||||||
this.folder = folder;
|
this.folder = folder;
|
||||||
|
@ -35,16 +35,16 @@ public class WSSharedFolderNotificationBean implements WorkspaceNotificationBean
|
||||||
this.userIdToNotify = userIdToNotify;
|
this.userIdToNotify = userIdToNotify;
|
||||||
}
|
}
|
||||||
|
|
||||||
public SharedFolderBean getFolder() {
|
public WorkspaceFolderBean getFolder() {
|
||||||
return folder;
|
return folder;
|
||||||
}
|
}
|
||||||
|
|
||||||
public void setFolder(SharedFolderBean folder) {
|
public void setFolder(WorkspaceFolderBean folder) {
|
||||||
this.folder = folder;
|
this.folder = folder;
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "WSSharedFolderNotificationBean [userIdToNotify=" + userIdToNotify + ", folder=" + folder + "]";
|
return "WorkspaceNotificationSharedFolder [userIdToNotify=" + userIdToNotify + ", folder=" + folder + "]";
|
||||||
}
|
}
|
||||||
}
|
}
|
|
@ -5,26 +5,26 @@ public enum WorkspaceNotificationType {
|
||||||
/**
|
/**
|
||||||
* use to notify a user she got a workspace item new in some of her workspace shared folder
|
* use to notify a user she got a workspace item new in some of her workspace shared folder
|
||||||
*/
|
*/
|
||||||
ITEM_NEW(WSAddedItemNotificationBean.class),
|
ITEM_NEW(WorkspaceNotificationAddedItem.class),
|
||||||
/**
|
/**
|
||||||
* use to notify a user he got a workspace folder shared
|
* use to notify a user he got a workspace folder shared
|
||||||
*/
|
*/
|
||||||
FOLDER_SHARE(WSSharedFolderNotificationBean.class),
|
FOLDER_SHARE(WorkspaceNotificationSharedFolder.class),
|
||||||
/**
|
/**
|
||||||
* use to notify a user he got a workspace folder Unshared
|
* use to notify a user he got a workspace folder Unshared
|
||||||
*/
|
*/
|
||||||
FOLDER_UNSHARE(WSUnsharedFolderNotificationBean.class);
|
FOLDER_UNSHARE(WorkspaceNotificationUnsharedFolder.class);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
Class<? extends WorkspaceNotificationBean> beanClass;
|
Class<? extends WorkspaceNotification> beanClass;
|
||||||
|
|
||||||
WorkspaceNotificationType(Class<? extends WorkspaceNotificationBean> beanClass){
|
WorkspaceNotificationType(Class<? extends WorkspaceNotification> beanClass){
|
||||||
this.beanClass = beanClass;
|
this.beanClass = beanClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
public Class<? extends WorkspaceNotificationBean> getNotificationClass(){
|
public Class<? extends WorkspaceNotification> getNotificationClass(){
|
||||||
return this.beanClass;
|
return this.beanClass;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||||
|
|
||||||
@JsonIgnoreProperties(ignoreUnknown=true)
|
@JsonIgnoreProperties(ignoreUnknown=true)
|
||||||
public class WSUnsharedFolderNotificationBean implements WorkspaceNotificationBean {
|
public class WorkspaceNotificationUnsharedFolder implements WorkspaceNotification {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the username of the user you wish to notify
|
* the username of the user you wish to notify
|
||||||
|
@ -25,12 +25,12 @@ public class WSUnsharedFolderNotificationBean implements WorkspaceNotificationBe
|
||||||
private String unsharedFolderName;
|
private String unsharedFolderName;
|
||||||
|
|
||||||
|
|
||||||
public WSUnsharedFolderNotificationBean() {
|
public WorkspaceNotificationUnsharedFolder() {
|
||||||
super();
|
super();
|
||||||
// TODO Auto-generated constructor stub
|
// TODO Auto-generated constructor stub
|
||||||
}
|
}
|
||||||
|
|
||||||
public WSUnsharedFolderNotificationBean(String userIdToNotify, String unsharedFolderId, String unsharedFolderName) {
|
public WorkspaceNotificationUnsharedFolder(String userIdToNotify, String unsharedFolderId, String unsharedFolderName) {
|
||||||
super();
|
super();
|
||||||
this.userIdToNotify = userIdToNotify;
|
this.userIdToNotify = userIdToNotify;
|
||||||
this.unsharedFolderId = unsharedFolderId;
|
this.unsharedFolderId = unsharedFolderId;
|
||||||
|
@ -39,7 +39,7 @@ public class WSUnsharedFolderNotificationBean implements WorkspaceNotificationBe
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return "WSUnsharedFolderNotificationBean [userIdToNotify=" + userIdToNotify + ", unsharedFolderId="
|
return "WorkspaceNotificationUnsharedFolder [userIdToNotify=" + userIdToNotify + ", unsharedFolderId="
|
||||||
+ unsharedFolderId + ", unsharedFolderName=" + unsharedFolderName + "]";
|
+ unsharedFolderId + ", unsharedFolderName=" + unsharedFolderName + "]";
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue