Compare commits
41 Commits
28
.classpath
28
.classpath
|
@ -1,28 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<classpath>
|
|
||||||
<classpathentry kind="src" output="target/classes" path="src/main/java">
|
|
||||||
<attributes>
|
|
||||||
<attribute name="optional" value="true"/>
|
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
|
||||||
</attributes>
|
|
||||||
</classpathentry>
|
|
||||||
<classpathentry kind="src" output="target/test-classes" path="src/test/java">
|
|
||||||
<attributes>
|
|
||||||
<attribute name="test" value="true"/>
|
|
||||||
<attribute name="optional" value="true"/>
|
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
|
||||||
</attributes>
|
|
||||||
</classpathentry>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.m2e.MAVEN2_CLASSPATH_CONTAINER">
|
|
||||||
<attributes>
|
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
|
||||||
</attributes>
|
|
||||||
</classpathentry>
|
|
||||||
<classpathentry kind="con" path="org.eclipse.jdt.launching.JRE_CONTAINER/org.eclipse.jdt.internal.debug.ui.launcher.StandardVMType/Java 8">
|
|
||||||
<attributes>
|
|
||||||
<attribute name="module" value="true"/>
|
|
||||||
<attribute name="maven.pomderived" value="true"/>
|
|
||||||
</attributes>
|
|
||||||
</classpathentry>
|
|
||||||
<classpathentry kind="output" path="target/classes"/>
|
|
||||||
</classpath>
|
|
|
@ -1 +1,174 @@
|
||||||
/target/
|
#
|
||||||
|
ignore_me
|
||||||
|
tomcat
|
||||||
|
|
||||||
|
target
|
||||||
|
.classpath
|
||||||
|
.visual
|
||||||
|
.project
|
||||||
|
.settings
|
||||||
|
/**/.DS_Store
|
||||||
|
|
||||||
|
# Created by https://www.toptal.com/developers/gitignore/api/java,macos,linux,visualstudiocode,eclipse
|
||||||
|
# Edit at https://www.toptal.com/developers/gitignore?templates=java,macos,linux,visualstudiocode,eclipse
|
||||||
|
|
||||||
|
### Eclipse ###
|
||||||
|
.metadata
|
||||||
|
bin/
|
||||||
|
tmp/
|
||||||
|
*.tmp
|
||||||
|
*.bak
|
||||||
|
*.swp
|
||||||
|
*~.nib
|
||||||
|
local.properties
|
||||||
|
.settings/
|
||||||
|
.loadpath
|
||||||
|
.recommenders
|
||||||
|
|
||||||
|
# External tool builders
|
||||||
|
.externalToolBuilders/
|
||||||
|
|
||||||
|
# Locally stored "Eclipse launch configurations"
|
||||||
|
*.launch
|
||||||
|
|
||||||
|
# PyDev specific (Python IDE for Eclipse)
|
||||||
|
*.pydevproject
|
||||||
|
|
||||||
|
# CDT-specific (C/C++ Development Tooling)
|
||||||
|
.cproject
|
||||||
|
|
||||||
|
# CDT- autotools
|
||||||
|
.autotools
|
||||||
|
|
||||||
|
# Java annotation processor (APT)
|
||||||
|
.factorypath
|
||||||
|
|
||||||
|
# PDT-specific (PHP Development Tools)
|
||||||
|
.buildpath
|
||||||
|
|
||||||
|
# sbteclipse plugin
|
||||||
|
.target
|
||||||
|
|
||||||
|
# Tern plugin
|
||||||
|
.tern-project
|
||||||
|
|
||||||
|
# TeXlipse plugin
|
||||||
|
.texlipse
|
||||||
|
|
||||||
|
# STS (Spring Tool Suite)
|
||||||
|
.springBeans
|
||||||
|
|
||||||
|
# Code Recommenders
|
||||||
|
.recommenders/
|
||||||
|
|
||||||
|
# Annotation Processing
|
||||||
|
.apt_generated/
|
||||||
|
.apt_generated_test/
|
||||||
|
|
||||||
|
# Scala IDE specific (Scala & Java development for Eclipse)
|
||||||
|
.cache-main
|
||||||
|
.scala_dependencies
|
||||||
|
.worksheet
|
||||||
|
|
||||||
|
# Uncomment this line if you wish to ignore the project description file.
|
||||||
|
# Typically, this file would be tracked if it contains build/dependency configurations:
|
||||||
|
#.project
|
||||||
|
|
||||||
|
### Eclipse Patch ###
|
||||||
|
# Spring Boot Tooling
|
||||||
|
.sts4-cache/
|
||||||
|
|
||||||
|
### Java ###
|
||||||
|
# Compiled class file
|
||||||
|
*.class
|
||||||
|
|
||||||
|
# Log file
|
||||||
|
*.log
|
||||||
|
|
||||||
|
# BlueJ files
|
||||||
|
*.ctxt
|
||||||
|
|
||||||
|
# Mobile Tools for Java (J2ME)
|
||||||
|
.mtj.tmp/
|
||||||
|
|
||||||
|
# Package Files #
|
||||||
|
*.jar
|
||||||
|
*.war
|
||||||
|
*.nar
|
||||||
|
*.ear
|
||||||
|
*.zip
|
||||||
|
*.tar.gz
|
||||||
|
*.rar
|
||||||
|
|
||||||
|
# virtual machine crash logs, see http://www.java.com/en/download/help/error_hotspot.xml
|
||||||
|
hs_err_pid*
|
||||||
|
replay_pid*
|
||||||
|
|
||||||
|
### Linux ###
|
||||||
|
*~
|
||||||
|
|
||||||
|
# temporary files which can be created if a process still has a handle open of a deleted file
|
||||||
|
.fuse_hidden*
|
||||||
|
|
||||||
|
# KDE directory preferences
|
||||||
|
.directory
|
||||||
|
|
||||||
|
# Linux trash folder which might appear on any partition or disk
|
||||||
|
.Trash-*
|
||||||
|
|
||||||
|
# .nfs files are created when an open file is removed but is still being accessed
|
||||||
|
.nfs*
|
||||||
|
|
||||||
|
### macOS ###
|
||||||
|
# General
|
||||||
|
.DS_Store
|
||||||
|
.AppleDouble
|
||||||
|
.LSOverride
|
||||||
|
|
||||||
|
# Icon must end with two \r
|
||||||
|
Icon
|
||||||
|
|
||||||
|
|
||||||
|
# Thumbnails
|
||||||
|
._*
|
||||||
|
|
||||||
|
# Files that might appear in the root of a volume
|
||||||
|
.DocumentRevisions-V100
|
||||||
|
.fseventsd
|
||||||
|
.Spotlight-V100
|
||||||
|
.TemporaryItems
|
||||||
|
.Trashes
|
||||||
|
.VolumeIcon.icns
|
||||||
|
.com.apple.timemachine.donotpresent
|
||||||
|
|
||||||
|
# Directories potentially created on remote AFP share
|
||||||
|
.AppleDB
|
||||||
|
.AppleDesktop
|
||||||
|
Network Trash Folder
|
||||||
|
Temporary Items
|
||||||
|
.apdisk
|
||||||
|
|
||||||
|
### macOS Patch ###
|
||||||
|
# iCloud generated files
|
||||||
|
*.icloud
|
||||||
|
|
||||||
|
### VisualStudioCode ###
|
||||||
|
.vscode/*
|
||||||
|
!.vscode/settings.json
|
||||||
|
!.vscode/tasks.json
|
||||||
|
!.vscode/launch.json
|
||||||
|
!.vscode/extensions.json
|
||||||
|
!.vscode/*.code-snippets
|
||||||
|
|
||||||
|
# Local History for Visual Studio Code
|
||||||
|
.history/
|
||||||
|
|
||||||
|
# Built Visual Studio Code Extensions
|
||||||
|
*.vsix
|
||||||
|
|
||||||
|
### VisualStudioCode Patch ###
|
||||||
|
# Ignore all local history of files
|
||||||
|
.history
|
||||||
|
.ionide
|
||||||
|
|
||||||
|
# End of https://www.toptal.com/developers/gitignore/api/java,macos,linux,visualstudiocode,eclipse
|
||||||
|
|
23
.project
23
.project
|
@ -1,23 +0,0 @@
|
||||||
<?xml version="1.0" encoding="UTF-8"?>
|
|
||||||
<projectDescription>
|
|
||||||
<name>social-service-client</name>
|
|
||||||
<comment></comment>
|
|
||||||
<projects>
|
|
||||||
</projects>
|
|
||||||
<buildSpec>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.jdt.core.javabuilder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
<buildCommand>
|
|
||||||
<name>org.eclipse.m2e.core.maven2Builder</name>
|
|
||||||
<arguments>
|
|
||||||
</arguments>
|
|
||||||
</buildCommand>
|
|
||||||
</buildSpec>
|
|
||||||
<natures>
|
|
||||||
<nature>org.eclipse.jdt.core.javanature</nature>
|
|
||||||
<nature>org.eclipse.m2e.core.maven2Nature</nature>
|
|
||||||
</natures>
|
|
||||||
</projectDescription>
|
|
|
@ -1,4 +0,0 @@
|
||||||
eclipse.preferences.version=1
|
|
||||||
encoding//src/main/java=UTF-8
|
|
||||||
encoding//src/test/java=UTF-8
|
|
||||||
encoding/<project>=UTF-8
|
|
|
@ -1,8 +0,0 @@
|
||||||
eclipse.preferences.version=1
|
|
||||||
org.eclipse.jdt.core.compiler.codegen.targetPlatform=1.8
|
|
||||||
org.eclipse.jdt.core.compiler.compliance=1.8
|
|
||||||
org.eclipse.jdt.core.compiler.problem.enablePreviewFeatures=disabled
|
|
||||||
org.eclipse.jdt.core.compiler.problem.forbiddenReference=warning
|
|
||||||
org.eclipse.jdt.core.compiler.problem.reportPreviewFeatures=ignore
|
|
||||||
org.eclipse.jdt.core.compiler.release=disabled
|
|
||||||
org.eclipse.jdt.core.compiler.source=1.8
|
|
|
@ -1,4 +0,0 @@
|
||||||
activeProfiles=
|
|
||||||
eclipse.preferences.version=1
|
|
||||||
resolveWorkspaceProjects=true
|
|
||||||
version=1
|
|
|
@ -0,0 +1,3 @@
|
||||||
|
{
|
||||||
|
"java.configuration.updateBuildConfiguration": "interactive"
|
||||||
|
}
|
15
CHANGELOG.md
15
CHANGELOG.md
|
@ -1,5 +1,20 @@
|
||||||
# Changelog
|
# Changelog
|
||||||
|
|
||||||
|
## [v2.1.0-SNAPSHOT]
|
||||||
|
|
||||||
|
- Feature #27999 [StorageHub] downstream components to upgrade in order to work with storagehub 1.5.0
|
||||||
|
- moved to gcube-smartgears-bom 2.5.1-SNAPSHOT
|
||||||
|
|
||||||
|
|
||||||
|
## [v2.0.1] - 2024-04-16
|
||||||
|
|
||||||
|
- fixed dependency versions
|
||||||
|
|
||||||
|
|
||||||
|
## [v2.0.0] - 2023-12-04
|
||||||
|
|
||||||
|
- Integrated corresponding API calls for all the public functions in Social Networking Library
|
||||||
|
|
||||||
## [v1.2.0] - 2022-10-20
|
## [v1.2.0] - 2022-10-20
|
||||||
|
|
||||||
- Minor fix on a method name
|
- Minor fix on a method name
|
||||||
|
|
|
@ -20,10 +20,12 @@ See [Releases](https://code-repo.d4science.org/gCubeSystem/social-service-client
|
||||||
## Authors
|
## Authors
|
||||||
|
|
||||||
* **Massimiliano Assante** ([ORCID](https://orcid.org/0000-0002-3761-1492)) - [ISTI-CNR Infrascience Group](https://www.isti.cnr.it/People/M.Assante)
|
* **Massimiliano Assante** ([ORCID](https://orcid.org/0000-0002-3761-1492)) - [ISTI-CNR Infrascience Group](https://www.isti.cnr.it/People/M.Assante)
|
||||||
|
* **Ahmed Ibrahim** ([ORCID](https://orcid.org/0009-0001-3009-5755)) - [ISTI-CNR Infrascience Group](https://www.isti.cnr.it/en/about/people-detail/976/Ahmed_Salah_Tawfik_Ibrahim)
|
||||||
|
|
||||||
## Maintainers
|
## Maintainers
|
||||||
|
|
||||||
* **Massimiliano Assante** ([ORCID](https://orcid.org/0000-0002-3761-1492)) - [ISTI-CNR Infrascience Group](https://www.isti.cnr.it/People/M.Assante)
|
* **Massimiliano Assante** ([ORCID](https://orcid.org/0000-0002-3761-1492)) - [ISTI-CNR Infrascience Group](https://www.isti.cnr.it/People/M.Assante)
|
||||||
|
* **Ahmed Ibrahim** ([ORCID](https://orcid.org/0009-0001-3009-5755)) - [ISTI-CNR Infrascience Group](https://www.isti.cnr.it/en/about/people-detail/976/Ahmed_Salah_Tawfik_Ibrahim)
|
||||||
|
|
||||||
## License
|
## License
|
||||||
|
|
||||||
|
|
40
pom.xml
40
pom.xml
|
@ -6,30 +6,24 @@
|
||||||
<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.social-networking</groupId>
|
<groupId>org.gcube.social-networking</groupId>
|
||||||
<artifactId>social-service-client</artifactId>
|
<artifactId>social-service-client</artifactId>
|
||||||
<version>1.2.0</version>
|
<version>2.1.0-SNAPSHOT</version>
|
||||||
<name>social-networking-service-client</name>
|
<name>social-networking-service-client</name>
|
||||||
<packaging>jar</packaging>
|
<packaging>jar</packaging>
|
||||||
<description>The social networking web service client library</description>
|
<description>The social networking web service client library</description>
|
||||||
|
|
||||||
<dependencyManagement>
|
<dependencyManagement>
|
||||||
<dependencies>
|
<dependencies>
|
||||||
<dependency>
|
|
||||||
<groupId>org.gcube.distribution</groupId>
|
|
||||||
<artifactId>gcube-bom</artifactId>
|
|
||||||
<version>2.0.2</version>
|
|
||||||
<type>pom</type>
|
|
||||||
<scope>import</scope>
|
|
||||||
</dependency>
|
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.distribution</groupId>
|
<groupId>org.gcube.distribution</groupId>
|
||||||
<artifactId>gcube-smartgears-bom</artifactId>
|
<artifactId>gcube-smartgears-bom</artifactId>
|
||||||
<version>2.1.1</version>
|
<version>2.5.1-SNAPSHOT</version>
|
||||||
<type>pom</type>
|
<type>pom</type>
|
||||||
<scope>import</scope>
|
<scope>import</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
@ -37,7 +31,7 @@
|
||||||
</dependencyManagement>
|
</dependencyManagement>
|
||||||
|
|
||||||
<properties>
|
<properties>
|
||||||
<java-version>1.8</java-version>
|
<java-version>1.8</java-version>
|
||||||
<jaxrs.version>2.0.1</jaxrs.version>
|
<jaxrs.version>2.0.1</jaxrs.version>
|
||||||
<distroDirectory>${project.basedir}/distro</distroDirectory>
|
<distroDirectory>${project.basedir}/distro</distroDirectory>
|
||||||
<gCubeSubsystem>social-networking</gCubeSubsystem>
|
<gCubeSubsystem>social-networking</gCubeSubsystem>
|
||||||
|
@ -56,9 +50,29 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.portal</groupId>
|
<groupId>org.gcube.portal</groupId>
|
||||||
<artifactId>social-networking-library</artifactId>
|
<artifactId>social-networking-library</artifactId>
|
||||||
<version>[1.16.0, 2.0.0)</version>
|
<version>[2.0.0, 3.0.0)</version>
|
||||||
<scope>compile</scope>
|
<scope>compile</scope>
|
||||||
</dependency>
|
</dependency>
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-core</artifactId>
|
||||||
|
<version>2.8.7</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-annotations</artifactId>
|
||||||
|
<version>2.8.7</version>
|
||||||
|
</dependency>
|
||||||
|
|
||||||
|
|
||||||
|
<dependency>
|
||||||
|
<groupId>com.fasterxml.jackson.core</groupId>
|
||||||
|
<artifactId>jackson-databind</artifactId>
|
||||||
|
<version>2.8.7</version>
|
||||||
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.core</groupId>
|
<groupId>org.gcube.core</groupId>
|
||||||
<artifactId>common-generic-clients</artifactId>
|
<artifactId>common-generic-clients</artifactId>
|
||||||
|
@ -67,7 +81,7 @@
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.gcube.social-networking</groupId>
|
<groupId>org.gcube.social-networking</groupId>
|
||||||
<artifactId>social-service-model</artifactId>
|
<artifactId>social-service-model</artifactId>
|
||||||
<version>[1.2.0-SNAPSHOT, 2.0.0)</version>
|
<version>[1.2.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
|
||||||
</dependency>
|
</dependency>
|
||||||
<dependency>
|
<dependency>
|
||||||
<groupId>org.projectlombok</groupId>
|
<groupId>org.projectlombok</groupId>
|
||||||
|
|
Binary file not shown.
|
@ -10,20 +10,18 @@ import org.slf4j.LoggerFactory;
|
||||||
*/
|
*/
|
||||||
public abstract class BaseClient {
|
public abstract class BaseClient {
|
||||||
|
|
||||||
private static Logger logger = LoggerFactory.getLogger(BaseClient.class);
|
private static Logger logger = LoggerFactory.getLogger(BaseClient.class);
|
||||||
private String serviceEndpoint;
|
private String serviceEndpoint;
|
||||||
|
|
||||||
public BaseClient(String subPath) throws Exception {
|
public BaseClient(String subPath) throws Exception {
|
||||||
ServiceDiscoverer discoverer = new ServiceDiscoverer();
|
ServiceDiscoverer discoverer = new ServiceDiscoverer();
|
||||||
logger.debug("Discovering service...");
|
serviceEndpoint = discoverer.getEntryPoint();
|
||||||
serviceEndpoint = discoverer.getEntryPoint();
|
logger.debug("Discovering service...");
|
||||||
serviceEndpoint = serviceEndpoint.endsWith("/") ? serviceEndpoint + subPath :
|
serviceEndpoint = serviceEndpoint.endsWith("/") ? serviceEndpoint + subPath : serviceEndpoint + "/" + subPath;
|
||||||
serviceEndpoint + "/" + subPath;
|
logger.info("Discovered service " + serviceEndpoint);
|
||||||
logger.debug("Discovered service " + serviceEndpoint);
|
}
|
||||||
}
|
|
||||||
|
|
||||||
public String getServiceEndpoint() {
|
|
||||||
return serviceEndpoint;
|
|
||||||
}
|
|
||||||
|
|
||||||
|
public String getServiceEndpoint() {
|
||||||
|
return serviceEndpoint;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -1,10 +1,16 @@
|
||||||
package org.gcube.social_networking.social_networking_client_library;
|
package org.gcube.social_networking.social_networking_client_library;
|
||||||
|
|
||||||
|
import java.util.ArrayList;
|
||||||
import java.util.HashMap;
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.ws.rs.core.GenericType;
|
import javax.ws.rs.core.GenericType;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.Validate;
|
||||||
|
import org.gcube.portal.databook.shared.Feed;
|
||||||
|
import org.gcube.portal.databook.shared.Post;
|
||||||
|
import org.gcube.portal.databook.shared.ex.*;
|
||||||
import org.gcube.social_networking.social_networking_client_library.utils.HttpClient;
|
import org.gcube.social_networking.social_networking_client_library.utils.HttpClient;
|
||||||
import org.gcube.social_networking.socialnetworking.model.output.ResponseBean;
|
import org.gcube.social_networking.socialnetworking.model.output.ResponseBean;
|
||||||
import org.slf4j.Logger;
|
import org.slf4j.Logger;
|
||||||
|
@ -13,6 +19,7 @@ import org.slf4j.LoggerFactory;
|
||||||
/**
|
/**
|
||||||
* HashTags client.
|
* HashTags client.
|
||||||
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
||||||
|
* @author Ahmed Ibrahim at ISTI-CNR (ahmed.ibrahim@isti.cnr.it)
|
||||||
*/
|
*/
|
||||||
public class HashTagClient extends BaseClient{
|
public class HashTagClient extends BaseClient{
|
||||||
|
|
||||||
|
@ -34,5 +41,4 @@ public class HashTagClient extends BaseClient{
|
||||||
String request = getServiceEndpoint() + thisMethodSignature;
|
String request = getServiceEndpoint() + thisMethodSignature;
|
||||||
return HttpClient.get(new GenericType<ResponseBean<HashMap<String, Integer>>>(){}, request);
|
return HttpClient.get(new GenericType<ResponseBean<HashMap<String, Integer>>>(){}, request);
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -0,0 +1,487 @@
|
||||||
|
package org.gcube.social_networking.social_networking_client_library;
|
||||||
|
|
||||||
|
import org.apache.commons.lang.Validate;
|
||||||
|
import org.gcube.portal.databook.shared.*;
|
||||||
|
import org.gcube.social_networking.social_networking_client_library.utils.HttpClient;
|
||||||
|
import org.gcube.social_networking.socialnetworking.model.output.ResponseBean;
|
||||||
|
import org.slf4j.Logger;
|
||||||
|
import org.slf4j.LoggerFactory;
|
||||||
|
|
||||||
|
import javax.ws.rs.core.GenericType;
|
||||||
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
|
public class LibClient extends BaseClient{
|
||||||
|
|
||||||
|
private static final String SUB_SERVICE_PATH = "2/lib/";
|
||||||
|
private static Logger logger = LoggerFactory.getLogger(LibClient.class);
|
||||||
|
|
||||||
|
|
||||||
|
public LibClient() throws Exception {
|
||||||
|
super(SUB_SERVICE_PATH);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Comments
|
||||||
|
public Boolean addCommentLib(Comment comment){
|
||||||
|
Validate.isTrue(comment != null, "Comment to write cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for writing comment");
|
||||||
|
String thisMethodSignature = "add-comment-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, comment);
|
||||||
|
}
|
||||||
|
public Comment readCommentByIdLib(String commentid){
|
||||||
|
Validate.isTrue(commentid != null, "Commentid to read cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for reading commentid");
|
||||||
|
String thisMethodSignature = "read-comment-by-id-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?commentid=" + commentid;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<Comment>>(){}, request);
|
||||||
|
}
|
||||||
|
public List<Comment> getAllCommentsByPostIdLib(String postid){
|
||||||
|
Validate.isTrue(postid != null, "Postid to read cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for reading comments of post");
|
||||||
|
String thisMethodSignature = "get-comments-by-post-id-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?postid=" + postid;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<ArrayList<Comment>>>(){}, request);
|
||||||
|
}
|
||||||
|
public List<Comment> getRecentCommentsByUserAndDateLib(final String userid,
|
||||||
|
final long timeInMillis){
|
||||||
|
|
||||||
|
Validate.isTrue(userid != null, "username to read cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for reading recent comments of user");
|
||||||
|
String thisMethodSignature = "get-recent-comments-by-user-and-date-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?time=" + timeInMillis + "&username=" + userid;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<ArrayList<Comment>>>(){}, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Boolean editCommentLib(Comment comment){
|
||||||
|
Validate.isTrue(comment != null, "Comment to write cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for writing comment");
|
||||||
|
String thisMethodSignature = "edit-comment-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, comment);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean deleteCommentLib(String commentid, String postid){
|
||||||
|
Validate.isTrue(commentid != null, "Comment to write cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for del comment");
|
||||||
|
String thisMethodSignature = "delete-comment-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?commentid=" + commentid + "&postid=" + postid;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, postid);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Hashtags
|
||||||
|
public boolean saveHashTagsLib(String feedid, String vreid, List<String> hashtags) {
|
||||||
|
Validate.isTrue(hashtags != null, "hashtags to write cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for saving hashtags");
|
||||||
|
String thisMethodSignature = "save-hashtag-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?feedid=" + feedid + "&vreid=" + vreid;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, hashtags);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean deleteHashTagsLib(String feedid, String vreid, List<String> hashtags) {
|
||||||
|
Validate.isTrue(hashtags != null, "hashtags to delete cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for deleting hashtags");
|
||||||
|
String thisMethodSignature = "delete-hashtag-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?feedid=" + feedid + "&vreid=" + vreid;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, hashtags);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean saveHashTagsCommentLib(String commentId, String vreid, List<String> hashtags){
|
||||||
|
Validate.isTrue(hashtags != null, "hashtags to comment cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for saving hashtags comment");
|
||||||
|
String thisMethodSignature = "save-hashtag-comment-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?commentid=" + commentId + "&vreid=" + vreid;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, hashtags);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean deleteHashTagsCommentLib(String commentId, String vreid, List<String> hashtags) {
|
||||||
|
Validate.isTrue(hashtags != null, "hashtags to comment delete cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for deleting hashtags comment");
|
||||||
|
String thisMethodSignature = "delete-hashtag-comment-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?commentid=" + commentId + "&vreid=" + vreid;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, hashtags);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Integer> getVREHashtagsWithOccurrenceLib(String vreid) {
|
||||||
|
logger.debug("Request for vre hashtags occurrences");
|
||||||
|
String thisMethodSignature = "get-vre-hashtags-occurrences-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?vreid=" + vreid;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<HashMap<String, Integer>>>(){}, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<String, Integer> getVREHashtagsWithOccurrenceFilteredByTimeLib(String vreid, long timestamp){
|
||||||
|
logger.debug("Request for vre hashtags occurrences with time");
|
||||||
|
String thisMethodSignature = "get-vre-hashtags-occurrences-time-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?vreid=" + vreid + "&time=" + timestamp;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<HashMap<String, Integer>>>(){}, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public List<Post> getVREPostsByHashtagLib(String vreid, String hashtag){
|
||||||
|
hashtag = hashtag.substring(1);
|
||||||
|
logger.debug("Request for vre of hashtags");
|
||||||
|
String thisMethodSignature = "get-vre-post-by-hashtag-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?vreid=" + vreid + "&hashtag=" + hashtag;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<ArrayList<Post>>>(){}, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Invites
|
||||||
|
public String isExistingInviteLib(String vreid, String email){
|
||||||
|
Validate.isTrue(email != null, "email to invite cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for inviting to vre");
|
||||||
|
String thisMethodSignature = "is-existing-invite-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?vreid=" + vreid + "&email=" + email;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<String>>(){}, request);
|
||||||
|
}
|
||||||
|
public InviteOperationResult saveInviteLib(Invite invite){
|
||||||
|
Validate.isTrue(invite != null, "likeid to unlike cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for saving invite");
|
||||||
|
String thisMethodSignature = "save-invite-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<InviteOperationResult>>(){}, request, invite);
|
||||||
|
}
|
||||||
|
public Invite readInviteLib(String inviteid){
|
||||||
|
Validate.isTrue(inviteid != null, "inviteid to read likes cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for reading invite");
|
||||||
|
String thisMethodSignature = "read-invite-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?inviteid=" + inviteid;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<Invite>>(){}, request);
|
||||||
|
}
|
||||||
|
public boolean setInviteStatusLib(String vreid, String email, InviteStatus status){
|
||||||
|
Validate.isTrue(status != null, "status to set cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for setting invite status");
|
||||||
|
String thisMethodSignature = "set-invite-status-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?vreid=" + vreid + "&email=" + email;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Invite> getInvitedEmailsByVRELib(String vreid, InviteStatus... status){
|
||||||
|
Validate.isTrue(status != null, "status to get cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for getting email invites");
|
||||||
|
String thisMethodSignature = "get-invited-email-by-vre-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?vreid=" + vreid;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<ArrayList<Invite>>>(){}, request, status);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Likes
|
||||||
|
public boolean likeLib(Like like){
|
||||||
|
Validate.isTrue(like != null, "like to write cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for liking post");
|
||||||
|
String thisMethodSignature = "like-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, like);
|
||||||
|
}
|
||||||
|
public boolean unlikeLib(String userid, String likeid, String feedid){
|
||||||
|
Validate.isTrue(likeid != null, "likeid to unlike cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for unliking post");
|
||||||
|
String thisMethodSignature = "unlike-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid + "&likeid=" + likeid + "&feedid=" + feedid ;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, likeid);
|
||||||
|
}
|
||||||
|
public List<String>getAllLikedPostIdsByUserLib(String userid){
|
||||||
|
Validate.isTrue(userid != null, "userid to read likes cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for reading likes of user");
|
||||||
|
String thisMethodSignature = "get-all-liked-posts-by-user-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<ArrayList<String>>>(){}, request);
|
||||||
|
}
|
||||||
|
public List<Like>getAllLikesByPostLib(String postid){
|
||||||
|
Validate.isTrue(postid != null, "postid to read likes cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for reading likes of post");
|
||||||
|
String thisMethodSignature = "get-all-likes-by-post-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?postid=" + postid;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<ArrayList<Like>>>(){}, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
//Notifications
|
||||||
|
public boolean saveNotificationLib(Notification n){
|
||||||
|
Validate.isTrue(n != null, "Notification cannot be null");
|
||||||
|
logger.debug("Request for saving notification");
|
||||||
|
String thisMethodSignature = "save-notification-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, n);
|
||||||
|
}
|
||||||
|
public Notification readNotificationLib(String notificationid){
|
||||||
|
logger.debug("Request for getting notification by id");
|
||||||
|
String thisMethodSignature = "read-notification-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?notid=" + notificationid;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<Notification>>(){}, request);
|
||||||
|
}
|
||||||
|
public boolean setNotificationReadLib(String notificationid){
|
||||||
|
Validate.isTrue(notificationid != null, "Notificationid cannot be null");
|
||||||
|
logger.debug("Request for setting notification read");
|
||||||
|
String thisMethodSignature = "set-notification-read-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?notid=" + notificationid;;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, notificationid);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Notification> getAllNotificationByUserLib(String userid, int limit) {
|
||||||
|
logger.debug("Request for getting notification by user");
|
||||||
|
String thisMethodSignature = "get-all-notifications-user";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid + "&limit=" + limit;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<ArrayList<Notification>>>(){}, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Notification> getUnreadNotificationsByUserLib(String userid) {
|
||||||
|
logger.debug("Request for getting unread notification by user");
|
||||||
|
String thisMethodSignature = "get-unread-notifications-user";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<ArrayList<Notification>>>(){}, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Notification> getRangeNotificationsByUserLib(String userid,int from, int quantity) {
|
||||||
|
logger.debug("Request for getting range notification by user");
|
||||||
|
String thisMethodSignature = "get-range-notifications-user";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid + "&from=" + from + "&quantity=" + quantity;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<ArrayList<Notification>>>(){}, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean setAllNotificationReadByUserLib(String userid) {
|
||||||
|
Validate.isTrue(userid != null, "userid cannot be null");
|
||||||
|
logger.debug("Request for setting all notification read");
|
||||||
|
String thisMethodSignature = "set-all-notification-read-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid;;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, userid);
|
||||||
|
}
|
||||||
|
public boolean checkUnreadNotificationsLib(String userid) {
|
||||||
|
Validate.isTrue(userid != null, "userid cannot be null");
|
||||||
|
logger.debug("Request for check unread notifications");
|
||||||
|
String thisMethodSignature = "check-unread-notification-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid;;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, userid);
|
||||||
|
}
|
||||||
|
public boolean checkUnreadMessagesNotificationsLib(String userid) {
|
||||||
|
Validate.isTrue(userid != null, "userid cannot be null");
|
||||||
|
logger.debug("Request for check unread messages notifications");
|
||||||
|
String thisMethodSignature = "check-unread-messages-notification-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid;;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, userid);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<NotificationChannelType> getUserNotificationChannelsLib(String userid, NotificationType notificationType) {
|
||||||
|
Validate.isTrue(userid != null, "userid cannot be null");
|
||||||
|
logger.debug("Request for get user notification channels");
|
||||||
|
String thisMethodSignature = "get-user-notification-channels-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid + "&type=" + notificationType.toString();
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<ArrayList<NotificationChannelType>>>(){}, request);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean setUserNotificationPreferencesLib(String userid, Map<NotificationType, NotificationChannelType[]> enabledChannels){
|
||||||
|
Validate.isTrue(userid != null, "userid cannot be null");
|
||||||
|
logger.debug("Request for set user notification preferences");
|
||||||
|
String thisMethodSignature = "set-notification-preference-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid;
|
||||||
|
for(NotificationType notificationType: enabledChannels.keySet()){
|
||||||
|
logger.info("Type: " + notificationType.toString());
|
||||||
|
for(NotificationChannelType channelType: enabledChannels.get(notificationType)){
|
||||||
|
logger.info(channelType.toString());
|
||||||
|
}
|
||||||
|
}
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, enabledChannels);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public Map<NotificationType, NotificationChannelType[]> getUserNotificationPreferencesLib(String userid){
|
||||||
|
Validate.isTrue(userid != null, "userid cannot be null");
|
||||||
|
logger.debug("Request for getting notification preferences");
|
||||||
|
String thisMethodSignature = "get-notification-preference-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid;;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<HashMap<NotificationType, NotificationChannelType[]>>>(){}, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
|
public boolean saveUserPostLib(Post post){
|
||||||
|
Validate.isTrue(post != null, "Post to write cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for save user post");
|
||||||
|
String thisMethodSignature = "save-user-post-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, post);
|
||||||
|
} //bool
|
||||||
|
|
||||||
|
public boolean saveAttachmentEntryLib(String postkey, Attachment attachment){
|
||||||
|
Validate.isTrue(attachment != null, "Attachment to write cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for save attachment");
|
||||||
|
String thisMethodSignature = "save-attachment-lib" + "?postid=" + postkey;
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, attachment);
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean saveUserPostLib(Post post, List<Attachment> attachments ){
|
||||||
|
Validate.isTrue(post != null, "Post to write cannot be null");
|
||||||
|
|
||||||
|
if (attachments != null && !attachments.isEmpty())
|
||||||
|
post.setMultiFileUpload(true);
|
||||||
|
boolean savePostResult = saveUserPostLib(post);
|
||||||
|
if (savePostResult) {
|
||||||
|
logger.info("Post has been saved");
|
||||||
|
String postkey = post.getKey();
|
||||||
|
for (Attachment attachment : attachments) {
|
||||||
|
boolean attachSaveResult = saveAttachmentEntryLib(postkey, attachment);
|
||||||
|
if (!attachSaveResult)
|
||||||
|
logger.info("Some of the attachments failed to be saved: " + attachment.getName());
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else return false;
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean saveAppPostLib(Post post, List<Attachment> attachments) {
|
||||||
|
Validate.isTrue(post != null, "Post to write cannot be null");
|
||||||
|
|
||||||
|
if (attachments != null && !attachments.isEmpty())
|
||||||
|
post.setMultiFileUpload(true);
|
||||||
|
boolean savePostResult = saveAppPostLib(post);
|
||||||
|
if (savePostResult) {
|
||||||
|
logger.info("Post has been saved");
|
||||||
|
String postkey = post.getKey();
|
||||||
|
for (Attachment attachment : attachments) {
|
||||||
|
boolean attachSaveResult = saveAttachmentEntryLib(postkey, attachment);
|
||||||
|
if (!attachSaveResult)
|
||||||
|
logger.info("Some of the attachments failed to be saved: " + attachment.getName());
|
||||||
|
}
|
||||||
|
return true;
|
||||||
|
}
|
||||||
|
else return false;
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public boolean saveAppPostLib(Post post){
|
||||||
|
Validate.isTrue(post != null, "Post to write cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for saving application post");
|
||||||
|
String thisMethodSignature = "save-app-post-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, post);
|
||||||
|
} //bool
|
||||||
|
|
||||||
|
public boolean savePostToVRETimelineLib(String postkey, String vreid){
|
||||||
|
Validate.isTrue(postkey != null, "Post to write cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for writing post to vretimeline");
|
||||||
|
String thisMethodSignature = "save-post-to-vretimeline-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?postid=" + postkey + "&vreid=" + vreid;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, postkey);
|
||||||
|
} //bool
|
||||||
|
|
||||||
|
public Post readPostLib(String postid){
|
||||||
|
logger.debug("Request for getting post with id");
|
||||||
|
String thisMethodSignature = "read-post-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?postid=" + postid;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<Post>>(){}, request);
|
||||||
|
} //post
|
||||||
|
|
||||||
|
public List<Post> getRecentPostsByUserAndDateLib(String userid, long timeinmillis){
|
||||||
|
logger.debug("Request for getting recent posts by user");
|
||||||
|
String thisMethodSignature = "get-recent-posts-by-user-date-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid + "&time=" + timeinmillis;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<ArrayList<Post>>>(){}, request);
|
||||||
|
} //list<post>
|
||||||
|
|
||||||
|
public boolean deletePostLib(String postid){
|
||||||
|
Validate.isTrue(postid != null, "feed to delete cannot be null");
|
||||||
|
|
||||||
|
logger.debug("Request for delete user post");
|
||||||
|
String thisMethodSignature = "delete-post-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?postid=" + postid;
|
||||||
|
return HttpClient.post(new GenericType<ResponseBean<Boolean>>(){}, request, postid);
|
||||||
|
} //bool
|
||||||
|
|
||||||
|
public List<Post> getAllPostsByUserLib(String userid) {
|
||||||
|
logger.debug("Request for getting all posts by user");
|
||||||
|
String thisMethodSignature = "get-all-posts-by-user-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid ;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<ArrayList<Post>>>(){}, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Post> getAllPostsByAppLib(String appid) {
|
||||||
|
logger.debug("Request for getting all posts by app");
|
||||||
|
String thisMethodSignature = "get-all-posts-by-app-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?appid=" + appid ;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<ArrayList<Post>>>(){}, request);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Post> getRecentCommentedPostsByUserAndDateLib(String userid,
|
||||||
|
long timeInMillis) {
|
||||||
|
logger.debug("Request for getting recent commented posts by user and date");
|
||||||
|
String thisMethodSignature = "get-recent-commented-posts-by-user-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid + "&time=" + timeInMillis;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<ArrayList<Post>>>(){}, request);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Post> getAllPortalPrivacyLevelPostsLib(){
|
||||||
|
logger.debug("Request for getting portal privacy level posts");
|
||||||
|
String thisMethodSignature = "get-portal-privacy-level-posts-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<ArrayList<Post>>>(){}, request);
|
||||||
|
} //list<post>
|
||||||
|
|
||||||
|
public List<Post> getRecentPostsByUserLib(String userid, int quantity) {
|
||||||
|
logger.debug("Request for getting recent posts by user");
|
||||||
|
String thisMethodSignature = "get-recent-posts-by-user-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?userid=" + userid + "&quantity=" + quantity ;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<ArrayList<Post>>>(){}, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Post> getAllPostsByVRELib(String vreid) {
|
||||||
|
logger.debug("Request for getting all posts by vre");
|
||||||
|
String thisMethodSignature = "get-all-posts-by-vre-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?vreid=" + vreid ;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<ArrayList<Post>>>(){}, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Post> getRecentPostsByVRELib(String vreid, int quantity) {
|
||||||
|
logger.debug("Request for getting recent posts by vre");
|
||||||
|
String thisMethodSignature = "get-recent-posts-by-vre-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?vreid=" + vreid + "&quantity=" + quantity ;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<ArrayList<Post>>>(){}, request);
|
||||||
|
|
||||||
|
}
|
||||||
|
|
||||||
|
public RangePosts getRecentPostsByVREAndRangeLib(String vreid, int from, int quantity) {
|
||||||
|
logger.debug("Request for getting recent posts by vre and range");
|
||||||
|
String thisMethodSignature = "get-recent-posts-by-vre-range-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?vreid=" + vreid + "&from=" + from + "&quantity=" + quantity;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<RangePosts>>(){}, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<Attachment> getAttachmentsByFeedIdLib(String feedId) {
|
||||||
|
logger.debug("Request for getting attachment by postid");
|
||||||
|
String thisMethodSignature = "get-attachment-by-postid-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature + "?postid=" + feedId ;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<ArrayList<Attachment>>>(){}, request);
|
||||||
|
}
|
||||||
|
|
||||||
|
public List<String> getAllVREIdsLib(){
|
||||||
|
logger.debug("Request for getting all vre ids");
|
||||||
|
String thisMethodSignature = "get-all-vre-ids-lib";
|
||||||
|
String request = getServiceEndpoint() + thisMethodSignature ;
|
||||||
|
return HttpClient.get(new GenericType<ResponseBean<ArrayList<String>>>(){}, request);
|
||||||
|
}
|
||||||
|
}
|
|
@ -1,12 +1,20 @@
|
||||||
package org.gcube.social_networking.social_networking_client_library;
|
package org.gcube.social_networking.social_networking_client_library;
|
||||||
|
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.ws.rs.core.GenericType;
|
import javax.ws.rs.core.GenericType;
|
||||||
|
|
||||||
import org.apache.commons.lang.Validate;
|
import org.apache.commons.lang.Validate;
|
||||||
import org.gcube.portal.databook.shared.Notification;
|
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.ex.ColumnNameNotFoundException;
|
||||||
|
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.social_networking.social_networking_client_library.utils.HttpClient;
|
import org.gcube.social_networking.social_networking_client_library.utils.HttpClient;
|
||||||
import org.gcube.social_networking.socialnetworking.model.beans.JobNotificationBean;
|
import org.gcube.social_networking.socialnetworking.model.beans.JobNotificationBean;
|
||||||
import org.gcube.social_networking.socialnetworking.model.beans.catalogue.CatalogueEvent;
|
import org.gcube.social_networking.socialnetworking.model.beans.catalogue.CatalogueEvent;
|
||||||
|
@ -20,6 +28,7 @@ import org.slf4j.LoggerFactory;
|
||||||
/**
|
/**
|
||||||
* Notifications client.
|
* Notifications client.
|
||||||
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
||||||
|
* @author Ahmed Ibrahim at ISTI-CNR (ahmed.ibrahim@isti.cnr.it)
|
||||||
*/
|
*/
|
||||||
public class NotificationClient extends BaseClient{
|
public class NotificationClient extends BaseClient{
|
||||||
|
|
||||||
|
@ -40,7 +49,7 @@ public class NotificationClient extends BaseClient{
|
||||||
public List<Notification> getNotifications(int from, int quantity){
|
public List<Notification> getNotifications(int from, int quantity){
|
||||||
|
|
||||||
Validate.isTrue(from >= 1, "From cannot be negative");
|
Validate.isTrue(from >= 1, "From cannot be negative");
|
||||||
Validate.isTrue(from >= 0, "Quantity cannot be negative");
|
Validate.isTrue(quantity >= 0, "Quantity cannot be negative");
|
||||||
|
|
||||||
logger.debug("Request for getting notifications");
|
logger.debug("Request for getting notifications");
|
||||||
String thisMethodSignature = "get-range-notifications";
|
String thisMethodSignature = "get-range-notifications";
|
||||||
|
@ -89,5 +98,4 @@ public class NotificationClient extends BaseClient{
|
||||||
HttpClient.post(new GenericType<ResponseBean<String>>(){}, request, event);
|
HttpClient.post(new GenericType<ResponseBean<String>>(){}, request, event);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -3,13 +3,15 @@ package org.gcube.social_networking.social_networking_client_library;
|
||||||
import java.io.UnsupportedEncodingException;
|
import java.io.UnsupportedEncodingException;
|
||||||
import java.net.URLEncoder;
|
import java.net.URLEncoder;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
|
import java.util.HashMap;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
|
import java.util.Map;
|
||||||
|
|
||||||
import javax.ws.rs.core.GenericType;
|
import javax.ws.rs.core.GenericType;
|
||||||
|
|
||||||
import org.apache.commons.lang.Validate;
|
import org.apache.commons.lang.Validate;
|
||||||
import org.gcube.portal.databook.shared.Feed;
|
import org.gcube.portal.databook.shared.*;
|
||||||
import org.gcube.portal.databook.shared.Post;
|
|
||||||
import org.gcube.social_networking.social_networking_client_library.utils.HttpClient;
|
import org.gcube.social_networking.social_networking_client_library.utils.HttpClient;
|
||||||
import org.gcube.social_networking.socialnetworking.model.beans.PostInputBean;
|
import org.gcube.social_networking.socialnetworking.model.beans.PostInputBean;
|
||||||
import org.gcube.social_networking.socialnetworking.model.output.ResponseBean;
|
import org.gcube.social_networking.socialnetworking.model.output.ResponseBean;
|
||||||
|
@ -19,6 +21,7 @@ import org.slf4j.LoggerFactory;
|
||||||
/**
|
/**
|
||||||
* Posts client.
|
* Posts client.
|
||||||
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
* @author Costantino Perciante at ISTI-CNR (costantino.perciante@isti.cnr.it)
|
||||||
|
* @author Ahmed Ibrahim at ISTI-CNR (ahmed.ibrahim@isti.cnr.it)
|
||||||
*/
|
*/
|
||||||
public class PostClient extends BaseClient{
|
public class PostClient extends BaseClient{
|
||||||
|
|
||||||
|
@ -183,5 +186,4 @@ public class PostClient extends BaseClient{
|
||||||
return HttpClient.get(new GenericType<ResponseBean<ArrayList<String>>>(){}, request);
|
return HttpClient.get(new GenericType<ResponseBean<ArrayList<String>>>(){}, request);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
|
@ -135,7 +135,7 @@ public class UserClient extends BaseClient{
|
||||||
|
|
||||||
Validate.isTrue(localRole != null, "role cannot be null");
|
Validate.isTrue(localRole != null, "role cannot be null");
|
||||||
|
|
||||||
logger.debug("Request for getting usernames with global role");
|
logger.debug("Request for getting usernames by role role");
|
||||||
String thisMethodSignature = "get-usernames-by-role";
|
String thisMethodSignature = "get-usernames-by-role";
|
||||||
String request = getServiceEndpoint() + thisMethodSignature + "?role-name=" + localRole;
|
String request = getServiceEndpoint() + thisMethodSignature + "?role-name=" + localRole;
|
||||||
return HttpClient.get(new GenericType<ResponseBean<ArrayList<String>>>(){}, request);
|
return HttpClient.get(new GenericType<ResponseBean<ArrayList<String>>>(){}, request);
|
||||||
|
|
|
@ -3,6 +3,7 @@ package org.gcube.portal.social_networking_client_library;
|
||||||
import java.net.URL;
|
import java.net.URL;
|
||||||
import java.util.ArrayList;
|
import java.util.ArrayList;
|
||||||
import java.util.Arrays;
|
import java.util.Arrays;
|
||||||
|
import java.util.Date;
|
||||||
import java.util.List;
|
import java.util.List;
|
||||||
import java.util.Map;
|
import java.util.Map;
|
||||||
import java.util.Set;
|
import java.util.Set;
|
||||||
|
@ -54,8 +55,11 @@ public class TestClientServices {
|
||||||
@Before
|
@Before
|
||||||
public void setContextAndToken(){
|
public void setContextAndToken(){
|
||||||
|
|
||||||
|
//ScopeProvider.instance.set("/d4science.research-infrastructures.eu/gCubeApps/gCube");
|
||||||
|
//String umaToken = "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJySUJPYjZZY3p2ZE4xNVpuNHFkUTRLdEQ5VUhyY1dwNWJCT3NaLXpYbXM0In0.eyJleHAiOjE2NjM2NjU2NTgsImlhdCI6MTY2MzY2NTM1OCwiYXV0aF90aW1lIjoxNjYzNjY0MTg1LCJqdGkiOiIxMjNhYmY0MS1lZmE1LTQ4ZjEtYmE2Zi03MjNkOWZjNDAwMWQiLCJpc3MiOiJodHRwczovL2FjY291bnRzLmQ0c2NpZW5jZS5vcmcvYXV0aC9yZWFsbXMvZDRzY2llbmNlIiwiYXVkIjoiJTJGZDRzY2llbmNlLnJlc2VhcmNoLWluZnJhc3RydWN0dXJlcy5ldSUyRmdDdWJlQXBwcyUyRmdDdWJlIiwic3ViIjoiMzM4OGQwZjgtM2E0OS00ZGEwLWE3OGUtN2I2MjI1OTI2M2U2IiwidHlwIjoiQmVhcmVyIiwiYXpwIjoidmxhYi5pc3RpLmNuci5pdCIsInNlc3Npb25fc3RhdGUiOiI3MjRkMmJmOS00NjQ2LTQwZjAtOTY1ZC02MzFlODJiZWZkMmEiLCJhY3IiOiIxIiwiYWxsb3dlZC1vcmlnaW5zIjpbIi8qIl0sInJlc291cmNlX2FjY2VzcyI6eyIlMkZkNHNjaWVuY2UucmVzZWFyY2gtaW5mcmFzdHJ1Y3R1cmVzLmV1JTJGZ0N1YmVBcHBzJTJGZ0N1YmUiOnsicm9sZXMiOlsiVlJFLU1hbmFnZXIiLCJNZW1iZXIiXX19LCJhdXRob3JpemF0aW9uIjp7InBlcm1pc3Npb25zIjpbeyJyc2lkIjoiYWNlM2ZmNWQtYjU2ZS00MDgzLTljMzAtMjY0NTJiODc3YWIzIiwicnNuYW1lIjoiRGVmYXVsdCBSZXNvdXJjZSJ9XX0sInNjb3BlIjoicHJvZmlsZSBlbWFpbCIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJuYW1lIjoiTWFzc2ltaWxpYW5vIEFzc2FudGUiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJtYXNzaW1pbGlhbm8uYXNzYW50ZSIsImdpdmVuX25hbWUiOiJNYXNzaW1pbGlhbm8iLCJmYW1pbHlfbmFtZSI6IkFzc2FudGUiLCJlbWFpbCI6Im1hc3NpbWlsaWFuby5hc3NhbnRlQGlzdGkuY25yLml0In0.KIxC9QYGZCp6jAdye_82q648JjZli9KMxe-lqyFWkuA-HaZ-Ig2lWyn747iKp3UmstQgCTTonmOsVANHp1Feu_U1CuiWqRZ8OhmrTj8Q5v-FKwVtN2GfbjOF9b4aMXySFPd1HtCGHJ4o57uUrIQvvOV_SJOK5SOjG0YzOmsrOcXzSPl97ZZLKwio-Py0rxN6fdK8Obx7TL1eGgllhAI7ZDFRfoZrbz-F1YL1IPlQ6RI76rb7sbt6oL-T6LirP92AmUaW_nTLBBqrFR7uCaZdZKIDd4zxBmyzXjkNHncMKg8yFl-i1SRe58EcucMwEN0O-kUkhIb2CzaClsiWcLjP5g";
|
||||||
ScopeProvider.instance.set("/gcube/devsec/devVRE");
|
ScopeProvider.instance.set("/gcube/devsec/devVRE");
|
||||||
String umaToken = "";
|
String umaToken = "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJSSklZNEpoNF9qdDdvNmREY0NlUDFfS1l0akcxVExXVW9oMkQ2Tzk1bFNBIn0.eyJleHAiOjE2NjYyODUxMDYsImlhdCI6MTY2NjI4NDgwNiwiYXV0aF90aW1lIjoxNjY2Mjc5NDM2LCJqdGkiOiJjYjlmZDgxNi1kNGU5LTQ4NTYtOTQ5My1iYzk4ZDFhYTdiZTMiLCJpc3MiOiJodHRwczovL2FjY291bnRzLmRldi5kNHNjaWVuY2Uub3JnL2F1dGgvcmVhbG1zL2Q0c2NpZW5jZSIsImF1ZCI6IiUyRmdjdWJlJTJGZGV2c2VjJTJGZGV2VlJFIiwic3ViIjoiNzcxZjYxNTEtMDBhZS00NWMyLWE3NTQtZjA1NDZkOThmNDgyIiwidHlwIjoiQmVhcmVyIiwiYXpwIjoibmV4dC5kNHNjaWVuY2Uub3JnIiwic2Vzc2lvbl9zdGF0ZSI6ImNlZDM0NmE1LWExNzctNGNmYy1iYjU5LTBlMjk5OWJhZDU4ZCIsImFsbG93ZWQtb3JpZ2lucyI6WyIvKiJdLCJyZXNvdXJjZV9hY2Nlc3MiOnsiJTJGZ2N1YmUlMkZkZXZzZWMlMkZkZXZWUkUiOnsicm9sZXMiOlsiQ2F0YWxvZ3VlLU1hbmFnZXIiLCJNZW1iZXIiXX19LCJhdXRob3JpemF0aW9uIjp7InBlcm1pc3Npb25zIjpbeyJyc2lkIjoiNTcyODU1MTAtMzkzOS00ZGU3LThmYzEtZTNhOWQzY2NlMjgxIiwicnNuYW1lIjoiRGVmYXVsdCBSZXNvdXJjZSJ9XX0sInNjb3BlIjoiZW1haWwgcHJvZmlsZSIsInNpZCI6ImNlZDM0NmE1LWExNzctNGNmYy1iYjU5LTBlMjk5OWJhZDU4ZCIsImVtYWlsX3ZlcmlmaWVkIjp0cnVlLCJuYW1lIjoiQW5kcmVhIFJvc3NpIiwicHJlZmVycmVkX3VzZXJuYW1lIjoiYW5kcmVhLnJvc3NpIiwiZ2l2ZW5fbmFtZSI6IkFuZHJlYSIsImZhbWlseV9uYW1lIjoiUm9zc2kiLCJlbWFpbCI6Im0uYXNzYW50ZUBnbWFpbC5jb20ifQ.HHHqPWPkq8wVV2dT8U4iraGy0VpdFb2MJKTGZLz3woqhGOo7cARKTF9S_Cv9RigkL7vg_vriScDZzwCH-jVopK8EDRZTthiQIITzYG7EPg-B0zuOkUeC1GE0LFU3kqCTpwbLElOmQJfn6FP95lzMQWIhJrMSwVwjsXDf12bcYyr0QZDa8A9lxA4RkQezkpXhJ72s841oOp1vul5wyoSFYCdr7cZnMLuY5pdasheqGfQdkGi39SZ_dlnGgAkEArVqUCIlCxvdT2EUpiPG9854e2fBFdOss6NiSbZHF5n5nLvR8kDCaN12YOCw54fxwAByhvI0pBKEa_uM029eip43-A";
|
||||||
|
umaToken = "eyJhbGciOiJSUzI1NiIsInR5cCIgOiAiSldUIiwia2lkIiA6ICJSSklZNEpoNF9qdDdvNmREY0NlUDFfS1l0akcxVExXVW9oMkQ2Tzk1bFNBIn0.eyJleHAiOjE2NjYzNDYzNDYsImlhdCI6MTY2NjM0NjA0NiwianRpIjoiNDBjNjk2YmQtNjdiMi00MGQ4LTk4OGEtZjk2OTMzMDdlMzJkIiwiaXNzIjoiaHR0cHM6Ly9hY2NvdW50cy5kZXYuZDRzY2llbmNlLm9yZy9hdXRoL3JlYWxtcy9kNHNjaWVuY2UiLCJhdWQiOiIlMkZnY3ViZSUyRmRldnNlYyUyRmRldlZSRSIsInN1YiI6IjUyOGI2M2I1LTAwYTgtNGQ0My1hMWRlLTE1NDMyYTAxZjNiMSIsInR5cCI6IkJlYXJlciIsImF6cCI6Im5leHQuZDRzY2llbmNlLm9yZyIsInNlc3Npb25fc3RhdGUiOiJmMjYyNTQyMC03NGM1LTQ1NDQtYjY2YS1kZmEwOGQ2N2Q0NTQiLCJhbGxvd2VkLW9yaWdpbnMiOlsiLyoiXSwicmVzb3VyY2VfYWNjZXNzIjp7ImNvbmR1Y3Rvci1zZXJ2ZXIiOnsicm9sZXMiOlsiY29uZHVjdG9yLW1hbmFnZXIiXX0sIiUyRmdjdWJlJTJGZGV2c2VjJTJGZGV2VlJFIjp7InJvbGVzIjpbIkNhdGFsb2d1ZS1NYW5hZ2VyIiwiQ2F0YWxvZ3VlLU1vZGVyYXRvciIsIk1lbWJlciJdfX0sImF1dGhvcml6YXRpb24iOnsicGVybWlzc2lvbnMiOlt7InJzaWQiOiI1NzI4NTUxMC0zOTM5LTRkZTctOGZjMS1lM2E5ZDNjY2UyODEiLCJyc25hbWUiOiJEZWZhdWx0IFJlc291cmNlIn1dfSwic2NvcGUiOiJlbWFpbCBwcm9maWxlIiwic2lkIjoiZjI2MjU0MjAtNzRjNS00NTQ0LWI2NmEtZGZhMDhkNjdkNDU0IiwiZW1haWxfdmVyaWZpZWQiOnRydWUsIm5hbWUiOiJMdWNhIEZyb3NpbmkiLCJwcmVmZXJyZWRfdXNlcm5hbWUiOiJsdWNhLmZyb3NpbmkiLCJnaXZlbl9uYW1lIjoiTHVjYSIsImZhbWlseV9uYW1lIjoiRnJvc2luaSIsImVtYWlsIjoibHVjYS5mcm9zaW5pQGlzdGkuY25yLml0In0.jt43mGeSm_4hVNFThTBmmOxzotsTHPp0DKDzBNAgESFkzNRb7ZE1j7Ab_1M6fqjpciLsk093XTEpws0OksUEAWUgxj5iAOXopJKRr6cCnmQXitWTa8WpwWZyj6AiI8PSgHCQhY3-CU8mptmd4acDtagHSbhZ320aNx7rLTaZ_7KEdRmErmgzWhnPwD3O2ONcnxIuAL1rqu4o8SJl-cj5ppFc2V54VSY56AT2IK2GmP_he9R32_0K_F0SAwsuDmv7eF1MwQM7j27H9ewfEKP8w9RooZtZYj3Pm7-Ac4XSir9w5eG1xKOyiGbIlvJZU4FQwXINntUVTVPVfPaXZ_ZbOw";
|
||||||
AccessTokenProvider.instance.set(umaToken);
|
AccessTokenProvider.instance.set(umaToken);
|
||||||
SecurityTokenProvider.instance.set("");
|
SecurityTokenProvider.instance.set("");
|
||||||
}
|
}
|
||||||
|
@ -221,6 +225,12 @@ public class TestClientServices {
|
||||||
assert(vreManagers != null && !vreManagers.isEmpty());
|
assert(vreManagers != null && !vreManagers.isEmpty());
|
||||||
System.out.println("Data Managers are " + vreManagers);
|
System.out.println("Data Managers are " + vreManagers);
|
||||||
|
|
||||||
|
List<String> moderators = userClient.getAllUsernamesByLocalRole("VRE-Managers");
|
||||||
|
assert(moderators != null && !moderators.isEmpty());
|
||||||
|
System.out.println("Catalogue-Moderators are " + moderators);
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
String myEmail = userClient.getEmail();
|
String myEmail = userClient.getEmail();
|
||||||
|
|
||||||
assert(myEmail != null && !myEmail.isEmpty());
|
assert(myEmail != null && !myEmail.isEmpty());
|
||||||
|
@ -301,13 +311,16 @@ public class TestClientServices {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
//@Test
|
@Test
|
||||||
public void writeUserPost() throws Exception{
|
public void writeUserPost() throws Exception{
|
||||||
|
|
||||||
PostClient postClient = new PostClient();
|
PostClient postClient = new PostClient();
|
||||||
PostInputBean toWrite = new PostInputBean("Testing social networking rest client", null, null, null, null, null, false, null);
|
PostInputBean postInputBean = new PostInputBean();
|
||||||
Post written = postClient.writeUserPost(toWrite);
|
postInputBean.setText("Testing social networking rest client at " + new Date());
|
||||||
logger.debug("Written post is " + written);
|
//Post post = postClient.writeApplicationPost(postInputBean);
|
||||||
|
PostInputBean post = new PostInputBean("Testing social networking rest client", null, null, null, null, null, false, null);
|
||||||
|
Post written = postClient.writeUserPost(postInputBean);
|
||||||
|
logger.debug("Written post is " + post);
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue