diff --git a/dmp-backend/core/src/main/java/eu/eudat/integrationevent/InboxIntegrationEventConfigurer.java b/dmp-backend/core/src/main/java/eu/eudat/integrationevent/InboxIntegrationEventConfigurer.java
index a4a8ddcf1..bb851e993 100644
--- a/dmp-backend/core/src/main/java/eu/eudat/integrationevent/InboxIntegrationEventConfigurer.java
+++ b/dmp-backend/core/src/main/java/eu/eudat/integrationevent/InboxIntegrationEventConfigurer.java
@@ -9,6 +9,7 @@ import org.springframework.boot.context.properties.EnableConfigurationProperties
import org.springframework.context.ApplicationContext;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.DependsOn;
@Configuration
@EnableConfigurationProperties({InboxProperties.class})
diff --git a/dmp-backend/core/src/main/java/eu/eudat/integrationevent/outbox/notification/NotificationIntegrationEventHandlerImpl.java b/dmp-backend/core/src/main/java/eu/eudat/integrationevent/outbox/notification/NotificationIntegrationEventHandlerImpl.java
index 3bdde96a0..935ed86c8 100644
--- a/dmp-backend/core/src/main/java/eu/eudat/integrationevent/outbox/notification/NotificationIntegrationEventHandlerImpl.java
+++ b/dmp-backend/core/src/main/java/eu/eudat/integrationevent/outbox/notification/NotificationIntegrationEventHandlerImpl.java
@@ -7,6 +7,7 @@ import eu.eudat.commons.enums.notification.NotificationTrackingProcess;
import eu.eudat.commons.enums.notification.NotificationTrackingState;
import eu.eudat.data.UserContactInfoEntity;
import eu.eudat.data.UserEntity;
+import eu.eudat.integrationevent.outbox.OutboxIntegrationEvent;
import eu.eudat.integrationevent.outbox.OutboxService;
import eu.eudat.model.persist.notification.NotificationPersist;
import eu.eudat.query.UserContactInfoQuery;
@@ -25,6 +26,7 @@ import org.springframework.web.context.annotation.RequestScope;
import javax.management.InvalidApplicationException;
import java.time.Instant;
import java.util.List;
+import java.util.UUID;
@Component
@RequestScope
@@ -57,30 +59,30 @@ public class NotificationIntegrationEventHandlerImpl implements NotificationInte
@Override
public void handle(NotificationIntegrationEvent event) throws InvalidApplicationException {
-// OutboxIntegrationEvent message = new OutboxIntegrationEvent();
-// message.setMessageId(UUID.randomUUID());
-// message.setType(OutboxIntegrationEvent.NOTIFY);
-// message.setEvent(event);
-// this.outboxService.publish(message);
- NotificationPersist persist = new NotificationPersist();
- persist.setType(event.getNotificationType());
- persist.setUserId(event.getUserId());
- persist.setContactHint(event.getContactHint());
- persist.setContactTypeHint(event.getContactTypeHint());
- persist.setData(event.getData());
- persist.setNotifyState(NotificationNotifyState.PENDING);
- persist.setNotifiedWith(event.getContactTypeHint());
- persist.setRetryCount(0);
- persist.setTrackingState(NotificationTrackingState.UNDEFINED);
- persist.setTrackingProcess(NotificationTrackingProcess.PENDING);
- persist.setTrackingData(null);
- persist.setProvenanceRef(event.getProvenanceRef());
- persist.setNotifiedAt(Instant.now());
- validatorFactory.validator(NotificationPersist.NotificationPersistValidator.class).validateForce(persist);
- if (isNotificationConsistent(persist)) {
- notificationService.persist(persist, null);
- auditService.track(AuditableAction.Notification_Persist, "notification_event", event);
- }
+ OutboxIntegrationEvent message = new OutboxIntegrationEvent();
+ message.setMessageId(UUID.randomUUID());
+ message.setType(OutboxIntegrationEvent.NOTIFY);
+ message.setEvent(event);
+ this.outboxService.publish(message);
+// NotificationPersist persist = new NotificationPersist();
+// persist.setType(event.getNotificationType());
+// persist.setUserId(event.getUserId());
+// persist.setContactHint(event.getContactHint());
+// persist.setContactTypeHint(event.getContactTypeHint());
+// persist.setData(event.getData());
+// persist.setNotifyState(NotificationNotifyState.PENDING);
+// persist.setNotifiedWith(event.getContactTypeHint());
+// persist.setRetryCount(0);
+// persist.setTrackingState(NotificationTrackingState.UNDEFINED);
+// persist.setTrackingProcess(NotificationTrackingProcess.PENDING);
+// persist.setTrackingData(null);
+// persist.setProvenanceRef(event.getProvenanceRef());
+// persist.setNotifiedAt(Instant.now());
+// validatorFactory.validator(NotificationPersist.NotificationPersistValidator.class).validateForce(persist);
+// if (isNotificationConsistent(persist)) {
+// notificationService.persist(persist, null);
+// auditService.track(AuditableAction.Notification_Persist, "notification_event", event);
+// }
}
private boolean isNotificationConsistent(NotificationPersist notification) {
diff --git a/dmp-backend/notification-service/notification-web/pom.xml b/dmp-backend/notification-service/notification-web/pom.xml
index e90de6030..d53e3492a 100644
--- a/dmp-backend/notification-service/notification-web/pom.xml
+++ b/dmp-backend/notification-service/notification-web/pom.xml
@@ -8,15 +8,16 @@
gr.cite
notification-service-parent
1.0.0
- ../pom.xml
+ ../../notification-service/pom.xml
notification-web
jar
- 11
- 11
+ 21
+ 21
+ 21
@@ -24,10 +25,14 @@
org.springframework.boot
spring-boot-starter-web
+
+ org.springframework.boot
+ spring-boot-starter-webflux
+
+
org.springframework.boot
spring-boot-starter-validation
- 2.6.4
@@ -35,15 +40,21 @@
postgresql
- org.hibernate
+ org.hibernate.orm
hibernate-core
+
+ org.springframework.boot
+ spring-boot-starter-tomcat
+
+
gr.cite
notification
1.0.0
+
gr.cite
oidc-authz
@@ -64,15 +75,6 @@
cors-web
1.0.0
-
- org.springframework.boot
- spring-boot
- 2.6.4
-
-
- org.springframework
- spring-web
-
diff --git a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/NotificationApplication.java b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/NotificationApplication.java
index 164fdca37..300316451 100644
--- a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/NotificationApplication.java
+++ b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/NotificationApplication.java
@@ -3,19 +3,24 @@ package gr.cite.notification.web;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.boot.autoconfigure.domain.EntityScan;
-import org.springframework.context.annotation.ComponentScan;
+import org.springframework.scheduling.annotation.EnableAsync;
-@SpringBootApplication
-@ComponentScan({
- "gr.cite.notification",
- "gr.cite.tools",
- "gr.cite.commons"})
+@SpringBootApplication(
+ scanBasePackages = {
+ "eu.eudat",
+ "gr.cite",
+ "gr.cite.queueoutbox",
+ "gr.cite.queueinbox",
+ "gr.cite.notification.integrationevent",
+ "gr.cite.tools",
+ "gr.cite.commons"})
@EntityScan({
- "gr.cite.notification.data"})
+ "gr.cite.notification.data"})
+@EnableAsync
public class NotificationApplication {
- public static void main(String[] args) {
- SpringApplication.run(NotificationApplication.class, args);
- }
+ public static void main(String[] args) {
+ SpringApplication.run(NotificationApplication.class, args);
+ }
}
diff --git a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/config/SecurityConfiguration.java b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/config/SecurityConfiguration.java
index 18d3c5172..2e17e3de6 100644
--- a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/config/SecurityConfiguration.java
+++ b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/config/SecurityConfiguration.java
@@ -18,18 +18,20 @@ import org.springframework.context.annotation.Configuration;
import org.springframework.security.authentication.AuthenticationManagerResolver;
import org.springframework.security.config.annotation.web.builders.HttpSecurity;
import org.springframework.security.config.annotation.web.configuration.EnableWebSecurity;
-import org.springframework.security.config.annotation.web.configuration.WebSecurityConfigurerAdapter;
+import org.springframework.security.config.annotation.web.configurers.AbstractHttpConfigurer;
+import org.springframework.security.config.annotation.web.configurers.HeadersConfigurer;
import org.springframework.security.config.http.SessionCreationPolicy;
+import org.springframework.security.web.SecurityFilterChain;
import org.springframework.security.web.authentication.preauth.AbstractPreAuthenticatedProcessingFilter;
-import javax.servlet.Filter;
-import javax.servlet.http.HttpServletRequest;
+import jakarta.servlet.Filter;
+import jakarta.servlet.http.HttpServletRequest;
import java.util.List;
import java.util.Set;
@Configuration
@EnableWebSecurity
-public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
+public class SecurityConfiguration {
private final WebSecurityProperties webSecurityProperties;
private final AuthenticationManagerResolver authenticationManagerResolver;
@@ -47,20 +49,19 @@ public class SecurityConfiguration extends WebSecurityConfigurerAdapter {
this.ownedAuthorizationHandler = ownedAuthorizationHandler;
}
- @Override
- protected void configure(HttpSecurity http) throws Exception {
- http
- .csrf().disable()
- .cors()
- .and()
+ @Bean
+ public SecurityFilterChain filterChain(HttpSecurity http) throws Exception {
+ HttpSecurity tempHttp = http
+ .csrf(AbstractHttpConfigurer::disable)
+ .cors(httpSecurityCorsConfigurer -> {})
+ .headers(httpSecurityHeadersConfigurer -> httpSecurityHeadersConfigurer.frameOptions(HeadersConfigurer.FrameOptionsConfig::disable))
.addFilterBefore(apiKeyFilter, AbstractPreAuthenticatedProcessingFilter.class)
- .authorizeRequests()
- .antMatchers(buildAntPatterns(webSecurityProperties.getAllowedEndpoints())).anonymous()
- .antMatchers(buildAntPatterns(webSecurityProperties.getAuthorizedEndpoints())).authenticated()
- .and()
- .sessionManagement().sessionCreationPolicy(SessionCreationPolicy.NEVER)
- .and()
+ .authorizeHttpRequests(authRequest ->
+ authRequest.requestMatchers(buildAntPatterns(webSecurityProperties.getAllowedEndpoints())).anonymous()
+ .requestMatchers(buildAntPatterns(webSecurityProperties.getAuthorizedEndpoints())).authenticated())
+ .sessionManagement( sessionManagementConfigurer-> sessionManagementConfigurer.sessionCreationPolicy(SessionCreationPolicy.NEVER))
.oauth2ResourceServer(oauth2 -> oauth2.authenticationManagerResolver(authenticationManagerResolver));
+ return tempHttp.build();
}
@Bean
diff --git a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/controllers/InAppNotificationController.java b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/controllers/InAppNotificationController.java
index 90d7ad22e..519148da3 100644
--- a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/controllers/InAppNotificationController.java
+++ b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/controllers/InAppNotificationController.java
@@ -34,7 +34,7 @@ import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.*;
import javax.management.InvalidApplicationException;
-import javax.transaction.Transactional;
+import jakarta.transaction.Transactional;
import java.util.*;
@RestController
diff --git a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/controllers/NotificationController.java b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/controllers/NotificationController.java
index d5127e0df..789ab6d5e 100644
--- a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/controllers/NotificationController.java
+++ b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/controllers/NotificationController.java
@@ -2,10 +2,8 @@ package gr.cite.notification.web.controllers;
import gr.cite.notification.audit.AuditableAction;
import gr.cite.notification.authorization.AuthorizationFlags;
-import gr.cite.notification.common.enums.IsActive;
import gr.cite.notification.data.NotificationEntity;
import gr.cite.notification.model.Notification;
-import gr.cite.notification.model.SendNotificationResult;
import gr.cite.notification.model.builder.NotificationBuilder;
import gr.cite.notification.model.censorship.NotificationCensor;
import gr.cite.notification.model.persist.NotificationPersist;
@@ -24,6 +22,7 @@ import gr.cite.tools.fieldset.FieldSet;
import gr.cite.tools.logging.LoggerService;
import gr.cite.tools.logging.MapLogEntry;
import gr.cite.tools.validation.MyValidate;
+import jakarta.transaction.Transactional;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
@@ -31,7 +30,6 @@ import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.*;
import javax.management.InvalidApplicationException;
-import javax.transaction.Transactional;
import java.util.*;
@RestController
diff --git a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/controllers/NotificationTemplateController.java b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/controllers/NotificationTemplateController.java
index 820b7caf5..ba3050101 100644
--- a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/controllers/NotificationTemplateController.java
+++ b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/controllers/NotificationTemplateController.java
@@ -29,7 +29,7 @@ import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.*;
import javax.management.InvalidApplicationException;
-import javax.transaction.Transactional;
+import jakarta.transaction.Transactional;
import java.util.*;
@RestController
diff --git a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/controllers/TenantConfigurationController.java b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/controllers/TenantConfigurationController.java
index 0112e376c..82de8be48 100644
--- a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/controllers/TenantConfigurationController.java
+++ b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/controllers/TenantConfigurationController.java
@@ -32,8 +32,8 @@ import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.*;
import javax.management.InvalidApplicationException;
-import javax.transaction.Transactional;
-import javax.validation.Valid;
+import jakarta.transaction.Transactional;
+import jakarta.validation.Valid;
import java.util.*;
@RestController
diff --git a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/controllers/UserNotificationPreferenceController.java b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/controllers/UserNotificationPreferenceController.java
index 352b0c3ba..1a54be1b0 100644
--- a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/controllers/UserNotificationPreferenceController.java
+++ b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/controllers/UserNotificationPreferenceController.java
@@ -10,11 +10,9 @@ import gr.cite.notification.model.UserNotificationPreference;
import gr.cite.notification.model.builder.UserNotificationPreferenceBuilder;
import gr.cite.notification.model.censorship.UserNotificationPreferenceCensor;
import gr.cite.notification.model.persist.UserNotificationPreferencePersist;
-import gr.cite.notification.model.persist.tenantconfiguration.TenantConfigurationNotifierListPersist;
import gr.cite.notification.query.UserNotificationPreferenceQuery;
import gr.cite.notification.query.lookup.NotifierListLookup;
import gr.cite.notification.query.lookup.UserNotificationPreferenceLookup;
-import gr.cite.notification.service.tenantconfiguration.TenantConfigurationService;
import gr.cite.notification.service.userNotificationPreference.UserNotificationPreferenceService;
import gr.cite.notification.web.model.QueryResult;
import gr.cite.tools.auditing.AuditService;
@@ -27,15 +25,14 @@ import gr.cite.tools.exception.MyNotFoundException;
import gr.cite.tools.fieldset.FieldSet;
import gr.cite.tools.logging.LoggerService;
import gr.cite.tools.logging.MapLogEntry;
+import jakarta.validation.Valid;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.MessageSource;
import org.springframework.context.i18n.LocaleContextHolder;
import org.springframework.web.bind.annotation.*;
-import javax.management.InvalidApplicationException;
-import javax.transaction.Transactional;
-import javax.validation.Valid;
+import jakarta.transaction.Transactional;
import java.util.*;
@RestController
diff --git a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/interceptors/UserInterceptor.java b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/interceptors/UserInterceptor.java
index 47208b1ca..83e461b18 100644
--- a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/interceptors/UserInterceptor.java
+++ b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/interceptors/UserInterceptor.java
@@ -35,8 +35,8 @@ import org.springframework.ui.ModelMap;
import org.springframework.web.context.request.WebRequest;
import org.springframework.web.context.request.WebRequestInterceptor;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
+import jakarta.persistence.EntityManager;
+import jakarta.persistence.PersistenceContext;
import java.time.Instant;
import java.util.ArrayList;
import java.util.List;
diff --git a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/scope/tenant/TenantInterceptor.java b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/scope/tenant/TenantInterceptor.java
index ef36af989..e28f0a5ec 100644
--- a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/scope/tenant/TenantInterceptor.java
+++ b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/scope/tenant/TenantInterceptor.java
@@ -26,13 +26,13 @@ import org.springframework.web.context.request.WebRequest;
import org.springframework.web.context.request.WebRequestInterceptor;
import javax.management.InvalidApplicationException;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.Tuple;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Root;
-import javax.persistence.criteria.Subquery;
+import jakarta.persistence.EntityManager;
+import jakarta.persistence.PersistenceContext;
+import jakarta.persistence.Tuple;
+import jakarta.persistence.criteria.CriteriaBuilder;
+import jakarta.persistence.criteria.CriteriaQuery;
+import jakarta.persistence.criteria.Root;
+import jakarta.persistence.criteria.Subquery;
import java.util.List;
import java.util.Locale;
diff --git a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/scope/tenant/TenantScopeClaimInterceptor.java b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/scope/tenant/TenantScopeClaimInterceptor.java
index dbabb0857..138b9661f 100644
--- a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/scope/tenant/TenantScopeClaimInterceptor.java
+++ b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/scope/tenant/TenantScopeClaimInterceptor.java
@@ -22,12 +22,12 @@ import org.springframework.web.context.request.WebRequest;
import org.springframework.web.context.request.WebRequestInterceptor;
import javax.management.InvalidApplicationException;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.Tuple;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Root;
+import jakarta.persistence.EntityManager;
+import jakarta.persistence.PersistenceContext;
+import jakarta.persistence.Tuple;
+import jakarta.persistence.criteria.CriteriaBuilder;
+import jakarta.persistence.criteria.CriteriaQuery;
+import jakarta.persistence.criteria.Root;
import java.util.List;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/scope/tenant/TenantScopeHeaderInterceptor.java b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/scope/tenant/TenantScopeHeaderInterceptor.java
index 15bc2790f..3a5b2ca20 100644
--- a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/scope/tenant/TenantScopeHeaderInterceptor.java
+++ b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/scope/tenant/TenantScopeHeaderInterceptor.java
@@ -17,12 +17,12 @@ import org.springframework.web.context.request.WebRequest;
import org.springframework.web.context.request.WebRequestInterceptor;
import javax.management.InvalidApplicationException;
-import javax.persistence.EntityManager;
-import javax.persistence.PersistenceContext;
-import javax.persistence.Tuple;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.CriteriaQuery;
-import javax.persistence.criteria.Root;
+import jakarta.persistence.EntityManager;
+import jakarta.persistence.PersistenceContext;
+import jakarta.persistence.Tuple;
+import jakarta.persistence.criteria.CriteriaBuilder;
+import jakarta.persistence.criteria.CriteriaQuery;
+import jakarta.persistence.criteria.Root;
import java.util.List;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/scope/user/UserInterceptor.java b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/scope/user/UserInterceptor.java
index 43bc4fb9b..63ac88829 100644
--- a/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/scope/user/UserInterceptor.java
+++ b/dmp-backend/notification-service/notification-web/src/main/java/gr/cite/notification/web/scope/user/UserInterceptor.java
@@ -21,12 +21,12 @@
//import org.springframework.web.context.request.WebRequestInterceptor;
//
//import javax.management.InvalidApplicationException;
-//import javax.persistence.EntityManager;
-//import javax.persistence.PersistenceContext;
-//import javax.persistence.Tuple;
-//import javax.persistence.criteria.CriteriaBuilder;
-//import javax.persistence.criteria.CriteriaQuery;
-//import javax.persistence.criteria.Root;
+//import jakarta.persistence.EntityManager;
+//import jakarta.persistence.PersistenceContext;
+//import jakarta.persistence.Tuple;
+//import jakarta.persistence.criteria.CriteriaBuilder;
+//import jakarta.persistence.criteria.CriteriaQuery;
+//import jakarta.persistence.criteria.Root;
//import java.time.Instant;
//import java.util.List;
//import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification-web/src/main/resources/config/application.yml b/dmp-backend/notification-service/notification-web/src/main/resources/config/application.yml
index 4f9a66b6d..06b5f37c9 100644
--- a/dmp-backend/notification-service/notification-web/src/main/resources/config/application.yml
+++ b/dmp-backend/notification-service/notification-web/src/main/resources/config/application.yml
@@ -16,5 +16,6 @@ spring:
optional:classpath:config/cors.yml[.yml], optional:classpath:config/cors-${spring.profiles.active}.yml[.yml], optional:file:../config/cors-${spring.profiles.active}.yml[.yml],
optional:classpath:config/notification.yml[.yml], optional:classpath:config/notification-${spring.profiles.active}.yml[.yml], optional:file:../config/notification-${spring.profiles.active}.yml[.yml],
optional:classpath:config/email.yml[.yml], optional:classpath:config/email-${spring.profiles.active}.yml[.yml], optional:file:../config/email-${spring.profiles.active}.yml[.yml],
+ optional:classpath:config/queue.yml[.yml], optional:classpath:config/queue-${spring.profiles.active}.yml[.yml], optional:file:../config/queue-${spring.profiles.active}.yml[.yml],
optional:classpath:config/cipher.yml[.yml], optional:classpath:config/cipher-${spring.profiles.active}.yml[.yml], optional:file:../config/cipher-${spring.profiles.active}.yml[.yml],
optional:classpath:config/formatting.yml[.yml], optional:classpath:config/formatting-${spring.profiles.active}.yml[.yml], optional:file:../config/formatting-${spring.profiles.active}.yml[.yml]
diff --git a/dmp-backend/notification-service/notification-web/src/main/resources/config/queue-devel.yml b/dmp-backend/notification-service/notification-web/src/main/resources/config/queue-devel.yml
index 04855c727..1c761d9e5 100644
--- a/dmp-backend/notification-service/notification-web/src/main/resources/config/queue-devel.yml
+++ b/dmp-backend/notification-service/notification-web/src/main/resources/config/queue-devel.yml
@@ -1,5 +1,6 @@
queue:
rabbitmq:
+ enable: true
durable: true
queue: cite_dmp_devel_notification_inbox_queue
exchange: cite_dmp_devel_queue
@@ -7,11 +8,13 @@ queue:
publisherEnabled: true
task:
publisher:
+ enable: true
options:
exchange: cite_dmp_devel_queue
rabbitmq:
enable: true
listener:
+ enable: true
options:
exchange: cite_dmp_devel_queue
rabbitmq:
diff --git a/dmp-backend/notification-service/notification-web/src/main/resources/config/queue.yml b/dmp-backend/notification-service/notification-web/src/main/resources/config/queue.yml
index 4bc96aee1..a61881d7d 100644
--- a/dmp-backend/notification-service/notification-web/src/main/resources/config/queue.yml
+++ b/dmp-backend/notification-service/notification-web/src/main/resources/config/queue.yml
@@ -43,9 +43,9 @@ queue:
exchange: null
notify-topic: notification.notify
tenant-removal-topic: tenant.remove
- tenant-touch-topic: tenant.touch
+ tenant-touched-topic: tenant.touch
user-removal-topic: user.remove
- user-touch-topic: user.touch
+ user-touched-topic: user.touch
rabbitmq:
enable: false
interval-seconds: 30
diff --git a/dmp-backend/notification-service/notification-web/target/classes/config/application.yml b/dmp-backend/notification-service/notification-web/target/classes/config/application.yml
index 4f9a66b6d..06b5f37c9 100644
--- a/dmp-backend/notification-service/notification-web/target/classes/config/application.yml
+++ b/dmp-backend/notification-service/notification-web/target/classes/config/application.yml
@@ -16,5 +16,6 @@ spring:
optional:classpath:config/cors.yml[.yml], optional:classpath:config/cors-${spring.profiles.active}.yml[.yml], optional:file:../config/cors-${spring.profiles.active}.yml[.yml],
optional:classpath:config/notification.yml[.yml], optional:classpath:config/notification-${spring.profiles.active}.yml[.yml], optional:file:../config/notification-${spring.profiles.active}.yml[.yml],
optional:classpath:config/email.yml[.yml], optional:classpath:config/email-${spring.profiles.active}.yml[.yml], optional:file:../config/email-${spring.profiles.active}.yml[.yml],
+ optional:classpath:config/queue.yml[.yml], optional:classpath:config/queue-${spring.profiles.active}.yml[.yml], optional:file:../config/queue-${spring.profiles.active}.yml[.yml],
optional:classpath:config/cipher.yml[.yml], optional:classpath:config/cipher-${spring.profiles.active}.yml[.yml], optional:file:../config/cipher-${spring.profiles.active}.yml[.yml],
optional:classpath:config/formatting.yml[.yml], optional:classpath:config/formatting-${spring.profiles.active}.yml[.yml], optional:file:../config/formatting-${spring.profiles.active}.yml[.yml]
diff --git a/dmp-backend/notification-service/notification-web/target/classes/config/queue-devel.yml b/dmp-backend/notification-service/notification-web/target/classes/config/queue-devel.yml
index 04855c727..1c761d9e5 100644
--- a/dmp-backend/notification-service/notification-web/target/classes/config/queue-devel.yml
+++ b/dmp-backend/notification-service/notification-web/target/classes/config/queue-devel.yml
@@ -1,5 +1,6 @@
queue:
rabbitmq:
+ enable: true
durable: true
queue: cite_dmp_devel_notification_inbox_queue
exchange: cite_dmp_devel_queue
@@ -7,11 +8,13 @@ queue:
publisherEnabled: true
task:
publisher:
+ enable: true
options:
exchange: cite_dmp_devel_queue
rabbitmq:
enable: true
listener:
+ enable: true
options:
exchange: cite_dmp_devel_queue
rabbitmq:
diff --git a/dmp-backend/notification-service/notification-web/target/classes/config/queue.yml b/dmp-backend/notification-service/notification-web/target/classes/config/queue.yml
index 4bc96aee1..a61881d7d 100644
--- a/dmp-backend/notification-service/notification-web/target/classes/config/queue.yml
+++ b/dmp-backend/notification-service/notification-web/target/classes/config/queue.yml
@@ -43,9 +43,9 @@ queue:
exchange: null
notify-topic: notification.notify
tenant-removal-topic: tenant.remove
- tenant-touch-topic: tenant.touch
+ tenant-touched-topic: tenant.touch
user-removal-topic: user.remove
- user-touch-topic: user.touch
+ user-touched-topic: user.touch
rabbitmq:
enable: false
interval-seconds: 30
diff --git a/dmp-backend/notification-service/notification/pom.xml b/dmp-backend/notification-service/notification/pom.xml
index b5e71bb6a..50ba3238f 100644
--- a/dmp-backend/notification-service/notification/pom.xml
+++ b/dmp-backend/notification-service/notification/pom.xml
@@ -7,16 +7,17 @@
gr.cite
notification-service-parent
1.0.0
- ../pom.xml
+ ../../notification-service/pom.xml
notification
- 1.0.0
+
11
11
11
+
org.springframework.boot
@@ -45,16 +46,11 @@
poi-ooxml
5.2.2
-
-
- javax.persistence
- javax.persistence-api
-
gr.cite
data-tools
- 1.0.0
+ 2.1.2
gr.cite
@@ -84,16 +80,14 @@
gr.cite
validation
- 1.0.0
+ 2.1.0
+
com.fasterxml.jackson.datatype
jackson-datatype-jsr310
-
- org.springframework
- spring-web
-
+
gr.cite
cipher
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/XmlHandlingService.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/XmlHandlingService.java
index e6b4b991e..cec063abf 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/XmlHandlingService.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/XmlHandlingService.java
@@ -10,10 +10,10 @@ import org.xml.sax.InputSource;
import org.xml.sax.SAXException;
import javax.management.InvalidApplicationException;
-import javax.xml.bind.JAXBContext;
-import javax.xml.bind.JAXBException;
-import javax.xml.bind.Marshaller;
-import javax.xml.bind.Unmarshaller;
+import jakarta.xml.bind.JAXBContext;
+import jakarta.xml.bind.JAXBException;
+import jakarta.xml.bind.Marshaller;
+import jakarta.xml.bind.Unmarshaller;
import javax.xml.parsers.DocumentBuilder;
import javax.xml.parsers.DocumentBuilderFactory;
import javax.xml.parsers.ParserConfigurationException;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/scope/tenant/TenantScope.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/scope/tenant/TenantScope.java
index 34e102280..99111183a 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/scope/tenant/TenantScope.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/scope/tenant/TenantScope.java
@@ -13,7 +13,7 @@ import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.RequestScope;
import javax.management.InvalidApplicationException;
-import javax.persistence.EntityManager;
+import jakarta.persistence.EntityManager;
import java.util.UUID;
@Component
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/types/tenant/TenantConfigEntity.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/types/tenant/TenantConfigEntity.java
index 6a13dbd50..4d5a0a7db 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/types/tenant/TenantConfigEntity.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/types/tenant/TenantConfigEntity.java
@@ -1,10 +1,10 @@
package gr.cite.notification.common.types.tenant;
-import javax.xml.bind.annotation.XmlAccessType;
-import javax.xml.bind.annotation.XmlAccessorType;
-import javax.xml.bind.annotation.XmlElement;
-import javax.xml.bind.annotation.XmlRootElement;
+import jakarta.xml.bind.annotation.XmlAccessType;
+import jakarta.xml.bind.annotation.XmlAccessorType;
+import jakarta.xml.bind.annotation.XmlElement;
+import jakarta.xml.bind.annotation.XmlRootElement;
@XmlRootElement(name = "config")
@XmlAccessorType(XmlAccessType.FIELD)
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/types/tenant/TenantDepositConfigEntity.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/types/tenant/TenantDepositConfigEntity.java
index e4b02bd46..f2498eada 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/types/tenant/TenantDepositConfigEntity.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/types/tenant/TenantDepositConfigEntity.java
@@ -1,6 +1,6 @@
package gr.cite.notification.common.types.tenant;
-import javax.xml.bind.annotation.*;
+import jakarta.xml.bind.annotation.*;
import java.util.List;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/types/tenant/TenantFileTransformersConfigEntity.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/types/tenant/TenantFileTransformersConfigEntity.java
index bd1e3409b..e661197d7 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/types/tenant/TenantFileTransformersConfigEntity.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/types/tenant/TenantFileTransformersConfigEntity.java
@@ -1,6 +1,6 @@
package gr.cite.notification.common.types.tenant;
-import javax.xml.bind.annotation.*;
+import jakarta.xml.bind.annotation.*;
import java.util.List;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/types/tenant/TenantSourceEntity.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/types/tenant/TenantSourceEntity.java
index 6c8ccf4b3..5871f2c0e 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/types/tenant/TenantSourceEntity.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/types/tenant/TenantSourceEntity.java
@@ -1,6 +1,6 @@
package gr.cite.notification.common.types.tenant;
-import javax.xml.bind.annotation.*;
+import jakarta.xml.bind.annotation.*;
import java.util.List;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/EnumNotNull.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/EnumNotNull.java
index 111523d6e..9b6cc2a3f 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/EnumNotNull.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/EnumNotNull.java
@@ -1,7 +1,7 @@
package gr.cite.notification.common.validation;
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
+import jakarta.validation.ConstraintValidator;
+import jakarta.validation.ConstraintValidatorContext;
public class EnumNotNull implements ConstraintValidator {
@Override
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/FieldNotNullIfOtherSet.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/FieldNotNullIfOtherSet.java
index ad2fd2fa9..23b812d12 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/FieldNotNullIfOtherSet.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/FieldNotNullIfOtherSet.java
@@ -1,8 +1,8 @@
package gr.cite.notification.common.validation;
-import javax.validation.Constraint;
-import javax.validation.Payload;
+import jakarta.validation.Constraint;
+import jakarta.validation.Payload;
import java.lang.annotation.*;
@Constraint( validatedBy = { FieldNotNullIfOtherSetValidator.class } )
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/FieldNotNullIfOtherSetValidator.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/FieldNotNullIfOtherSetValidator.java
index b12b3eaf7..dc537b9d0 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/FieldNotNullIfOtherSetValidator.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/FieldNotNullIfOtherSetValidator.java
@@ -2,8 +2,8 @@ package gr.cite.notification.common.validation;
import org.springframework.beans.BeanWrapperImpl;
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
+import jakarta.validation.ConstraintValidator;
+import jakarta.validation.ConstraintValidatorContext;
import java.util.Objects;
public class FieldNotNullIfOtherSetValidator implements ConstraintValidator {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/FieldsValueMatch.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/FieldsValueMatch.java
index 872fdb55a..3935b5f7e 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/FieldsValueMatch.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/FieldsValueMatch.java
@@ -1,7 +1,7 @@
package gr.cite.notification.common.validation;
-import javax.validation.Constraint;
-import javax.validation.Payload;
+import jakarta.validation.Constraint;
+import jakarta.validation.Payload;
import java.lang.annotation.ElementType;
import java.lang.annotation.Retention;
import java.lang.annotation.RetentionPolicy;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/FieldsValueMatchValidator.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/FieldsValueMatchValidator.java
index 6f1a4cde0..15097deb8 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/FieldsValueMatchValidator.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/FieldsValueMatchValidator.java
@@ -2,8 +2,8 @@ package gr.cite.notification.common.validation;
import org.springframework.beans.BeanWrapperImpl;
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
+import jakarta.validation.ConstraintValidator;
+import jakarta.validation.ConstraintValidatorContext;
public class FieldsValueMatchValidator implements ConstraintValidator {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/ValidEnum.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/ValidEnum.java
index b48e7c503..5c3002235 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/ValidEnum.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/ValidEnum.java
@@ -1,7 +1,7 @@
package gr.cite.notification.common.validation;
-import javax.validation.Constraint;
-import javax.validation.Payload;
+import jakarta.validation.Constraint;
+import jakarta.validation.Payload;
import java.lang.annotation.*;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/ValidId.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/ValidId.java
index ed0240c5e..8fa3989fa 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/ValidId.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/ValidId.java
@@ -1,8 +1,8 @@
package gr.cite.notification.common.validation;
-import javax.validation.Constraint;
-import javax.validation.Payload;
+import jakarta.validation.Constraint;
+import jakarta.validation.Payload;
import java.lang.annotation.*;
@Constraint( validatedBy = { ValidIdValidator.class } )
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/ValidIdValidator.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/ValidIdValidator.java
index 729c032ff..c1ce3886c 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/ValidIdValidator.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/ValidIdValidator.java
@@ -3,8 +3,8 @@ package gr.cite.notification.common.validation;
import gr.cite.notification.convention.ConventionService;
import org.springframework.beans.factory.annotation.Autowired;
-import javax.validation.ConstraintValidator;
-import javax.validation.ConstraintValidatorContext;
+import jakarta.validation.ConstraintValidator;
+import jakarta.validation.ConstraintValidatorContext;
import java.util.UUID;
public class ValidIdValidator implements ConstraintValidator {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/ValidationServiceImpl.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/ValidationServiceImpl.java
index b6ebb716a..47e0b807b 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/ValidationServiceImpl.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/common/validation/ValidationServiceImpl.java
@@ -8,7 +8,7 @@ import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
-import javax.validation.Validator;
+import jakarta.validation.Validator;
import java.util.List;
import java.util.Map;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/config/email/EmailProperties.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/config/email/EmailProperties.java
index 9f57df829..505b2bd96 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/config/email/EmailProperties.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/config/email/EmailProperties.java
@@ -1,11 +1,10 @@
package gr.cite.notification.config.email;
import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.boot.context.properties.ConstructorBinding;
-@ConstructorBinding
@ConfigurationProperties(prefix = "email")
public class EmailProperties {
+
private final String address;
public EmailProperties(String address) {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/config/formatting/FormattingServiceProperties.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/config/formatting/FormattingServiceProperties.java
index 9366026c3..39f517869 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/config/formatting/FormattingServiceProperties.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/config/formatting/FormattingServiceProperties.java
@@ -1,38 +1,38 @@
package gr.cite.notification.config.formatting;
-
import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.boot.context.properties.ConstructorBinding;
-@ConstructorBinding
@ConfigurationProperties(prefix = "formatting.options")
public class FormattingServiceProperties {
- private final String integerFormat;
- private final String decimalFormat;
- private final String dateTimeFormat;
- private final Integer decimalDigitsRound;
+ private final String integerFormat;
- public FormattingServiceProperties(String integerFormat, String decimalFormat, String dateTimeFormat, Integer decimalDigitsRound) {
- this.integerFormat = integerFormat;
- this.decimalFormat = decimalFormat;
- this.dateTimeFormat = dateTimeFormat;
- this.decimalDigitsRound = decimalDigitsRound;
- }
+ private final String decimalFormat;
- public String getIntegerFormat() {
- return integerFormat;
- }
+ private final String dateTimeFormat;
- public String getDecimalFormat() {
- return decimalFormat;
- }
+ private final Integer decimalDigitsRound;
- public String getDateTimeFormat() {
- return dateTimeFormat;
- }
+ public FormattingServiceProperties(String integerFormat, String decimalFormat, String dateTimeFormat, Integer decimalDigitsRound) {
+ this.integerFormat = integerFormat;
+ this.decimalFormat = decimalFormat;
+ this.dateTimeFormat = dateTimeFormat;
+ this.decimalDigitsRound = decimalDigitsRound;
+ }
- public Integer getDecimalDigitsRound() {
- return decimalDigitsRound;
- }
+ public String getIntegerFormat() {
+ return integerFormat;
+ }
+
+ public String getDecimalFormat() {
+ return decimalFormat;
+ }
+
+ public String getDateTimeFormat() {
+ return dateTimeFormat;
+ }
+
+ public Integer getDecimalDigitsRound() {
+ return decimalDigitsRound;
+ }
}
\ No newline at end of file
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/config/notification/NotificationConfig.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/config/notification/NotificationConfig.java
index d757deb02..5ede51cd9 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/config/notification/NotificationConfig.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/config/notification/NotificationConfig.java
@@ -5,6 +5,7 @@ import gr.cite.notification.schedule.NotificationScheduleTask;
import gr.cite.notification.service.message.common.MessageBuilderBase;
import gr.cite.notification.service.notificationscheduling.NotificationSchedulingService;
import gr.cite.notification.service.notificationscheduling.NotificationSchedulingServiceImpl;
+import gr.cite.queueinbox.task.rabbitmq.QueueListenerProperties;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
import org.springframework.boot.context.properties.EnableConfigurationProperties;
@@ -32,11 +33,13 @@ public class NotificationConfig {
}
private final ApplicationContext applicationContext;
private final NotificationProperties properties;
+ private final QueueListenerProperties queueListenerProperties;
@Autowired
- public NotificationConfig(ApplicationContext applicationContext, NotificationProperties properties) {
+ public NotificationConfig(ApplicationContext applicationContext, NotificationProperties properties, QueueListenerProperties queueListenerProperties) {
this.applicationContext = applicationContext;
this.properties = properties;
+ this.queueListenerProperties = queueListenerProperties;
}
@Bean(BeanQualifier.GLOBAL_POLICIES_MAP)
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/config/notification/NotificationProperties.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/config/notification/NotificationProperties.java
index f8a4e75af..1e963fcd7 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/config/notification/NotificationProperties.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/config/notification/NotificationProperties.java
@@ -1,348 +1,385 @@
package gr.cite.notification.config.notification;
-import gr.cite.notification.common.enums.NotificationContactType;
import gr.cite.notification.common.enums.EmailOverrideMode;
+import gr.cite.notification.common.enums.NotificationContactType;
import gr.cite.notification.common.types.notification.FieldInfo;
import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.boot.context.properties.ConstructorBinding;
import java.util.List;
import java.util.Map;
import java.util.UUID;
-@ConstructorBinding
@ConfigurationProperties(prefix = "notification")
public class NotificationProperties {
- private final Task task;
- private final Resolver resolver;
- private final Map message;
- private final Template overrideCache;
- private final StaticFieldItems staticFields;
-
- public NotificationProperties(Task task, Resolver resolver, Map message, Template overrideCache, StaticFieldItems staticFields) {
- this.task = task;
- this.resolver = resolver;
- this.message = message;
- this.overrideCache = overrideCache;
- this.staticFields = staticFields;
- }
-
- public Task getTask() {
- return task;
- }
-
- public Resolver getResolver() {
- return resolver;
- }
-
- public Map getMessage() {
- return message;
- }
-
- public Template getOverrideCache() {
- return overrideCache;
- }
-
- public StaticFieldItems getStaticFields() {
- return staticFields;
- }
-
- public static class Task {
- private final Processor processor;
-
- public Task(Processor processor) {
- this.processor = processor;
- }
-
- public Processor getProcessor() {
- return processor;
- }
-
- public static class Processor {
- private final Boolean enable;
- private final Long intervalSeconds;
- private final Options options;
- private final List overrides;
-
- public Processor(Boolean enable, Long intervalSeconds, Options options, List overrides) {
- this.enable = enable;
- this.intervalSeconds = intervalSeconds;
- this.options = options;
- this.overrides = overrides;
- }
-
- public Boolean getEnable() {
- return enable;
- }
-
- public Long getIntervalSeconds() {
- return intervalSeconds;
- }
-
- public Options getOptions() {
- return options;
- }
-
- public List getOverrides() {
- return overrides;
- }
-
- public static class Options {
- private final Long retryThreshold;
- private final Long maxRetryDelaySeconds;
- private final Long tooOldToSendSeconds;
- private final Long tooOldToTrackSeconds;
-
- public Options(Long retryThreshold, Long maxRetryDelaySeconds, Long tooOldToSendSeconds, Long tooOldToTrackSeconds) {
- this.retryThreshold = retryThreshold;
- this.maxRetryDelaySeconds = maxRetryDelaySeconds;
- this.tooOldToSendSeconds = tooOldToSendSeconds;
- this.tooOldToTrackSeconds = tooOldToTrackSeconds;
- }
-
- public Long getRetryThreshold() {
- return retryThreshold;
- }
-
- public Long getMaxRetryDelaySeconds() {
- return maxRetryDelaySeconds;
- }
-
- public Long getTooOldToSendSeconds() {
- return tooOldToSendSeconds;
- }
-
- public Long getTooOldToTrackSeconds() {
- return tooOldToTrackSeconds;
- }
- }
- }
- }
-
- public static class Resolver {
- private final List globalPolicies;
-
- public Resolver(List globalPolicies) {
- this.globalPolicies = globalPolicies;
- }
-
- public List getGlobalPolicies() {
- return globalPolicies;
- }
-
- public static class GlobalPolicy {
- private final UUID type;
- private final List contacts;
-
- public GlobalPolicy(UUID type, List contacts) {
- this.type = type;
- this.contacts = contacts;
- }
-
- public UUID getType() {
- return type;
- }
-
- public List getContacts() {
- return contacts;
- }
- }
- }
-
- public static class Template {
- private final TemplateCache templateCache;
-
- private final List flows;
-
- public Template(TemplateCache templateCache, List flows) {
- this.templateCache = templateCache;
- this.flows = flows;
- }
-
- public TemplateCache getTemplateCache() {
- return templateCache;
- }
-
-
- public List getFlows() {
- return flows;
- }
-
- public static class TemplateCache {
- private final String prefix;
- private final String keyPattern;
-
- public TemplateCache(String prefix, String keyPattern) {
- this.prefix = prefix;
- this.keyPattern = keyPattern;
- }
-
- public String getPrefix() {
- return prefix;
- }
-
- public String getKeyPattern() {
- return keyPattern;
- }
- }
- }
-
- public static class StaticFieldItems {
- private final List Fields;
-
- public StaticFieldItems(List fields) {
- Fields = fields;
- }
-
- public List getFields() {
- return Fields;
- }
- }
-
- public static class Field {
- private final String key;
- private final String type;
- private final String value;
-
- public Field(String key, String type, String value) {
- this.key = key;
- this.type = type;
- this.value = value;
- }
-
- public String getKey() {
- return key;
- }
-
- public String getType() {
- return type;
- }
-
- public String getValue() {
- return value;
- }
- }
-
- public static class Flow {
- private final UUID key;
- private final String subjectPath;
- private final String subjectKey;
- private final FieldOption subjectFieldOptions;
- private final String bodyPath;
- private final String bodyKey;
- private final FieldOption bodyFieldOptions;
- private final List cc;
- private final EmailOverrideMode ccMode;
- private final List bcc;
- private final EmailOverrideMode bccMode;
- private final Boolean allowAttachments;
- private final List cipherFields;
- private final String priorityKey;
- private final List extraDataKeys;
-
- public Flow(UUID key, String subjectPath, String subjectKey, FieldOption subjectFieldOptions, String bodyPath, String bodyKey, FieldOption bodyFieldOptions, List cc, EmailOverrideMode ccMode, List bcc, EmailOverrideMode bccMode, Boolean allowAttachments, List cipherFields, String priorityKey, List extraDataKeys) {
- this.key = key;
- this.subjectPath = subjectPath;
- this.subjectKey = subjectKey;
- this.subjectFieldOptions = subjectFieldOptions;
- this.bodyPath = bodyPath;
- this.bodyKey = bodyKey;
- this.bodyFieldOptions = bodyFieldOptions;
- this.cc = cc;
- this.ccMode = ccMode;
- this.bcc = bcc;
- this.bccMode = bccMode;
- this.allowAttachments = allowAttachments;
- this.cipherFields = cipherFields;
- this.priorityKey = priorityKey;
- this.extraDataKeys = extraDataKeys;
- }
-
- public UUID getKey() {
- return key;
- }
-
- public String getSubjectPath() {
- return subjectPath;
- }
-
- public String getSubjectKey() {
- return subjectKey;
- }
-
- public FieldOption getSubjectFieldOptions() {
- return subjectFieldOptions;
- }
-
- public String getBodyPath() {
- return bodyPath;
- }
-
- public String getBodyKey() {
- return bodyKey;
- }
-
- public FieldOption getBodyFieldOptions() {
- return bodyFieldOptions;
- }
-
- public List getCc() {
- return cc;
- }
-
- public EmailOverrideMode getCcMode() {
- return ccMode;
- }
-
- public List getBcc() {
- return bcc;
- }
-
- public EmailOverrideMode getBccMode() {
- return bccMode;
- }
-
- public Boolean getAllowAttachments() {
- return allowAttachments;
- }
-
- public List getCipherFields() {
- return cipherFields;
- }
-
- public String getPriorityKey() {
- return priorityKey;
- }
-
- public List getExtraDataKeys() {
- return extraDataKeys;
- }
-
- public static class FieldOption {
- private final List mandatory;
- private final List optional;
-
- private final Map formatting;
-
- public FieldOption(List mandatory, List optional, Map formatting) {
- this.mandatory = mandatory;
- this.optional = optional;
- this.formatting = formatting;
- }
-
- public List getMandatory() {
- return mandatory;
- }
-
- public List getOptional() {
- return optional;
- }
-
- public Map getFormatting() {
- return formatting;
- }
-
- }
- }
+ private final Task task;
+
+ private final Resolver resolver;
+
+ private final Map message;
+
+ private final Template overrideCache;
+
+ private final StaticFieldItems staticFields;
+
+ public NotificationProperties(Task task, Resolver resolver, Map message, Template overrideCache, StaticFieldItems staticFields) {
+ this.task = task;
+ this.resolver = resolver;
+ this.message = message;
+ this.overrideCache = overrideCache;
+ this.staticFields = staticFields;
+ }
+
+ public Task getTask() {
+ return task;
+ }
+
+ public Resolver getResolver() {
+ return resolver;
+ }
+
+ public Map getMessage() {
+ return message;
+ }
+
+ public Template getOverrideCache() {
+ return overrideCache;
+ }
+
+ public StaticFieldItems getStaticFields() {
+ return staticFields;
+ }
+
+ public static class Task {
+
+ private final Processor processor;
+
+ public Task(Processor processor) {
+ this.processor = processor;
+ }
+
+ public Processor getProcessor() {
+ return processor;
+ }
+
+ public static class Processor {
+
+ private final Boolean enable;
+
+ private final Long intervalSeconds;
+
+ private final Options options;
+
+ private final List overrides;
+
+ public Processor(Boolean enable, Long intervalSeconds, Options options, List overrides) {
+ this.enable = enable;
+ this.intervalSeconds = intervalSeconds;
+ this.options = options;
+ this.overrides = overrides;
+ }
+
+ public Boolean getEnable() {
+ return enable;
+ }
+
+ public Long getIntervalSeconds() {
+ return intervalSeconds;
+ }
+
+ public Options getOptions() {
+ return options;
+ }
+
+ public List getOverrides() {
+ return overrides;
+ }
+
+ public static class Options {
+
+ private final Long retryThreshold;
+
+ private final Long maxRetryDelaySeconds;
+
+ private final Long tooOldToSendSeconds;
+
+ private final Long tooOldToTrackSeconds;
+
+ public Options(Long retryThreshold, Long maxRetryDelaySeconds, Long tooOldToSendSeconds, Long tooOldToTrackSeconds) {
+ this.retryThreshold = retryThreshold;
+ this.maxRetryDelaySeconds = maxRetryDelaySeconds;
+ this.tooOldToSendSeconds = tooOldToSendSeconds;
+ this.tooOldToTrackSeconds = tooOldToTrackSeconds;
+ }
+
+ public Long getRetryThreshold() {
+ return retryThreshold;
+ }
+
+ public Long getMaxRetryDelaySeconds() {
+ return maxRetryDelaySeconds;
+ }
+
+ public Long getTooOldToSendSeconds() {
+ return tooOldToSendSeconds;
+ }
+
+ public Long getTooOldToTrackSeconds() {
+ return tooOldToTrackSeconds;
+ }
+ }
+ }
+ }
+
+ public static class Resolver {
+
+ private final List globalPolicies;
+
+ public Resolver(List globalPolicies) {
+ this.globalPolicies = globalPolicies;
+ }
+
+ public List getGlobalPolicies() {
+ return globalPolicies;
+ }
+
+ public static class GlobalPolicy {
+
+ private final UUID type;
+
+ private final List contacts;
+
+ public GlobalPolicy(UUID type, List contacts) {
+ this.type = type;
+ this.contacts = contacts;
+ }
+
+ public UUID getType() {
+ return type;
+ }
+
+ public List getContacts() {
+ return contacts;
+ }
+ }
+ }
+
+ public static class Template {
+
+ private final TemplateCache templateCache;
+
+ private final List flows;
+
+ public Template(TemplateCache templateCache, List flows) {
+ this.templateCache = templateCache;
+ this.flows = flows;
+ }
+
+ public TemplateCache getTemplateCache() {
+ return templateCache;
+ }
+
+ public List getFlows() {
+ return flows;
+ }
+
+ public static class TemplateCache {
+
+ private final String prefix;
+
+ private final String keyPattern;
+
+ public TemplateCache(String prefix, String keyPattern) {
+ this.prefix = prefix;
+ this.keyPattern = keyPattern;
+ }
+
+ public String getPrefix() {
+ return prefix;
+ }
+
+ public String getKeyPattern() {
+ return keyPattern;
+ }
+ }
+ }
+
+ public static class StaticFieldItems {
+
+ private final List Fields;
+
+ public StaticFieldItems(List fields) {
+ Fields = fields;
+ }
+
+ public List getFields() {
+ return Fields;
+ }
+ }
+
+ public static class Field {
+
+ private final String key;
+
+ private final String type;
+
+ private final String value;
+
+ public Field(String key, String type, String value) {
+ this.key = key;
+ this.type = type;
+ this.value = value;
+ }
+
+ public String getKey() {
+ return key;
+ }
+
+ public String getType() {
+ return type;
+ }
+
+ public String getValue() {
+ return value;
+ }
+ }
+
+ public static class Flow {
+
+ private final UUID key;
+
+ private final String subjectPath;
+
+ private final String subjectKey;
+
+ private final FieldOption subjectFieldOptions;
+
+ private final String bodyPath;
+
+ private final String bodyKey;
+
+ private final FieldOption bodyFieldOptions;
+
+ private final List cc;
+
+ private final EmailOverrideMode ccMode;
+
+ private final List bcc;
+
+ private final EmailOverrideMode bccMode;
+
+ private final Boolean allowAttachments;
+
+ private final List cipherFields;
+
+ private final String priorityKey;
+
+ private final List extraDataKeys;
+
+ public Flow(UUID key, String subjectPath, String subjectKey, FieldOption subjectFieldOptions, String bodyPath, String bodyKey, FieldOption bodyFieldOptions, List cc, EmailOverrideMode ccMode, List bcc, EmailOverrideMode bccMode, Boolean allowAttachments, List cipherFields, String priorityKey, List extraDataKeys) {
+ this.key = key;
+ this.subjectPath = subjectPath;
+ this.subjectKey = subjectKey;
+ this.subjectFieldOptions = subjectFieldOptions;
+ this.bodyPath = bodyPath;
+ this.bodyKey = bodyKey;
+ this.bodyFieldOptions = bodyFieldOptions;
+ this.cc = cc;
+ this.ccMode = ccMode;
+ this.bcc = bcc;
+ this.bccMode = bccMode;
+ this.allowAttachments = allowAttachments;
+ this.cipherFields = cipherFields;
+ this.priorityKey = priorityKey;
+ this.extraDataKeys = extraDataKeys;
+ }
+
+ public UUID getKey() {
+ return key;
+ }
+
+ public String getSubjectPath() {
+ return subjectPath;
+ }
+
+ public String getSubjectKey() {
+ return subjectKey;
+ }
+
+ public FieldOption getSubjectFieldOptions() {
+ return subjectFieldOptions;
+ }
+
+ public String getBodyPath() {
+ return bodyPath;
+ }
+
+ public String getBodyKey() {
+ return bodyKey;
+ }
+
+ public FieldOption getBodyFieldOptions() {
+ return bodyFieldOptions;
+ }
+
+ public List getCc() {
+ return cc;
+ }
+
+ public EmailOverrideMode getCcMode() {
+ return ccMode;
+ }
+
+ public List getBcc() {
+ return bcc;
+ }
+
+ public EmailOverrideMode getBccMode() {
+ return bccMode;
+ }
+
+ public Boolean getAllowAttachments() {
+ return allowAttachments;
+ }
+
+ public List getCipherFields() {
+ return cipherFields;
+ }
+
+ public String getPriorityKey() {
+ return priorityKey;
+ }
+
+ public List getExtraDataKeys() {
+ return extraDataKeys;
+ }
+
+ public static class FieldOption {
+
+ private final List mandatory;
+
+ private final List optional;
+
+ private final Map formatting;
+
+ public FieldOption(List mandatory, List optional, Map formatting) {
+ this.mandatory = mandatory;
+ this.optional = optional;
+ this.formatting = formatting;
+ }
+
+ public List getMandatory() {
+ return mandatory;
+ }
+
+ public List getOptional() {
+ return optional;
+ }
+
+ public Map getFormatting() {
+ return formatting;
+ }
+
+ }
+ }
}
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/InAppNotificationEntity.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/InAppNotificationEntity.java
index ad43ac87f..2fdb75a32 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/InAppNotificationEntity.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/InAppNotificationEntity.java
@@ -8,7 +8,7 @@ import gr.cite.notification.data.conventers.IsActiveConverter;
import gr.cite.notification.data.conventers.NotificationInAppTrackingConverter;
import gr.cite.notification.data.tenant.TenantScopedBaseEntity;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.time.Instant;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/LanguageEntity.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/LanguageEntity.java
index cbd2f4e8d..3c8d8f4bf 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/LanguageEntity.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/LanguageEntity.java
@@ -4,7 +4,7 @@ import gr.cite.notification.common.enums.IsActive;
import gr.cite.notification.data.conventers.IsActiveConverter;
import gr.cite.notification.data.tenant.TenantScopedBaseEntity;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.time.Instant;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/NotificationEntity.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/NotificationEntity.java
index f4925acbc..b6fee25a3 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/NotificationEntity.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/NotificationEntity.java
@@ -4,7 +4,7 @@ import gr.cite.notification.common.enums.*;
import gr.cite.notification.data.conventers.*;
import gr.cite.notification.data.tenant.TenantScopedBaseEntity;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.time.Instant;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/NotificationTemplateEntity.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/NotificationTemplateEntity.java
index 393794885..6e7db21c1 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/NotificationTemplateEntity.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/NotificationTemplateEntity.java
@@ -4,7 +4,7 @@ import gr.cite.notification.common.enums.*;
import gr.cite.notification.data.conventers.*;
import gr.cite.notification.data.tenant.TenantScopedBaseEntity;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.time.Instant;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/QueueInboxEntity.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/QueueInboxEntity.java
index ac0cf52ce..9fee15112 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/QueueInboxEntity.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/QueueInboxEntity.java
@@ -5,7 +5,7 @@ import gr.cite.notification.data.conventers.IsActiveConverter;
import gr.cite.queueinbox.entity.QueueInbox;
import gr.cite.queueinbox.entity.QueueInboxStatus;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.time.Instant;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/QueueOutboxEntity.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/QueueOutboxEntity.java
index 4ebf0a938..a5dac204d 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/QueueOutboxEntity.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/QueueOutboxEntity.java
@@ -6,7 +6,7 @@ import gr.cite.notification.data.conventers.IsActiveConverter;
import gr.cite.queueoutbox.entity.QueueOutbox;
import gr.cite.queueoutbox.entity.QueueOutboxNotifyStatus;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.time.Instant;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/TenantConfigurationEntity.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/TenantConfigurationEntity.java
index b7744dd08..2377a11d5 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/TenantConfigurationEntity.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/TenantConfigurationEntity.java
@@ -6,7 +6,7 @@ import gr.cite.notification.data.conventers.IsActiveConverter;
import gr.cite.notification.data.conventers.TenantConfigurationTypeConverter;
import gr.cite.notification.data.tenant.TenantScopedBaseEntity;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.time.Instant;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/TenantEntity.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/TenantEntity.java
index 74bb43f5e..297da6dc1 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/TenantEntity.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/TenantEntity.java
@@ -3,7 +3,7 @@ package gr.cite.notification.data;
import gr.cite.notification.common.enums.IsActive;
import gr.cite.notification.data.conventers.IsActiveConverter;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.time.Instant;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/TenantScopedEntityManager.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/TenantScopedEntityManager.java
index a1406480c..b5c1a866f 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/TenantScopedEntityManager.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/TenantScopedEntityManager.java
@@ -10,10 +10,10 @@ import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Service;
import javax.management.InvalidApplicationException;
-import javax.persistence.EntityManager;
-import javax.persistence.FlushModeType;
-import javax.persistence.PersistenceContext;
-import javax.persistence.Query;
+import jakarta.persistence.EntityManager;
+import jakarta.persistence.FlushModeType;
+import jakarta.persistence.PersistenceContext;
+import jakarta.persistence.Query;
import java.util.UUID;
@Service
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/TenantUserEntity.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/TenantUserEntity.java
index a0823546d..257689196 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/TenantUserEntity.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/TenantUserEntity.java
@@ -4,7 +4,7 @@ import gr.cite.notification.common.enums.IsActive;
import gr.cite.notification.data.conventers.IsActiveConverter;
import gr.cite.notification.data.tenant.TenantScopedBaseEntity;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.time.Instant;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/UserContactInfoEntity.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/UserContactInfoEntity.java
index 678d3aa78..08a8da048 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/UserContactInfoEntity.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/UserContactInfoEntity.java
@@ -4,7 +4,7 @@ import gr.cite.notification.common.enums.ContactInfoType;
import gr.cite.notification.data.conventers.ContactInfoTypeConverter;
import gr.cite.notification.data.tenant.TenantScopedBaseEntity;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.time.Instant;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/UserCredentialEntity.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/UserCredentialEntity.java
index ebd5b44f1..ca4053893 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/UserCredentialEntity.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/UserCredentialEntity.java
@@ -3,7 +3,7 @@ package gr.cite.notification.data;
import gr.cite.notification.data.tenant.TenantScopedBaseEntity;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.time.Instant;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/UserEntity.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/UserEntity.java
index 20b69be02..fd38203ed 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/UserEntity.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/UserEntity.java
@@ -3,7 +3,7 @@ package gr.cite.notification.data;
import gr.cite.notification.common.enums.IsActive;
import gr.cite.notification.data.conventers.IsActiveConverter;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.time.Instant;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/UserNotificationPreferenceEntity.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/UserNotificationPreferenceEntity.java
index 05d1e149c..331f22523 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/UserNotificationPreferenceEntity.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/UserNotificationPreferenceEntity.java
@@ -5,7 +5,7 @@ import gr.cite.notification.data.composite.CompositeUserNotificationPreferenceId
import gr.cite.notification.data.conventers.NotificationContactTypeConverter;
import gr.cite.notification.data.tenant.TenantScopedBaseEntity;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.time.Instant;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/UserRoleEntity.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/UserRoleEntity.java
index 1a4cbc9c2..cbc808350 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/UserRoleEntity.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/UserRoleEntity.java
@@ -3,7 +3,7 @@ package gr.cite.notification.data;
import gr.cite.notification.data.tenant.TenantScopedBaseEntity;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.time.Instant;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/ContactInfoTypeConverter.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/ContactInfoTypeConverter.java
index 5a2859c6f..76617646e 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/ContactInfoTypeConverter.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/ContactInfoTypeConverter.java
@@ -2,7 +2,7 @@ package gr.cite.notification.data.conventers;
import gr.cite.notification.common.enums.ContactInfoType;
-import javax.persistence.Converter;
+import jakarta.persistence.Converter;
@Converter
public class ContactInfoTypeConverter extends DatabaseEnumConverter{
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/DatabaseEnumConverter.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/DatabaseEnumConverter.java
index 0962df9fc..6cb0dd82c 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/DatabaseEnumConverter.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/DatabaseEnumConverter.java
@@ -1,8 +1,8 @@
package gr.cite.notification.data.conventers;
-import javax.persistence.AttributeConverter;
-import javax.persistence.Converter;
+import jakarta.persistence.AttributeConverter;
+import jakarta.persistence.Converter;
@Converter
public abstract class DatabaseEnumConverter, T> implements AttributeConverter {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/InAppNotificationPriorityConverter.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/InAppNotificationPriorityConverter.java
index 6bc531660..42a43d3b1 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/InAppNotificationPriorityConverter.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/InAppNotificationPriorityConverter.java
@@ -2,7 +2,7 @@ package gr.cite.notification.data.conventers;
import gr.cite.notification.common.enums.InAppNotificationPriority;
-import javax.persistence.Converter;
+import jakarta.persistence.Converter;
@Converter
public class InAppNotificationPriorityConverter extends DatabaseEnumConverter {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/IsActiveConverter.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/IsActiveConverter.java
index cf8b1a095..b761adc7e 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/IsActiveConverter.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/IsActiveConverter.java
@@ -3,7 +3,7 @@ package gr.cite.notification.data.conventers;
import gr.cite.notification.common.enums.IsActive;
-import javax.persistence.Converter;
+import jakarta.persistence.Converter;
@Converter
public class IsActiveConverter extends DatabaseEnumConverter {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationContactTypeConverter.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationContactTypeConverter.java
index 889c4a81b..ad21a70a3 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationContactTypeConverter.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationContactTypeConverter.java
@@ -3,7 +3,7 @@ package gr.cite.notification.data.conventers;
import gr.cite.notification.common.enums.NotificationContactType;
-import javax.persistence.Converter;
+import jakarta.persistence.Converter;
@Converter
public class NotificationContactTypeConverter extends DatabaseEnumConverter {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationInAppTrackingConverter.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationInAppTrackingConverter.java
index 831281c9a..1ed3bb9e1 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationInAppTrackingConverter.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationInAppTrackingConverter.java
@@ -2,7 +2,7 @@ package gr.cite.notification.data.conventers;
import gr.cite.notification.common.enums.NotificationInAppTracking;
-import javax.persistence.Converter;
+import jakarta.persistence.Converter;
@Converter
public class NotificationInAppTrackingConverter extends DatabaseEnumConverter {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationNotifyStateConverter.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationNotifyStateConverter.java
index 1a03b8726..7116e9b39 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationNotifyStateConverter.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationNotifyStateConverter.java
@@ -3,7 +3,7 @@ package gr.cite.notification.data.conventers;
import gr.cite.notification.common.enums.NotificationNotifyState;
-import javax.persistence.Converter;
+import jakarta.persistence.Converter;
@Converter
public class NotificationNotifyStateConverter extends DatabaseEnumConverter {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationTemplateChannelConverter.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationTemplateChannelConverter.java
index 0b0c6fc4f..a18b99656 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationTemplateChannelConverter.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationTemplateChannelConverter.java
@@ -4,7 +4,7 @@ package gr.cite.notification.data.conventers;
import gr.cite.notification.common.enums.NotificationTemplateChannel;
-import javax.persistence.Converter;
+import jakarta.persistence.Converter;
@Converter
public class NotificationTemplateChannelConverter extends DatabaseEnumConverter {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationTemplateKindConverter.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationTemplateKindConverter.java
index a4f355b58..4d6f1cce2 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationTemplateKindConverter.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationTemplateKindConverter.java
@@ -3,7 +3,7 @@ package gr.cite.notification.data.conventers;
import gr.cite.notification.common.enums.NotificationTemplateKind;
-import javax.persistence.Converter;
+import jakarta.persistence.Converter;
@Converter
public class NotificationTemplateKindConverter extends DatabaseEnumConverter {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationTrackingProcessConverter.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationTrackingProcessConverter.java
index 64e7ada64..c85a83240 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationTrackingProcessConverter.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationTrackingProcessConverter.java
@@ -2,7 +2,7 @@ package gr.cite.notification.data.conventers;
import gr.cite.notification.common.enums.NotificationTrackingProcess;
-import javax.persistence.Converter;
+import jakarta.persistence.Converter;
@Converter
public class NotificationTrackingProcessConverter extends DatabaseEnumConverter {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationTrackingStateConverter.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationTrackingStateConverter.java
index 25109651f..290639cda 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationTrackingStateConverter.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/NotificationTrackingStateConverter.java
@@ -3,7 +3,7 @@ package gr.cite.notification.data.conventers;
import gr.cite.notification.common.enums.NotificationTrackingState;
-import javax.persistence.Converter;
+import jakarta.persistence.Converter;
@Converter
public class NotificationTrackingStateConverter extends DatabaseEnumConverter {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/TenantConfigurationTypeConverter.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/TenantConfigurationTypeConverter.java
index 2ade1f572..d0ed545cb 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/TenantConfigurationTypeConverter.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/conventers/TenantConfigurationTypeConverter.java
@@ -3,7 +3,7 @@ package gr.cite.notification.data.conventers;
import gr.cite.notification.common.enums.TenantConfigurationType;
-import javax.persistence.Converter;
+import jakarta.persistence.Converter;
@Converter
public class TenantConfigurationTypeConverter extends DatabaseEnumConverter {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/tenant/TenantFilterAspect.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/tenant/TenantFilterAspect.java
index 5c6f90bab..468755369 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/tenant/TenantFilterAspect.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/tenant/TenantFilterAspect.java
@@ -12,7 +12,7 @@ import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
import javax.management.InvalidApplicationException;
-import javax.persistence.EntityManager;
+import jakarta.persistence.EntityManager;
@Aspect
@Component
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/tenant/TenantListener.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/tenant/TenantListener.java
index 57d59ae06..a7c9901d3 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/tenant/TenantListener.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/tenant/TenantListener.java
@@ -8,9 +8,9 @@ import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import javax.management.InvalidApplicationException;
-import javax.persistence.PrePersist;
-import javax.persistence.PreRemove;
-import javax.persistence.PreUpdate;
+import jakarta.persistence.PrePersist;
+import jakarta.persistence.PreRemove;
+import jakarta.persistence.PreUpdate;
import java.util.UUID;
public class TenantListener {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/tenant/TenantScopedBaseEntity.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/tenant/TenantScopedBaseEntity.java
index 01705eb10..070497032 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/tenant/TenantScopedBaseEntity.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/data/tenant/TenantScopedBaseEntity.java
@@ -5,9 +5,9 @@ import org.hibernate.annotations.Filter;
import org.hibernate.annotations.FilterDef;
import org.hibernate.annotations.ParamDef;
-import javax.persistence.Column;
-import javax.persistence.EntityListeners;
-import javax.persistence.MappedSuperclass;
+import jakarta.persistence.Column;
+import jakarta.persistence.EntityListeners;
+import jakarta.persistence.MappedSuperclass;
import java.io.Serializable;
import java.util.UUID;
@@ -15,17 +15,22 @@ import java.util.UUID;
//@Getter
//@Setter
//@NoArgsConstructor
-@FilterDef(name = TenantScopedBaseEntity.tenantFilter, parameters = {@ParamDef(name = TenantScopedBaseEntity.tenantFilterTenantParam, type = "string")})
+@FilterDef(name = TenantScopedBaseEntity.tenantFilter, parameters = {@ParamDef(name = TenantScopedBaseEntity.tenantFilterTenantParam, type = String.class)})
@Filter(name = "tenantFilter", condition = "tenant = (cast(:tenantId as uuid))")
@EntityListeners(TenantListener.class)
public abstract class TenantScopedBaseEntity implements TenantScoped, Serializable {
+
private static final long serialVersionUID = 1L;
+
public static final String tenantFilter = "tenantFilter";
+
public static final String tenantFilterTenantParam = "tenantId";
@Column(name = "tenant", columnDefinition = "uuid", nullable = true)
private UUID tenantId;
+
public static final String _tenantId = "tenantId";
+
public UUID getTenantId() {
return tenantId;
}
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/AppRabbitConfigurer.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/AppRabbitConfigurer.java
index cfe2ecd6e..753d7db09 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/AppRabbitConfigurer.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/AppRabbitConfigurer.java
@@ -41,7 +41,7 @@ public class AppRabbitConfigurer extends RabbitConfigurer {
return new InboxBindings(bindingItems);
}
- @Bean
+ @Bean(name = "InboxCreator")
public InboxCreator inboxCreator() {
return (params) -> {
InboxRepository inboxRepository = this.applicationContext.getBean(InboxRepository.class);
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/InboxIntegrationEventConfigurer.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/InboxIntegrationEventConfigurer.java
new file mode 100644
index 000000000..ec7abfd6a
--- /dev/null
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/InboxIntegrationEventConfigurer.java
@@ -0,0 +1,34 @@
+package gr.cite.notification.integrationevent;
+
+import gr.cite.notification.integrationevent.inbox.InboxProperties;
+import gr.cite.notification.integrationevent.inbox.InboxRepositoryImpl;
+import gr.cite.queueinbox.InboxConfigurer;
+import gr.cite.queueinbox.repository.InboxRepository;
+import jakarta.persistence.EntityManagerFactory;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+import org.springframework.context.annotation.DependsOn;
+import org.springframework.stereotype.Component;
+
+@Configuration
+@EnableConfigurationProperties({InboxProperties.class})
+@ConditionalOnProperty(prefix = "queue.task.listener", name = "enable", matchIfMissing = false)
+public class InboxIntegrationEventConfigurer extends InboxConfigurer {
+ private ApplicationContext applicationContext;
+ private InboxProperties inboxProperties;
+
+ public InboxIntegrationEventConfigurer(ApplicationContext applicationContext, InboxProperties inboxProperties) {
+ this.applicationContext = applicationContext;
+ this.inboxProperties = inboxProperties;
+ }
+
+ @Bean
+ public InboxRepository inboxRepositoryCreator() {
+ return new InboxRepositoryImpl(this.applicationContext, this.inboxProperties);
+ }
+
+}
+
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/OutboxIntegrationEventConfigurer.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/OutboxIntegrationEventConfigurer.java
new file mode 100644
index 000000000..70ebc5361
--- /dev/null
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/OutboxIntegrationEventConfigurer.java
@@ -0,0 +1,68 @@
+package gr.cite.notification.integrationevent;
+
+import gr.cite.notification.integrationevent.outbox.OutboxProperties;
+import gr.cite.notification.integrationevent.outbox.OutboxRepositoryImpl;
+import gr.cite.queueoutbox.IntegrationEventContextCreator;
+import gr.cite.queueoutbox.OutboxConfigurer;
+import gr.cite.queueoutbox.repository.OutboxRepository;
+import gr.cite.rabbitmq.IntegrationEventMessageConstants;
+import gr.cite.rabbitmq.RabbitProperties;
+import gr.cite.rabbitmq.broker.MessageHydrator;
+import org.springframework.amqp.core.MessageProperties;
+import org.springframework.boot.autoconfigure.condition.ConditionalOnProperty;
+import org.springframework.boot.context.properties.EnableConfigurationProperties;
+import org.springframework.context.ApplicationContext;
+import org.springframework.context.annotation.Bean;
+import org.springframework.context.annotation.Configuration;
+
+import java.nio.charset.StandardCharsets;
+import java.time.Instant;
+import java.util.Date;
+import java.util.UUID;
+
+@Configuration
+@EnableConfigurationProperties({OutboxProperties.class})
+@ConditionalOnProperty(prefix = "queue.task.publisher", name = "enable", matchIfMissing = false)
+public class OutboxIntegrationEventConfigurer extends OutboxConfigurer {
+ private ApplicationContext applicationContext;
+ private OutboxProperties outboxProperties;
+
+ public OutboxIntegrationEventConfigurer(ApplicationContext applicationContext, OutboxProperties outboxProperties) {
+ this.applicationContext = applicationContext;
+ this.outboxProperties = outboxProperties;
+ }
+
+ @Bean
+ public MessageHydrator messageHydrator(RabbitProperties rabbitProperties) {
+ return (message, event, eventContext) -> {
+ MessageProperties messageProperties = message.getMessageProperties();
+ messageProperties.setAppId(rabbitProperties.getAppId());
+ messageProperties.setContentEncoding(StandardCharsets.UTF_8.displayName());
+ messageProperties.setContentType(MessageProperties.CONTENT_TYPE_JSON);
+ //messageProperties.setUserId(userContext.getCurrentUser().toString());
+ messageProperties.setTimestamp(Date.from(Instant.now()));
+ messageProperties.setMessageId(event.getMessageId().toString());
+
+ if (eventContext != null) {
+ UUID tenant = ((IntegrationEventContextImpl) eventContext).getTenant();
+ if (tenant != null) {
+ messageProperties.setHeader(IntegrationEventMessageConstants.TENANT, tenant);
+ }
+ }
+
+ return message;
+ };
+ }
+
+ @Bean
+ public IntegrationEventContextCreator integrationEventContextCreator() {
+ return (message) -> new IntegrationEventContextImpl();
+ }
+
+ @Bean
+ public OutboxRepository outboxRepositoryCreator() {
+ return new OutboxRepositoryImpl(this.applicationContext, this.outboxProperties);
+ }
+}
+
+
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/inbox/InboxProperties.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/inbox/InboxProperties.java
index 3d257f8aa..18e14699b 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/inbox/InboxProperties.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/inbox/InboxProperties.java
@@ -1,33 +1,22 @@
package gr.cite.notification.integrationevent.inbox;
import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.boot.context.properties.ConstructorBinding;
-import org.springframework.validation.annotation.Validated;
-import javax.validation.constraints.NotNull;
import java.util.List;
-@Validated
@ConfigurationProperties(prefix = "queue.task.listener.options")
-@ConstructorBinding
public class InboxProperties {
- @NotNull
private final String exchange;
- @NotNull
private final List notifyTopic;
- @NotNull
private final List tenantRemovalTopic;
- @NotNull
private final List tenantTouchedTopic;
- @NotNull
private final List userRemovalTopic;
- @NotNull
private final List userTouchedTopic;
public InboxProperties(
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/outbox/OutboxIntegrationEvent.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/outbox/OutboxIntegrationEvent.java
new file mode 100644
index 000000000..5961fe016
--- /dev/null
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/outbox/OutboxIntegrationEvent.java
@@ -0,0 +1,19 @@
+package gr.cite.notification.integrationevent.outbox;
+
+import com.fasterxml.jackson.annotation.JsonIgnoreProperties;
+import gr.cite.notification.integrationevent.TrackedEvent;
+import gr.cite.rabbitmq.IntegrationEvent;
+
+@JsonIgnoreProperties(ignoreUnknown = true)
+public class OutboxIntegrationEvent extends IntegrationEvent {
+ private TrackedEvent event;
+
+ public TrackedEvent getEvent() {
+ return event;
+ }
+
+ public void setEvent(TrackedEvent event) {
+ this.event = event;
+ }
+
+}
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/outbox/OutboxProperties.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/outbox/OutboxProperties.java
index f1725a708..af5e77173 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/outbox/OutboxProperties.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/outbox/OutboxProperties.java
@@ -1,60 +1,35 @@
package gr.cite.notification.integrationevent.outbox;
import org.springframework.boot.context.properties.ConfigurationProperties;
-import org.springframework.validation.annotation.Validated;
-import javax.validation.constraints.NotNull;
-
-@Validated
@ConfigurationProperties(prefix = "queue.task.publisher.options")
public class OutboxProperties {
- @NotNull
private final String exchange;
- @NotNull
private final String tenantTouchTopic;
- @NotNull
private final String tenantRemovalTopic;
- @NotNull
- private final String tenantReactivationTopic;
+ private final String userTouchTopic;
- @NotNull
- private final String tenantUserInviteTopic;
+ private final String userRemovalTopic;
- @NotNull
private final String notifyTopic;
- @NotNull
- private final String forgetMeCompletedTopic;
-
- @NotNull
- private final String whatYouKnowAboutMeCompletedTopic;
-
- @NotNull
- private final String generateFileTopic;
-
public OutboxProperties(String exchange,
String tenantTouchTopic,
String tenantRemovalTopic,
- String tenantReactivationTopic,
- String tenantUserInviteTopic,
- String notifyTopic,
- String forgetMeCompletedTopic,
- String whatYouKnowAboutMeCompletedTopic,
- String generateFileTopic
+ String userTouchTopic,
+ String userRemovalTopic,
+ String notifyTopic
) {
this.exchange = exchange;
this.tenantTouchTopic = tenantTouchTopic;
this.tenantRemovalTopic = tenantRemovalTopic;
- this.tenantReactivationTopic = tenantReactivationTopic;
- this.tenantUserInviteTopic = tenantUserInviteTopic;
+ this.userTouchTopic = userTouchTopic;
+ this.userRemovalTopic = userRemovalTopic;
this.notifyTopic = notifyTopic;
- this.forgetMeCompletedTopic = forgetMeCompletedTopic;
- this.whatYouKnowAboutMeCompletedTopic = whatYouKnowAboutMeCompletedTopic;
- this.generateFileTopic = generateFileTopic;
}
public String getExchange() {
@@ -69,27 +44,15 @@ public class OutboxProperties {
return tenantRemovalTopic;
}
- public String getTenantReactivationTopic() {
- return tenantReactivationTopic;
+ public String getUserTouchTopic() {
+ return userTouchTopic;
}
- public String getTenantUserInviteTopic() {
- return tenantUserInviteTopic;
+ public String getUserRemovalTopic() {
+ return userRemovalTopic;
}
public String getNotifyTopic() {
return notifyTopic;
}
-
- public String getForgetMeCompletedTopic() {
- return forgetMeCompletedTopic;
- }
-
- public String getWhatYouKnowAboutMeCompletedTopic() {
- return whatYouKnowAboutMeCompletedTopic;
- }
-
- public String getGenerateFileTopic() {
- return generateFileTopic;
- }
}
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/outbox/OutboxRepositoryImpl.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/outbox/OutboxRepositoryImpl.java
new file mode 100644
index 000000000..8bdc8fdb0
--- /dev/null
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/integrationevent/outbox/OutboxRepositoryImpl.java
@@ -0,0 +1,397 @@
+package gr.cite.notification.integrationevent.outbox;
+
+import gr.cite.notification.common.JsonHandlingService;
+import gr.cite.notification.common.enums.IsActive;
+import gr.cite.notification.common.scope.fake.FakeRequestScope;
+import gr.cite.notification.data.QueueOutboxEntity;
+import gr.cite.notification.query.QueueOutboxQuery;
+import gr.cite.queueoutbox.entity.QueueOutbox;
+import gr.cite.queueoutbox.entity.QueueOutboxNotifyStatus;
+import gr.cite.queueoutbox.repository.CandidateInfo;
+import gr.cite.queueoutbox.repository.OutboxRepository;
+import gr.cite.queueoutbox.task.MessageOptions;
+import gr.cite.rabbitmq.IntegrationEvent;
+import gr.cite.tools.data.query.Ordering;
+import gr.cite.tools.data.query.QueryFactory;
+import gr.cite.tools.logging.LoggerService;
+import jakarta.persistence.EntityManager;
+import jakarta.persistence.EntityManagerFactory;
+import jakarta.persistence.EntityTransaction;
+import jakarta.persistence.OptimisticLockException;
+import org.slf4j.LoggerFactory;
+import org.springframework.context.ApplicationContext;
+import org.springframework.stereotype.Component;
+
+import java.time.Instant;
+import java.util.List;
+import java.util.Random;
+import java.util.UUID;
+import java.util.function.Function;
+import java.util.stream.Collectors;
+
+public class OutboxRepositoryImpl implements OutboxRepository {
+
+ protected final ApplicationContext applicationContext;
+ private final Random random = new Random();
+ private static final LoggerService logger = new LoggerService(LoggerFactory.getLogger(OutboxRepositoryImpl.class));
+ private final JsonHandlingService jsonHandlingService;
+ private final OutboxProperties outboxProperties;
+
+ public OutboxRepositoryImpl(
+ ApplicationContext applicationContext,
+ OutboxProperties outboxProperties
+ ) {
+ this.applicationContext = applicationContext;
+ this.jsonHandlingService = this.applicationContext.getBean(JsonHandlingService.class);
+ this.outboxProperties = outboxProperties;
+ }
+
+ @Override
+ public CandidateInfo candidate(Instant lastCandidateCreationTimestamp, MessageOptions messageOptions, Function onConfirmTimeout) {
+ EntityTransaction transaction = null;
+ EntityManager entityManager = null;
+ CandidateInfo candidate = null;
+ try (FakeRequestScope ignored = new FakeRequestScope()) {
+ try {
+ QueryFactory queryFactory = this.applicationContext.getBean(QueryFactory.class);
+ EntityManagerFactory entityManagerFactory = this.applicationContext.getBean(EntityManagerFactory.class);
+ entityManager = entityManagerFactory.createEntityManager();
+
+ transaction = entityManager.getTransaction();
+ transaction.begin();
+
+ QueueOutboxEntity item = queryFactory.query(QueueOutboxQuery.class)
+ .isActives(IsActive.Active)
+ .notifyStatus(QueueOutboxNotifyStatus.PENDING, QueueOutboxNotifyStatus.WAITING_CONFIRMATION, QueueOutboxNotifyStatus.ERROR)
+ .retryThreshold(messageOptions.getRetryThreashold())
+ .confirmTimeout(messageOptions.getConfirmTimeoutSeconds())
+ .createdAfter(lastCandidateCreationTimestamp)
+ .ordering(new Ordering().addAscending(QueueOutboxEntity._createdAt))
+ .first();
+
+ if (item != null) {
+ boolean confirmTimeout = onConfirmTimeout.apply(item);
+
+ QueueOutboxNotifyStatus prevState = item.getNotifyStatus();
+ item.setNotifyStatus(QueueOutboxNotifyStatus.PROCESSING);
+
+ entityManager.merge(item);
+ entityManager.flush();
+
+ candidate = new CandidateInfo();
+ candidate.setId(item.getId());
+ candidate.setCreatedAt(item.getCreatedAt());
+ candidate.setPreviousState(prevState);
+ }
+
+ transaction.commit();
+ } catch (OptimisticLockException ex) {
+ // we get this if/when someone else already modified the notifications. We want to essentially ignore this, and keep working
+ logger.debug("Concurrency exception getting queue outbox. Skipping: {} ", ex.getMessage());
+ if (transaction != null) transaction.rollback();
+ candidate = null;
+ } catch (Exception ex) {
+ logger.error("Problem getting list of queue outbox. Skipping: {}", ex.getMessage(), ex);
+ if (transaction != null) transaction.rollback();
+ candidate = null;
+ } finally {
+ if (entityManager != null) entityManager.close();
+ }
+ } catch (Exception ex) {
+ logger.error("Problem getting list of queue outbox. Skipping: {}", ex.getMessage(), ex);
+ }
+
+ return candidate;
+ }
+
+ @Override
+ public Boolean shouldOmit(CandidateInfo candidate, Function shouldOmit) {
+ EntityTransaction transaction = null;
+ EntityManager entityManager = null;
+ boolean success = false;
+
+ try (FakeRequestScope ignored = new FakeRequestScope()) {
+ try {
+ EntityManagerFactory entityManagerFactory = this.applicationContext.getBean(EntityManagerFactory.class);
+
+ entityManager = entityManagerFactory.createEntityManager();
+ transaction = entityManager.getTransaction();
+
+ transaction.begin();
+
+ QueryFactory queryFactory = this.applicationContext.getBean(QueryFactory.class);
+ QueueOutboxEntity item = queryFactory.query(QueueOutboxQuery.class).ids(candidate.getId()).first();
+
+ if (item == null) {
+ logger.warn("Could not lookup queue outbox {} to process. Continuing...", candidate.getId());
+ } else {
+ if (shouldOmit.apply(item)) {
+ item.setNotifyStatus(QueueOutboxNotifyStatus.OMITTED);
+
+ entityManager.merge(item);
+ entityManager.flush();
+ success = true;
+ }
+ }
+
+ transaction.commit();
+ } catch (Exception ex) {
+ logger.error("Problem executing purge. rolling back any db changes and marking error. Continuing...", ex);
+ if (transaction != null) transaction.rollback();
+ success = false;
+ } finally {
+ if (entityManager != null) entityManager.close();
+ }
+ } catch (Exception ex) {
+ logger.error("Problem executing purge. rolling back any db changes and marking error. Continuing...", ex);
+ }
+ return success;
+ }
+
+ @Override
+ public Boolean shouldWait(CandidateInfo candidate, Function itIsTimeFunc) {
+ EntityTransaction transaction = null;
+ EntityManager entityManager = null;
+ boolean success = false;
+
+ try (FakeRequestScope ignored = new FakeRequestScope()) {
+ try {
+ EntityManagerFactory entityManagerFactory = this.applicationContext.getBean(EntityManagerFactory.class);
+
+ entityManager = entityManagerFactory.createEntityManager();
+ transaction = entityManager.getTransaction();
+
+ transaction.begin();
+
+ QueryFactory queryFactory = this.applicationContext.getBean(QueryFactory.class);
+ QueueOutboxEntity item = queryFactory.query(QueueOutboxQuery.class).ids(candidate.getId()).first();
+
+ if (item.getRetryCount() != null && item.getRetryCount() >= 1) {
+ Boolean itIsTime = itIsTimeFunc.apply(item);
+
+ if (!itIsTime) {
+ item.setNotifyStatus(candidate.getPreviousState());
+
+ entityManager.merge(item);
+ entityManager.flush();
+ success = true;
+ }
+
+ success = !itIsTime;
+ }
+ transaction.commit();
+ } catch (Exception ex) {
+ logger.error("Problem executing purge. rolling back any db changes and marking error. Continuing...", ex);
+ if (transaction != null) transaction.rollback();
+ success = false;
+ } finally {
+ if (entityManager != null) entityManager.close();
+ }
+ } catch (Exception ex) {
+ logger.error("Problem executing purge. rolling back any db changes and marking error. Continuing...", ex);
+ }
+ return success;
+ }
+
+ @Override
+ public Boolean process(CandidateInfo candidateInfo, Boolean isAutoconfirmOnPublish, Function publish) {
+ EntityTransaction transaction = null;
+ EntityManager entityManager = null;
+ Boolean success = false;
+
+ try (FakeRequestScope ignored = new FakeRequestScope()) {
+ try {
+
+ EntityManagerFactory entityManagerFactory = this.applicationContext.getBean(EntityManagerFactory.class);
+
+ entityManager = entityManagerFactory.createEntityManager();
+ transaction = entityManager.getTransaction();
+ transaction.begin();
+
+ QueryFactory queryFactory = this.applicationContext.getBean(QueryFactory.class);
+ QueueOutboxEntity item = queryFactory.query(QueueOutboxQuery.class).ids(candidateInfo.getId()).first();
+
+ if (item == null) {
+ logger.warn("Could not lookup queue outbox {} to process. Continuing...", candidateInfo.getId());
+ } else {
+
+ success = publish.apply(item);
+ if (success) {
+ if (isAutoconfirmOnPublish) {
+ item.setNotifyStatus(QueueOutboxNotifyStatus.CONFIRMED);
+ item.setConfirmedAt(Instant.now());
+ } else {
+ item.setNotifyStatus(QueueOutboxNotifyStatus.WAITING_CONFIRMATION);
+ }
+ item.setPublishedAt(Instant.now());
+ } else {
+ item.setNotifyStatus(QueueOutboxNotifyStatus.ERROR);
+ item.setRetryCount(item.getRetryCount() != null ? item.getRetryCount() + 1 : 0);
+ item.setPublishedAt(null);
+ }
+
+ entityManager.merge(item);
+ entityManager.flush();
+ }
+
+ transaction.commit();
+ } catch (Exception ex) {
+ logger.error("Problem executing purge. rolling back any db changes and marking error. Continuing...", ex);
+ if (transaction != null) transaction.rollback();
+ success = false;
+ } finally {
+ if (entityManager != null) entityManager.close();
+ }
+ } catch (Exception ex) {
+ logger.error("Problem executing purge. rolling back any db changes and marking error. Continuing...", ex);
+ }
+ return success;
+ }
+
+ @Override
+ public void handleConfirm(List confirmedMessages) {
+ EntityTransaction transaction = null;
+ EntityManager entityManager = null;
+
+ try (FakeRequestScope ignored = new FakeRequestScope()) {
+ try {
+
+ EntityManagerFactory entityManagerFactory = this.applicationContext.getBean(EntityManagerFactory.class);
+
+ entityManager = entityManagerFactory.createEntityManager();
+ transaction = entityManager.getTransaction();
+ transaction.begin();
+
+ QueryFactory queryFactory = this.applicationContext.getBean(QueryFactory.class);
+ List queueOutboxMessages = queryFactory.query(QueueOutboxQuery.class).ids(confirmedMessages).collect();
+
+ if (queueOutboxMessages == null) {
+ logger.warn("Could not lookup messages {} to process. Continuing...", String.join(",", confirmedMessages.stream().map(x -> x.toString()).collect(Collectors.toList())));
+ } else {
+
+ for (QueueOutboxEntity queueOutboxMessage : queueOutboxMessages) {
+ queueOutboxMessage.setNotifyStatus(QueueOutboxNotifyStatus.CONFIRMED);
+ queueOutboxMessage.setConfirmedAt(Instant.now());
+ entityManager.merge(queueOutboxMessage);
+ }
+
+ entityManager.flush();
+ }
+
+ transaction.commit();
+ } catch (Exception ex) {
+ logger.error("Problem executing purge. rolling back any db changes and marking error. Continuing...", ex);
+ if (transaction != null) transaction.rollback();
+ } finally {
+ if (entityManager != null) entityManager.close();
+ }
+ } catch (Exception ex) {
+ logger.error("Problem executing purge. rolling back any db changes and marking error. Continuing...", ex);
+ }
+ }
+
+ @Override
+ public void handleNack(List nackedMessages) {
+ EntityTransaction transaction = null;
+ EntityManager entityManager = null;
+
+ try (FakeRequestScope ignored = new FakeRequestScope()) {
+ try {
+
+ EntityManagerFactory entityManagerFactory = this.applicationContext.getBean(EntityManagerFactory.class);
+
+ entityManager = entityManagerFactory.createEntityManager();
+ transaction = entityManager.getTransaction();
+ transaction.begin();
+
+ QueryFactory queryFactory = this.applicationContext.getBean(QueryFactory.class);
+ List queueOutboxMessages = queryFactory.query(QueueOutboxQuery.class).ids(nackedMessages).collect();
+
+ if (queueOutboxMessages == null) {
+ logger.warn("Could not lookup messages {} to process. Continuing...", String.join(",", nackedMessages.stream().map(x -> x.toString()).collect(Collectors.toList())));
+ } else {
+
+ for (QueueOutboxEntity queueOutboxMessage : queueOutboxMessages) {
+ queueOutboxMessage.setNotifyStatus(QueueOutboxNotifyStatus.ERROR);
+ queueOutboxMessage.setRetryCount(queueOutboxMessage.getRetryCount() != null ? queueOutboxMessage.getRetryCount() + 1 : 0);
+ entityManager.merge(queueOutboxMessage);
+ }
+
+ entityManager.flush();
+ }
+
+ transaction.commit();
+ } catch (Exception ex) {
+ logger.error("Problem executing purge. rolling back any db changes and marking error. Continuing...", ex);
+ if (transaction != null) transaction.rollback();
+ } finally {
+ if (entityManager != null) entityManager.close();
+ }
+ } catch (Exception ex) {
+ logger.error("Problem executing purge. rolling back any db changes and marking error. Continuing...", ex);
+ }
+ }
+
+ @Override
+ public QueueOutbox create(IntegrationEvent item) {
+ EntityTransaction transaction = null;
+ EntityManager entityManager = null;
+ boolean success = false;
+ QueueOutboxEntity queueMessage = null;
+ try (FakeRequestScope ignored = new FakeRequestScope()) {
+ try {
+ queueMessage = this.mapEvent((OutboxIntegrationEvent) item);
+ EntityManagerFactory entityManagerFactory = this.applicationContext.getBean(EntityManagerFactory.class);
+
+ entityManager = entityManagerFactory.createEntityManager();
+ transaction = entityManager.getTransaction();
+
+ transaction.begin();
+
+ entityManager.persist(queueMessage);
+ entityManager.flush();
+
+ transaction.commit();
+ } catch (Exception ex) {
+ logger.error("Problem executing purge. rolling back any db changes and marking error. Continuing...", ex);
+ if (transaction != null) transaction.rollback();
+ success = false;
+ } finally {
+ if (entityManager != null) entityManager.close();
+ }
+ } catch (Exception ex) {
+ logger.error("Problem executing purge. rolling back any db changes and marking error. Continuing...", ex);
+ }
+ return queueMessage;
+ }
+
+ private QueueOutboxEntity mapEvent(OutboxIntegrationEvent event) {
+ String routingKey;
+ switch (event.getType()) {
+ default: {
+ logger.error("unrecognized outgoing integration event {}. Skipping...", event.getType());
+ return null;
+ }
+ }
+
+// UUID correlationId = UUID.randomUUID();
+// if (event.getEvent() != null) event.getEvent().setTrackingContextTag(correlationId.toString());
+// event.setMessage(this.jsonHandlingService.toJsonSafe(event.getEvent()));
+// //this._logTrackingService.Trace(correlationId.ToString(), $"Correlating current tracking context with new correlationId {correlationId}");
+//
+// QueueOutboxEntity queueMessage = new QueueOutboxEntity();
+// queueMessage.setId(UUID.randomUUID());
+// queueMessage.setTenantId(null);
+// queueMessage.setExchange(this.outboxProperties.getExchange());
+// queueMessage.setRoute(routingKey);
+// queueMessage.setMessageId(event.getMessageId());
+// queueMessage.setMessage(this.jsonHandlingService.toJsonSafe(event));
+// queueMessage.setIsActive(IsActive.Active);
+// queueMessage.setNotifyStatus(QueueOutboxNotifyStatus.PENDING);
+// queueMessage.setRetryCount(0);
+// queueMessage.setCreatedAt(Instant.now());
+// queueMessage.setUpdatedAt(Instant.now());
+//
+// return queueMessage;
+ }
+}
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/InAppNotification.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/InAppNotification.java
index 7af31d850..dc5569f72 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/InAppNotification.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/InAppNotification.java
@@ -5,7 +5,7 @@ import gr.cite.notification.common.enums.IsActive;
import gr.cite.notification.common.enums.NotificationInAppTracking;
import gr.cite.notification.data.tenant.TenantScopedBaseEntity;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.time.Instant;
import java.util.UUID;
public class InAppNotification {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/Notification.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/Notification.java
index 4db8fbeab..4d0d5b8b2 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/Notification.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/Notification.java
@@ -5,8 +5,8 @@ import gr.cite.notification.data.conventers.IsActiveConverter;
import gr.cite.notification.data.conventers.NotificationTrackingProcessConverter;
import gr.cite.notification.data.conventers.NotificationTrackingStateConverter;
-import javax.persistence.Column;
-import javax.persistence.Convert;
+import jakarta.persistence.Column;
+import jakarta.persistence.Convert;
import java.time.Instant;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/UserNotificationPreference.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/UserNotificationPreference.java
index 797ad7b92..d36614e65 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/UserNotificationPreference.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/UserNotificationPreference.java
@@ -4,7 +4,7 @@ import gr.cite.notification.common.enums.NotificationContactType;
import gr.cite.notification.data.composite.CompositeUserNotificationPreferenceId;
import gr.cite.notification.data.tenant.TenantScopedBaseEntity;
-import javax.persistence.*;
+import jakarta.persistence.*;
import java.time.Instant;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/NotificationPersist.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/NotificationPersist.java
index f2bdc7088..3d88f109d 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/NotificationPersist.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/NotificationPersist.java
@@ -4,7 +4,7 @@ import gr.cite.notification.common.enums.NotificationContactType;
import gr.cite.notification.common.enums.NotificationNotifyState;
import gr.cite.notification.common.validation.ValidId;
-import javax.validation.constraints.NotNull;
+import jakarta.validation.constraints.NotNull;
import java.time.Instant;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/NotificationTemplatePersist.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/NotificationTemplatePersist.java
index c1518fa9c..1803029e6 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/NotificationTemplatePersist.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/NotificationTemplatePersist.java
@@ -6,8 +6,8 @@ import gr.cite.notification.common.validation.ValidEnum;
import gr.cite.notification.common.validation.ValidId;
import gr.cite.notification.model.persist.notificationtemplate.NotificationTemplateValuePersist;
-import javax.validation.Valid;
-import javax.validation.constraints.NotNull;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotNull;
import java.util.UUID;
public class NotificationTemplatePersist {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/TenantTouchedIntegrationEventPersist.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/TenantTouchedIntegrationEventPersist.java
index 695dec029..c2f807d89 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/TenantTouchedIntegrationEventPersist.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/TenantTouchedIntegrationEventPersist.java
@@ -2,9 +2,9 @@ package gr.cite.notification.model.persist;
import gr.cite.notification.common.validation.ValidId;
-import javax.validation.constraints.NotEmpty;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Size;
import java.util.UUID;
public class TenantTouchedIntegrationEventPersist {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/UserContactInfoPersist.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/UserContactInfoPersist.java
index ce22bf2fa..4f2506ae5 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/UserContactInfoPersist.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/UserContactInfoPersist.java
@@ -5,8 +5,8 @@ import gr.cite.notification.common.enums.IsActive;
import gr.cite.notification.common.validation.FieldNotNullIfOtherSet;
import gr.cite.notification.common.validation.ValidId;
-import javax.validation.constraints.NotEmpty;
-import javax.validation.constraints.NotNull;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
import java.time.Instant;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/UserTouchedIntegrationEventPersist.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/UserTouchedIntegrationEventPersist.java
index 27ddc86bb..64bf7865f 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/UserTouchedIntegrationEventPersist.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/UserTouchedIntegrationEventPersist.java
@@ -2,9 +2,9 @@ package gr.cite.notification.model.persist;
import gr.cite.notification.common.validation.ValidId;
-import javax.validation.constraints.NotEmpty;
-import javax.validation.constraints.NotNull;
-import javax.validation.constraints.Size;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
+import jakarta.validation.constraints.Size;
import java.util.UUID;
public class UserTouchedIntegrationEventPersist {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/notificationtemplate/FieldInfoPersist.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/notificationtemplate/FieldInfoPersist.java
index 16cbb12fc..371941dba 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/notificationtemplate/FieldInfoPersist.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/notificationtemplate/FieldInfoPersist.java
@@ -3,8 +3,8 @@ package gr.cite.notification.model.persist.notificationtemplate;
import gr.cite.notification.common.enums.NotificationDataType;
import gr.cite.notification.common.validation.ValidEnum;
-import javax.validation.constraints.NotEmpty;
-import javax.validation.constraints.NotNull;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
public class FieldInfoPersist {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/notificationtemplate/FieldOptionsPersist.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/notificationtemplate/FieldOptionsPersist.java
index bb63f1187..4af0a3efe 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/notificationtemplate/FieldOptionsPersist.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/notificationtemplate/FieldOptionsPersist.java
@@ -1,7 +1,7 @@
package gr.cite.notification.model.persist.notificationtemplate;
-import javax.validation.Valid;
+import jakarta.validation.Valid;
import java.util.List;
import java.util.Map;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/notificationtemplate/NotificationTemplateValuePersist.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/notificationtemplate/NotificationTemplateValuePersist.java
index b52afa46c..12acb9887 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/notificationtemplate/NotificationTemplateValuePersist.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/model/persist/notificationtemplate/NotificationTemplateValuePersist.java
@@ -3,9 +3,9 @@ package gr.cite.notification.model.persist.notificationtemplate;
import gr.cite.notification.common.enums.EmailOverrideMode;
import gr.cite.notification.common.validation.ValidEnum;
-import javax.validation.Valid;
-import javax.validation.constraints.NotEmpty;
-import javax.validation.constraints.NotNull;
+import jakarta.validation.Valid;
+import jakarta.validation.constraints.NotEmpty;
+import jakarta.validation.constraints.NotNull;
import java.util.List;
public class NotificationTemplateValuePersist {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/InAppNotificationQuery.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/InAppNotificationQuery.java
index c18838706..50970c662 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/InAppNotificationQuery.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/InAppNotificationQuery.java
@@ -1,9 +1,10 @@
package gr.cite.notification.query;
import gr.cite.notification.authorization.AuthorizationFlags;
-import gr.cite.notification.common.enums.*;
+import gr.cite.notification.common.enums.InAppNotificationPriority;
+import gr.cite.notification.common.enums.IsActive;
+import gr.cite.notification.common.enums.NotificationInAppTracking;
import gr.cite.notification.data.InAppNotificationEntity;
-import gr.cite.notification.data.LanguageEntity;
import gr.cite.notification.model.InAppNotification;
import gr.cite.tools.data.query.FieldResolver;
import gr.cite.tools.data.query.QueryBase;
@@ -12,8 +13,8 @@ import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
-import javax.persistence.Tuple;
-import javax.persistence.criteria.Predicate;
+import jakarta.persistence.Tuple;
+import jakarta.persistence.criteria.Predicate;
import java.time.Instant;
import java.util.*;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/LanguageQuery.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/LanguageQuery.java
index 1cf2024e2..1aaef85a0 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/LanguageQuery.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/LanguageQuery.java
@@ -11,9 +11,9 @@ import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
-import javax.persistence.Tuple;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.Predicate;
+import jakarta.persistence.Tuple;
+import jakarta.persistence.criteria.CriteriaBuilder;
+import jakarta.persistence.criteria.Predicate;
import java.time.Instant;
import java.util.*;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/NotificationQuery.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/NotificationQuery.java
index 53bd80673..461b22c8a 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/NotificationQuery.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/NotificationQuery.java
@@ -12,8 +12,8 @@ import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
-import javax.persistence.Tuple;
-import javax.persistence.criteria.Predicate;
+import jakarta.persistence.Tuple;
+import jakarta.persistence.criteria.Predicate;
import java.time.Instant;
import java.util.*;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/NotificationTemplateQuery.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/NotificationTemplateQuery.java
index fb5535de4..e35dae690 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/NotificationTemplateQuery.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/NotificationTemplateQuery.java
@@ -12,10 +12,10 @@ import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
-import javax.persistence.Tuple;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Subquery;
+import jakarta.persistence.Tuple;
+import jakarta.persistence.criteria.CriteriaBuilder;
+import jakarta.persistence.criteria.Predicate;
+import jakarta.persistence.criteria.Subquery;
import java.time.Instant;
import java.util.*;
@@ -198,9 +198,8 @@ public class NotificationTemplateQuery extends QueryBase subQuery = queryContext.Query.subquery(this.languageQuery.entityClass());
- this.applySubQuery(this.languageQuery, queryContext.CriteriaBuilder, subQuery);
- predicates.add(queryContext.CriteriaBuilder.in(queryContext.Root.get(NotificationTemplateEntity._languageId)).value(subQuery));
+ QueryContext subQuery = this.applySubQuery(this.languageQuery, queryContext, UUID.class, root -> root.get(NotificationTemplateEntity._id));
+ predicates.add(queryContext.CriteriaBuilder.in(queryContext.Root.get(NotificationTemplateEntity._languageId)).value(subQuery.Query));
}
if (this.channels != null) {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/QueueInboxQuery.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/QueueInboxQuery.java
index 4e9e6ccbe..eb7278c68 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/QueueInboxQuery.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/QueueInboxQuery.java
@@ -11,9 +11,9 @@ import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
-import javax.persistence.Tuple;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.Predicate;
+import jakarta.persistence.Tuple;
+import jakarta.persistence.criteria.CriteriaBuilder;
+import jakarta.persistence.criteria.Predicate;
import java.time.Instant;
import java.util.*;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/QueueOutboxQuery.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/QueueOutboxQuery.java
index b8f6f78b9..4dbea999c 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/QueueOutboxQuery.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/QueueOutboxQuery.java
@@ -12,9 +12,9 @@ import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
-import javax.persistence.Tuple;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.Predicate;
+import jakarta.persistence.Tuple;
+import jakarta.persistence.criteria.CriteriaBuilder;
+import jakarta.persistence.criteria.Predicate;
import java.time.Instant;
import java.util.*;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/TenantConfigurationQuery.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/TenantConfigurationQuery.java
index e3758f168..c279355ed 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/TenantConfigurationQuery.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/TenantConfigurationQuery.java
@@ -12,9 +12,9 @@ import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
-import javax.persistence.Tuple;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.Predicate;
+import jakarta.persistence.Tuple;
+import jakarta.persistence.criteria.CriteriaBuilder;
+import jakarta.persistence.criteria.Predicate;
import java.time.Instant;
import java.util.*;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/TenantQuery.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/TenantQuery.java
index 0b0c2d653..b97498d12 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/TenantQuery.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/TenantQuery.java
@@ -11,8 +11,8 @@ import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
-import javax.persistence.Tuple;
-import javax.persistence.criteria.Predicate;
+import jakarta.persistence.Tuple;
+import jakarta.persistence.criteria.Predicate;
import java.time.Instant;
import java.util.*;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/UserContactInfoQuery.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/UserContactInfoQuery.java
index 3d4986146..6454117b3 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/UserContactInfoQuery.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/UserContactInfoQuery.java
@@ -17,10 +17,10 @@ import gr.cite.tools.data.query.QueryContext;
import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.RequestScope;
-import javax.persistence.Tuple;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.Predicate;
-import javax.persistence.criteria.Subquery;
+import jakarta.persistence.Tuple;
+import jakarta.persistence.criteria.CriteriaBuilder;
+import jakarta.persistence.criteria.Predicate;
+import jakarta.persistence.criteria.Subquery;
import java.time.Instant;
import java.util.*;
@@ -226,12 +226,11 @@ public class UserContactInfoQuery extends QueryBase {
predicates.add(inClause);
}
if (this.userQuery != null) {
- Subquery subQuery = queryContext.Query.subquery(this.userQuery.entityClass());
- this.applySubQuery(this.userQuery, queryContext.CriteriaBuilder, subQuery);
- predicates.add(queryContext.CriteriaBuilder.in(queryContext.Root.get(UserContactInfoEntity._userId)).value(subQuery));
+ QueryContext subQuery = this.applySubQuery(this.userQuery, queryContext, UUID.class, root -> root.get(UserContactInfoEntity._userId));
+ predicates.add(queryContext.CriteriaBuilder.in(queryContext.Root.get(UserContactInfoEntity._userId)).value(subQuery.Query));
}
- if (predicates.size() > 0) {
+ if (!predicates.isEmpty()) {
Predicate[] predicatesArray = predicates.toArray(new Predicate[0]);
return queryContext.CriteriaBuilder.and(predicatesArray);
} else {
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/UserCredentialQuery.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/UserCredentialQuery.java
index e07a4cd7d..30cb14f14 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/UserCredentialQuery.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/UserCredentialQuery.java
@@ -13,9 +13,9 @@ import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
-import javax.persistence.Tuple;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.Predicate;
+import jakarta.persistence.Tuple;
+import jakarta.persistence.criteria.CriteriaBuilder;
+import jakarta.persistence.criteria.Predicate;
import java.time.Instant;
import java.util.*;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/UserNotificationPreferenceQuery.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/UserNotificationPreferenceQuery.java
index 977d3baa4..1d7a7d65e 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/UserNotificationPreferenceQuery.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/UserNotificationPreferenceQuery.java
@@ -10,8 +10,8 @@ import org.springframework.beans.factory.config.BeanDefinition;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
-import javax.persistence.Tuple;
-import javax.persistence.criteria.Predicate;
+import jakarta.persistence.Tuple;
+import jakarta.persistence.criteria.Predicate;
import java.time.Instant;
import java.util.*;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/UserQuery.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/UserQuery.java
index 9fb299b91..6de90a27b 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/UserQuery.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/UserQuery.java
@@ -14,9 +14,9 @@ import gr.cite.tools.data.query.QueryContext;
import org.springframework.stereotype.Component;
import org.springframework.web.context.annotation.RequestScope;
-import javax.persistence.Tuple;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.Predicate;
+import jakarta.persistence.Tuple;
+import jakarta.persistence.criteria.CriteriaBuilder;
+import jakarta.persistence.criteria.Predicate;
import java.time.Instant;
import java.util.*;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/UserRoleQuery.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/UserRoleQuery.java
index 33e882f1e..907b69a7e 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/UserRoleQuery.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/query/UserRoleQuery.java
@@ -14,9 +14,9 @@ import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
-import javax.persistence.Tuple;
-import javax.persistence.criteria.CriteriaBuilder;
-import javax.persistence.criteria.Predicate;
+import jakarta.persistence.Tuple;
+import jakarta.persistence.criteria.CriteriaBuilder;
+import jakarta.persistence.criteria.Predicate;
import java.time.Instant;
import java.util.*;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/service/inappnotification/InAppNotificationServiceImpl.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/service/inappnotification/InAppNotificationServiceImpl.java
index 3086fee5b..ce310daf6 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/service/inappnotification/InAppNotificationServiceImpl.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/service/inappnotification/InAppNotificationServiceImpl.java
@@ -18,8 +18,8 @@ import org.springframework.stereotype.Service;
import org.springframework.web.context.annotation.RequestScope;
import javax.management.InvalidApplicationException;
-import javax.persistence.Column;
-import javax.persistence.Query;
+import jakarta.persistence.Column;
+import jakarta.persistence.Query;
import java.time.Instant;
import java.util.List;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/service/notificationscheduling/NotificationSchedulingServiceImpl.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/service/notificationscheduling/NotificationSchedulingServiceImpl.java
index 2f67e396f..b3616e466 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/service/notificationscheduling/NotificationSchedulingServiceImpl.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/service/notificationscheduling/NotificationSchedulingServiceImpl.java
@@ -24,10 +24,10 @@ import gr.cite.tools.logging.LoggerService;
import org.slf4j.LoggerFactory;
import org.springframework.context.ApplicationContext;
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.EntityTransaction;
-import javax.persistence.OptimisticLockException;
+import jakarta.persistence.EntityManager;
+import jakarta.persistence.EntityManagerFactory;
+import jakarta.persistence.EntityTransaction;
+import jakarta.persistence.OptimisticLockException;
import java.time.Instant;
import java.util.List;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/service/notify/EmailNotifier.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/service/notify/EmailNotifier.java
index 8d46a8f8e..0030bda27 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/service/notify/EmailNotifier.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/service/notify/EmailNotifier.java
@@ -8,18 +8,14 @@ import gr.cite.notification.service.contact.model.EmailContact;
import gr.cite.notification.service.message.model.EmailMessage;
import gr.cite.notification.service.message.model.Message;
import gr.cite.tools.logging.LoggerService;
-import org.slf4j.Logger;
+import jakarta.mail.MessagingException;
+import jakarta.mail.internet.MimeMessage;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.mail.SimpleMailMessage;
import org.springframework.mail.javamail.JavaMailSender;
import org.springframework.mail.javamail.MimeMessageHelper;
import org.springframework.stereotype.Component;
-import javax.mail.MessagingException;
-import javax.mail.internet.MimeMessage;
-import java.nio.charset.Charset;
-
import static java.nio.charset.StandardCharsets.UTF_8;
@Component
diff --git a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/service/notify/InAppNotifier.java b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/service/notify/InAppNotifier.java
index fc89f1b91..e92995be7 100644
--- a/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/service/notify/InAppNotifier.java
+++ b/dmp-backend/notification-service/notification/src/main/java/gr/cite/notification/service/notify/InAppNotifier.java
@@ -17,9 +17,9 @@ import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.context.ApplicationContext;
import org.springframework.stereotype.Component;
-import javax.persistence.EntityManager;
-import javax.persistence.EntityManagerFactory;
-import javax.persistence.EntityTransaction;
+import jakarta.persistence.EntityManager;
+import jakarta.persistence.EntityManagerFactory;
+import jakarta.persistence.EntityTransaction;
import java.time.Instant;
import java.util.UUID;
diff --git a/dmp-backend/notification-service/pom.xml b/dmp-backend/notification-service/pom.xml
index ebe8127bb..02ab51031 100644
--- a/dmp-backend/notification-service/pom.xml
+++ b/dmp-backend/notification-service/pom.xml
@@ -4,31 +4,88 @@
xsi:schemaLocation="http://maven.apache.org/POM/4.0.0 http://maven.apache.org/xsd/maven-4.0.0.xsd">
4.0.0
-
-
- org.springframework.boot
- spring-boot-starter-parent
- 2.6.4
-
-
-
gr.cite
notification-service-parent
Argos Notification Parent
1.0.0
pom
+
+ org.springframework.boot
+ spring-boot-starter-parent
+ 3.1.2
+
+
+
notification
notification-web
- 11
- 11
+ 21
+ 21
+ 21
+ 21
+
+ org.springframework
+ spring-context-support
+
+
+ org.springframework.boot
+ spring-boot-starter-data-jpa
+
+
+
+ org.hibernate.orm
+ hibernate-core
+ compile
+ 6.3.1.Final
+
+
+ org.hibernate.orm
+ hibernate-c3p0
+ compile
+
+
+
+
+ com.fasterxml.jackson.dataformat
+ jackson-dataformat-xml
+
+
+
+
+
+ com.fasterxml.jackson.core
+ jackson-core
+
+
+
+ com.fasterxml.jackson.core
+ jackson-databind
+
+
+ com.fasterxml.jackson.datatype
+ jackson-datatype-jsr310
+ 2.13.3
+
+
+
+ com.fasterxml.jackson.module
+ jackson-module-jaxb-annotations
+
+
+
+
+ javax.xml.bind
+ jaxb-api
+ 2.3.1
+
+
jakarta.annotation
@@ -46,7 +103,36 @@
jakarta.persistence-api
3.1.0
-
+
+
+ gr.cite
+ data-tools
+ 2.1.2
+
+
+
+ gr.cite
+ logging
+ 2.1.0
+
+
+
+ gr.cite
+ oidc-authn
+ 2.2.1
+
+
+ gr.cite
+ oidc-authz
+ 2.1.0
+
+
+
+ gr.cite
+ rabbitmq-core
+ 1.0.0
+
+
gr.cite
queue-inbox
@@ -57,12 +143,6 @@
queue-outbox
1.0.0
-
-
- gr.cite
- rabbitmq-core
- 1.0.0
-
@@ -94,6 +174,20 @@
+
+
+ cite-dev
+
+
+ cite-maven
+ CITE Maven Repository
+ https://crepo.cite.gr/repository/cite-maven/
+
+
+
+ true
+
+
\ No newline at end of file
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/ExecutorServiceConfig.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/ExecutorServiceConfig.java
deleted file mode 100644
index 78da24f79..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/ExecutorServiceConfig.java
+++ /dev/null
@@ -1,28 +0,0 @@
-package eu.eudat.configurations;
-
-import org.springframework.context.annotation.Bean;
-import org.springframework.context.annotation.Configuration;
-import org.springframework.core.task.TaskExecutor;
-import org.springframework.scheduling.concurrent.ThreadPoolTaskExecutor;
-
-import java.util.concurrent.Executor;
-import java.util.concurrent.ExecutorService;
-import java.util.concurrent.Executors;
-
-/**
- * Created by ikalyvas on 9/26/2018.
- */
-@Configuration
-public class ExecutorServiceConfig {
-
- @Bean
- public Executor asyncExecutor() {
- ThreadPoolTaskExecutor executor = new ThreadPoolTaskExecutor();
- executor.setCorePoolSize(2);
- executor.setMaxPoolSize(2);
- executor.setQueueCapacity(500);
- executor.setThreadNamePrefix("Rules-");
- executor.initialize();
- return executor;
- }
-}
\ No newline at end of file
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/DynamicFunderConfiguration.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/DynamicFunderConfiguration.java
deleted file mode 100644
index 4a7f08672..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/DynamicFunderConfiguration.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package eu.eudat.configurations.dynamicfunder;
-
-import eu.eudat.configurations.dynamicfunder.entities.Configuration;
-import eu.eudat.models.data.dynamicfields.DynamicField;
-
-import java.util.List;
-
-public interface DynamicFunderConfiguration {
- Configuration getConfiguration();
-
- List getFields();
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/DynamicFunderConfigurationDevelImpl.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/DynamicFunderConfigurationDevelImpl.java
deleted file mode 100644
index eca3ab522..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/DynamicFunderConfigurationDevelImpl.java
+++ /dev/null
@@ -1,85 +0,0 @@
-package eu.eudat.configurations.dynamicfunder;
-
-import eu.eudat.configurations.dynamicfunder.entities.Configuration;
-import eu.eudat.configurations.dynamicfunder.entities.Property;
-import eu.eudat.models.data.dynamicfields.Dependency;
-import eu.eudat.models.data.dynamicfields.DynamicField;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.context.annotation.Profile;
-import org.springframework.core.env.Environment;
-import org.springframework.stereotype.Service;
-
-import jakarta.xml.bind.JAXBContext;
-import jakarta.xml.bind.Unmarshaller;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.LinkedList;
-import java.util.List;
-
-@Service("dynamicFunderConfiguration")
-@Profile("devel")
-public class DynamicFunderConfigurationDevelImpl implements DynamicFunderConfiguration {
- private static final Logger logger = LoggerFactory.getLogger(DynamicFunderConfigurationDevelImpl.class);
-
- private Configuration configuration;
- private List fields;
- private Environment environment;
-
- public DynamicFunderConfigurationDevelImpl(Environment environment) {
- this.environment = environment;
- }
-
- @Override
- public Configuration getConfiguration() {
- if (this.configuration != null) return this.configuration;
- String fileUrl = this.environment.getProperty("configuration.dynamicFunderUrl");
- logger.info("Loaded also config file: " + fileUrl);
- String current = null;
- InputStream is = null;
- try {
- current = new java.io.File(".").getCanonicalPath();
-
- JAXBContext jaxbContext = JAXBContext.newInstance(Configuration.class);
- Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
- is = new URL("file:///"+ current + "/web/src/main/resources/FunderConfiguration.xml").openStream();
- this.configuration = (Configuration) jaxbUnmarshaller.unmarshal(is);
- } catch (Exception ex) {
- logger.error("Cannot find in folder" + current, ex);
- } finally {
- try {
- if (is != null) is.close();
- } catch (IOException e) {
- logger.warn("Warning: Could not close a stream after reading from file: " + fileUrl, e);
- }
- }
- return this.configuration;
- }
-
- @Override
- public List getFields() {
- if (this.fields != null) return this.fields;
- Configuration configuration = this.getConfiguration();
- List fields = new LinkedList<>();
- List properties = configuration.getConfigurationProperties();
- properties.stream().forEach(item -> {
- DynamicField dynamicField = new DynamicField();
- dynamicField.setId(item.getId());
- dynamicField.setName(item.getName());
- dynamicField.setQueryProperty(item.getQueryProperty());
- dynamicField.setRequired(item.getRequired());
- List dependencies = new LinkedList<>();
- item.getDependencies().stream().forEach(dependency -> {
- Dependency modelDependency = new Dependency();
- modelDependency.setId(dependency.getId());
- modelDependency.setQueryProperty(dependency.getQueryProperty());
- dependencies.add(modelDependency);
- });
- dynamicField.setDependencies(dependencies);
- fields.add(dynamicField);
- });
- this.fields = fields;
- return fields;
- }
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/DynamicFunderConfigurationProdImpl.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/DynamicFunderConfigurationProdImpl.java
deleted file mode 100644
index 30f2124a5..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/DynamicFunderConfigurationProdImpl.java
+++ /dev/null
@@ -1,86 +0,0 @@
-package eu.eudat.configurations.dynamicfunder;
-
-import eu.eudat.configurations.dynamicfunder.entities.Configuration;
-import eu.eudat.configurations.dynamicfunder.entities.Property;
-import eu.eudat.models.data.dynamicfields.Dependency;
-import eu.eudat.models.data.dynamicfields.DynamicField;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.context.annotation.Profile;
-import org.springframework.core.env.Environment;
-import org.springframework.stereotype.Service;
-
-import jakarta.xml.bind.JAXBContext;
-import jakarta.xml.bind.Unmarshaller;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.nio.file.Paths;
-import java.util.LinkedList;
-import java.util.List;
-
-@Service("dynamicFunderConfiguration")
-@Profile({ "production", "staging", "docker" })
-public class DynamicFunderConfigurationProdImpl implements DynamicFunderConfiguration {
- private static final Logger logger = LoggerFactory.getLogger(DynamicFunderConfigurationProdImpl.class);
-
- private Configuration configuration;
- private List fields;
- private Environment environment;
-
- public DynamicFunderConfigurationProdImpl(Environment environment) {
- this.environment = environment;
- }
-
- @Override
- public Configuration getConfiguration() {
- if (this.configuration != null) return this.configuration;
- String fileUrl = this.environment.getProperty("configuration.dynamicFunderUrl");
- logger.info("Loaded also config file: " + fileUrl);
- String current = null;
- InputStream is = null;
- try {
- current = new java.io.File(".").getCanonicalPath();
-
- JAXBContext jaxbContext = JAXBContext.newInstance(Configuration.class);
- Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
- is = new URL(Paths.get(fileUrl).toUri().toURL().toString()).openStream();
- this.configuration = (Configuration) jaxbUnmarshaller.unmarshal(is);
- } catch (Exception ex) {
- logger.error("Cannot find in folder" + current, ex);
- } finally {
- try {
- if (is != null) is.close();
- } catch (IOException e) {
- logger.warn("Warning: Could not close a stream after reading from file: " + fileUrl, e);
- }
- }
- return this.configuration;
- }
-
- @Override
- public List getFields() {
- if (this.fields != null) return this.fields;
- Configuration configuration = this.getConfiguration();
- List fields = new LinkedList<>();
- List properties = configuration.getConfigurationProperties();
- properties.stream().forEach(item -> {
- DynamicField dynamicField = new DynamicField();
- dynamicField.setId(item.getId());
- dynamicField.setName(item.getName());
- dynamicField.setQueryProperty(item.getQueryProperty());
- dynamicField.setRequired(item.getRequired());
- List dependencies = new LinkedList<>();
- item.getDependencies().stream().forEach(dependency -> {
- Dependency modelDependency = new Dependency();
- modelDependency.setId(dependency.getId());
- modelDependency.setQueryProperty(dependency.getQueryProperty());
- dependencies.add(modelDependency);
- });
- dynamicField.setDependencies(dependencies);
- fields.add(dynamicField);
- });
- this.fields = fields;
- return fields;
- }
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Configuration.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Configuration.java
deleted file mode 100644
index 3a65659c1..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Configuration.java
+++ /dev/null
@@ -1,31 +0,0 @@
-package eu.eudat.configurations.dynamicfunder.entities;
-
-import jakarta.xml.bind.annotation.XmlElement;
-import jakarta.xml.bind.annotation.XmlElementWrapper;
-import jakarta.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-@XmlRootElement
-public class Configuration {
- private List configurationProperties;
- private MainProperty mainExternalField;
-
- public MainProperty getMainExternalField() {
- return mainExternalField;
- }
-
- @XmlElement(name = "mainExternalField")
- public void setMainExternalField(MainProperty mainExternalField) {
- this.mainExternalField = mainExternalField;
- }
-
- public List getConfigurationProperties() {
- return configurationProperties;
- }
-
- @XmlElementWrapper
- @XmlElement(name = "property")
- public void setConfigurationProperties(List configurationProperties) {
- this.configurationProperties = configurationProperties;
- }
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Dependency.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Dependency.java
deleted file mode 100644
index 0d7288ec9..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Dependency.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package eu.eudat.configurations.dynamicfunder.entities;
-
-import jakarta.xml.bind.annotation.XmlElement;
-
-public class Dependency {
- private String id;
- private String queryProperty;
-
- public String getId() {
- return id;
- }
-
- public String getQueryProperty() {
- return queryProperty;
- }
-
- @XmlElement(name = "id")
- public void setId(String id) {
- this.id = id;
- }
-
- @XmlElement(name = "queryProperty")
- public void setQueryProperty(String queryProperty) {
- this.queryProperty = queryProperty;
- }
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Language.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Language.java
deleted file mode 100644
index 1dfd36c00..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Language.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package eu.eudat.configurations.dynamicfunder.entities;
-
-import jakarta.xml.bind.annotation.XmlElement;
-
-public class Language {
- private String key;
- private String languageKey;
-
- public String getKey() {
- return key;
- }
-
- @XmlElement(name = "key")
- public void setKey(String key) {
- this.key = key;
- }
-
- public String getLanguageKey() {
- return languageKey;
- }
-
- @XmlElement(name = "languageKey")
- public void setLanguageKey(String languageKey) {
- this.languageKey = languageKey;
- }
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/MainProperty.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/MainProperty.java
deleted file mode 100644
index 285a3fb37..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/MainProperty.java
+++ /dev/null
@@ -1,103 +0,0 @@
-package eu.eudat.configurations.dynamicfunder.entities;
-
-import eu.eudat.service.remotefetcher.config.UrlConfiguration;
-
-import jakarta.xml.bind.annotation.XmlElement;
-import jakarta.xml.bind.annotation.XmlElementWrapper;
-import java.util.List;
-
-public class MainProperty {
- private String id;
- private String name;
- private String queryProperty;
- private String externalFieldId;
- private List urlConfig;
- private String externalFieldLabel;
- private List dependencies;
- private Boolean required;
- private List language;
-
-
- public String getId() {
- return id;
- }
-
- @XmlElement(name = "id")
- public void setId(String id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- @XmlElement(name = "name")
- public void setName(String name) {
- this.name = name;
- }
-
- public String getExternalFieldId() {
- return externalFieldId;
- }
-
- @XmlElement(name = "externalFieldId")
- public void setExternalFieldId(String externalFieldId) {
- this.externalFieldId = externalFieldId;
- }
-
- public String getExternalFieldLabel() {
- return externalFieldLabel;
- }
-
- @XmlElement(name = "externalFieldLabel")
- public void setExternalFieldLabel(String externalFieldLabel) {
- this.externalFieldLabel = externalFieldLabel;
- }
-
- public List getDependencies() {
- return dependencies;
- }
-
- @XmlElementWrapper
- @XmlElement(name = "dependency")
- public void setDependencies(List dependencies) {
- this.dependencies = dependencies;
- }
-
- public Boolean getRequired() {
- return required;
- }
-
- @XmlElement(name = "required")
- public void setRequired(Boolean required) {
- this.required = required;
- }
-
- public String getQueryProperty() {
- return queryProperty;
- }
-
- @XmlElement(name = "queryProperty")
- public void setQueryProperty(String queryProperty) {
- this.queryProperty = queryProperty;
- }
-
- public List getUrlConfig() {
- return urlConfig;
- }
-
- @XmlElement(name = "urlConfig")
- public void setUrlConfig(List urlConfig) {
- this.urlConfig = urlConfig;
- }
-
- public List getLanguage() {
- return language;
- }
-
- @XmlElementWrapper
- @XmlElement(name = "languageProperty")
- public void setLanguage(List language) {
- this.language = language;
- }
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Property.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Property.java
deleted file mode 100644
index 2f5172f0e..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicfunder/entities/Property.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package eu.eudat.configurations.dynamicfunder.entities;
-
-
-import jakarta.xml.bind.annotation.XmlElement;
-import jakarta.xml.bind.annotation.XmlElementWrapper;
-import java.util.List;
-
-public class Property {
- private String id;
- private String name;
- private String sourceUrl;
- private String queryProperty;
- private String externalFieldId;
- private String externalFieldLabel;
- private List dependencies;
- private Boolean required;
-
-
- public String getId() {
- return id;
- }
-
- @XmlElement(name = "id")
- public void setId(String id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- @XmlElement(name = "name")
- public void setName(String name) {
- this.name = name;
- }
-
- public String getSourceUrl() {
- return sourceUrl;
- }
-
- @XmlElement(name = "sourceUrl")
- public void setSourceUrl(String sourceUrl) {
- this.sourceUrl = sourceUrl;
- }
-
- public String getExternalFieldId() {
- return externalFieldId;
- }
-
- @XmlElement(name = "externalFieldId")
- public void setExternalFieldId(String externalFieldId) {
- this.externalFieldId = externalFieldId;
- }
-
- public String getExternalFieldLabel() {
- return externalFieldLabel;
- }
-
- @XmlElement(name = "externalFieldLabel")
- public void setExternalFieldLabel(String externalFieldLabel) {
- this.externalFieldLabel = externalFieldLabel;
- }
-
- public List getDependencies() {
- return dependencies;
- }
-
- @XmlElementWrapper
- @XmlElement(name = "dependency")
- public void setDependencies(List dependencies) {
- this.dependencies = dependencies;
- }
-
- public Boolean getRequired() {
- return required;
- }
-
- @XmlElement(name = "required")
- public void setRequired(Boolean required) {
- this.required = required;
- }
-
- public String getQueryProperty() {
- return queryProperty;
- }
-
- @XmlElement(name = "queryProperty")
- public void setQueryProperty(String queryProperty) {
- this.queryProperty = queryProperty;
- }
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/DynamicGrantConfiguration.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/DynamicGrantConfiguration.java
deleted file mode 100644
index efe07f403..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/DynamicGrantConfiguration.java
+++ /dev/null
@@ -1,15 +0,0 @@
-package eu.eudat.configurations.dynamicgrant;
-
-import eu.eudat.configurations.dynamicgrant.entities.Configuration;
-import eu.eudat.models.data.dynamicfields.DynamicField;
-
-import java.util.List;
-
-/**
- * Created by ikalyvas on 3/23/2018.
- */
-public interface DynamicGrantConfiguration {
- Configuration getConfiguration();
-
- List getFields();
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/DynamicGrantConfigurationDevelImpl.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/DynamicGrantConfigurationDevelImpl.java
deleted file mode 100644
index eb4fc308c..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/DynamicGrantConfigurationDevelImpl.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package eu.eudat.configurations.dynamicgrant;
-
-import eu.eudat.configurations.dynamicgrant.entities.Configuration;
-import eu.eudat.configurations.dynamicgrant.entities.Property;
-import eu.eudat.models.data.dynamicfields.Dependency;
-import eu.eudat.models.data.dynamicfields.DynamicField;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Profile;
-import org.springframework.core.env.Environment;
-import org.springframework.stereotype.Service;
-
-import jakarta.xml.bind.JAXBContext;
-import jakarta.xml.bind.Unmarshaller;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * Created by ikalyvas on 5/4/2018.
- */
-
-@Service("dynamicGrantConfiguration")
-@Profile("devel")
-public class DynamicGrantConfigurationDevelImpl implements DynamicGrantConfiguration {
- private static final Logger logger = LoggerFactory.getLogger(DynamicGrantConfigurationDevelImpl.class);
-
- private Configuration configuration;
-
- private List fields;
-
- private Environment environment;
-
- @Autowired
- public DynamicGrantConfigurationDevelImpl(Environment environment) {
- this.environment = environment;
- }
-
- @Override
- public Configuration getConfiguration() {
- if (this.configuration != null) return this.configuration;
- String fileUrl = this.environment.getProperty("configuration.dynamicGrantUrl");
- logger.info("Loaded also config file: " + fileUrl);
- String current = null;
- InputStream is = null;
- try {
- current = new java.io.File(".").getCanonicalPath();
-
- JAXBContext jaxbContext = JAXBContext.newInstance(Configuration.class);
- Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
- is = new URL("file:///"+ current + "/web/src/main/resources/GrantConfiguration.xml").openStream();
- this.configuration = (Configuration) jaxbUnmarshaller.unmarshal(is);
- } catch (Exception ex) {
- logger.error("Cannot find in folder" + current, ex);
- } finally {
- try {
- if (is != null) is.close();
- } catch (IOException e) {
- logger.warn("Warning: Could not close a stream after reading from file: " + fileUrl, e);
- }
- }
- return this.configuration;
- }
-
- @Override
- public List getFields() {
- if (this.fields != null) return this.fields;
- Configuration configuration = this.getConfiguration();
- List fields = new LinkedList<>();
- List properties = configuration.getConfigurationProperties();
- properties.stream().forEach(item -> {
- DynamicField dynamicField = new DynamicField();
- dynamicField.setId(item.getId());
- dynamicField.setName(item.getName());
- dynamicField.setQueryProperty(item.getQueryProperty());
- dynamicField.setRequired(item.getRequired());
- List dependencies = new LinkedList<>();
- item.getDependencies().stream().forEach(dependency -> {
- Dependency modelDependency = new Dependency();
- modelDependency.setId(dependency.getId());
- modelDependency.setQueryProperty(dependency.getQueryProperty());
- dependencies.add(modelDependency);
- });
- dynamicField.setDependencies(dependencies);
- fields.add(dynamicField);
- });
- this.fields = fields;
- return fields;
- }
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/DynamicGrantConfigurationProdImpl.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/DynamicGrantConfigurationProdImpl.java
deleted file mode 100644
index e23dd1240..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/DynamicGrantConfigurationProdImpl.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package eu.eudat.configurations.dynamicgrant;
-
-import eu.eudat.configurations.dynamicgrant.entities.Configuration;
-import eu.eudat.configurations.dynamicgrant.entities.Property;
-import eu.eudat.models.data.dynamicfields.Dependency;
-import eu.eudat.models.data.dynamicfields.DynamicField;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Profile;
-import org.springframework.core.env.Environment;
-import org.springframework.stereotype.Service;
-
-import jakarta.xml.bind.JAXBContext;
-import jakarta.xml.bind.Unmarshaller;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.nio.file.Paths;
-import java.util.LinkedList;
-import java.util.List;
-
-/**
- * Created by ikalyvas on 3/23/2018.
- */
-@Service("dynamicGrantConfiguration")
-@Profile({ "production", "staging", "docker" })
-public class DynamicGrantConfigurationProdImpl implements DynamicGrantConfiguration {
- private static final Logger logger = LoggerFactory.getLogger(DynamicGrantConfigurationProdImpl.class);
-
- private Configuration configuration;
-
- private List fields;
-
- private Environment environment;
-
- @Autowired
- public DynamicGrantConfigurationProdImpl(Environment environment) {
- this.environment = environment;
- }
-
- @Override
- public Configuration getConfiguration() {
- if (this.configuration != null) return this.configuration;
- String fileUrl = this.environment.getProperty("configuration.dynamicGrantUrl");
- logger.info("Loaded also config file: " + fileUrl);
- String current = null;
- InputStream is = null;
- try {
- current = new java.io.File(".").getCanonicalPath();
-
- JAXBContext jaxbContext = JAXBContext.newInstance(Configuration.class);
- Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
- is = new URL(Paths.get(fileUrl).toUri().toURL().toString()).openStream();
- this.configuration = (Configuration) jaxbUnmarshaller.unmarshal(is);
- } catch (Exception ex) {
- logger.error("Cannot find in folder" + current, ex);
- } finally {
- try {
- if (is != null) is.close();
- } catch (IOException e) {
- logger.warn("Warning: Could not close a stream after reading from file: " + fileUrl, e);
- }
- }
- return this.configuration;
- }
-
- @Override
- public List getFields() {
- if (this.fields != null) return this.fields;
- Configuration configuration = this.getConfiguration();
- List fields = new LinkedList<>();
- List properties = configuration.getConfigurationProperties();
- properties.stream().forEach(item -> {
- DynamicField dynamicField = new DynamicField();
- dynamicField.setId(item.getId());
- dynamicField.setName(item.getName());
- dynamicField.setQueryProperty(item.getQueryProperty());
- dynamicField.setRequired(item.getRequired());
- List dependencies = new LinkedList<>();
- item.getDependencies().stream().forEach(dependency -> {
- Dependency modelDependency = new Dependency();
- modelDependency.setId(dependency.getId());
- modelDependency.setQueryProperty(dependency.getQueryProperty());
- dependencies.add(modelDependency);
- });
- dynamicField.setDependencies(dependencies);
- fields.add(dynamicField);
- });
- this.fields = fields;
- return fields;
- }
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Configuration.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Configuration.java
deleted file mode 100644
index 1fede94fa..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Configuration.java
+++ /dev/null
@@ -1,34 +0,0 @@
-package eu.eudat.configurations.dynamicgrant.entities;
-
-import jakarta.xml.bind.annotation.XmlElement;
-import jakarta.xml.bind.annotation.XmlElementWrapper;
-import jakarta.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-/**
- * Created by ikalyvas on 3/23/2018.
- */
-@XmlRootElement
-public class Configuration {
- private List configurationProperties;
- private MainProperty mainExternalField;
-
- public MainProperty getMainExternalField() {
- return mainExternalField;
- }
-
- @XmlElement(name = "mainExternalField")
- public void setMainExternalField(MainProperty mainExternalField) {
- this.mainExternalField = mainExternalField;
- }
-
- public List getConfigurationProperties() {
- return configurationProperties;
- }
-
- @XmlElementWrapper
- @XmlElement(name = "property")
- public void setConfigurationProperties(List configurationProperties) {
- this.configurationProperties = configurationProperties;
- }
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Dependency.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Dependency.java
deleted file mode 100644
index 8eb96a9b1..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Dependency.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package eu.eudat.configurations.dynamicgrant.entities;
-
-import jakarta.xml.bind.annotation.XmlElement;
-
-/**
- * Created by ikalyvas on 3/23/2018.
- */
-public class Dependency {
- private String id;
- private String queryProperty;
-
- public String getId() {
- return id;
- }
-
- public String getQueryProperty() {
- return queryProperty;
- }
-
- @XmlElement(name = "id")
- public void setId(String id) {
- this.id = id;
- }
-
- @XmlElement(name = "queryProperty")
- public void setQueryProperty(String queryProperty) {
- this.queryProperty = queryProperty;
- }
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Language.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Language.java
deleted file mode 100644
index 47c024643..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Language.java
+++ /dev/null
@@ -1,29 +0,0 @@
-package eu.eudat.configurations.dynamicgrant.entities;
-
-import jakarta.xml.bind.annotation.XmlElement;
-
-/**
- * Created by ikalyvas on 3/28/2018.
- */
-public class Language {
- private String key;
- private String languageKey;
-
- public String getKey() {
- return key;
- }
-
- @XmlElement(name = "key")
- public void setKey(String key) {
- this.key = key;
- }
-
- public String getLanguageKey() {
- return languageKey;
- }
-
- @XmlElement(name = "languageKey")
- public void setLanguageKey(String languageKey) {
- this.languageKey = languageKey;
- }
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/MainProperty.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/MainProperty.java
deleted file mode 100644
index b73219a82..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/MainProperty.java
+++ /dev/null
@@ -1,106 +0,0 @@
-package eu.eudat.configurations.dynamicgrant.entities;
-
-import eu.eudat.service.remotefetcher.config.UrlConfiguration;
-
-import jakarta.xml.bind.annotation.XmlElement;
-import jakarta.xml.bind.annotation.XmlElementWrapper;
-import java.util.List;
-
-/**
- * Created by ikalyvas on 3/28/2018.
- */
-public class MainProperty {
- private String id;
- private String name;
- private String queryProperty;
- private String externalFieldId;
- private List urlConfig;
- private String externalFieldLabel;
- private List dependencies;
- private Boolean required;
- private List language;
-
-
- public String getId() {
- return id;
- }
-
- @XmlElement(name = "id")
- public void setId(String id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- @XmlElement(name = "name")
- public void setName(String name) {
- this.name = name;
- }
-
- public String getExternalFieldId() {
- return externalFieldId;
- }
-
- @XmlElement(name = "externalFieldId")
- public void setExternalFieldId(String externalFieldId) {
- this.externalFieldId = externalFieldId;
- }
-
- public String getExternalFieldLabel() {
- return externalFieldLabel;
- }
-
- @XmlElement(name = "externalFieldLabel")
- public void setExternalFieldLabel(String externalFieldLabel) {
- this.externalFieldLabel = externalFieldLabel;
- }
-
- public List getDependencies() {
- return dependencies;
- }
-
- @XmlElementWrapper
- @XmlElement(name = "dependency")
- public void setDependencies(List dependencies) {
- this.dependencies = dependencies;
- }
-
- public Boolean getRequired() {
- return required;
- }
-
- @XmlElement(name = "required")
- public void setRequired(Boolean required) {
- this.required = required;
- }
-
- public String getQueryProperty() {
- return queryProperty;
- }
-
- @XmlElement(name = "queryProperty")
- public void setQueryProperty(String queryProperty) {
- this.queryProperty = queryProperty;
- }
-
- public List getUrlConfig() {
- return urlConfig;
- }
-
- @XmlElement(name = "urlConfig")
- public void setUrlConfig(List urlConfig) {
- this.urlConfig = urlConfig;
- }
-
- public List getLanguage() {
- return language;
- }
-
- @XmlElementWrapper
- @XmlElement(name = "languageProperty")
- public void setLanguage(List language) {
- this.language = language;
- }
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Property.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Property.java
deleted file mode 100644
index ec31ce285..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicgrant/entities/Property.java
+++ /dev/null
@@ -1,93 +0,0 @@
-package eu.eudat.configurations.dynamicgrant.entities;
-
-import jakarta.xml.bind.annotation.XmlElement;
-import jakarta.xml.bind.annotation.XmlElementWrapper;
-import java.util.List;
-
-/**
- * Created by ikalyvas on 3/23/2018.
- */
-public class Property {
- private String id;
- private String name;
- private String sourceUrl;
- private String queryProperty;
- private String externalFieldId;
- private String externalFieldLabel;
- private List dependencies;
- private Boolean required;
-
-
- public String getId() {
- return id;
- }
-
- @XmlElement(name = "id")
- public void setId(String id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- @XmlElement(name = "name")
- public void setName(String name) {
- this.name = name;
- }
-
- public String getSourceUrl() {
- return sourceUrl;
- }
-
- @XmlElement(name = "sourceUrl")
- public void setSourceUrl(String sourceUrl) {
- this.sourceUrl = sourceUrl;
- }
-
- public String getExternalFieldId() {
- return externalFieldId;
- }
-
- @XmlElement(name = "externalFieldId")
- public void setExternalFieldId(String externalFieldId) {
- this.externalFieldId = externalFieldId;
- }
-
- public String getExternalFieldLabel() {
- return externalFieldLabel;
- }
-
- @XmlElement(name = "externalFieldLabel")
- public void setExternalFieldLabel(String externalFieldLabel) {
- this.externalFieldLabel = externalFieldLabel;
- }
-
- public List getDependencies() {
- return dependencies;
- }
-
- @XmlElementWrapper
- @XmlElement(name = "dependency")
- public void setDependencies(List dependencies) {
- this.dependencies = dependencies;
- }
-
- public Boolean getRequired() {
- return required;
- }
-
- @XmlElement(name = "required")
- public void setRequired(Boolean required) {
- this.required = required;
- }
-
- public String getQueryProperty() {
- return queryProperty;
- }
-
- @XmlElement(name = "queryProperty")
- public void setQueryProperty(String queryProperty) {
- this.queryProperty = queryProperty;
- }
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/DynamicProjectConfiguration.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/DynamicProjectConfiguration.java
deleted file mode 100644
index 825a00c9f..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/DynamicProjectConfiguration.java
+++ /dev/null
@@ -1,12 +0,0 @@
-package eu.eudat.configurations.dynamicproject;
-
-import eu.eudat.configurations.dynamicproject.entities.Configuration;
-import eu.eudat.models.data.dynamicfields.DynamicField;
-
-import java.util.List;
-
-public interface DynamicProjectConfiguration {
- Configuration getConfiguration();
-
- List getFields();
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/DynamicProjectConfigurationDevelImpl.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/DynamicProjectConfigurationDevelImpl.java
deleted file mode 100644
index f385580bf..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/DynamicProjectConfigurationDevelImpl.java
+++ /dev/null
@@ -1,87 +0,0 @@
-package eu.eudat.configurations.dynamicproject;
-
-import eu.eudat.configurations.dynamicproject.entities.Configuration;
-import eu.eudat.configurations.dynamicproject.entities.Property;
-import eu.eudat.models.data.dynamicfields.Dependency;
-import eu.eudat.models.data.dynamicfields.DynamicField;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Profile;
-import org.springframework.core.env.Environment;
-import org.springframework.stereotype.Service;
-
-import jakarta.xml.bind.JAXBContext;
-import jakarta.xml.bind.Unmarshaller;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.util.LinkedList;
-import java.util.List;
-
-@Service("dynamicProjectConfiguration")
-@Profile("devel")
-public class DynamicProjectConfigurationDevelImpl implements DynamicProjectConfiguration{
- private static final Logger logger = LoggerFactory.getLogger(DynamicProjectConfigurationDevelImpl.class);
-
- private Configuration configuration;
- private List fields;
- private Environment environment;
-
- @Autowired
- public DynamicProjectConfigurationDevelImpl(Environment environment) {
- this.environment = environment;
- }
-
- @Override
- public Configuration getConfiguration() {
- if (this.configuration != null) return this.configuration;
- String fileUrl = this.environment.getProperty("configuration.dynamicProjectUrl");
- logger.info("Loaded also config file: " + fileUrl);
- String current = null;
- InputStream is = null;
- try {
- current = new java.io.File(".").getCanonicalPath();
-
- JAXBContext jaxbContext = JAXBContext.newInstance(Configuration.class);
- Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
- is = new URL("file:///"+ current + "/web/src/main/resources/ProjectConfiguration.xml").openStream();
- this.configuration = (Configuration) jaxbUnmarshaller.unmarshal(is);
- } catch (Exception ex) {
- logger.error("Cannot find in folder" + current, ex);
- } finally {
- try {
- if (is != null) is.close();
- } catch (IOException e) {
- logger.warn("Warning: Could not close a stream after reading from file: " + fileUrl, e);
- }
- }
- return this.configuration;
- }
-
- @Override
- public List getFields() {
- if (this.fields != null) return this.fields;
- Configuration configuration = this.getConfiguration();
- List fields = new LinkedList<>();
- List properties = configuration.getConfigurationProperties();
- properties.stream().forEach(item -> {
- DynamicField dynamicField = new DynamicField();
- dynamicField.setId(item.getId());
- dynamicField.setName(item.getName());
- dynamicField.setQueryProperty(item.getQueryProperty());
- dynamicField.setRequired(item.getRequired());
- List dependencies = new LinkedList<>();
- item.getDependencies().stream().forEach(dependency -> {
- Dependency modelDependency = new Dependency();
- modelDependency.setId(dependency.getId());
- modelDependency.setQueryProperty(dependency.getQueryProperty());
- dependencies.add(modelDependency);
- });
- dynamicField.setDependencies(dependencies);
- fields.add(dynamicField);
- });
- this.fields = fields;
- return fields;
- }
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/DynamicProjectConfigurationProdImpl.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/DynamicProjectConfigurationProdImpl.java
deleted file mode 100644
index 0d0aeb607..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/DynamicProjectConfigurationProdImpl.java
+++ /dev/null
@@ -1,90 +0,0 @@
-package eu.eudat.configurations.dynamicproject;
-
-import eu.eudat.configurations.dynamicproject.entities.Configuration;
-import eu.eudat.configurations.dynamicproject.entities.Property;
-import eu.eudat.models.data.dynamicfields.Dependency;
-import eu.eudat.models.data.dynamicfields.DynamicField;
-import org.slf4j.Logger;
-import org.slf4j.LoggerFactory;
-import org.springframework.beans.factory.annotation.Autowired;
-import org.springframework.context.annotation.Profile;
-import org.springframework.core.env.Environment;
-import org.springframework.stereotype.Service;
-
-import jakarta.xml.bind.JAXBContext;
-import jakarta.xml.bind.Unmarshaller;
-import java.io.IOException;
-import java.io.InputStream;
-import java.net.URL;
-import java.nio.file.Paths;
-import java.util.LinkedList;
-import java.util.List;
-
-@Service("dynamicProjectConfiguration")
-@Profile({ "production", "staging", "docker" })
-public class DynamicProjectConfigurationProdImpl implements DynamicProjectConfiguration{
- private static final Logger logger = LoggerFactory.getLogger(DynamicProjectConfigurationProdImpl.class);
-
- private Configuration configuration;
-
- private List fields;
-
- private Environment environment;
-
- @Autowired
- public DynamicProjectConfigurationProdImpl(Environment environment) {
- this.environment = environment;
- }
-
- @Override
- public Configuration getConfiguration() {
- if (this.configuration != null) return this.configuration;
- String fileUrl = this.environment.getProperty("configuration.dynamicProjectUrl");
- logger.info("Loaded also config file: " + fileUrl);
- String current = null;
- InputStream is = null;
- try {
- current = new java.io.File(".").getCanonicalPath();
-
- JAXBContext jaxbContext = JAXBContext.newInstance(Configuration.class);
- Unmarshaller jaxbUnmarshaller = jaxbContext.createUnmarshaller();
- is = new URL(Paths.get(fileUrl).toUri().toURL().toString()).openStream();
- this.configuration = (Configuration) jaxbUnmarshaller.unmarshal(is);
- } catch (Exception ex) {
- logger.error("Cannot find in folder" + current, ex);
- } finally {
- try {
- if (is != null) is.close();
- } catch (IOException e) {
- logger.warn("Warning: Could not close a stream after reading from file: " + fileUrl, e);
- }
- }
- return this.configuration;
- }
-
- @Override
- public List getFields() {
- if (this.fields != null) return this.fields;
- Configuration configuration = this.getConfiguration();
- List fields = new LinkedList<>();
- List properties = configuration.getConfigurationProperties();
- properties.stream().forEach(item -> {
- DynamicField dynamicField = new DynamicField();
- dynamicField.setId(item.getId());
- dynamicField.setName(item.getName());
- dynamicField.setQueryProperty(item.getQueryProperty());
- dynamicField.setRequired(item.getRequired());
- List dependencies = new LinkedList<>();
- item.getDependencies().stream().forEach(dependency -> {
- Dependency modelDependency = new Dependency();
- modelDependency.setId(dependency.getId());
- modelDependency.setQueryProperty(dependency.getQueryProperty());
- dependencies.add(modelDependency);
- });
- dynamicField.setDependencies(dependencies);
- fields.add(dynamicField);
- });
- this.fields = fields;
- return fields;
- }
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Configuration.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Configuration.java
deleted file mode 100644
index f207844c6..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Configuration.java
+++ /dev/null
@@ -1,32 +0,0 @@
-package eu.eudat.configurations.dynamicproject.entities;
-
-
-import jakarta.xml.bind.annotation.XmlElement;
-import jakarta.xml.bind.annotation.XmlElementWrapper;
-import jakarta.xml.bind.annotation.XmlRootElement;
-import java.util.List;
-
-@XmlRootElement
-public class Configuration {
- private List configurationProperties;
- private MainProperty mainExternalField;
-
- public MainProperty getMainExternalField() {
- return mainExternalField;
- }
-
- @XmlElement(name = "mainExternalField")
- public void setMainExternalField(MainProperty mainExternalField) {
- this.mainExternalField = mainExternalField;
- }
-
- public List getConfigurationProperties() {
- return configurationProperties;
- }
-
- @XmlElementWrapper
- @XmlElement(name = "property")
- public void setConfigurationProperties(List configurationProperties) {
- this.configurationProperties = configurationProperties;
- }
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Dependency.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Dependency.java
deleted file mode 100644
index 889444402..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Dependency.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package eu.eudat.configurations.dynamicproject.entities;
-
-import jakarta.xml.bind.annotation.XmlElement;
-
-public class Dependency {
- private String id;
- private String queryProperty;
-
- public String getId() {
- return id;
- }
-
- public String getQueryProperty() {
- return queryProperty;
- }
-
- @XmlElement(name = "id")
- public void setId(String id) {
- this.id = id;
- }
-
- @XmlElement(name = "queryProperty")
- public void setQueryProperty(String queryProperty) {
- this.queryProperty = queryProperty;
- }
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Language.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Language.java
deleted file mode 100644
index 89fed26d6..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Language.java
+++ /dev/null
@@ -1,26 +0,0 @@
-package eu.eudat.configurations.dynamicproject.entities;
-
-import jakarta.xml.bind.annotation.XmlElement;
-
-public class Language {
- private String key;
- private String languageKey;
-
- public String getKey() {
- return key;
- }
-
- @XmlElement(name = "key")
- public void setKey(String key) {
- this.key = key;
- }
-
- public String getLanguageKey() {
- return languageKey;
- }
-
- @XmlElement(name = "languageKey")
- public void setLanguageKey(String languageKey) {
- this.languageKey = languageKey;
- }
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/MainProperty.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/MainProperty.java
deleted file mode 100644
index 96df8f202..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/MainProperty.java
+++ /dev/null
@@ -1,103 +0,0 @@
-package eu.eudat.configurations.dynamicproject.entities;
-
-import eu.eudat.service.remotefetcher.config.UrlConfiguration;
-
-import jakarta.xml.bind.annotation.XmlElement;
-import jakarta.xml.bind.annotation.XmlElementWrapper;
-import java.util.List;
-
-public class MainProperty {
- private String id;
- private String name;
- private String queryProperty;
- private String externalFieldId;
- private List urlConfig;
- private String externalFieldLabel;
- private List dependencies;
- private Boolean required;
- private List language;
-
-
- public String getId() {
- return id;
- }
-
- @XmlElement(name = "id")
- public void setId(String id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- @XmlElement(name = "name")
- public void setName(String name) {
- this.name = name;
- }
-
- public String getExternalFieldId() {
- return externalFieldId;
- }
-
- @XmlElement(name = "externalFieldId")
- public void setExternalFieldId(String externalFieldId) {
- this.externalFieldId = externalFieldId;
- }
-
- public String getExternalFieldLabel() {
- return externalFieldLabel;
- }
-
- @XmlElement(name = "externalFieldLabel")
- public void setExternalFieldLabel(String externalFieldLabel) {
- this.externalFieldLabel = externalFieldLabel;
- }
-
- public List getDependencies() {
- return dependencies;
- }
-
- @XmlElementWrapper
- @XmlElement(name = "dependency")
- public void setDependencies(List dependencies) {
- this.dependencies = dependencies;
- }
-
- public Boolean getRequired() {
- return required;
- }
-
- @XmlElement(name = "required")
- public void setRequired(Boolean required) {
- this.required = required;
- }
-
- public String getQueryProperty() {
- return queryProperty;
- }
-
- @XmlElement(name = "queryProperty")
- public void setQueryProperty(String queryProperty) {
- this.queryProperty = queryProperty;
- }
-
- public List getUrlConfig() {
- return urlConfig;
- }
-
- @XmlElement(name = "urlConfig")
- public void setUrlConfig(List urlConfig) {
- this.urlConfig = urlConfig;
- }
-
- public List getLanguage() {
- return language;
- }
-
- @XmlElementWrapper
- @XmlElement(name = "languageProperty")
- public void setLanguage(List language) {
- this.language = language;
- }
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Property.java b/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Property.java
deleted file mode 100644
index 40b919a8a..000000000
--- a/dmp-backend/web/src/main/java/eu/eudat/configurations/dynamicproject/entities/Property.java
+++ /dev/null
@@ -1,91 +0,0 @@
-package eu.eudat.configurations.dynamicproject.entities;
-
-
-import jakarta.xml.bind.annotation.XmlElement;
-import jakarta.xml.bind.annotation.XmlElementWrapper;
-import java.util.List;
-
-public class Property {
- private String id;
- private String name;
- private String sourceUrl;
- private String queryProperty;
- private String externalFieldId;
- private String externalFieldLabel;
- private List dependencies;
- private Boolean required;
-
-
- public String getId() {
- return id;
- }
-
- @XmlElement(name = "id")
- public void setId(String id) {
- this.id = id;
- }
-
- public String getName() {
- return name;
- }
-
- @XmlElement(name = "name")
- public void setName(String name) {
- this.name = name;
- }
-
- public String getSourceUrl() {
- return sourceUrl;
- }
-
- @XmlElement(name = "sourceUrl")
- public void setSourceUrl(String sourceUrl) {
- this.sourceUrl = sourceUrl;
- }
-
- public String getExternalFieldId() {
- return externalFieldId;
- }
-
- @XmlElement(name = "externalFieldId")
- public void setExternalFieldId(String externalFieldId) {
- this.externalFieldId = externalFieldId;
- }
-
- public String getExternalFieldLabel() {
- return externalFieldLabel;
- }
-
- @XmlElement(name = "externalFieldLabel")
- public void setExternalFieldLabel(String externalFieldLabel) {
- this.externalFieldLabel = externalFieldLabel;
- }
-
- public List getDependencies() {
- return dependencies;
- }
-
- @XmlElementWrapper
- @XmlElement(name = "dependency")
- public void setDependencies(List dependencies) {
- this.dependencies = dependencies;
- }
-
- public Boolean getRequired() {
- return required;
- }
-
- @XmlElement(name = "required")
- public void setRequired(Boolean required) {
- this.required = required;
- }
-
- public String getQueryProperty() {
- return queryProperty;
- }
-
- @XmlElement(name = "queryProperty")
- public void setQueryProperty(String queryProperty) {
- this.queryProperty = queryProperty;
- }
-}
diff --git a/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPs.java b/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPs.java
index 428b8b971..eec034d9f 100644
--- a/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPs.java
+++ b/dmp-backend/web/src/main/java/eu/eudat/controllers/DMPs.java
@@ -2,7 +2,6 @@ package eu.eudat.controllers;
import eu.eudat.authorization.Permission;
-import eu.eudat.configurations.dynamicgrant.DynamicGrantConfiguration;
import eu.eudat.criteria.DMPCriteria;
import eu.eudat.data.DmpEntity;
import eu.eudat.data.dao.criteria.DynamicFieldsCriteria;
@@ -65,17 +64,15 @@ import static org.springframework.http.MediaType.*;
public class DMPs extends BaseController {
private static final Logger logger = LoggerFactory.getLogger(DMPs.class);
- private DynamicGrantConfiguration dynamicGrantConfiguration;
private Environment environment;
private DataManagementPlanManager dataManagementPlanManager;
private ConfigLoader configLoader;
private final AuthorizationService authorizationService;
@Autowired
- public DMPs(ApiContext apiContext, DynamicGrantConfiguration dynamicGrantConfiguration, Environment environment,
+ public DMPs(ApiContext apiContext, Environment environment,
DataManagementPlanManager dataManagementPlanManager, ConfigLoader configLoader, AuthorizationService authorizationService) {
super(apiContext);
- this.dynamicGrantConfiguration = dynamicGrantConfiguration;
this.environment = environment;
this.dataManagementPlanManager = dataManagementPlanManager;
this.configLoader = configLoader;
@@ -168,14 +165,14 @@ public class DMPs extends BaseController {
// }
}
- @RequestMapping(method = RequestMethod.POST, value = {"/dynamic"}, consumes = "application/json", produces = "application/json")
- public @ResponseBody
- ResponseEntity>>> getWithCriteria(@RequestBody RequestItem criteriaRequestItem) throws InstantiationException, IllegalAccessException {
- this.authorizationService.authorizeForce(Permission.AuthenticatedRole);
-
- List> dataTable = this.dataManagementPlanManager.getDynamicFields(criteriaRequestItem.getCriteria().getId(), this.dynamicGrantConfiguration, criteriaRequestItem.getCriteria());
- return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem>>().status(ApiMessageCode.NO_MESSAGE).payload(dataTable));
- }
+// @RequestMapping(method = RequestMethod.POST, value = {"/dynamic"}, consumes = "application/json", produces = "application/json")
+// public @ResponseBody
+// ResponseEntity>>> getWithCriteria(@RequestBody RequestItem criteriaRequestItem) throws InstantiationException, IllegalAccessException {
+// this.authorizationService.authorizeForce(Permission.AuthenticatedRole);
+//
+// List> dataTable = this.dataManagementPlanManager.getDynamicFields(criteriaRequestItem.getCriteria().getId(), this.dynamicGrantConfiguration, criteriaRequestItem.getCriteria());
+// return ResponseEntity.status(HttpStatus.OK).body(new ResponseItem>>().status(ApiMessageCode.NO_MESSAGE).payload(dataTable));
+// }
@RequestMapping(method = RequestMethod.GET, value = {"/versions/{id}"}, consumes = "application/json", produces = "application/json")
public @ResponseBody
diff --git a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java
index f49727fe2..7071a0afa 100644
--- a/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java
+++ b/dmp-backend/web/src/main/java/eu/eudat/logic/managers/DataManagementPlanManager.java
@@ -6,8 +6,6 @@ import eu.eudat.commons.XmlHandlingService;
import eu.eudat.commons.enums.*;
import eu.eudat.commons.scope.user.UserScope;
import eu.eudat.commons.types.dmpblueprint.*;
-import eu.eudat.configurations.dynamicgrant.DynamicGrantConfiguration;
-import eu.eudat.configurations.dynamicgrant.entities.Property;
import eu.eudat.data.*;
import eu.eudat.data.dao.criteria.*;
import eu.eudat.data.dao.entities.*;
@@ -366,48 +364,48 @@ public class DataManagementPlanManager {
return datamanagementPlan;
}
- public List> getDynamicFields(String id, DynamicGrantConfiguration dynamicGrantConfiguration, DynamicFieldsCriteria criteria) throws IllegalAccessException, InstantiationException {
- List> result = new LinkedList<>();
- RestTemplate restTemplate = new RestTemplate();
- HttpHeaders headers = new HttpHeaders();
- headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
- headers.setContentType(MediaType.APPLICATION_JSON);
- HttpEntity entity = new HttpEntity<>("parameters", headers);
-
- Property property = dynamicGrantConfiguration.getConfiguration().getConfigurationProperties().stream()
- .filter(item -> item.getId().equals(id)).findFirst().orElse(null);
- StringBuilder stringBuilder = new StringBuilder();
- if (criteria.getLike() != null) stringBuilder.append("?search=" + criteria.getLike());
- if (property.getDependencies() != null && !property.getDependencies().isEmpty() && criteria.getDynamicFields() != null && !criteria.getDynamicFields().isEmpty()) {
- property.getDependencies().stream().forEach(item -> {
- DynamicFieldsCriteria.DynamicFieldDependencyCriteria dependencyCriteria = criteria.getDynamicFields().stream().filter(dfield -> dfield.getProperty().equals(item.getId()))
- .findFirst().orElse(null);
- if (dependencyCriteria != null) {
- if (criteria.getLike() != null || property.getDependencies().indexOf(item) > 0)
- stringBuilder.append("&");
- stringBuilder.append(item.getQueryProperty() + "=" + dependencyCriteria.getValue());
- }
- });
-
- ResponseEntity response = restTemplate.exchange(property.getSourceUrl() + stringBuilder.toString(), HttpMethod.GET, entity, ArrayList.class);
- response.getBody().forEach(item -> {
- Tuple tuple = new Tuple<>();
- tuple.setId((String) (((Map) item).get(property.getExternalFieldId())));
- tuple.setLabel((String) (((Map) item).get(property.getExternalFieldLabel())));
- result.add(tuple);
- });
-
- } else {
- ResponseEntity response = restTemplate.exchange(property.getSourceUrl() + stringBuilder.toString(), HttpMethod.GET, entity, ArrayList.class);
- response.getBody().forEach(item -> {
- Tuple tuple = new Tuple<>();
- tuple.setId((String) (((Map) item).get(property.getExternalFieldId())));
- tuple.setLabel((String) (((Map) item).get(property.getExternalFieldLabel())));
- result.add(tuple);
- });
- }
- return result;
- }
+// public List> getDynamicFields(String id, DynamicGrantConfiguration dynamicGrantConfiguration, DynamicFieldsCriteria criteria) throws IllegalAccessException, InstantiationException {
+// List> result = new LinkedList<>();
+// RestTemplate restTemplate = new RestTemplate();
+// HttpHeaders headers = new HttpHeaders();
+// headers.setAccept(Collections.singletonList(MediaType.APPLICATION_JSON));
+// headers.setContentType(MediaType.APPLICATION_JSON);
+// HttpEntity entity = new HttpEntity<>("parameters", headers);
+//
+// Property property = dynamicGrantConfiguration.getConfiguration().getConfigurationProperties().stream()
+// .filter(item -> item.getId().equals(id)).findFirst().orElse(null);
+// StringBuilder stringBuilder = new StringBuilder();
+// if (criteria.getLike() != null) stringBuilder.append("?search=" + criteria.getLike());
+// if (property.getDependencies() != null && !property.getDependencies().isEmpty() && criteria.getDynamicFields() != null && !criteria.getDynamicFields().isEmpty()) {
+// property.getDependencies().stream().forEach(item -> {
+// DynamicFieldsCriteria.DynamicFieldDependencyCriteria dependencyCriteria = criteria.getDynamicFields().stream().filter(dfield -> dfield.getProperty().equals(item.getId()))
+// .findFirst().orElse(null);
+// if (dependencyCriteria != null) {
+// if (criteria.getLike() != null || property.getDependencies().indexOf(item) > 0)
+// stringBuilder.append("&");
+// stringBuilder.append(item.getQueryProperty() + "=" + dependencyCriteria.getValue());
+// }
+// });
+//
+// ResponseEntity response = restTemplate.exchange(property.getSourceUrl() + stringBuilder.toString(), HttpMethod.GET, entity, ArrayList.class);
+// response.getBody().forEach(item -> {
+// Tuple tuple = new Tuple<>();
+// tuple.setId((String) (((Map) item).get(property.getExternalFieldId())));
+// tuple.setLabel((String) (((Map) item).get(property.getExternalFieldLabel())));
+// result.add(tuple);
+// });
+//
+// } else {
+// ResponseEntity response = restTemplate.exchange(property.getSourceUrl() + stringBuilder.toString(), HttpMethod.GET, entity, ArrayList.class);
+// response.getBody().forEach(item -> {
+// Tuple tuple = new Tuple<>();
+// tuple.setId((String) (((Map) item).get(property.getExternalFieldId())));
+// tuple.setLabel((String) (((Map) item).get(property.getExternalFieldLabel())));
+// result.add(tuple);
+// });
+// }
+// return result;
+// }
public DataTableData getDatasetProfilesUsedByDMP(DatasetProfileTableRequestItem datasetProfileTableRequestItem) throws InvalidApplicationException {
datasetProfileTableRequestItem.getCriteria().setFilter(DatasetProfileCriteria.DatasetProfileFilter.DMPs.getValue());
diff --git a/dmp-backend/web/src/main/resources/config/queue-devel.yml b/dmp-backend/web/src/main/resources/config/queue-devel.yml
index a5a7d9992..be18ee0e5 100644
--- a/dmp-backend/web/src/main/resources/config/queue-devel.yml
+++ b/dmp-backend/web/src/main/resources/config/queue-devel.yml
@@ -1,5 +1,6 @@
queue:
rabbitmq:
+ enable: true
durable: true
queue: cite_dmp_devel_web_inbox_queue
exchange: cite_dmp_devel_queue
diff --git a/dmp-backend/web/src/main/resources/config/queue.yml b/dmp-backend/web/src/main/resources/config/queue.yml
index 0f04da973..a9abcd96f 100644
--- a/dmp-backend/web/src/main/resources/config/queue.yml
+++ b/dmp-backend/web/src/main/resources/config/queue.yml
@@ -8,7 +8,7 @@ spring:
enabled: false
queue:
rabbitmq:
- enable: true
+ enable: false
app-id: ${THE_API_ID}
durable: null
queue: null