Aligned to new "retrieve" functions of abstract library

This commit is contained in:
Mauro Mugnaini 2021-12-27 12:53:41 +01:00
parent 4ae6933607
commit ccad4e9ab0
4 changed files with 29 additions and 13 deletions

View File

@ -1,10 +1,11 @@
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).
# Changelog for "event-publisher-portal" # Changelog for "event-publisher-portal"
## [v1.1.0-SNAPSHOT]
## [v1.0.2] ## [v1.0.2]
- OIDC token only is now used to send events to the orchestrator endpoint (UMA token is no more involved). - OIDC token only is now used to send events to the orchestrator endpoint (UMA token is no more involved).
## [v1.0.1] ## [v1.0.1]
- First release (#19461) - First release (#19461)
This project adheres to [Semantic Versioning](https://semver.org/spec/v2.0.0.html).

23
pom.xml
View File

@ -1,33 +1,39 @@
<project xmlns="http://maven.apache.org/POM/4.0.0" <project xmlns="http://maven.apache.org/POM/4.0.0"
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd"> xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 https://maven.apache.org/xsd/maven-4.0.0.xsd">
<modelVersion>4.0.0</modelVersion> <modelVersion>4.0.0</modelVersion>
<parent> <parent>
<artifactId>maven-parent</artifactId> <artifactId>maven-parent</artifactId>
<groupId>org.gcube.tools</groupId> <groupId>org.gcube.tools</groupId>
<version>1.1.0</version> <version>1.1.0</version>
<relativePath /> <relativePath />
</parent> </parent>
<groupId>org.gcube.portal</groupId> <groupId>org.gcube.portal</groupId>
<artifactId>event-publisher-portal</artifactId> <artifactId>event-publisher-portal</artifactId>
<version>1.1.0-SNAPSHOT</version>
<packaging>jar</packaging> <packaging>jar</packaging>
<version>1.0.2</version>
<dependencyManagement> <dependencyManagement>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.gcube.distribution</groupId> <groupId>org.gcube.distribution</groupId>
<artifactId>maven-portal-bom</artifactId> <artifactId>maven-portal-bom</artifactId>
<version>3.6.0</version> <version>3.6.3-SNAPSHOT</version>
<type>pom</type> <type>pom</type>
<scope>import</scope> <scope>import</scope>
</dependency> </dependency>
</dependencies> </dependencies>
</dependencyManagement> </dependencyManagement>
<scm>
<connection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</connection> <scm>
<developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</developerConnection> <connection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</connection>
<url>https://code-repo.d4science.org/gCubeSystem/${project.artifactId}</url> <developerConnection>scm:git:https://code-repo.d4science.org/gCubeSystem/${project.artifactId}.git</developerConnection>
</scm> <url>https://code-repo.d4science.org/gCubeSystem/${project.artifactId}</url>
</scm>
<build> <build>
<plugins> <plugins>
<plugin> <plugin>
@ -40,16 +46,15 @@
</plugin> </plugin>
</plugins> </plugins>
</build> </build>
<dependencies> <dependencies>
<dependency> <dependency>
<groupId>org.gcube.portal</groupId> <groupId>org.gcube.portal</groupId>
<artifactId>oidc-library-portal</artifactId> <artifactId>oidc-library-portal</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.gcube.common</groupId> <groupId>org.gcube.common</groupId>
<artifactId>event-publisher-library</artifactId> <artifactId>event-publisher-library</artifactId>
<version>[1.0.0-SNAPSHOT, 2.0.0-SNAPSHOT)</version>
</dependency> </dependency>
<dependency> <dependency>
<groupId>org.gcube.dvos</groupId> <groupId>org.gcube.dvos</groupId>

View File

@ -6,6 +6,7 @@ import org.gcube.event.publisher.EventSender;
import org.gcube.event.publisher.HTTPWithOIDCAuthEventSender; import org.gcube.event.publisher.HTTPWithOIDCAuthEventSender;
import org.gcube.oidc.rest.OpenIdConnectConfiguration; import org.gcube.oidc.rest.OpenIdConnectConfiguration;
import org.gcube.portal.oidc.lr62.LiferayOpenIdConnectConfiguration; import org.gcube.portal.oidc.lr62.LiferayOpenIdConnectConfiguration;
import org.json.simple.JSONObject;
import com.liferay.portal.kernel.log.Log; import com.liferay.portal.kernel.log.Log;
import com.liferay.portal.kernel.log.LogFactoryUtil; import com.liferay.portal.kernel.log.LogFactoryUtil;
@ -27,6 +28,15 @@ public abstract class AbstractLR62EventPublisher extends AbstractEventPublisher
public void send(Event event) { public void send(Event event) {
System.out.println(event); System.out.println(event);
} }
@Override
public String sendAndGetResult(Event event) {
System.out.println(event);
return null;
}
@Override
public JSONObject retrive(String id) {
return null;
}
}; };
} else { } else {
OpenIdConnectConfiguration openIdConnectConfiguration = LiferayOpenIdConnectConfiguration OpenIdConnectConfiguration openIdConnectConfiguration = LiferayOpenIdConnectConfiguration

View File

@ -94,7 +94,7 @@ public class PortalEvent extends Event {
public void setRole(Role role) throws PortalException, SystemException { public void setRole(Role role) throws PortalException, SystemException {
setRole(getRoleIdentifier(role)); setRole(getRoleIdentifier(role));
} }
protected String getRoleIdentifier(Role role) throws PortalException, SystemException { protected String getRoleIdentifier(Role role) throws PortalException, SystemException {
try { try {
return ROLE_MANAGER.getRole(role.getRoleId()).getRoleName(); return ROLE_MANAGER.getRole(role.getRoleId()).getRoleName();