first notifications working
This commit is contained in:
parent
593644b9ec
commit
2fcbb24d63
7
pom.xml
7
pom.xml
|
@ -20,6 +20,7 @@
|
||||||
<properties>
|
<properties>
|
||||||
<java-version>1.8</java-version>
|
<java-version>1.8</java-version>
|
||||||
<version.jersey>2.9</version.jersey>
|
<version.jersey>2.9</version.jersey>
|
||||||
|
<jackson.version>2.8.11</jackson.version>
|
||||||
<enunciate.version>2.14.0</enunciate.version>
|
<enunciate.version>2.14.0</enunciate.version>
|
||||||
<gCubeSubsystem>social-networking</gCubeSubsystem>
|
<gCubeSubsystem>social-networking</gCubeSubsystem>
|
||||||
<distroDirectory>${project.basedir}/distro</distroDirectory>
|
<distroDirectory>${project.basedir}/distro</distroDirectory>
|
||||||
|
@ -54,12 +55,16 @@
|
||||||
</scm>
|
</scm>
|
||||||
|
|
||||||
<dependencies>
|
<dependencies>
|
||||||
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.common</groupId>
|
<groupId>org.gcube.common</groupId>
|
||||||
<artifactId>storagehub-model</artifactId>
|
<artifactId>storagehub-model</artifactId>
|
||||||
<version>[1.0.0,2.0.0-SNAPSHOT)</version>
|
<version>[1.0.0,2.0.0-SNAPSHOT)</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-annotations</artifactId>
|
||||||
|
<version>${jackson.version}</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.glassfish.jersey.ext</groupId>
|
<groupId>org.glassfish.jersey.ext</groupId>
|
||||||
<artifactId>jersey-bean-validation</artifactId>
|
<artifactId>jersey-bean-validation</artifactId>
|
||||||
|
|
|
@ -2,9 +2,13 @@ package org.gcube.social_networking.socialnetworking.model.beans;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||||
|
|
||||||
public class WSAddedItemNotificationBean implements WorkspaceNotificationBean {
|
@JsonTypeName("ITEM_NEW")
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown=true)
|
||||||
|
public class WSAddedItemNotificationBean extends WorkspaceNotificationBean {
|
||||||
/**
|
/**
|
||||||
* the username of the user you wish to notify
|
* the username of the user you wish to notify
|
||||||
*/
|
*/
|
||||||
|
@ -20,6 +24,11 @@ public class WSAddedItemNotificationBean implements WorkspaceNotificationBean {
|
||||||
@NotNull(message="folderItem cannot be missing")
|
@NotNull(message="folderItem cannot be missing")
|
||||||
private SharedFolderBean folder;
|
private SharedFolderBean folder;
|
||||||
|
|
||||||
|
public WSAddedItemNotificationBean() {
|
||||||
|
super();
|
||||||
|
// TODO Auto-generated constructor stub
|
||||||
|
}
|
||||||
|
|
||||||
public WSAddedItemNotificationBean(String userIdToNotify, WorkspaceFileItemBean item, SharedFolderBean folder) {
|
public WSAddedItemNotificationBean(String userIdToNotify, WorkspaceFileItemBean item, SharedFolderBean folder) {
|
||||||
super();
|
super();
|
||||||
this.userIdToNotify = userIdToNotify;
|
this.userIdToNotify = userIdToNotify;
|
||||||
|
|
|
@ -2,9 +2,14 @@ package org.gcube.social_networking.socialnetworking.model.beans;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||||
|
|
||||||
public class WSSharedFolderNotificationBean implements WorkspaceNotificationBean {
|
|
||||||
|
@JsonTypeName("FOLDER_SHARE")
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown=true)
|
||||||
|
public class WSSharedFolderNotificationBean extends WorkspaceNotificationBean {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the username of the user you wish to notify
|
* the username of the user you wish to notify
|
||||||
|
|
|
@ -2,9 +2,12 @@ package org.gcube.social_networking.socialnetworking.model.beans;
|
||||||
|
|
||||||
import javax.validation.constraints.NotNull;
|
import javax.validation.constraints.NotNull;
|
||||||
|
|
||||||
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||||
|
|
||||||
public class WSUnsharedFolderNotificationBean implements WorkspaceNotificationBean {
|
@JsonTypeName("FOLDER_UNSHARE")
|
||||||
|
public class WSUnsharedFolderNotificationBean extends WorkspaceNotificationBean {
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* the username of the user you wish to notify
|
* the username of the user you wish to notify
|
||||||
|
@ -21,6 +24,12 @@ public class WSUnsharedFolderNotificationBean implements WorkspaceNotificationBe
|
||||||
@NotNull(message="unsharedFolderName cannot be missing")
|
@NotNull(message="unsharedFolderName cannot be missing")
|
||||||
private String unsharedFolderName;
|
private String unsharedFolderName;
|
||||||
|
|
||||||
|
|
||||||
|
public WSUnsharedFolderNotificationBean() {
|
||||||
|
super();
|
||||||
|
// TODO Auto-generated constructor stub
|
||||||
|
}
|
||||||
|
|
||||||
public WSUnsharedFolderNotificationBean(String userIdToNotify, String unsharedFolderId, String unsharedFolderName) {
|
public WSUnsharedFolderNotificationBean(String userIdToNotify, String unsharedFolderId, String unsharedFolderName) {
|
||||||
super();
|
super();
|
||||||
this.userIdToNotify = userIdToNotify;
|
this.userIdToNotify = userIdToNotify;
|
||||||
|
|
|
@ -1,5 +1,17 @@
|
||||||
package org.gcube.social_networking.socialnetworking.model.beans;
|
package org.gcube.social_networking.socialnetworking.model.beans;
|
||||||
|
|
||||||
public interface WorkspaceNotificationBean {
|
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonSubTypes;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||||
|
import com.fasterxml.jackson.annotation.JsonTypeInfo.As;
|
||||||
|
|
||||||
|
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||||
|
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME,
|
||||||
|
include = As.PROPERTY, property = "type") @JsonSubTypes({
|
||||||
|
@JsonSubTypes.Type(value = WSSharedFolderNotificationBean.class, name = "FOLDER_SHARE"),
|
||||||
|
@JsonSubTypes.Type(value = WSUnsharedFolderNotificationBean.class, name = "FOLDER_UNSHARE"),
|
||||||
|
@JsonSubTypes.Type(value = WSAddedItemNotificationBean.class, name = "ITEM_NEW")
|
||||||
|
})
|
||||||
|
public abstract class WorkspaceNotificationBean {
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -6,6 +6,10 @@ public class WorkspaceNotificationMessage {
|
||||||
|
|
||||||
private WorkspaceNotificationBean bean;
|
private WorkspaceNotificationBean bean;
|
||||||
|
|
||||||
|
public WorkspaceNotificationMessage() {
|
||||||
|
super();
|
||||||
|
}
|
||||||
|
|
||||||
public WorkspaceNotificationMessage(WorkspaceNotificationType type, WorkspaceNotificationBean bean) {
|
public WorkspaceNotificationMessage(WorkspaceNotificationType type, WorkspaceNotificationBean bean) {
|
||||||
super();
|
super();
|
||||||
this.type = type;
|
this.type = type;
|
||||||
|
@ -20,6 +24,11 @@ public class WorkspaceNotificationMessage {
|
||||||
return bean;
|
return bean;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public void setType(WorkspaceNotificationType type) {
|
||||||
|
this.type = type;
|
||||||
|
}
|
||||||
|
|
||||||
|
public void setBean(WorkspaceNotificationBean bean) {
|
||||||
|
this.bean = bean;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue