added partial support for workspace notifications
parent
b11217abf0
commit
a0432fed4d
@ -0,0 +1,131 @@
|
||||
package org.gcube.social_networking.socialnetworking.model.beans;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
|
||||
public class SharedFolderBean {
|
||||
|
||||
@JsonProperty("id")
|
||||
@NotNull
|
||||
private String id;
|
||||
|
||||
@JsonProperty("name")
|
||||
@NotNull
|
||||
private String name;
|
||||
|
||||
@JsonProperty("title")
|
||||
@NotNull
|
||||
private String title;
|
||||
|
||||
@JsonProperty("displayName")
|
||||
@NotNull
|
||||
private String displayName;
|
||||
|
||||
@JsonProperty("path")
|
||||
@NotNull
|
||||
private String path;
|
||||
|
||||
@JsonProperty("parentId")
|
||||
@NotNull
|
||||
private String parentId;
|
||||
|
||||
@JsonProperty("vreFolder")
|
||||
@NotNull
|
||||
boolean vreFolder;
|
||||
|
||||
public SharedFolderBean(String id, String name, String title, String displayName, String path, String parentId, boolean vreFolder) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.title = title;
|
||||
this.displayName = displayName;
|
||||
this.path = path;
|
||||
this.parentId = parentId;
|
||||
this.vreFolder = vreFolder;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getDisplayName() {
|
||||
return displayName;
|
||||
}
|
||||
|
||||
public void setDisplayName(String displayName) {
|
||||
this.displayName = displayName;
|
||||
}
|
||||
|
||||
public String getParentId() {
|
||||
return parentId;
|
||||
}
|
||||
|
||||
public void setParentId(String parentId) {
|
||||
this.parentId = parentId;
|
||||
}
|
||||
|
||||
public boolean isVreFolder() {
|
||||
return vreFolder;
|
||||
}
|
||||
|
||||
public void setVreFolder(boolean vreFolder) {
|
||||
this.vreFolder = vreFolder;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("SharedFolderBean [id=");
|
||||
builder.append(id);
|
||||
builder.append(", name=");
|
||||
builder.append(name);
|
||||
builder.append(", displayName=");
|
||||
builder.append(displayName);
|
||||
builder.append(", path=");
|
||||
builder.append(path);
|
||||
builder.append(", parentId=");
|
||||
builder.append(parentId);
|
||||
builder.append(", vreFolder=");
|
||||
builder.append(vreFolder);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,59 @@
|
||||
package org.gcube.social_networking.socialnetworking.model.beans;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class WSAddedItemNotificationBean implements WorkspaceNotificationBean {
|
||||
/**
|
||||
* the username of the user you wish to notify
|
||||
*/
|
||||
@JsonProperty("userIdToNotify")
|
||||
@NotNull(message="recipient cannot be missing")
|
||||
private String userIdToNotify;
|
||||
|
||||
@JsonProperty("fileItem")
|
||||
@NotNull(message="fileItem cannot be missing")
|
||||
private WorkspaceFileItemBean item;
|
||||
|
||||
@JsonProperty("folderItem")
|
||||
@NotNull(message="folderItem cannot be missing")
|
||||
private SharedFolderBean folder;
|
||||
|
||||
public WSAddedItemNotificationBean(String userIdToNotify, WorkspaceFileItemBean item, SharedFolderBean folder) {
|
||||
super();
|
||||
this.userIdToNotify = userIdToNotify;
|
||||
this.item = item;
|
||||
this.folder = folder;
|
||||
}
|
||||
|
||||
public String getUserIdToNotify() {
|
||||
return userIdToNotify;
|
||||
}
|
||||
|
||||
public void setUserIdToNotify(String userIdToNotify) {
|
||||
this.userIdToNotify = userIdToNotify;
|
||||
}
|
||||
|
||||
public WorkspaceFileItemBean getItem() {
|
||||
return item;
|
||||
}
|
||||
|
||||
public void setItem(WorkspaceFileItemBean item) {
|
||||
this.item = item;
|
||||
}
|
||||
|
||||
public SharedFolderBean getFolder() {
|
||||
return folder;
|
||||
}
|
||||
|
||||
public void setFolder(SharedFolderBean folder) {
|
||||
this.folder = folder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WSAddedItemNotificationBean [userIdToNotify=" + userIdToNotify + ", item=" + item + ", folder=" + folder
|
||||
+ "]";
|
||||
}
|
||||
}
|
@ -0,0 +1,46 @@
|
||||
package org.gcube.social_networking.socialnetworking.model.beans;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class WSSharedFolderNotificationBean implements WorkspaceNotificationBean {
|
||||
|
||||
/**
|
||||
* the username of the user you wish to notify
|
||||
*/
|
||||
@JsonProperty("userIdToNotify")
|
||||
@NotNull(message="recipient cannot be missing")
|
||||
private String userIdToNotify;
|
||||
|
||||
@JsonProperty("folderItem")
|
||||
@NotNull(message="folderItem cannot be missing")
|
||||
private SharedFolderBean folder;
|
||||
|
||||
public WSSharedFolderNotificationBean(String userIdToNotify, SharedFolderBean folder) {
|
||||
super();
|
||||
this.userIdToNotify = userIdToNotify;
|
||||
this.folder = folder;
|
||||
}
|
||||
|
||||
public String getUserIdToNotify() {
|
||||
return userIdToNotify;
|
||||
}
|
||||
|
||||
public void setUserIdToNotify(String userIdToNotify) {
|
||||
this.userIdToNotify = userIdToNotify;
|
||||
}
|
||||
|
||||
public SharedFolderBean getFolder() {
|
||||
return folder;
|
||||
}
|
||||
|
||||
public void setFolder(SharedFolderBean folder) {
|
||||
this.folder = folder;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "WSSharedFolderNotificationBean [userIdToNotify=" + userIdToNotify + ", folder=" + folder + "]";
|
||||
}
|
||||
}
|
@ -0,0 +1,100 @@
|
||||
package org.gcube.social_networking.socialnetworking.model.beans;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
public class WorkspaceFileItemBean {
|
||||
|
||||
@JsonProperty("id")
|
||||
@NotNull
|
||||
private String id;
|
||||
|
||||
@JsonProperty("name")
|
||||
@NotNull
|
||||
private String name;
|
||||
|
||||
@JsonProperty("title")
|
||||
@NotNull
|
||||
private String title;
|
||||
|
||||
@JsonProperty("path")
|
||||
@NotNull
|
||||
private String path;
|
||||
|
||||
@JsonProperty("parent")
|
||||
@NotNull
|
||||
private SharedFolderBean parent;
|
||||
|
||||
public WorkspaceFileItemBean(String id, String name, String title, String path, SharedFolderBean parent) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.name = name;
|
||||
this.title = title;
|
||||
this.path = path;
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getName() {
|
||||
return name;
|
||||
}
|
||||
|
||||
public void setName(String name) {
|
||||
this.name = name;
|
||||
}
|
||||
|
||||
public String getPath() {
|
||||
return path;
|
||||
}
|
||||
|
||||
public void setPath(String path) {
|
||||
this.path = path;
|
||||
}
|
||||
|
||||
public SharedFolderBean getParent() {
|
||||
return parent;
|
||||
}
|
||||
|
||||
public void setParent(SharedFolderBean parent) {
|
||||
this.parent = parent;
|
||||
}
|
||||
|
||||
public String getTitle() {
|
||||
return title;
|
||||
}
|
||||
|
||||
|
||||
public void setTitle(String title) {
|
||||
this.title = title;
|
||||
}
|
||||
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
StringBuilder builder = new StringBuilder();
|
||||
builder.append("WorkspaceFileItemBean [id=");
|
||||
builder.append(id);
|
||||
builder.append(", name=");
|
||||
builder.append(name);
|
||||
builder.append(", title=");
|
||||
builder.append(title);
|
||||
builder.append(", path=");
|
||||
builder.append(path);
|
||||
builder.append(", parent=");
|
||||
builder.append(parent);
|
||||
builder.append("]");
|
||||
return builder.toString();
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,5 @@
|
||||
package org.gcube.social_networking.socialnetworking.model.beans;
|
||||
|
||||
interface WorkspaceNotificationBean {
|
||||
|
||||
}
|
@ -0,0 +1,25 @@
|
||||
package org.gcube.social_networking.socialnetworking.model.beans;
|
||||
|
||||
public class WorkspaceNotificationMessage {
|
||||
|
||||
private WorkspaceNotificationType type;
|
||||
|
||||
private WorkspaceNotificationBean bean;
|
||||
|
||||
public WorkspaceNotificationMessage(WorkspaceNotificationType type, WorkspaceNotificationBean bean) {
|
||||
super();
|
||||
this.type = type;
|
||||
this.bean = bean;
|
||||
}
|
||||
|
||||
public WorkspaceNotificationType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public WorkspaceNotificationBean getBean() {
|
||||
return bean;
|
||||
}
|
||||
|
||||
|
||||
|
||||
}
|
@ -0,0 +1,26 @@
|
||||
package org.gcube.social_networking.socialnetworking.model.beans;
|
||||
|
||||
public enum WorkspaceNotificationType {
|
||||
|
||||
/**
|
||||
* use to notify a user she got a workspace item new in some of her workspace shared folder
|
||||
*/
|
||||
WP_ITEM_NEW(WSAddedItemNotificationBean.class),
|
||||
/**
|
||||
* use to notify a user he got a workspace folder shared
|
||||
*/
|
||||
WP_FOLDER_SHARE(WSSharedFolderNotificationBean.class);
|
||||
|
||||
|
||||
Class<? extends WorkspaceNotificationBean> beanClass;
|
||||
|
||||
WorkspaceNotificationType(Class<? extends WorkspaceNotificationBean> beanClass){
|
||||
this.beanClass = beanClass;
|
||||
}
|
||||
|
||||
|
||||
public Class<? extends WorkspaceNotificationBean> getNotificationClass(){
|
||||
return this.beanClass;
|
||||
}
|
||||
|
||||
}
|
Loading…
Reference in New Issue