remodeled in better way
This commit is contained in:
parent
82cd6553f3
commit
0c79f9ba3f
|
@ -1,6 +1,6 @@
|
|||
# Changelog
|
||||
|
||||
## [v1.1.3-SNAPSHOT] - 2022-05-02
|
||||
## [v1.1.5-SNAPSHOT] - 2022-05-02
|
||||
|
||||
- Partially added support for workspace notifications
|
||||
|
||||
|
|
15
pom.xml
15
pom.xml
|
@ -12,7 +12,7 @@
|
|||
|
||||
<groupId>org.gcube.social-networking</groupId>
|
||||
<artifactId>social-service-model</artifactId>
|
||||
<version>1.1.3-SNAPSHOT</version>
|
||||
<version>1.1.5-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>social-networking-service-model</name>
|
||||
<description>Social networking service model classes</description>
|
||||
|
@ -55,6 +55,19 @@
|
|||
</scm>
|
||||
|
||||
<dependencies>
|
||||
<!-- enunciate deps -->
|
||||
<dependency>
|
||||
<groupId>com.webcohesion.enunciate</groupId>
|
||||
<artifactId>enunciate-core-annotations</artifactId>
|
||||
<version>${enunciate.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.webcohesion.enunciate</groupId>
|
||||
<artifactId>enunciate-rt-util</artifactId>
|
||||
<version>${enunciate.version}</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>storagehub-model</artifactId>
|
||||
|
|
|
@ -1,8 +1,26 @@
|
|||
package org.gcube.social_networking.socialnetworking.model.beans;
|
||||
|
||||
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;
|
||||
|
||||
/**
|
||||
* The WorkspaceNotification super class
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public interface WorkspaceNotification {
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.NAME,
|
||||
include = As.PROPERTY, property = "type") @JsonSubTypes({
|
||||
@JsonSubTypes.Type(value = WorkspaceNotificationSharedFolder.class, name = "FOLDER_SHARE"),
|
||||
@JsonSubTypes.Type(value = WorkspaceNotificationUnsharedFolder.class, name = "FOLDER_UNSHARE"),
|
||||
@JsonSubTypes.Type(value = WorkspaceNotificationAddedItem.class, name = "ITEM_NEW")
|
||||
})
|
||||
public abstract class WorkspaceNotification {
|
||||
WorkspaceNotificationType type;
|
||||
|
||||
public WorkspaceNotificationType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
|
||||
}
|
||||
|
|
|
@ -7,7 +7,8 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown=true)
|
||||
public class WorkspaceNotificationAddedItem implements WorkspaceNotification {
|
||||
@JsonTypeName("ITEM_NEW")
|
||||
public class WorkspaceNotificationAddedItem extends WorkspaceNotification {
|
||||
/**
|
||||
* the username of the user you wish to notify
|
||||
*/
|
||||
|
|
|
@ -1,37 +0,0 @@
|
|||
package org.gcube.social_networking.socialnetworking.model.beans;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonTypeInfo;
|
||||
|
||||
public class WorkspaceNotificationMessage {
|
||||
|
||||
private WorkspaceNotificationType type;
|
||||
|
||||
@JsonTypeInfo(use = JsonTypeInfo.Id.CLASS)
|
||||
private WorkspaceNotification bean;
|
||||
|
||||
public WorkspaceNotificationMessage() {
|
||||
super();
|
||||
}
|
||||
|
||||
public WorkspaceNotificationMessage(WorkspaceNotificationType type, WorkspaceNotification bean) {
|
||||
super();
|
||||
this.type = type;
|
||||
this.bean = bean;
|
||||
}
|
||||
|
||||
public WorkspaceNotificationType getType() {
|
||||
return type;
|
||||
}
|
||||
|
||||
public WorkspaceNotification getBean() {
|
||||
return bean;
|
||||
}
|
||||
|
||||
public void setType(WorkspaceNotificationType type) {
|
||||
this.type = type;
|
||||
}
|
||||
|
||||
public void setBean(WorkspaceNotification bean) {
|
||||
this.bean = bean;
|
||||
}
|
||||
}
|
|
@ -8,7 +8,8 @@ import com.fasterxml.jackson.annotation.JsonTypeName;
|
|||
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown=true)
|
||||
public class WorkspaceNotificationSharedFolder implements WorkspaceNotification {
|
||||
@JsonTypeName("SHARED_FOLDER")
|
||||
public class WorkspaceNotificationSharedFolder extends WorkspaceNotification {
|
||||
|
||||
/**
|
||||
* the username of the user you wish to notify
|
||||
|
|
|
@ -7,7 +7,8 @@ import com.fasterxml.jackson.annotation.JsonProperty;
|
|||
import com.fasterxml.jackson.annotation.JsonTypeName;
|
||||
|
||||
@JsonIgnoreProperties(ignoreUnknown=true)
|
||||
public class WorkspaceNotificationUnsharedFolder implements WorkspaceNotification {
|
||||
@JsonTypeName("UNSHARED_FOLDER")
|
||||
public class WorkspaceNotificationUnsharedFolder extends WorkspaceNotification {
|
||||
|
||||
/**
|
||||
* the username of the user you wish to notify
|
||||
|
|
Loading…
Reference in New Issue