Compare commits
4 Commits
Author | SHA1 | Date |
---|---|---|
Alfredo Oliviero | 2f8209f960 | |
Massimiliano Assante | 59f2bab36c | |
Massimiliano Assante | 4ef30dcbe4 | |
Massimiliano Assante | cd303ee54f |
|
@ -1,5 +1,14 @@
|
|||
# Changelog
|
||||
|
||||
## [v1.2.1-SNAPSHOT] - 2024-09-19
|
||||
|
||||
moved to gcube-smartgears-bom 2.6.0-SNAPSHOT
|
||||
removed gcube-bom dependency
|
||||
|
||||
## [v1.2.0] - 2022-05-02
|
||||
|
||||
- Feature #23995 dd support for set Message read / unread
|
||||
|
||||
## [v1.1.7] - 2022-05-02
|
||||
|
||||
- Added support for workspace and catalogue notifications
|
||||
|
|
20
pom.xml
20
pom.xml
|
@ -7,12 +7,12 @@
|
|||
<parent>
|
||||
<groupId>org.gcube.tools</groupId>
|
||||
<artifactId>maven-parent</artifactId>
|
||||
<version>1.1.0</version>
|
||||
<version>1.2.0</version>
|
||||
</parent>
|
||||
|
||||
<groupId>org.gcube.social-networking</groupId>
|
||||
<artifactId>social-service-model</artifactId>
|
||||
<version>1.1.7</version>
|
||||
<version>1.2.1-SNAPSHOT</version>
|
||||
<packaging>jar</packaging>
|
||||
<name>social-networking-service-model</name>
|
||||
<description>Social networking service model classes</description>
|
||||
|
@ -31,17 +31,10 @@
|
|||
|
||||
<dependencyManagement>
|
||||
<dependencies>
|
||||
<dependency>
|
||||
<groupId>org.gcube.distribution</groupId>
|
||||
<artifactId>gcube-bom</artifactId>
|
||||
<version>2.0.1</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.gcube.distribution</groupId>
|
||||
<artifactId>gcube-smartgears-bom</artifactId>
|
||||
<version>2.1.0</version>
|
||||
<version>2.6.0-SNAPSHOT</version>
|
||||
<type>pom</type>
|
||||
<scope>import</scope>
|
||||
</dependency>
|
||||
|
@ -71,7 +64,12 @@
|
|||
<dependency>
|
||||
<groupId>org.gcube.common</groupId>
|
||||
<artifactId>storagehub-model</artifactId>
|
||||
<version>[1.0.0,2.0.0-SNAPSHOT)</version>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>org.projectlombok</groupId>
|
||||
<artifactId>lombok</artifactId>
|
||||
<version>1.18.2</version>
|
||||
<scope>provided</scope>
|
||||
</dependency>
|
||||
<dependency>
|
||||
<groupId>com.fasterxml.jackson.core</groupId>
|
||||
|
|
|
@ -1,144 +0,0 @@
|
|||
package org.gcube.social_networking.socialnetworking.model.beans;
|
||||
|
||||
import java.util.ArrayList;
|
||||
import java.util.Calendar;
|
||||
import java.util.List;
|
||||
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
/**
|
||||
* Used for serialization
|
||||
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true)
|
||||
public class Message {
|
||||
|
||||
@JsonProperty("id")
|
||||
private String id;
|
||||
|
||||
@JsonProperty("subject")
|
||||
@NotNull
|
||||
@Size(min=1, message="subject cannot be empty")
|
||||
private String subject;
|
||||
|
||||
@JsonProperty("body")
|
||||
@NotNull
|
||||
@Size(min=1, message="body cannot be empty")
|
||||
private String body;
|
||||
|
||||
@JsonProperty("sender")
|
||||
private String senderId;
|
||||
|
||||
@JsonProperty("send_time")
|
||||
private Calendar sendTime;
|
||||
|
||||
@JsonProperty("read")
|
||||
private boolean read;
|
||||
|
||||
@JsonProperty("attachment_ids")
|
||||
private List<String> attachmentIds;
|
||||
|
||||
@JsonProperty("recipients")
|
||||
@NotNull
|
||||
@Size(min=1, message="recipient cannot be empty")
|
||||
private List<Recipient> recipients;
|
||||
|
||||
public Message() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Message(String id, String subject, String body,
|
||||
String senderId, Calendar sendTime, boolean read,
|
||||
List<String> attachmentIds, List<Recipient> recipients) {
|
||||
super();
|
||||
this.id = id;
|
||||
this.subject = subject;
|
||||
this.body = body;
|
||||
this.senderId = senderId;
|
||||
this.sendTime = sendTime;
|
||||
this.read = read;
|
||||
this.attachmentIds = attachmentIds;
|
||||
this.recipients = recipients;
|
||||
}
|
||||
|
||||
public Message(String subject, String body, ArrayList<Recipient> recipients) {
|
||||
this.subject = subject;
|
||||
this.body = body;
|
||||
this.recipients = recipients;
|
||||
}
|
||||
|
||||
public String getId() {
|
||||
return id;
|
||||
}
|
||||
|
||||
public void setId(String id) {
|
||||
this.id = id;
|
||||
}
|
||||
|
||||
public String getSubject() {
|
||||
return subject;
|
||||
}
|
||||
|
||||
public void setSubject(String subject) {
|
||||
this.subject = subject;
|
||||
}
|
||||
|
||||
public String getBody() {
|
||||
return body;
|
||||
}
|
||||
|
||||
public void setBody(String body) {
|
||||
this.body = body;
|
||||
}
|
||||
|
||||
public String getSenderId() {
|
||||
return senderId;
|
||||
}
|
||||
|
||||
public void setSenderId(String senderId) {
|
||||
this.senderId = senderId;
|
||||
}
|
||||
|
||||
public Calendar getSendTime() {
|
||||
return sendTime;
|
||||
}
|
||||
|
||||
public void setSendTime(Calendar sendTime) {
|
||||
this.sendTime = sendTime;
|
||||
}
|
||||
|
||||
public boolean isRead() {
|
||||
return read;
|
||||
}
|
||||
|
||||
public void setRead(boolean read) {
|
||||
this.read = read;
|
||||
}
|
||||
|
||||
public List<String> getAttachmentIds() {
|
||||
return attachmentIds;
|
||||
}
|
||||
|
||||
public void setAttachmentIds(List<String> attachmentIds) {
|
||||
this.attachmentIds = attachmentIds;
|
||||
}
|
||||
|
||||
public List<Recipient> getRecipients() {
|
||||
return recipients;
|
||||
}
|
||||
|
||||
public void setRecipients(List<Recipient> recipients) {
|
||||
this.recipients = recipients;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "Message [id=" + id + ", subject=" + subject
|
||||
+ ", body=" + body + ", senderId=" + senderId + ", sendTime="
|
||||
+ sendTime + ", read=" + read + ", attachmentIds="
|
||||
+ attachmentIds + ", recipients=" + recipients + "]";
|
||||
}
|
||||
}
|
|
@ -0,0 +1,103 @@
|
|||
package org.gcube.social_networking.socialnetworking.model.beans;
|
||||
|
||||
import java.io.Serializable;
|
||||
import java.util.ArrayList;
|
||||
|
||||
import javax.validation.Valid;
|
||||
import javax.validation.constraints.NotNull;
|
||||
import javax.validation.constraints.Size;
|
||||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
|
||||
/**
|
||||
* Generic input bean for methods that allow to write messages
|
||||
*/
|
||||
@JsonIgnoreProperties(ignoreUnknown = true) // ignore in serialization/deserialization
|
||||
|
||||
public class MessageInputBean implements Serializable {
|
||||
|
||||
private static final long serialVersionUID = -1317811686036127456L;
|
||||
|
||||
@JsonProperty("body")
|
||||
@NotNull(message="body cannot be missing")
|
||||
@Size(min=1, message="body cannot be empty")
|
||||
|
||||
private String body;
|
||||
|
||||
@JsonProperty("subject")
|
||||
@NotNull(message="subject cannot be missing")
|
||||
@Size(min=1, message="subject cannot be empty")
|
||||
/**
|
||||
* subject
|
||||
*/
|
||||
private String subject;
|
||||
|
||||
@JsonProperty("recipients")
|
||||
@NotNull(message="recipients cannot be missing")
|
||||
@Size(min=1, message="at least a recipient is needed")
|
||||
@Valid // validate recursively
|
||||
private ArrayList<Recipient> recipients;
|
||||
|
||||
/**
|
||||
* a list of workspace item id valid in the workspace of the sender
|
||||
*/
|
||||
@JsonProperty("attachmentIds")
|
||||
@Valid // validate recursively
|
||||
private ArrayList<String> attachmentIds;
|
||||
|
||||
public MessageInputBean() {
|
||||
super();
|
||||
}
|
||||
|
||||
public MessageInputBean(String body, String subject,
|
||||
ArrayList<Recipient> recipients) {
|
||||
super();
|
||||
this.body = body;
|
||||
this.subject = subject;
|
||||
this.recipients = recipients;
|
||||
this.attachmentIds = new ArrayList<>();
|
||||
}
|
||||
|
||||
public MessageInputBean(String body, String subject,
|
||||
ArrayList<Recipient> recipients, ArrayList<String> attachmentIds) {
|
||||
super();
|
||||
this.body = body;
|
||||
this.subject = subject;
|
||||
this.recipients = recipients;
|
||||
this.attachmentIds = attachmentIds;
|
||||
}
|
||||
|
||||
public String getBody() {
|
||||
return body;
|
||||
}
|
||||
public void setBody(String body) {
|
||||
this.body = body;
|
||||
}
|
||||
public String getSubject() {
|
||||
return subject;
|
||||
}
|
||||
public void setSubject(String subject) {
|
||||
this.subject = subject;
|
||||
}
|
||||
public ArrayList<Recipient> getRecipients() {
|
||||
return recipients;
|
||||
}
|
||||
public void setRecipients(ArrayList<Recipient> recipients) {
|
||||
this.recipients = recipients;
|
||||
}
|
||||
|
||||
public ArrayList<String> getAttachmentIds() {
|
||||
return attachmentIds;
|
||||
}
|
||||
|
||||
public void setAttachmentIds(ArrayList<String> attachmentIds) {
|
||||
this.attachmentIds = attachmentIds;
|
||||
}
|
||||
|
||||
@Override
|
||||
public String toString() {
|
||||
return "MessageInputBean [body=" + body + ", subject=" + subject + ", recipients=" + recipients
|
||||
+ ", attachmentIds=" + attachmentIds + "]";
|
||||
}
|
||||
}
|
|
@ -7,6 +7,7 @@ import javax.validation.constraints.Size;
|
|||
|
||||
import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
|
||||
import com.fasterxml.jackson.annotation.JsonProperty;
|
||||
import com.webcohesion.enunciate.metadata.DocumentationExample;
|
||||
|
||||
/**
|
||||
* Recipient message bean
|
||||
|
@ -22,12 +23,15 @@ public class Recipient implements Serializable{
|
|||
@JsonProperty("id")
|
||||
@NotNull(message="recipient id must not be null")
|
||||
@Size(min=1, message="recipient id must not be empty")
|
||||
/*
|
||||
* @param "The recipient of the message",
|
||||
*/
|
||||
@DocumentationExample("john.smith")
|
||||
private String id;
|
||||
|
||||
public Recipient(){
|
||||
|
||||
public Recipient() {
|
||||
super();
|
||||
}
|
||||
|
||||
public Recipient(String id) {
|
||||
super();
|
||||
this.id = id;
|
||||
|
|
Loading…
Reference in New Issue