Social service - cassandra 4

This commit is contained in:
Ahmed Salah Tawfik Ibrahim 2023-11-13 11:33:37 +01:00
parent 6fce7cf11f
commit cd1e77e4fc
9 changed files with 43 additions and 82 deletions

View File

@ -1,5 +1,9 @@
# Changelog # Changelog
## [v2.9.2-SNAPSHOT] - 2023-11-05
- Replace Astyanx Java client for Cassandra 2 with Datastax client for Cassandra 4
## [v2.9.1] - 2023-09-28 ## [v2.9.1] - 2023-09-28
- Fix for Bug #25760 not closing connection to distributed cached - Fix for Bug #25760 not closing connection to distributed cached

99
pom.xml
View File

@ -1,6 +1,6 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/maven-v4_0_0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
@ -12,7 +12,7 @@
<groupId>org.gcube.portal</groupId> <groupId>org.gcube.portal</groupId>
<artifactId>social-networking-library-ws</artifactId> <artifactId>social-networking-library-ws</artifactId>
<packaging>war</packaging> <packaging>war</packaging>
<version>2.9.1</version> <version>2.9.2</version>
<name>social-networking-library-ws</name> <name>social-networking-library-ws</name>
<description>Rest interface for the social networking library.</description> <description>Rest interface for the social networking library.</description>
<properties> <properties>
@ -66,7 +66,6 @@
<groupId>javax.servlet</groupId> <groupId>javax.servlet</groupId>
<artifactId>javax.servlet-api</artifactId> <artifactId>javax.servlet-api</artifactId>
<version>3.1.0</version> <version>3.1.0</version>
<scope>provided</scope>
</dependency> </dependency>
<!-- end enunciate deps --> <!-- end enunciate deps -->
<dependency> <dependency>
@ -93,13 +92,12 @@
<dependency> <dependency>
<groupId>org.gcube.common</groupId> <groupId>org.gcube.common</groupId>
<artifactId>storagehub-client-library</artifactId> <artifactId>storagehub-client-library</artifactId>
<!-- <version>2.0.0-SNAPSHOT</version> --> <!-- <version>2.0.0-SNAPSHOT</version> -->
</dependency> </dependency>
<dependency> <dependency>
<groupId>com.sun.mail</groupId> <groupId>com.sun.mail</groupId>
<artifactId>javax.mail</artifactId> <artifactId>javax.mail</artifactId>
<version>1.5.2</version> <version>1.5.2</version>
<scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>commons-lang</groupId> <groupId>commons-lang</groupId>
@ -116,78 +114,20 @@
<dependency> <dependency>
<groupId>com.google.guava</groupId> <groupId>com.google.guava</groupId>
<artifactId>guava</artifactId> <artifactId>guava</artifactId>
<scope>compile</scope>
<version>18.0</version> <version>18.0</version>
<scope>compile</scope>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.slf4j</groupId> <groupId>org.slf4j</groupId>
<artifactId>slf4j-api</artifactId> <artifactId>slf4j-api</artifactId>
<scope>provided</scope> <scope>provided</scope>
</dependency> </dependency>
<dependency>
<groupId>com.netflix.astyanax</groupId>
<artifactId>astyanax</artifactId>
<version>2.0.2</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<artifactId>jersey-client</artifactId>
<groupId>com.sun.jersey</groupId>
</exclusion>
<exclusion>
<artifactId>jersey-bundle</artifactId>
<groupId>com.sun.jersey</groupId>
</exclusion>
<exclusion>
<artifactId>jersey-apache-client4</artifactId>
<groupId>com.sun.jersey.contribs</groupId>
</exclusion>
<exclusion>
<groupId>javax.ws.rs</groupId>
<artifactId>jsr311-api</artifactId>
</exclusion>
<exclusion>
<groupId>org.mortbay.jetty</groupId>
<artifactId>servlet-api</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency>
<groupId>com.netflix.astyanax</groupId>
<artifactId>astyanax-thrift</artifactId>
<version>2.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.netflix.astyanax</groupId>
<artifactId>astyanax-cassandra</artifactId>
<version>2.0.2</version>
<scope>compile</scope>
</dependency>
<dependency>
<groupId>com.netflix.astyanax</groupId>
<artifactId>astyanax-core</artifactId>
<version>2.0.2</version>
<scope>compile</scope>
<exclusions>
<exclusion>
<groupId>org.slf4j</groupId>
<artifactId>log4j-over-slf4j</artifactId>
</exclusion>
</exclusions>
</dependency>
<dependency> <dependency>
<groupId>org.gcube.socialnetworking</groupId> <groupId>org.gcube.socialnetworking</groupId>
<artifactId>social-util-library</artifactId> <artifactId>social-util-library</artifactId>
<version>[1.0.1-SNAPSHOT,2.0.0-SNAPSHOT)</version> <version>[1.0.1-SNAPSHOT,2.0.0-SNAPSHOT)</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>org.gcube.portal</groupId>
<artifactId>social-networking-library</artifactId>
<version>[1.18.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
<scope>compile</scope>
</dependency>
<dependency> <dependency>
<groupId>org.gcube.dvos</groupId> <groupId>org.gcube.dvos</groupId>
<artifactId>usermanagement-core</artifactId> <artifactId>usermanagement-core</artifactId>
@ -245,8 +185,13 @@
<groupId>com.fasterxml.jackson.dataformat</groupId> <groupId>com.fasterxml.jackson.dataformat</groupId>
<version>2.8.6</version> <version>2.8.6</version>
</dependency> </dependency>
<dependency>
<!-- Please note that the elasticsearch client needs a compress-lzf version <groupId>org.gcube.portal</groupId>
<artifactId>social-networking-library</artifactId>
<version>2.0.0-SNAPSHOT</version>
<scope>compile</scope>
</dependency>
<!-- Please note that the elasticsearch client needs a compress-lzf version
>= 1.0.2 --> >= 1.0.2 -->
<dependency> <dependency>
<groupId>com.ning</groupId> <groupId>com.ning</groupId>
@ -257,8 +202,15 @@
<dependency> <dependency>
<groupId>org.glassfish.jersey.containers</groupId> <groupId>org.glassfish.jersey.containers</groupId>
<!-- if your container implements Servlet API older than 3.0, use "jersey-container-servlet-core" --> <!-- if your container implements Servlet API older than 3.0, use "jersey-container-servlet-core" -->
<!--<artifactId>jersey-container-servlet</artifactId>-->
<artifactId>jersey-container-servlet-core</artifactId> <artifactId>jersey-container-servlet-core</artifactId>
<!--<version>3.0.0</version>-->
</dependency> </dependency>
<!--<dependency>
<groupId>org.glassfish.jersey.containers</groupId>
<artifactId>jersey-container-servlet</artifactId>
<version>2.13</version>
</dependency>-->
<dependency> <dependency>
<groupId>org.glassfish.jersey.media</groupId> <groupId>org.glassfish.jersey.media</groupId>
<artifactId>jersey-media-json-processing</artifactId> <artifactId>jersey-media-json-processing</artifactId>
@ -279,7 +231,6 @@
<groupId>javax.portlet</groupId> <groupId>javax.portlet</groupId>
<artifactId>portlet-api</artifactId> <artifactId>portlet-api</artifactId>
<version>2.0</version> <version>2.0</version>
<scope>compile</scope>
</dependency> </dependency>
<!-- SmartGears --> <!-- SmartGears -->
<dependency> <dependency>
@ -292,7 +243,6 @@
<artifactId>common-smartgears-app</artifactId> <artifactId>common-smartgears-app</artifactId>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<!-- notifications libraries --> <!-- notifications libraries -->
<dependency> <dependency>
<groupId>org.gcube.portal</groupId> <groupId>org.gcube.portal</groupId>
@ -312,7 +262,16 @@
<version>4.3</version> <version>4.3</version>
<scope>compile</scope> <scope>compile</scope>
</dependency> </dependency>
<dependency>
<groupId>org.mortbay.jetty</groupId>
<artifactId>jetty-util</artifactId>
<version>6.1.22</version>
</dependency>
<dependency>
<groupId>com.googlecode.json-simple</groupId>
<artifactId>json-simple</artifactId>
<version>1.1.1</version>
</dependency>
</dependencies> </dependencies>
<build> <build>

View File

@ -30,7 +30,7 @@ public class GroupsCache {
/** /**
* Retrieve an entry * Retrieve an entry
* @param id * @param groupId
* @return user associated to the user * @return user associated to the user
*/ */
public GCubeGroup getGroup(long groupId){ public GCubeGroup getGroup(long groupId){
@ -44,7 +44,7 @@ public class GroupsCache {
/** /**
* Save an entry into the cache * Save an entry into the cache
* @param id * @param id
* @param user * @param group
*/ */
public void pushEntry(long id, GCubeGroup group){ public void pushEntry(long id, GCubeGroup group){
Ehcache groupsCache = CachesManager.getCache(CachesManager.GROUPS_CACHE); Ehcache groupsCache = CachesManager.getCache(CachesManager.GROUPS_CACHE);

View File

@ -59,7 +59,7 @@ public class UsersCache{
/** /**
* Retrieve an entry * Retrieve an entry
* @param id * @param userId
* @return user associated to the user * @return user associated to the user
*/ */
public GCubeUser getUser(long userId){ public GCubeUser getUser(long userId){

View File

@ -39,8 +39,7 @@ public class CommentInputBean implements Serializable{
/** /**
* @param text * @param text
* @param postid * @param postid
* @param params */
*/
public CommentInputBean(String text, String postid) { public CommentInputBean(String text, String postid) {
super(); super();
this.text = text; this.text = text;

View File

@ -88,7 +88,7 @@ public class Likes {
/** /**
* Create a new like to a post in the context of the token * Create a new like to a post in the context of the token
* @param postid The post id to be liked * @param post The post id to be liked
* @return true if everything is OK * @return true if everything is OK
* @throws ValidationException * @throws ValidationException
*/ */
@ -128,7 +128,7 @@ public class Likes {
/** /**
* Unlike to a post in the context of the token * Unlike to a post in the context of the token
* @param postid The post id to be liked * @param likeInputBean The post id to be liked
* @return true if everything is OK * @return true if everything is OK
* @throws ValidationException * @throws ValidationException
*/ */

View File

@ -31,8 +31,7 @@ public class ResponseBean implements Serializable {
* @param success * @param success
* @param message * @param message
* @param result * @param result
* @param help */
*/
public ResponseBean(boolean success, String message, Object result) { public ResponseBean(boolean success, String message, Object result) {
super(); super();
this.success = success; this.success = success;

View File

@ -89,7 +89,7 @@ public class Filters {
* If the initial context is the root: all feeds are returned; * If the initial context is the root: all feeds are returned;
* If the initial context is a VO: feeds for vres within the vo are returned; * If the initial context is a VO: feeds for vres within the vo are returned;
* If the initial context is a vre: feeds of the vre are returned; * If the initial context is a vre: feeds of the vre are returned;
* @param retrievedLikedFeeds * @param feeds
* @param context * @param context
* @throws Exception * @throws Exception
*/ */
@ -160,7 +160,7 @@ public class Filters {
/** /**
* Depending on the type of object provided (e.g. Feed, Comment etc), some information are removed * Depending on the type of object provided (e.g. Feed, Comment etc), some information are removed
* @param comments * @param toClear
* @throws Exception * @throws Exception
*/ */
public static <T> void hideSensitiveInformation(List<T> toClear, String usernameCaller){ public static <T> void hideSensitiveInformation(List<T> toClear, String usernameCaller){

View File

@ -108,7 +108,7 @@ public class SocialUtils {
/** /**
* Method used when an application needs to publish something. * Method used when an application needs to publish something.
* @param feedText * @param postText
* @param uriParams * @param uriParams
* @param previewTitle * @param previewTitle
* @param previewDescription * @param previewDescription