v1.4.0. messages in cassandra

This commit is contained in:
Alfredo Oliviero 2024-10-25 18:44:26 +02:00
parent 79a725b43a
commit 4faa938908
7 changed files with 196 additions and 18 deletions

View File

@ -1,5 +1,9 @@
# Changelog # Changelog
## [v1.4.0-SNAPSHOT]
- moved messages from storagehub to cassandra [#27514]
## [v1.3.0] - 2024-10-25 ## [v1.3.0] - 2024-10-25
- Feature #27999 [StorageHub] downstream components to upgrade in order to work with storagehub 1.5.0 - Feature #27999 [StorageHub] downstream components to upgrade in order to work with storagehub 1.5.0

View File

@ -2,7 +2,7 @@
## Structure of the project ## Structure of the project
* The source code is present in the src folder. * The source code is present in the src folder.
## Built With ## Built With

17
pom.xml
View File

@ -12,7 +12,7 @@
<groupId>org.gcube.social-networking</groupId> <groupId>org.gcube.social-networking</groupId>
<artifactId>social-service-model</artifactId> <artifactId>social-service-model</artifactId>
<version>1.3.0</version> <version>1.4.0-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<name>social-networking-service-model</name> <name>social-networking-service-model</name>
<description>Social networking service model classes</description> <description>Social networking service model classes</description>
@ -48,6 +48,12 @@
</scm> </scm>
<dependencies> <dependencies>
<!--
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>gcube-jackson-annotations</artifactId>
</dependency> -->
<!-- enunciate deps --> <!-- enunciate deps -->
<dependency> <dependency>
<groupId>com.webcohesion.enunciate</groupId> <groupId>com.webcohesion.enunciate</groupId>
@ -61,21 +67,12 @@
<version>${enunciate.version}</version> <version>${enunciate.version}</version>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>org.gcube.common</groupId>
<artifactId>storagehub-model</artifactId>
</dependency>
<dependency> <dependency>
<groupId>org.projectlombok</groupId> <groupId>org.projectlombok</groupId>
<artifactId>lombok</artifactId> <artifactId>lombok</artifactId>
<version>1.18.2</version> <version>1.18.2</version>
<scope>provided</scope> <scope>provided</scope>
</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>

View File

@ -0,0 +1,148 @@
package org.gcube.social_networking.socialnetworking.model.beans.messages;
import java.util.Calendar;
public class Message {
public Message() {
}
String id;
String name;
String path;
String parentId;
String parentPath;
String primaryType;
boolean withAttachments;
Owner sender;
String subject;
String body;
boolean read;
boolean opened;
String[] addresses;
Calendar creationTime;
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 String getParentId() {
return parentId;
}
public void setParentId(String parentId) {
this.parentId = parentId;
}
public String getParentPath() {
return parentPath;
}
public void setParentPath(String parentPath) {
this.parentPath = parentPath;
}
public String getPrimaryType() {
return primaryType;
}
public void setPrimaryType(String primaryType) {
this.primaryType = primaryType;
}
public boolean isWithAttachments() {
return withAttachments;
}
public void setWithAttachments(boolean withAttachments) {
this.withAttachments = withAttachments;
}
public Owner getSender() {
return sender;
}
public void setSender(Owner sender) {
this.sender = sender;
}
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 boolean isRead() {
return read;
}
public void setRead(boolean read) {
this.read = read;
}
public boolean isOpened() {
return opened;
}
public void setOpened(boolean opened) {
this.opened = opened;
}
public String[] getAddresses() {
return addresses;
}
public void setAddresses(String[] addresses) {
this.addresses = addresses;
}
public Calendar getCreationTime() {
return creationTime;
}
public void setCreationTime(Calendar creationTime) {
this.creationTime = creationTime;
}
}

View File

@ -1,15 +1,11 @@
package org.gcube.social_networking.socialnetworking.model.beans; package org.gcube.social_networking.socialnetworking.model.beans.messages;
import java.util.Arrays; import java.util.Arrays;
/** /**
* Used for serialization * Used for serialization
*/ */
public class MessageInbox extends org.gcube.common.storagehub.model.messages.Message { public class MessageInbox extends Message {
//needed for serialization
public MessageInbox() {
super();
}
@Override @Override
public String toString() { public String toString() {

View File

@ -1,4 +1,4 @@
package org.gcube.social_networking.socialnetworking.model.beans; package org.gcube.social_networking.socialnetworking.model.beans.messages;
import java.io.Serializable; import java.io.Serializable;
import java.util.ArrayList; import java.util.ArrayList;
@ -7,6 +7,8 @@ import javax.validation.Valid;
import javax.validation.constraints.NotNull; import javax.validation.constraints.NotNull;
import javax.validation.constraints.Size; import javax.validation.constraints.Size;
import org.gcube.social_networking.socialnetworking.model.beans.Recipient;
import com.fasterxml.jackson.annotation.JsonIgnoreProperties; import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
import com.fasterxml.jackson.annotation.JsonProperty; import com.fasterxml.jackson.annotation.JsonProperty;

View File

@ -0,0 +1,31 @@
package org.gcube.social_networking.socialnetworking.model.beans.messages;
public class Owner {
String userName;
String userId;
public String getUserId() {
return userId;
}
public void setUserId(String userId) {
this.userId = userId;
}
public Owner() {
}
public Owner(String userName, String userId) {
this.userName = userName;
this.userId = userId;
}
public String getUserName() {
return userName;
}
public void setUserName(String userName) {
this.userName = userName;
}
}