refactored classes

This commit is contained in:
Massimiliano Assante 2022-05-02 17:54:29 +02:00
parent 99d46e7fc9
commit b593e5fff9
8 changed files with 35 additions and 35 deletions

View File

@ -24,9 +24,9 @@ public class WorkspaceFileItemBean {
@JsonProperty("parent")
@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();
this.id = id;
this.name = name;
@ -60,11 +60,11 @@ public class WorkspaceFileItemBean {
this.path = path;
}
public SharedFolderBean getParent() {
public WorkspaceFolderBean getParent() {
return parent;
}
public void setParent(SharedFolderBean parent) {
public void setParent(WorkspaceFolderBean parent) {
this.parent = parent;
}

View File

@ -5,7 +5,7 @@ import javax.validation.constraints.NotNull;
import com.fasterxml.jackson.annotation.JsonProperty;
public class SharedFolderBean {
public class WorkspaceFolderBean {
@JsonProperty("id")
@NotNull
@ -35,7 +35,7 @@ public class SharedFolderBean {
@NotNull
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();
this.id = id;
this.name = name;
@ -111,7 +111,7 @@ public class SharedFolderBean {
@Override
public String toString() {
StringBuilder builder = new StringBuilder();
builder.append("SharedFolderBean [id=");
builder.append("WorkspaceFolderBean [id=");
builder.append(id);
builder.append(", name=");
builder.append(name);

View File

@ -3,6 +3,6 @@ package org.gcube.social_networking.socialnetworking.model.beans;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
@JsonIgnoreProperties(ignoreUnknown = true)
public interface WorkspaceNotificationBean {
public interface WorkspaceNotification {
}

View File

@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
@JsonIgnoreProperties(ignoreUnknown=true)
public class WSAddedItemNotificationBean implements WorkspaceNotificationBean {
public class WorkspaceNotificationAddedItem implements WorkspaceNotification {
/**
* the username of the user you wish to notify
*/
@ -21,14 +21,14 @@ public class WSAddedItemNotificationBean implements WorkspaceNotificationBean {
@JsonProperty("folderItem")
@NotNull(message="folderItem cannot be missing")
private SharedFolderBean folder;
private WorkspaceFolderBean folder;
public WSAddedItemNotificationBean() {
public WorkspaceNotificationAddedItem() {
super();
// TODO Auto-generated constructor stub
}
public WSAddedItemNotificationBean(String userIdToNotify, WorkspaceFileItemBean item, SharedFolderBean folder) {
public WorkspaceNotificationAddedItem(String userIdToNotify, WorkspaceFileItemBean item, WorkspaceFolderBean folder) {
super();
this.userIdToNotify = userIdToNotify;
this.item = item;
@ -51,17 +51,17 @@ public class WSAddedItemNotificationBean implements WorkspaceNotificationBean {
this.item = item;
}
public SharedFolderBean getFolder() {
public WorkspaceFolderBean getFolder() {
return folder;
}
public void setFolder(SharedFolderBean folder) {
public void setFolder(WorkspaceFolderBean folder) {
this.folder = folder;
}
@Override
public String toString() {
return "WSAddedItemNotificationBean [userIdToNotify=" + userIdToNotify + ", item=" + item + ", folder=" + folder
return "WorkspaceNotificationAddedItem [userIdToNotify=" + userIdToNotify + ", item=" + item + ", folder=" + folder
+ "]";
}
}

View File

@ -7,13 +7,13 @@ public class WorkspaceNotificationMessage {
private WorkspaceNotificationType type;
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)
private WorkspaceNotificationBean bean;
private WorkspaceNotification bean;
public WorkspaceNotificationMessage() {
super();
}
public WorkspaceNotificationMessage(WorkspaceNotificationType type, WorkspaceNotificationBean bean) {
public WorkspaceNotificationMessage(WorkspaceNotificationType type, WorkspaceNotification bean) {
super();
this.type = type;
this.bean = bean;
@ -23,7 +23,7 @@ public class WorkspaceNotificationMessage {
return type;
}
public WorkspaceNotificationBean getBean() {
public WorkspaceNotification getBean() {
return bean;
}
@ -31,7 +31,7 @@ public class WorkspaceNotificationMessage {
this.type = type;
}
public void setBean(WorkspaceNotificationBean bean) {
public void setBean(WorkspaceNotification bean) {
this.bean = bean;
}
}

View File

@ -8,7 +8,7 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
@JsonIgnoreProperties(ignoreUnknown=true)
public class WSSharedFolderNotificationBean implements WorkspaceNotificationBean {
public class WorkspaceNotificationSharedFolder implements WorkspaceNotification {
/**
* the username of the user you wish to notify
@ -19,9 +19,9 @@ public class WSSharedFolderNotificationBean implements WorkspaceNotificationBean
@JsonProperty("folderItem")
@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();
this.userIdToNotify = userIdToNotify;
this.folder = folder;
@ -35,16 +35,16 @@ public class WSSharedFolderNotificationBean implements WorkspaceNotificationBean
this.userIdToNotify = userIdToNotify;
}
public SharedFolderBean getFolder() {
public WorkspaceFolderBean getFolder() {
return folder;
}
public void setFolder(SharedFolderBean folder) {
public void setFolder(WorkspaceFolderBean folder) {
this.folder = folder;
}
@Override
public String toString() {
return "WSSharedFolderNotificationBean [userIdToNotify=" + userIdToNotify + ", folder=" + folder + "]";
return "WorkspaceNotificationSharedFolder [userIdToNotify=" + userIdToNotify + ", folder=" + folder + "]";
}
}

View File

@ -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
*/
ITEM_NEW(WSAddedItemNotificationBean.class),
ITEM_NEW(WorkspaceNotificationAddedItem.class),
/**
* 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
*/
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;
}
public Class<? extends WorkspaceNotificationBean> getNotificationClass(){
public Class<? extends WorkspaceNotification> getNotificationClass(){
return this.beanClass;
}

View File

@ -7,7 +7,7 @@ import com.fasterxml.jackson.annotation.JsonProperty;
import com.fasterxml.jackson.annotation.JsonTypeName;
@JsonIgnoreProperties(ignoreUnknown=true)
public class WSUnsharedFolderNotificationBean implements WorkspaceNotificationBean {
public class WorkspaceNotificationUnsharedFolder implements WorkspaceNotification {
/**
* the username of the user you wish to notify
@ -25,12 +25,12 @@ public class WSUnsharedFolderNotificationBean implements WorkspaceNotificationBe
private String unsharedFolderName;
public WSUnsharedFolderNotificationBean() {
public WorkspaceNotificationUnsharedFolder() {
super();
// TODO Auto-generated constructor stub
}
public WSUnsharedFolderNotificationBean(String userIdToNotify, String unsharedFolderId, String unsharedFolderName) {
public WorkspaceNotificationUnsharedFolder(String userIdToNotify, String unsharedFolderId, String unsharedFolderName) {
super();
this.userIdToNotify = userIdToNotify;
this.unsharedFolderId = unsharedFolderId;
@ -39,7 +39,7 @@ public class WSUnsharedFolderNotificationBean implements WorkspaceNotificationBe
@Override
public String toString() {
return "WSUnsharedFolderNotificationBean [userIdToNotify=" + userIdToNotify + ", unsharedFolderId="
return "WorkspaceNotificationUnsharedFolder [userIdToNotify=" + userIdToNotify + ", unsharedFolderId="
+ unsharedFolderId + ", unsharedFolderName=" + unsharedFolderName + "]";
}