removed class CassandraClusterConnection

This commit is contained in:
Massimiliano Assante 2023-11-23 12:28:32 +01:00
parent c02408cc90
commit 60ddd56e8e
4 changed files with 58 additions and 27 deletions

View File

@ -8,7 +8,7 @@ This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.htm
- Feature #25901-fix, same as feature 25901 but with minor fixes related to deprecated methods and classes
## [v1.17.1] - 2023-10-30
## [v1.18.0-SNAPSHOT] - 2023-10-30
- Implementation of databookstore using rest api of social service client

23
pom.xml
View File

@ -11,7 +11,7 @@
<groupId>org.gcube.portal</groupId>
<artifactId>social-networking-library</artifactId>
<version>1.17.1-SNAPSHOT</version>
<version>1.18.0-SNAPSHOT</version>
<name>gCube Social Networking Library</name>
<description>
The gCube Social Networking Library is the 'bridge' between your gCube Applications and the social networking facilities.
@ -46,7 +46,7 @@
<dependency>
<groupId>org.gcube.social-networking</groupId>
<artifactId>social-service-client</artifactId>
<version>[1.1.0, 2.0.0)</version>
<version>[1.3.0-SNAPSHOT, 2.0.0)</version>
</dependency>
<dependency>
<groupId>com.google</groupId>
@ -56,7 +56,6 @@
<dependency>
<groupId>org.gcube.resources.discovery</groupId>
<artifactId>ic-client</artifactId>
<version>1.0.4</version>
<scope>provided</scope>
</dependency>
<dependency>
@ -129,6 +128,24 @@
<skipTests>true</skipTests>
</configuration>
</plugin>
<plugin>
<groupId>org.apache.maven.plugins</groupId>
<artifactId>maven-javadoc-plugin</artifactId>
<configuration>
<additionalparam>-Xdoclint:none</additionalparam>
<additionalJOption>-Xdoclint:none</additionalJOption>
</configuration>
<version>3.1.0</version>
<executions>
<execution>
<id>generate-doc</id>
<phase>install</phase>
<goals>
<goal>jar</goal>
</goals>
</execution>
</executions>
</plugin>
</plugins>
</build>

View File

@ -1,15 +1,45 @@
package org.gcube.portal.databook.server;
import java.util.*;
import java.util.ArrayList;
import java.util.Collections;
import java.util.Date;
import java.util.List;
import java.util.Map;
import javax.mail.internet.AddressException;
import org.gcube.portal.databook.shared.*;
import org.gcube.portal.databook.shared.ex.*;
import org.gcube.social_networking.social_networking_client_library.*;
import org.gcube.portal.databook.shared.Attachment;
import org.gcube.portal.databook.shared.Comment;
import org.gcube.portal.databook.shared.Feed;
import org.gcube.portal.databook.shared.FeedType;
import org.gcube.portal.databook.shared.Invite;
import org.gcube.portal.databook.shared.InviteOperationResult;
import org.gcube.portal.databook.shared.InviteStatus;
import org.gcube.portal.databook.shared.Like;
import org.gcube.portal.databook.shared.Notification;
import org.gcube.portal.databook.shared.NotificationChannelType;
import org.gcube.portal.databook.shared.NotificationType;
import org.gcube.portal.databook.shared.Post;
import org.gcube.portal.databook.shared.PostType;
import org.gcube.portal.databook.shared.RangeFeeds;
import org.gcube.portal.databook.shared.RangePosts;
import org.gcube.portal.databook.shared.ex.ColumnNameNotFoundException;
import org.gcube.portal.databook.shared.ex.CommentIDNotFoundException;
import org.gcube.portal.databook.shared.ex.FeedIDNotFoundException;
import org.gcube.portal.databook.shared.ex.FeedTypeNotFoundException;
import org.gcube.portal.databook.shared.ex.InviteIDNotFoundException;
import org.gcube.portal.databook.shared.ex.InviteStatusNotFoundException;
import org.gcube.portal.databook.shared.ex.LikeIDNotFoundException;
import org.gcube.portal.databook.shared.ex.NotificationChannelTypeNotFoundException;
import org.gcube.portal.databook.shared.ex.NotificationIDNotFoundException;
import org.gcube.portal.databook.shared.ex.NotificationTypeNotFoundException;
import org.gcube.portal.databook.shared.ex.PrivacyLevelTypeNotFoundException;
import org.gcube.social_networking.social_networking_client_library.CommentClient;
import org.gcube.social_networking.social_networking_client_library.HashTagClient;
import org.gcube.social_networking.social_networking_client_library.InviteClient;
import org.gcube.social_networking.social_networking_client_library.LikeClient;
import org.gcube.social_networking.social_networking_client_library.NotificationClient;
import org.gcube.social_networking.social_networking_client_library.PostClient;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
@ -32,21 +62,11 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
private static LikeClient likeClient;
/**
* connection instance
*/
private CassandraClusterConnection conn;
protected CassandraClusterConnection getConnection() {
return conn;
}
/**
* use this constructor carefully from test classes
* @param dropSchema set true if you want do drop the current and set up new one
*/
protected DBCassandraAstyanaxImpl(boolean dropSchema) {
conn = new CassandraClusterConnection(dropSchema);
try {
postClient = new PostClient();
notificationClient = new NotificationClient();
@ -63,7 +83,6 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
* public constructor, no dropping schema is allowed
*/
public DBCassandraAstyanaxImpl() {
conn = new CassandraClusterConnection(false);
try {
postClient = new PostClient();
notificationClient = new NotificationClient();
@ -81,7 +100,6 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
* public constructor, no dropping schema is allowed, infrastructureName is given.
*/
public DBCassandraAstyanaxImpl(String infrastructureName) {
conn = new CassandraClusterConnection(false, infrastructureName);
try {
postClient = new PostClient();
notificationClient = new NotificationClient();
@ -867,7 +885,6 @@ public final class DBCassandraAstyanaxImpl implements DatabookStore {
*/
@Override
public void closeConnection() {
conn.closeConnection();
}
@Override

View File

@ -12,9 +12,6 @@ import java.util.ArrayList;
import java.util.List;
import java.util.Properties;
import com.datastax.oss.driver.api.core.CqlSession;
import com.datastax.oss.driver.api.core.metadata.Metadata;
import com.datastax.oss.driver.api.core.metadata.schema.KeyspaceMetadata;
import org.gcube.common.portal.GCubePortalConstants;
import org.gcube.common.portal.PortalContext;
import org.gcube.common.resources.gcore.ServiceEndpoint;