Compare commits
12 Commits
Author | SHA1 | Date |
---|---|---|
|
97eae29a93 | |
|
5a2f00813b | |
|
88d35fce91 | |
|
8509f8cc91 | |
|
fc04f95b45 | |
|
364b076af2 | |
|
bd932d3fc6 | |
|
ae4f4e593c | |
|
ccb52f1770 | |
|
24fba77a4f | |
|
0419a89420 | |
|
f65486e9c0 |
|
@ -1,6 +1,11 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
## [v3.0.0] - 2023-12-06
|
## [v3.0.1] - 2023-04-22
|
||||||
|
|
||||||
|
- Feature 27286: removed noisy logs
|
||||||
|
- Bug 27218: advance social networking library version
|
||||||
|
|
||||||
|
## [v3.0.0-SNAPSHOT] - 2023-12-06
|
||||||
|
|
||||||
- Feature #26193, new impl for get users by role in a VRE
|
- Feature #26193, new impl for get users by role in a VRE
|
||||||
- Replace Astyanx Java client for Cassandra 2 with Datastax client for Cassandra 4
|
- Replace Astyanx Java client for Cassandra 2 with Datastax client for Cassandra 4
|
||||||
|
|
6
pom.xml
6
pom.xml
|
@ -6,13 +6,13 @@
|
||||||
<parent>
|
<parent>
|
||||||
<groupId>org.gcube.tools</groupId>
|
<groupId>org.gcube.tools</groupId>
|
||||||
<artifactId>maven-parent</artifactId>
|
<artifactId>maven-parent</artifactId>
|
||||||
<version>1.1.0</version>
|
<version>1.2.0</version>
|
||||||
</parent>
|
</parent>
|
||||||
|
|
||||||
<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>3.0.0</version>
|
<version>3.0.1</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>
|
||||||
|
@ -136,7 +136,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.portal</groupId>
|
<groupId>org.gcube.portal</groupId>
|
||||||
<artifactId>social-networking-library</artifactId>
|
<artifactId>social-networking-library</artifactId>
|
||||||
<version>[2.0.0-SNAPSHOT, 3.0.0)</version>
|
<version>[2.0.0, 3.0.0)</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
|
|
|
@ -16,7 +16,7 @@ public class GroupsCache {
|
||||||
*/
|
*/
|
||||||
private GroupsCache(){
|
private GroupsCache(){
|
||||||
|
|
||||||
logger.info("Building cache");
|
logger.debug("Building cache");
|
||||||
CachesManager.getCache(CachesManager.GROUPS_CACHE);
|
CachesManager.getCache(CachesManager.GROUPS_CACHE);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -55,7 +55,7 @@ public class SocialNetworkingSiteFinder {
|
||||||
|
|
||||||
// read fallback properties
|
// read fallback properties
|
||||||
try{
|
try{
|
||||||
logger.info("Trying to read config.properties");
|
logger.debug("Trying to read config.properties");
|
||||||
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
|
ClassLoader classLoader = Thread.currentThread().getContextClassLoader();
|
||||||
InputStream input = classLoader.getResourceAsStream("config.properties");
|
InputStream input = classLoader.getResourceAsStream("config.properties");
|
||||||
Properties properties = new Properties();
|
Properties properties = new Properties();
|
||||||
|
@ -140,7 +140,7 @@ public class SocialNetworkingSiteFinder {
|
||||||
if(gatewayVirtualGroups != null && !gatewayVirtualGroups.isEmpty()){
|
if(gatewayVirtualGroups != null && !gatewayVirtualGroups.isEmpty()){
|
||||||
for (VirtualGroup gatewayVirtualGroup : gatewayVirtualGroups) {
|
for (VirtualGroup gatewayVirtualGroup : gatewayVirtualGroups) {
|
||||||
if(virtualGroupsOfGroup.contains(gatewayVirtualGroup)){
|
if(virtualGroupsOfGroup.contains(gatewayVirtualGroup)){
|
||||||
logger.info("Matching gateway for scope " + scope + " is " + gateway);
|
logger.debug("Matching gateway for scope " + scope + " is " + gateway);
|
||||||
matchingGateway = gateway;
|
matchingGateway = gateway;
|
||||||
break ext_loop;
|
break ext_loop;
|
||||||
}
|
}
|
||||||
|
|
|
@ -33,7 +33,7 @@ public class UsersCache{
|
||||||
new Thread(){
|
new Thread(){
|
||||||
public void run() {
|
public void run() {
|
||||||
try{
|
try{
|
||||||
logger.info("Fetching users and putting them into cache");
|
logger.debug("Fetching users and putting them into cache");
|
||||||
Ehcache usersCache = CachesManager.getCache(CachesManager.USERS_CACHE);
|
Ehcache usersCache = CachesManager.getCache(CachesManager.USERS_CACHE);
|
||||||
GroupManager groupManager = GroupManagerWSBuilder.getInstance().getGroupManager();
|
GroupManager groupManager = GroupManagerWSBuilder.getInstance().getGroupManager();
|
||||||
UserManager userManager = UserManagerWSBuilder.getInstance().getUserManager();
|
UserManager userManager = UserManagerWSBuilder.getInstance().getUserManager();
|
||||||
|
|
|
@ -17,7 +17,7 @@ public class GroupManagerWSBuilder {
|
||||||
|
|
||||||
private GroupManagerWSBuilder(){
|
private GroupManagerWSBuilder(){
|
||||||
|
|
||||||
logger.info("Building GroupManager please wait");
|
logger.debug("Building GroupManager please wait");
|
||||||
|
|
||||||
try{
|
try{
|
||||||
groupManagerWs = new LiferayWSGroupManager(
|
groupManagerWs = new LiferayWSGroupManager(
|
||||||
|
@ -31,7 +31,7 @@ public class GroupManagerWSBuilder {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("GroupManager instance built");
|
logger.debug("GroupManager instance built");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -43,10 +43,10 @@ public class KeycloakAPICredentials {
|
||||||
* Private constructor
|
* Private constructor
|
||||||
*/
|
*/
|
||||||
private KeycloakAPICredentials() {
|
private KeycloakAPICredentials() {
|
||||||
logger.info("Building KeycloakAPICredentials object");
|
logger.debug("Building KeycloakAPICredentials object");
|
||||||
|
|
||||||
lookupPropertiesFromIs();
|
lookupPropertiesFromIs();
|
||||||
logger.info("KeycloakAPICredentials object built");
|
logger.debug("KeycloakAPICredentials object built");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -54,12 +54,12 @@ public class KeycloakAPICredentials {
|
||||||
*/
|
*/
|
||||||
private void lookupPropertiesFromIs() {
|
private void lookupPropertiesFromIs() {
|
||||||
|
|
||||||
logger.info("Starting creating KeycloakAPICredentials");
|
logger.debug("Starting creating KeycloakAPICredentials");
|
||||||
|
|
||||||
String oldContext = ScopeProvider.instance.get();
|
String oldContext = ScopeProvider.instance.get();
|
||||||
ApplicationContext ctx = ContextProvider.get(); // get this info from SmartGears
|
ApplicationContext ctx = ContextProvider.get(); // get this info from SmartGears
|
||||||
ScopeProvider.instance.set("/"+ctx.container().configuration().infrastructure());
|
ScopeProvider.instance.set("/"+ctx.container().configuration().infrastructure());
|
||||||
logger.info("Discovering liferay user's credentials in context " + ctx.container().configuration().infrastructure());
|
logger.debug("Discovering liferay user's credentials in context " + ctx.container().configuration().infrastructure());
|
||||||
|
|
||||||
try{
|
try{
|
||||||
List<ServiceEndpoint> resources = getConfigurationFromIS();
|
List<ServiceEndpoint> resources = getConfigurationFromIS();
|
||||||
|
@ -92,7 +92,7 @@ public class KeycloakAPICredentials {
|
||||||
ScopeProvider.instance.set(oldContext);
|
ScopeProvider.instance.set(oldContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("Bean built " + toString());
|
logger.debug("Bean built " + toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -52,10 +52,10 @@ public class LiferayJSONWsCredentials {
|
||||||
* Private constructor
|
* Private constructor
|
||||||
*/
|
*/
|
||||||
private LiferayJSONWsCredentials() {
|
private LiferayJSONWsCredentials() {
|
||||||
logger.info("Building LiferayJSONWsCredentials object");
|
logger.debug("Building LiferayJSONWsCredentials object");
|
||||||
loadNotifierToken();
|
loadNotifierToken();
|
||||||
lookupPropertiesFromIs();
|
lookupPropertiesFromIs();
|
||||||
logger.info("LiferayJSONWsCredentials object built");
|
logger.debug("LiferayJSONWsCredentials object built");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@ -75,7 +75,7 @@ public class LiferayJSONWsCredentials {
|
||||||
*/
|
*/
|
||||||
private void lookupPropertiesFromIs() {
|
private void lookupPropertiesFromIs() {
|
||||||
|
|
||||||
logger.info("Starting creating LiferayJSONWsCredentials");
|
logger.debug("Starting creating LiferayJSONWsCredentials");
|
||||||
|
|
||||||
String oldContext = ScopeProvider.instance.get();
|
String oldContext = ScopeProvider.instance.get();
|
||||||
ApplicationContext ctx = ContextProvider.get(); // get this info from SmartGears
|
ApplicationContext ctx = ContextProvider.get(); // get this info from SmartGears
|
||||||
|
@ -118,7 +118,7 @@ public class LiferayJSONWsCredentials {
|
||||||
ScopeProvider.instance.set(oldContext);
|
ScopeProvider.instance.set(oldContext);
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("Bean built " + toString());
|
logger.debug("Bean built " + toString());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -17,7 +17,7 @@ public class RoleManagerWSBuilder {
|
||||||
|
|
||||||
private RoleManagerWSBuilder(){
|
private RoleManagerWSBuilder(){
|
||||||
|
|
||||||
logger.info("Building UserManager please wait");
|
logger.debug("Building UserManager please wait");
|
||||||
|
|
||||||
try{
|
try{
|
||||||
roleManagerWs = new LiferayWSRoleManager(
|
roleManagerWs = new LiferayWSRoleManager(
|
||||||
|
@ -31,7 +31,7 @@ public class RoleManagerWSBuilder {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("UserManager instance built");
|
logger.debug("UserManager instance built");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -17,7 +17,7 @@ public class UserManagerWSBuilder {
|
||||||
|
|
||||||
private UserManagerWSBuilder(){
|
private UserManagerWSBuilder(){
|
||||||
|
|
||||||
logger.info("Building UserManager please wait");
|
logger.debug("Building UserManager please wait");
|
||||||
|
|
||||||
try{
|
try{
|
||||||
userManagerWs = new LiferayWSUserManager(
|
userManagerWs = new LiferayWSUserManager(
|
||||||
|
@ -31,7 +31,7 @@ public class UserManagerWSBuilder {
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
logger.info("UserManager instance built");
|
logger.debug("UserManager instance built");
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -84,7 +84,7 @@ public class Comments {
|
||||||
List<Comment> comments = null;
|
List<Comment> comments = null;
|
||||||
|
|
||||||
try{
|
try{
|
||||||
logger.info("Retrieving comments for user id " + username);
|
logger.debug("Retrieving comments for user id " + username);
|
||||||
comments = CassandraConnection.getInstance().getDatabookStore().getAllCommentByPost(key);
|
comments = CassandraConnection.getInstance().getDatabookStore().getAllCommentByPost(key);
|
||||||
Filters.filterCommentsPerContext(comments, context);
|
Filters.filterCommentsPerContext(comments, context);
|
||||||
responseBean.setResult(comments);
|
responseBean.setResult(comments);
|
||||||
|
@ -119,7 +119,7 @@ public class Comments {
|
||||||
List<Comment> comments = null;
|
List<Comment> comments = null;
|
||||||
|
|
||||||
try{
|
try{
|
||||||
logger.info("Retrieving comments for user id " + username);
|
logger.debug("Retrieving comments for user id " + username);
|
||||||
comments = CassandraConnection.getInstance().getDatabookStore().getRecentCommentsByUserAndDate(username, 0);
|
comments = CassandraConnection.getInstance().getDatabookStore().getRecentCommentsByUserAndDate(username, 0);
|
||||||
Filters.filterCommentsPerContext(comments, context);
|
Filters.filterCommentsPerContext(comments, context);
|
||||||
responseBean.setResult(comments);
|
responseBean.setResult(comments);
|
||||||
|
@ -154,7 +154,7 @@ public class Comments {
|
||||||
List<Comment> comments = null;
|
List<Comment> comments = null;
|
||||||
|
|
||||||
try{
|
try{
|
||||||
logger.info("Retrieving comments for user id " + username);
|
logger.debug("Retrieving comments for user id " + username);
|
||||||
comments = CassandraConnection.getInstance().getDatabookStore().getRecentCommentsByUserAndDate(username, timeInMillis);
|
comments = CassandraConnection.getInstance().getDatabookStore().getRecentCommentsByUserAndDate(username, timeInMillis);
|
||||||
Filters.filterCommentsPerContext(comments, context);
|
Filters.filterCommentsPerContext(comments, context);
|
||||||
responseBean.setResult(comments);
|
responseBean.setResult(comments);
|
||||||
|
@ -203,7 +203,7 @@ public class Comments {
|
||||||
String postOwnerId = CassandraConnection.getInstance().getDatabookStore().readPost(postId).getEntityId();
|
String postOwnerId = CassandraConnection.getInstance().getDatabookStore().readPost(postId).getEntityId();
|
||||||
Comment theComment = SocialUtils.commentPost(userid, time, postId, commentText, postOwnerId, context);
|
Comment theComment = SocialUtils.commentPost(userid, time, postId, commentText, postOwnerId, context);
|
||||||
if (theComment != null)
|
if (theComment != null)
|
||||||
logger.info("Added comment " + theComment.toString());
|
logger.debug("Added comment " + theComment.toString());
|
||||||
else {
|
else {
|
||||||
logger.error("Unable to write comment");
|
logger.error("Unable to write comment");
|
||||||
responseBean.setMessage("Unable to write comment, something went wrong please see server log");
|
responseBean.setMessage("Unable to write comment, something went wrong please see server log");
|
||||||
|
|
|
@ -60,7 +60,7 @@ public class HashTags {
|
||||||
ResponseBean responseBean = new ResponseBean();
|
ResponseBean responseBean = new ResponseBean();
|
||||||
Status status = Status.OK;
|
Status status = Status.OK;
|
||||||
|
|
||||||
logger.info("User " + username + " has requested hashtags of context " + context);
|
logger.debug("User " + username + " has requested hashtags of context " + context);
|
||||||
|
|
||||||
try{
|
try{
|
||||||
DatabookStore datastore = CassandraConnection.getInstance().getDatabookStore();
|
DatabookStore datastore = CassandraConnection.getInstance().getDatabookStore();
|
||||||
|
|
|
@ -50,7 +50,7 @@ public class Lib {
|
||||||
ResponseBean responseBean = new ResponseBean();
|
ResponseBean responseBean = new ResponseBean();
|
||||||
Status status = Status.OK;
|
Status status = Status.OK;
|
||||||
try {
|
try {
|
||||||
logger.info("Writing comment with commentid " + comment.getKey());
|
logger.debug("Writing comment with commentid " + comment.getKey());
|
||||||
boolean result = CassandraConnection.getInstance().getDatabookStore().addComment(comment);
|
boolean result = CassandraConnection.getInstance().getDatabookStore().addComment(comment);
|
||||||
responseBean.setResult(result);
|
responseBean.setResult(result);
|
||||||
responseBean.setMessage("");
|
responseBean.setMessage("");
|
||||||
|
@ -72,7 +72,7 @@ public class Lib {
|
||||||
ResponseBean responseBean = new ResponseBean();
|
ResponseBean responseBean = new ResponseBean();
|
||||||
Status status = Status.OK;
|
Status status = Status.OK;
|
||||||
try{
|
try{
|
||||||
logger.info("Getting comment with commentid " + commentid);
|
logger.debug("Getting comment with commentid " + commentid);
|
||||||
Comment result = CassandraConnection.getInstance().getDatabookStore().readCommentById(commentid);
|
Comment result = CassandraConnection.getInstance().getDatabookStore().readCommentById(commentid);
|
||||||
responseBean.setResult(result);
|
responseBean.setResult(result);
|
||||||
responseBean.setMessage("");
|
responseBean.setMessage("");
|
||||||
|
@ -103,7 +103,7 @@ public class Lib {
|
||||||
List<Comment> comments = null;
|
List<Comment> comments = null;
|
||||||
|
|
||||||
try{
|
try{
|
||||||
logger.info("Retrieving comments for postid " + postid);
|
logger.debug("Retrieving comments for postid " + postid);
|
||||||
comments = CassandraConnection.getInstance().getDatabookStore().getAllCommentByPost(postid);
|
comments = CassandraConnection.getInstance().getDatabookStore().getAllCommentByPost(postid);
|
||||||
responseBean.setResult(comments);
|
responseBean.setResult(comments);
|
||||||
responseBean.setSuccess(true);
|
responseBean.setSuccess(true);
|
||||||
|
@ -133,7 +133,7 @@ public class Lib {
|
||||||
List<Comment> comments = null;
|
List<Comment> comments = null;
|
||||||
|
|
||||||
try{
|
try{
|
||||||
logger.info("Retrieving comments for user id " + username);
|
logger.debug("Retrieving comments for user id " + username);
|
||||||
comments = CassandraConnection.getInstance().getDatabookStore().getRecentCommentsByUserAndDate(username, timeInMillis);
|
comments = CassandraConnection.getInstance().getDatabookStore().getRecentCommentsByUserAndDate(username, timeInMillis);
|
||||||
responseBean.setResult(comments);
|
responseBean.setResult(comments);
|
||||||
responseBean.setMessage("");
|
responseBean.setMessage("");
|
||||||
|
@ -160,7 +160,7 @@ public class Lib {
|
||||||
ResponseBean responseBean = new ResponseBean();
|
ResponseBean responseBean = new ResponseBean();
|
||||||
Status status = Status.OK;
|
Status status = Status.OK;
|
||||||
try{
|
try{
|
||||||
logger.info("Writing comment with commentid " + comment.getKey());
|
logger.debug("Writing comment with commentid " + comment.getKey());
|
||||||
boolean result = CassandraConnection.getInstance().getDatabookStore().editComment(comment);
|
boolean result = CassandraConnection.getInstance().getDatabookStore().editComment(comment);
|
||||||
responseBean.setResult(result);
|
responseBean.setResult(result);
|
||||||
responseBean.setMessage("");
|
responseBean.setMessage("");
|
||||||
|
@ -187,7 +187,7 @@ public class Lib {
|
||||||
ResponseBean responseBean = new ResponseBean();
|
ResponseBean responseBean = new ResponseBean();
|
||||||
Status status = Status.OK;
|
Status status = Status.OK;
|
||||||
try{
|
try{
|
||||||
logger.info("deleting comment with commentid " + commentid);
|
logger.debug("deleting comment with commentid " + commentid);
|
||||||
boolean result = CassandraConnection.getInstance().getDatabookStore().deleteComment(commentid, postid);
|
boolean result = CassandraConnection.getInstance().getDatabookStore().deleteComment(commentid, postid);
|
||||||
responseBean.setResult(result);
|
responseBean.setResult(result);
|
||||||
responseBean.setMessage("");
|
responseBean.setMessage("");
|
||||||
|
@ -218,7 +218,7 @@ public class Lib {
|
||||||
ResponseBean responseBean = new ResponseBean();
|
ResponseBean responseBean = new ResponseBean();
|
||||||
Status status = Status.OK;
|
Status status = Status.OK;
|
||||||
try{
|
try{
|
||||||
logger.info("Saving hashtags " );
|
logger.debug("Saving hashtags " );
|
||||||
boolean result = CassandraConnection.getInstance().getDatabookStore().saveHashTags(feedid,vreid,hashtags);
|
boolean result = CassandraConnection.getInstance().getDatabookStore().saveHashTags(feedid,vreid,hashtags);
|
||||||
responseBean.setResult(result);
|
responseBean.setResult(result);
|
||||||
responseBean.setMessage("");
|
responseBean.setMessage("");
|
||||||
|
@ -249,7 +249,7 @@ public class Lib {
|
||||||
ResponseBean responseBean = new ResponseBean();
|
ResponseBean responseBean = new ResponseBean();
|
||||||
Status status = Status.OK;
|
Status status = Status.OK;
|
||||||
try{
|
try{
|
||||||
logger.info("deleting hashtags " );
|
logger.debug("deleting hashtags " );
|
||||||
boolean result = CassandraConnection.getInstance().getDatabookStore().deleteHashTags(feedid,vreid,hashtags);
|
boolean result = CassandraConnection.getInstance().getDatabookStore().deleteHashTags(feedid,vreid,hashtags);
|
||||||
responseBean.setResult(result);
|
responseBean.setResult(result);
|
||||||
responseBean.setMessage("");
|
responseBean.setMessage("");
|
||||||
|
@ -280,7 +280,7 @@ public class Lib {
|
||||||
ResponseBean responseBean = new ResponseBean();
|
ResponseBean responseBean = new ResponseBean();
|
||||||
Status status = Status.OK;
|
Status status = Status.OK;
|
||||||
try{
|
try{
|
||||||
logger.info("Saving hashtags comments " );
|
logger.debug("Saving hashtags comments " );
|
||||||
boolean result = CassandraConnection.getInstance().getDatabookStore().saveHashTagsComment(commentid,vreid,hashtags);
|
boolean result = CassandraConnection.getInstance().getDatabookStore().saveHashTagsComment(commentid,vreid,hashtags);
|
||||||
responseBean.setResult(result);
|
responseBean.setResult(result);
|
||||||
responseBean.setMessage("");
|
responseBean.setMessage("");
|
||||||
|
@ -310,7 +310,7 @@ public class Lib {
|
||||||
ResponseBean responseBean = new ResponseBean();
|
ResponseBean responseBean = new ResponseBean();
|
||||||
Status status = Status.OK;
|
Status status = Status.OK;
|
||||||
try{
|
try{
|
||||||
logger.info("deleting hashtags " );
|
logger.debug("deleting hashtags " );
|
||||||
boolean result = CassandraConnection.getInstance().getDatabookStore().deleteHashTagsComment(commentid,vreid,hashtags);
|
boolean result = CassandraConnection.getInstance().getDatabookStore().deleteHashTagsComment(commentid,vreid,hashtags);
|
||||||
responseBean.setResult(result);
|
responseBean.setResult(result);
|
||||||
responseBean.setMessage("");
|
responseBean.setMessage("");
|
||||||
|
@ -338,7 +338,7 @@ public class Lib {
|
||||||
Map<String, Integer> hashtags = null;
|
Map<String, Integer> hashtags = null;
|
||||||
|
|
||||||
try{
|
try{
|
||||||
logger.info("getting vre hashtags occurrences " + vreid);
|
logger.debug("getting vre hashtags occurrences " + vreid);
|
||||||
hashtags = CassandraConnection.getInstance().getDatabookStore().getVREHashtagsWithOccurrence(vreid);
|
hashtags = CassandraConnection.getInstance().getDatabookStore().getVREHashtagsWithOccurrence(vreid);
|
||||||
responseBean.setResult(hashtags);
|
responseBean.setResult(hashtags);
|
||||||
responseBean.setMessage("");
|
responseBean.setMessage("");
|
||||||
|
@ -369,7 +369,7 @@ public class Lib {
|
||||||
Map<String, Integer> hashtags = null;
|
Map<String, Integer> hashtags = null;
|
||||||
|
|
||||||
try{
|
try{
|
||||||
logger.info("getting vre hashtags occurrences " + vreid);
|
logger.debug("getting vre hashtags occurrences " + vreid);
|
||||||
hashtags = CassandraConnection.getInstance().getDatabookStore().getVREHashtagsWithOccurrenceFilteredByTime(vreid, timestamp);
|
hashtags = CassandraConnection.getInstance().getDatabookStore().getVREHashtagsWithOccurrenceFilteredByTime(vreid, timestamp);
|
||||||
responseBean.setResult(hashtags);
|
responseBean.setResult(hashtags);
|
||||||
responseBean.setMessage("");
|
responseBean.setMessage("");
|
||||||
|
@ -399,7 +399,7 @@ public class Lib {
|
||||||
List<Post> posts = null;
|
List<Post> posts = null;
|
||||||
|
|
||||||
try{
|
try{
|
||||||
logger.info("getting vre hashtags occurrences " + vreid);
|
logger.debug("getting vre hashtags occurrences " + vreid);
|
||||||
posts = CassandraConnection.getInstance().getDatabookStore().getVREPostsByHashtag(vreid, hashtag);
|
posts = CassandraConnection.getInstance().getDatabookStore().getVREPostsByHashtag(vreid, hashtag);
|
||||||
responseBean.setResult(posts);
|
responseBean.setResult(posts);
|
||||||
responseBean.setMessage("");
|
responseBean.setMessage("");
|
||||||
|
@ -428,7 +428,7 @@ public class Lib {
|
||||||
String inv = null;
|
String inv = null;
|
||||||
|
|
||||||
try{
|
try{
|
||||||
logger.info("Retrieving invite for vre " + vreid);
|
logger.debug("Retrieving invite for vre " + vreid);
|
||||||
inv = CassandraConnection.getInstance().getDatabookStore().isExistingInvite(vreid, email);
|
inv = CassandraConnection.getInstance().getDatabookStore().isExistingInvite(vreid, email);
|
||||||
responseBean.setResult(inv);
|
responseBean.setResult(inv);
|
||||||
responseBean.setMessage("");
|
responseBean.setMessage("");
|
||||||
|
@ -481,7 +481,7 @@ public class Lib {
|
||||||
Invite inv = null;
|
Invite inv = null;
|
||||||
|
|
||||||
try{
|
try{
|
||||||
logger.info("Retrieving invite for id " + inviteid);
|
logger.debug("Retrieving invite for id " + inviteid);
|
||||||
inv = CassandraConnection.getInstance().getDatabookStore().readInvite(inviteid);
|
inv = CassandraConnection.getInstance().getDatabookStore().readInvite(inviteid);
|
||||||
responseBean.setResult(inv);
|
responseBean.setResult(inv);
|
||||||
responseBean.setMessage("");
|
responseBean.setMessage("");
|
||||||
|
@ -570,7 +570,7 @@ public class Lib {
|
||||||
ResponseBean responseBean = new ResponseBean();
|
ResponseBean responseBean = new ResponseBean();
|
||||||
Status status = Status.OK;
|
Status status = Status.OK;
|
||||||
try{
|
try{
|
||||||
logger.info("Writing like with likeid " + like.getKey());
|
logger.debug("Writing like with likeid " + like.getKey());
|
||||||
boolean result = CassandraConnection.getInstance().getDatabookStore().like(like);
|
boolean result = CassandraConnection.getInstance().getDatabookStore().like(like);
|
||||||
responseBean.setResult(result);
|
responseBean.setResult(result);
|
||||||
responseBean.setMessage("");
|
responseBean.setMessage("");
|
||||||
|
@ -599,7 +599,7 @@ public class Lib {
|
||||||
ResponseBean responseBean = new ResponseBean();
|
ResponseBean responseBean = new ResponseBean();
|
||||||
Status status = Status.OK;
|
Status status = Status.OK;
|
||||||
try{
|
try{
|
||||||
logger.info("Writing unlike with likeid " + likeid);
|
logger.debug("Writing unlike with likeid " + likeid);
|
||||||
boolean result = CassandraConnection.getInstance().getDatabookStore().unlike(userid,likeid,feedid);
|
boolean result = CassandraConnection.getInstance().getDatabookStore().unlike(userid,likeid,feedid);
|
||||||
responseBean.setResult(result);
|
responseBean.setResult(result);
|
||||||
responseBean.setMessage("");
|
responseBean.setMessage("");
|
||||||
|
@ -627,7 +627,7 @@ public class Lib {
|
||||||
List<String> likes = null;
|
List<String> likes = null;
|
||||||
|
|
||||||
try{
|
try{
|
||||||
logger.info("Retrieving likes for user id " + userid);
|
logger.debug("Retrieving likes for user id " + userid);
|
||||||
likes = CassandraConnection.getInstance().getDatabookStore().getAllLikedPostIdsByUser(userid);
|
likes = CassandraConnection.getInstance().getDatabookStore().getAllLikedPostIdsByUser(userid);
|
||||||
responseBean.setResult(likes);
|
responseBean.setResult(likes);
|
||||||
responseBean.setMessage("");
|
responseBean.setMessage("");
|
||||||
|
@ -655,7 +655,7 @@ public class Lib {
|
||||||
List<Like> likes = null;
|
List<Like> likes = null;
|
||||||
|
|
||||||
try{
|
try{
|
||||||
logger.info("Retrieving likes for post id " + postid);
|
logger.debug("Retrieving likes for post id " + postid);
|
||||||
likes = CassandraConnection.getInstance().getDatabookStore().getAllLikesByPost(postid);
|
likes = CassandraConnection.getInstance().getDatabookStore().getAllLikesByPost(postid);
|
||||||
responseBean.setResult(likes);
|
responseBean.setResult(likes);
|
||||||
responseBean.setMessage("");
|
responseBean.setMessage("");
|
||||||
|
@ -928,9 +928,9 @@ public class Lib {
|
||||||
) throws ValidationException{
|
) throws ValidationException{
|
||||||
ResponseBean responseBean = new ResponseBean();
|
ResponseBean responseBean = new ResponseBean();
|
||||||
for(NotificationType notificationType: enabledChannels.keySet()){
|
for(NotificationType notificationType: enabledChannels.keySet()){
|
||||||
logger.info("Type: " + notificationType.toString());
|
logger.debug("Type: " + notificationType.toString());
|
||||||
for(NotificationChannelType channelType: enabledChannels.get(notificationType)){
|
for(NotificationChannelType channelType: enabledChannels.get(notificationType)){
|
||||||
logger.info(channelType.toString());
|
logger.debug(channelType.toString());
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
Status status = Status.OK;
|
Status status = Status.OK;
|
||||||
|
@ -1017,8 +1017,8 @@ public class Lib {
|
||||||
responseBean.setMessage("");
|
responseBean.setMessage("");
|
||||||
responseBean.setSuccess(result);
|
responseBean.setSuccess(result);
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
logger.info("Unable to write attachment.", e);
|
logger.error("Unable to write attachment.", e);
|
||||||
logger.info(e.getMessage());
|
logger.error(e.getMessage());
|
||||||
responseBean.setMessage(e.getMessage());
|
responseBean.setMessage(e.getMessage());
|
||||||
responseBean.setSuccess(false);
|
responseBean.setSuccess(false);
|
||||||
status = Status.INTERNAL_SERVER_ERROR;
|
status = Status.INTERNAL_SERVER_ERROR;
|
||||||
|
|
|
@ -73,7 +73,7 @@ public class Likes {
|
||||||
List<Like> likes = null;
|
List<Like> likes = null;
|
||||||
|
|
||||||
try{
|
try{
|
||||||
logger.info("Retrieving likes for user id " + username);
|
logger.debug("Retrieving likes for user id " + username);
|
||||||
likes = CassandraConnection.getInstance().getDatabookStore().getAllLikesByPost(key);
|
likes = CassandraConnection.getInstance().getDatabookStore().getAllLikesByPost(key);
|
||||||
responseBean.setResult(likes);
|
responseBean.setResult(likes);
|
||||||
responseBean.setSuccess(true);
|
responseBean.setSuccess(true);
|
||||||
|
@ -113,7 +113,7 @@ public class Likes {
|
||||||
Status status = Status.OK;
|
Status status = Status.OK;
|
||||||
boolean likeResultOperation = SocialUtils.like(username, post.getPostId(), context);
|
boolean likeResultOperation = SocialUtils.like(username, post.getPostId(), context);
|
||||||
if (likeResultOperation)
|
if (likeResultOperation)
|
||||||
logger.info("Added like OK to postId " + post.getPostId());
|
logger.debug("Added like OK to postId " + post.getPostId());
|
||||||
else {
|
else {
|
||||||
logger.error("Unable to like this post"+ post.getPostId());
|
logger.error("Unable to like this post"+ post.getPostId());
|
||||||
responseBean.setMessage("Unable to like, something went wrong please see server log");
|
responseBean.setMessage("Unable to like, something went wrong please see server log");
|
||||||
|
@ -152,7 +152,7 @@ public class Likes {
|
||||||
Status status = Status.OK;
|
Status status = Status.OK;
|
||||||
boolean likeResultOperation = SocialUtils.unlike(username, likeInputBean.getLikeid(), likeInputBean.getPostid());
|
boolean likeResultOperation = SocialUtils.unlike(username, likeInputBean.getLikeid(), likeInputBean.getPostid());
|
||||||
if (likeResultOperation)
|
if (likeResultOperation)
|
||||||
logger.info("Unlike OK to postId " + likeInputBean.getPostid());
|
logger.debug("Unlike OK to postId " + likeInputBean.getPostid());
|
||||||
else {
|
else {
|
||||||
logger.error("Unable to unlike this post"+ likeInputBean.getPostid());
|
logger.error("Unable to unlike this post"+ likeInputBean.getPostid());
|
||||||
responseBean.setMessage("Unable to unlike, something went wrong please see server log");
|
responseBean.setMessage("Unable to unlike, something went wrong please see server log");
|
||||||
|
|
|
@ -122,7 +122,7 @@ public class Messages {
|
||||||
String body = input.getBody();
|
String body = input.getBody();
|
||||||
String subject = input.getSubject();
|
String subject = input.getSubject();
|
||||||
List<Recipient> recipientsIds = input.getRecipients(); // "recipients":[{"recipient":"id recipient"}, ......]
|
List<Recipient> recipientsIds = input.getRecipients(); // "recipients":[{"recipient":"id recipient"}, ......]
|
||||||
logger.info("Sender is going to be [" + fullName + "]");
|
logger.debug("Sender is going to be [" + fullName + "]");
|
||||||
|
|
||||||
// get the recipients ids (simple check, trim)
|
// get the recipients ids (simple check, trim)
|
||||||
List<String> recipientsListFiltered = new ArrayList<String>();
|
List<String> recipientsListFiltered = new ArrayList<String>();
|
||||||
|
@ -195,7 +195,7 @@ public class Messages {
|
||||||
ResponseBean responseBean = new ResponseBean();
|
ResponseBean responseBean = new ResponseBean();
|
||||||
Status status = Status.OK;
|
Status status = Status.OK;
|
||||||
|
|
||||||
logger.info("Request for retrieving sent messages by " + username);
|
logger.debug("Request for retrieving sent messages by " + username);
|
||||||
|
|
||||||
try{
|
try{
|
||||||
MessageManagerClient client = AbstractPlugin.messages().build();
|
MessageManagerClient client = AbstractPlugin.messages().build();
|
||||||
|
@ -231,7 +231,7 @@ public class Messages {
|
||||||
ResponseBean responseBean = new ResponseBean();
|
ResponseBean responseBean = new ResponseBean();
|
||||||
Status status = Status.OK;
|
Status status = Status.OK;
|
||||||
|
|
||||||
logger.info("Request for retrieving received messages by " + username);
|
logger.debug("Request for retrieving received messages by " + username);
|
||||||
try{
|
try{
|
||||||
MessageManagerClient client = AbstractPlugin.messages().build();
|
MessageManagerClient client = AbstractPlugin.messages().build();
|
||||||
List<Message> getMessages =client.getReceivedMessages();
|
List<Message> getMessages =client.getReceivedMessages();
|
||||||
|
@ -277,7 +277,7 @@ public class Messages {
|
||||||
MessageManagerClient client = AbstractPlugin.messages().build();
|
MessageManagerClient client = AbstractPlugin.messages().build();
|
||||||
client.setRead(messageId, read);
|
client.setRead(messageId, read);
|
||||||
String toReturn = "set Message id:" + messageId + (read ? " read" : " unread");
|
String toReturn = "set Message id:" + messageId + (read ? " read" : " unread");
|
||||||
logger.info("set Message id:" + messageId + " read?" + read + " for " + opExecutor);
|
logger.debug("set Message id:" + messageId + " read?" + read + " for " + opExecutor);
|
||||||
|
|
||||||
responseBean.setSuccess(true);
|
responseBean.setSuccess(true);
|
||||||
responseBean.setResult(toReturn);
|
responseBean.setResult(toReturn);
|
||||||
|
|
|
@ -292,7 +292,7 @@ public class Notifications {
|
||||||
Status status = Status.OK;
|
Status status = Status.OK;
|
||||||
|
|
||||||
String appQualifier = caller.getClient().getId();
|
String appQualifier = caller.getClient().getId();
|
||||||
logger.info("Received request from app " + appQualifier + " to notify job status described by bean " + job);
|
logger.debug("Received request from app " + appQualifier + " to notify job status described by bean " + job);
|
||||||
|
|
||||||
try{
|
try{
|
||||||
|
|
||||||
|
@ -370,9 +370,11 @@ public class Notifications {
|
||||||
Status status = Status.OK;
|
Status status = Status.OK;
|
||||||
boolean deliveryResult = false;
|
boolean deliveryResult = false;
|
||||||
try {
|
try {
|
||||||
logger.debug("catalogue notifications type is " + event.getType());
|
//logger.debug("catalogue notifications type is " + event.getType());
|
||||||
SocialNetworkingSite site = SocialNetworkingSiteFinder.getSocialNetworkingSiteFromScope(context);
|
SocialNetworkingSite site = SocialNetworkingSiteFinder.getSocialNetworkingSiteFromScope(context);
|
||||||
|
//logger.debug("social networking site is " + site.getName());
|
||||||
|
//logger.debug("context is " + context);
|
||||||
|
//logger.debug("user is " + user.getUsername());
|
||||||
|
|
||||||
NotificationsManager nm = new ApplicationNotificationsManager(UserManagerWSBuilder.getInstance().getUserManager(), site, context, user);
|
NotificationsManager nm = new ApplicationNotificationsManager(UserManagerWSBuilder.getInstance().getUserManager(), site, context, user);
|
||||||
|
|
||||||
|
@ -392,7 +394,12 @@ public class Notifications {
|
||||||
responseBean.setMessage("Username not found, got: " + userIdToNotify);
|
responseBean.setMessage("Username not found, got: " + userIdToNotify);
|
||||||
return Response.status(status).entity(responseBean).build();
|
return Response.status(status).entity(responseBean).build();
|
||||||
}
|
}
|
||||||
|
//logger.debug("username2notify " + username2Notify);
|
||||||
|
//logger.debug("type is " + CatalogueEventTypeMapper.getType(event.getType()));
|
||||||
|
//logger.debug("item id is " + event.getItemId());
|
||||||
|
//logger.debug("item text is " + event.getNotifyText());
|
||||||
|
//logger.debug("item url is " + event.getItemURL());
|
||||||
|
|
||||||
deliveryResult =
|
deliveryResult =
|
||||||
nm.notifyCatalogueEvent(
|
nm.notifyCatalogueEvent(
|
||||||
CatalogueEventTypeMapper.getType(event.getType()),
|
CatalogueEventTypeMapper.getType(event.getType()),
|
||||||
|
|
|
@ -83,7 +83,7 @@ public class Posts {
|
||||||
List<Post> posts = null;
|
List<Post> posts = null;
|
||||||
|
|
||||||
try{
|
try{
|
||||||
logger.info("Retrieving post for user id " + username + " and reference time " + timeInMillis);
|
logger.debug("Retrieving post for user id " + username + " and reference time " + timeInMillis);
|
||||||
posts = CassandraConnection.getInstance().getDatabookStore().getRecentPostsByUserAndDate(username, timeInMillis);
|
posts = CassandraConnection.getInstance().getDatabookStore().getRecentPostsByUserAndDate(username, timeInMillis);
|
||||||
Filters.filterPostsPerContext(posts, context);
|
Filters.filterPostsPerContext(posts, context);
|
||||||
Filters.hideSensitiveInformation(posts, caller.getClient().getId());
|
Filters.hideSensitiveInformation(posts, caller.getClient().getId());
|
||||||
|
@ -277,9 +277,9 @@ public class Posts {
|
||||||
|
|
||||||
// convert enablenotification parameter
|
// convert enablenotification parameter
|
||||||
if(enableNotification)
|
if(enableNotification)
|
||||||
logger.info("Enable notification for this user post.");
|
logger.debug("Enable notification for this user post.");
|
||||||
else
|
else
|
||||||
logger.info("Disable notification for this user post.");
|
logger.debug("Disable notification for this user post.");
|
||||||
|
|
||||||
|
|
||||||
// try to share
|
// try to share
|
||||||
|
@ -544,7 +544,7 @@ public class Posts {
|
||||||
String context = ScopeProvider.instance.get();
|
String context = ScopeProvider.instance.get();
|
||||||
ResponseBean responseBean = new ResponseBean();
|
ResponseBean responseBean = new ResponseBean();
|
||||||
Status status = Status.OK;
|
Status status = Status.OK;
|
||||||
logger.info("User " + username + " has requested posts containing hashtag " + hashtag + " in context " + context);
|
logger.debug("User " + username + " has requested posts containing hashtag " + hashtag + " in context " + context);
|
||||||
try{
|
try{
|
||||||
DatabookStore datastore = CassandraConnection.getInstance().getDatabookStore();
|
DatabookStore datastore = CassandraConnection.getInstance().getDatabookStore();
|
||||||
List<Post> posts = datastore.getVREPostsByHashtag(context, hashtag);
|
List<Post> posts = datastore.getVREPostsByHashtag(context, hashtag);
|
||||||
|
@ -656,9 +656,9 @@ public class Posts {
|
||||||
Status status = Status.OK;
|
Status status = Status.OK;
|
||||||
try{
|
try{
|
||||||
Post post = postWithAttachment.getPost();
|
Post post = postWithAttachment.getPost();
|
||||||
logger.info("Post is " + post);
|
logger.debug("Post is " + post);
|
||||||
List<Attachment> attachments = postWithAttachment.getAttachments();
|
List<Attachment> attachments = postWithAttachment.getAttachments();
|
||||||
logger.info("Attachments are " + attachments);
|
logger.debug("Attachments are " + attachments);
|
||||||
boolean result = CassandraConnection.getInstance().getDatabookStore().saveUserPost(post,attachments);
|
boolean result = CassandraConnection.getInstance().getDatabookStore().saveUserPost(post,attachments);
|
||||||
responseBean.setResult(result);
|
responseBean.setResult(result);
|
||||||
responseBean.setMessage("");
|
responseBean.setMessage("");
|
||||||
|
|
|
@ -70,7 +70,7 @@ public class Tokens {
|
||||||
status = Status.FORBIDDEN;
|
status = Status.FORBIDDEN;
|
||||||
return Response.status(status).entity(responseBean).build();
|
return Response.status(status).entity(responseBean).build();
|
||||||
}
|
}
|
||||||
logger.info("Generating token for the application with id " + appId);
|
logger.debug("Generating token for the application with id " + appId);
|
||||||
// each token is related to an identifier and the context
|
// each token is related to an identifier and the context
|
||||||
String appToken = authorizationService().generateExternalServiceToken(appId);
|
String appToken = authorizationService().generateExternalServiceToken(appId);
|
||||||
responseBean.setSuccess(true);
|
responseBean.setSuccess(true);
|
||||||
|
|
|
@ -141,7 +141,7 @@ public class Users {
|
||||||
|
|
||||||
GCubeUser user = userManager.getUserByUsername(username);
|
GCubeUser user = userManager.getUserByUsername(username);
|
||||||
fullName = user.getFullname();
|
fullName = user.getFullname();
|
||||||
logger.info("Found fullname " + fullName + " for user " + username);
|
logger.debug("Found fullname " + fullName + " for user " + username);
|
||||||
responseBean.setResult(fullName);
|
responseBean.setResult(fullName);
|
||||||
responseBean.setSuccess(true);
|
responseBean.setSuccess(true);
|
||||||
|
|
||||||
|
@ -182,7 +182,7 @@ public class Users {
|
||||||
UserManager userManager = UserManagerWSBuilder.getInstance().getUserManager();
|
UserManager userManager = UserManagerWSBuilder.getInstance().getUserManager();
|
||||||
GCubeUser user = userManager.getUserByUsername(username);
|
GCubeUser user = userManager.getUserByUsername(username);
|
||||||
email = user.getEmail();
|
email = user.getEmail();
|
||||||
logger.info("Found email " + email + " for user " + username);
|
logger.debug("Found email " + email + " for user " + username);
|
||||||
responseBean.setResult(email);
|
responseBean.setResult(email);
|
||||||
responseBean.setSuccess(true);
|
responseBean.setSuccess(true);
|
||||||
|
|
||||||
|
@ -532,7 +532,7 @@ public class Users {
|
||||||
}
|
}
|
||||||
|
|
||||||
private static List<UserRepresentation> searchByRole(Keycloak keycloak, String realmName, String context, String roleName) {
|
private static List<UserRepresentation> searchByRole(Keycloak keycloak, String realmName, String context, String roleName) {
|
||||||
logger.info("Searching by role: {}", roleName);
|
logger.debug("Searching by role: {}", roleName);
|
||||||
|
|
||||||
String clientIdContext = context.replace("/", "%2F") ;
|
String clientIdContext = context.replace("/", "%2F") ;
|
||||||
|
|
||||||
|
@ -541,8 +541,8 @@ public class Users {
|
||||||
|
|
||||||
String id = "";
|
String id = "";
|
||||||
for (ClientRepresentation client : clients) {
|
for (ClientRepresentation client : clients) {
|
||||||
logger.info("found client ="+client.getClientId());
|
logger.debug("found client ="+client.getClientId());
|
||||||
logger.info("found client id="+client.getId());
|
logger.debug("found client id="+client.getId());
|
||||||
id =client.getId();
|
id =client.getId();
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -22,9 +22,9 @@ public class CassandraConnection {
|
||||||
|
|
||||||
private CassandraConnection(){
|
private CassandraConnection(){
|
||||||
ApplicationContext ctx = ContextProvider.get(); // get this info from SmartGears
|
ApplicationContext ctx = ContextProvider.get(); // get this info from SmartGears
|
||||||
logger.info("Getting connection to cassandra");
|
logger.debug("Getting connection to cassandra");
|
||||||
store = new DBCassandraAstyanaxImpl(ctx.container().configuration().infrastructure());
|
store = new DBCassandraAstyanaxImpl(ctx.container().configuration().infrastructure());
|
||||||
logger.info("Connection to cassandra created");
|
logger.debug("Connection to cassandra created");
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
@ -24,9 +24,9 @@ public class ElasticSearchConnection {
|
||||||
private ElasticSearchConnection(){
|
private ElasticSearchConnection(){
|
||||||
try {
|
try {
|
||||||
ApplicationContext ctx = ContextProvider.get(); // get this info from SmartGears
|
ApplicationContext ctx = ContextProvider.get(); // get this info from SmartGears
|
||||||
logger.info("Creating connection to Elasticsearch");
|
logger.debug("Creating connection to Elasticsearch");
|
||||||
es = new ElasticSearchClientImpl(ctx.container().configuration().infrastructure());
|
es = new ElasticSearchClientImpl(ctx.container().configuration().infrastructure());
|
||||||
logger.info("Elasticsearch connection created");
|
logger.debug("Elasticsearch connection created");
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
logger.error("Failed to connect to elasticsearch", e);
|
logger.error("Failed to connect to elasticsearch", e);
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,7 +135,7 @@ public class SocialUtils {
|
||||||
SocialNetworkingSite site = SocialNetworkingSiteFinder.getSocialNetworkingSiteFromScope(ScopeProvider.instance.get());
|
SocialNetworkingSite site = SocialNetworkingSiteFinder.getSocialNetworkingSiteFromScope(ScopeProvider.instance.get());
|
||||||
|
|
||||||
escapedPostText = Utils.convertMentionUsernamesAnchorHTML(escapedPostText, mentionedUsersToConvertInHTML, site.getSiteURL(), site.getSiteLandingPagePath());
|
escapedPostText = Utils.convertMentionUsernamesAnchorHTML(escapedPostText, mentionedUsersToConvertInHTML, site.getSiteURL(), site.getSiteLandingPagePath());
|
||||||
logger.info("*** Escaped post text is " + escapedPostText);
|
logger.debug("*** Escaped post text is " + escapedPostText);
|
||||||
|
|
||||||
String scope = ScopeProvider.instance.get();
|
String scope = ScopeProvider.instance.get();
|
||||||
String appId = caller.getClient().getId();
|
String appId = caller.getClient().getId();
|
||||||
|
@ -154,7 +154,7 @@ public class SocialUtils {
|
||||||
boolean res = CassandraConnection.getInstance().getDatabookStore().saveAppPost(toWrite);
|
boolean res = CassandraConnection.getInstance().getDatabookStore().saveAppPost(toWrite);
|
||||||
|
|
||||||
if(res){
|
if(res){
|
||||||
logger.info("Feed correctly written by application " + appId);
|
logger.debug("Feed correctly written by application " + appId);
|
||||||
|
|
||||||
// wait a bit before saving hashtags
|
// wait a bit before saving hashtags
|
||||||
if(hashtags != null && !hashtags.isEmpty())
|
if(hashtags != null && !hashtags.isEmpty())
|
||||||
|
@ -439,7 +439,7 @@ public class SocialUtils {
|
||||||
Post toShare = new Post(UUID.randomUUID().toString(), PostType.PUBLISH, userId, new Date(),
|
Post toShare = new Post(UUID.randomUUID().toString(), PostType.PUBLISH, userId, new Date(),
|
||||||
vreId, url, urlThumbnail, textToPost, PrivacyLevel.SINGLE_VRE, fullName, email, thumbnailURL, linkTitle, linkDesc, host);
|
vreId, url, urlThumbnail, textToPost, PrivacyLevel.SINGLE_VRE, fullName, email, thumbnailURL, linkTitle, linkDesc, host);
|
||||||
|
|
||||||
logger.info("Attempting to save Post with text: " + textToPost + " Level = " + PrivacyLevel.SINGLE_VRE + " Timeline = " + vreId);
|
logger.debug("Attempting to save Post with text: " + textToPost + " Level = " + PrivacyLevel.SINGLE_VRE + " Timeline = " + vreId);
|
||||||
|
|
||||||
boolean result = CassandraConnection.getInstance().getDatabookStore().saveUserPost(toShare);
|
boolean result = CassandraConnection.getInstance().getDatabookStore().saveUserPost(toShare);
|
||||||
|
|
||||||
|
@ -450,7 +450,7 @@ public class SocialUtils {
|
||||||
try {
|
try {
|
||||||
|
|
||||||
try{
|
try{
|
||||||
logger.info("Sleeping waiting for cassandra's update");
|
logger.debug("Sleeping waiting for cassandra's update");
|
||||||
Thread.sleep(1000);
|
Thread.sleep(1000);
|
||||||
|
|
||||||
}catch(Exception e){
|
}catch(Exception e){
|
||||||
|
@ -547,10 +547,10 @@ public class SocialUtils {
|
||||||
String thumbnailURL = user.getUserAvatarURL();
|
String thumbnailURL = user.getUserAvatarURL();
|
||||||
|
|
||||||
Comment theComment = new Comment(commentKey, userid, time, postId, escapedCommentText, fullName, thumbnailURL);
|
Comment theComment = new Comment(commentKey, userid, time, postId, escapedCommentText, fullName, thumbnailURL);
|
||||||
logger.info("Attempting to save Comment with text: " + commentText + " postid="+postId);
|
logger.debug("Attempting to save Comment with text: " + commentText + " postid="+postId);
|
||||||
|
|
||||||
boolean result = CassandraConnection.getInstance().getDatabookStore().addComment(theComment);
|
boolean result = CassandraConnection.getInstance().getDatabookStore().addComment(theComment);
|
||||||
logger.info("Added comment? " + theComment.toString() + " Result is " +result);
|
logger.debug("Added comment? " + theComment.toString() + " Result is " +result);
|
||||||
|
|
||||||
if (!result)
|
if (!result)
|
||||||
return null;
|
return null;
|
||||||
|
@ -561,10 +561,10 @@ public class SocialUtils {
|
||||||
NotificationsManager nm = new ApplicationNotificationsManager(uManager, site, context, socialUser, NEWS_FEED_PORTLET_CLASSNAME);
|
NotificationsManager nm = new ApplicationNotificationsManager(uManager, site, context, socialUser, NEWS_FEED_PORTLET_CLASSNAME);
|
||||||
|
|
||||||
//if the user who commented this post is not the user who posted it notify the poster user (Post owner)
|
//if the user who commented this post is not the user who posted it notify the poster user (Post owner)
|
||||||
logger.info("The post creator is " + postOwnerId);
|
logger.debug("The post creator is " + postOwnerId);
|
||||||
if (! user.getUsername().equals(postOwnerId)) {
|
if (! user.getUsername().equals(postOwnerId)) {
|
||||||
boolean resultNotifyOwnComment = nm.notifyOwnCommentReply(postOwnerId, postId, escapedCommentText, theComment.getKey());
|
boolean resultNotifyOwnComment = nm.notifyOwnCommentReply(postOwnerId, postId, escapedCommentText, theComment.getKey());
|
||||||
logger.info("Comment Notification to post creator added? " + resultNotifyOwnComment);
|
logger.debug("Comment Notification to post creator added? " + resultNotifyOwnComment);
|
||||||
}
|
}
|
||||||
//if there are users who liked this post they get notified, asynchronously with this thread
|
//if there are users who liked this post they get notified, asynchronously with this thread
|
||||||
ArrayList<Like> likes = getAllLikesByPost(postId);
|
ArrayList<Like> likes = getAllLikesByPost(postId);
|
||||||
|
@ -669,7 +669,7 @@ public class SocialUtils {
|
||||||
new Date(), postid, user.getFullname(), user.getUserAvatarURL());
|
new Date(), postid, user.getFullname(), user.getUserAvatarURL());
|
||||||
Post thePost = null;
|
Post thePost = null;
|
||||||
try {
|
try {
|
||||||
logger.info("Attempting to read post with id: " +postid);
|
logger.debug("Attempting to read post with id: " +postid);
|
||||||
thePost = CassandraConnection.getInstance().getDatabookStore().readPost(postid);
|
thePost = CassandraConnection.getInstance().getDatabookStore().readPost(postid);
|
||||||
likeCommitResult = CassandraConnection.getInstance().getDatabookStore().like(toLike);
|
likeCommitResult = CassandraConnection.getInstance().getDatabookStore().like(toLike);
|
||||||
} catch (Exception e) {
|
} catch (Exception e) {
|
||||||
|
@ -689,10 +689,10 @@ public class SocialUtils {
|
||||||
String escapedPostText = messageParser.getParsedMessage();
|
String escapedPostText = messageParser.getParsedMessage();
|
||||||
|
|
||||||
//if the user who liked this post is not the user who posted it notify the poster user (Post owner)
|
//if the user who liked this post is not the user who posted it notify the poster user (Post owner)
|
||||||
logger.info("The post creator is " + postOwnerId);
|
logger.debug("The post creator is " + postOwnerId);
|
||||||
if (! user.getUsername().equals(postOwnerId)) {
|
if (! user.getUsername().equals(postOwnerId)) {
|
||||||
resultNotifyLike = nm.notifyLikedPost(postOwnerId, postid, escapedPostText);
|
resultNotifyLike = nm.notifyLikedPost(postOwnerId, postid, escapedPostText);
|
||||||
logger.info("Like Notification to post creator added? " + resultNotifyLike);
|
logger.debug("Like Notification to post creator added? " + resultNotifyLike);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
return likeCommitResult && resultNotifyLike;
|
return likeCommitResult && resultNotifyLike;
|
||||||
|
|
Loading…
Reference in New Issue