remove integration event descriptiontouched integration event

This commit is contained in:
Efstratios Giannopoulos 2024-03-29 16:27:27 +02:00
parent 2339b51c24
commit aa6768e67d
9 changed files with 1 additions and 351 deletions

View File

@ -1,10 +1,5 @@
package eu.eudat.integrationevent.outbox.annotationentitytouch;
import eu.eudat.integrationevent.outbox.dmptouched.DmpTouchedIntegrationEvent;
import eu.eudat.model.persist.DmpPersist;
import java.util.ArrayList;
import java.util.List;
import java.util.UUID;
public interface AnnotationEntityTouchedIntegrationEventHandler {

View File

@ -1,102 +0,0 @@
package eu.eudat.integrationevent.outbox.descriptiontouched;
import eu.eudat.commons.enums.DescriptionStatus;
import eu.eudat.integrationevent.TrackedEvent;
import eu.eudat.model.persist.descriptionproperties.PropertyDefinitionPersist;
import java.util.List;
import java.util.UUID;
public class DescriptionTouchedIntegrationEvent extends TrackedEvent {
private UUID id;
private String label;
private UUID dmpId;
private UUID dmpDescriptionTemplateId;
private UUID descriptionTemplateId;
private DescriptionStatus status;
private String description;
private PropertyDefinitionPersist properties;
private List<String> tags;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public UUID getDmpId() {
return dmpId;
}
public void setDmpId(UUID dmpId) {
this.dmpId = dmpId;
}
public UUID getDmpDescriptionTemplateId() {
return dmpDescriptionTemplateId;
}
public void setDmpDescriptionTemplateId(UUID dmpDescriptionTemplateId) {
this.dmpDescriptionTemplateId = dmpDescriptionTemplateId;
}
public UUID getDescriptionTemplateId() {
return descriptionTemplateId;
}
public void setDescriptionTemplateId(UUID descriptionTemplateId) {
this.descriptionTemplateId = descriptionTemplateId;
}
public DescriptionStatus getStatus() {
return status;
}
public void setStatus(DescriptionStatus status) {
this.status = status;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public PropertyDefinitionPersist getProperties() {
return properties;
}
public void setProperties(PropertyDefinitionPersist properties) {
this.properties = properties;
}
public List<String> getTags() {
return tags;
}
public void setTags(List<String> tags) {
this.tags = tags;
}
}

View File

@ -1,23 +0,0 @@
package eu.eudat.integrationevent.outbox.descriptiontouched;
import eu.eudat.model.persist.DescriptionPersist;
public interface DescriptionTouchedIntegrationEventHandler {
void handle(DescriptionTouchedIntegrationEvent event);
static DescriptionTouchedIntegrationEvent buildEventFromPersistModel(DescriptionPersist persist) {
DescriptionTouchedIntegrationEvent event = new DescriptionTouchedIntegrationEvent();
event.setId(persist.getId());
event.setLabel(persist.getLabel());
event.setDmpId(persist.getDmpId());
event.setDmpDescriptionTemplateId(persist.getDmpDescriptionTemplateId());
event.setDescriptionTemplateId(persist.getDescriptionTemplateId());
event.setStatus(persist.getStatus());
event.setDescription(persist.getDescription());
event.setProperties(persist.getProperties());
event.setTags(persist.getTags());
return event;
}
}

View File

@ -1,34 +0,0 @@
package eu.eudat.integrationevent.outbox.descriptiontouched;
import eu.eudat.integrationevent.outbox.OutboxIntegrationEvent;
import eu.eudat.integrationevent.outbox.OutboxService;
import gr.cite.tools.logging.LoggerService;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import java.util.UUID;
@Component
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class DescriptionTouchedIntegrationEventHandlerImpl implements DescriptionTouchedIntegrationEventHandler {
private static final LoggerService logger = new LoggerService(LoggerFactory.getLogger(DescriptionTouchedIntegrationEventHandlerImpl.class));
private final OutboxService outboxService;
public DescriptionTouchedIntegrationEventHandlerImpl(OutboxService outboxService) {
this.outboxService = outboxService;
}
@Override
public void handle(DescriptionTouchedIntegrationEvent event) {
OutboxIntegrationEvent message = new OutboxIntegrationEvent();
message.setMessageId(UUID.randomUUID());
message.setType(OutboxIntegrationEvent.DESCRIPTION_TOUCH);
message.setEvent(event);
this.outboxService.publish(message);
}
}

View File

@ -1,116 +0,0 @@
package eu.eudat.integrationevent.outbox.dmptouched;
import eu.eudat.commons.enums.DmpAccessType;
import eu.eudat.commons.enums.DmpStatus;
import eu.eudat.integrationevent.TrackedEvent;
import eu.eudat.model.persist.DmpDescriptionTemplatePersist;
import eu.eudat.model.persist.dmpproperties.DmpBlueprintValuePersist;
import eu.eudat.model.persist.dmpproperties.DmpContactPersist;
import java.util.List;
import java.util.Map;
import java.util.UUID;
public class DmpTouchedIntegrationEvent extends TrackedEvent {
private UUID id;
private String label;
private DmpStatus status;
private List<DmpContactPersist> contacts;
private Map<UUID, DmpBlueprintValuePersist> dmpBlueprintValues;
private String description;
private String language;
private UUID blueprint;
private DmpAccessType accessType;
private List<DmpDescriptionTemplatePersist> descriptionTemplates;
public UUID getId() {
return id;
}
public void setId(UUID id) {
this.id = id;
}
public String getLabel() {
return label;
}
public void setLabel(String label) {
this.label = label;
}
public DmpStatus getStatus() {
return status;
}
public void setStatus(DmpStatus status) {
this.status = status;
}
public List<DmpContactPersist> getContacts() {
return contacts;
}
public void setContacts(List<DmpContactPersist> contacts) {
this.contacts = contacts;
}
public Map<UUID, DmpBlueprintValuePersist> getDmpBlueprintValues() {
return dmpBlueprintValues;
}
public void setDmpBlueprintValues(Map<UUID, DmpBlueprintValuePersist> dmpBlueprintValues) {
this.dmpBlueprintValues = dmpBlueprintValues;
}
public String getDescription() {
return description;
}
public void setDescription(String description) {
this.description = description;
}
public String getLanguage() {
return language;
}
public void setLanguage(String language) {
this.language = language;
}
public UUID getBlueprint() {
return blueprint;
}
public void setBlueprint(UUID blueprint) {
this.blueprint = blueprint;
}
public DmpAccessType getAccessType() {
return accessType;
}
public void setAccessType(DmpAccessType accessType) {
this.accessType = accessType;
}
public List<DmpDescriptionTemplatePersist> getDescriptionTemplates() {
return descriptionTemplates;
}
public void setDescriptionTemplates(List<DmpDescriptionTemplatePersist> descriptionTemplates) {
this.descriptionTemplates = descriptionTemplates;
}
}

View File

@ -1,24 +0,0 @@
package eu.eudat.integrationevent.outbox.dmptouched;
import eu.eudat.model.persist.DmpPersist;
public interface DmpTouchedIntegrationEventHandler {
void handle(DmpTouchedIntegrationEvent event);
static DmpTouchedIntegrationEvent buildEventFromPersistModel(DmpPersist persist) {
DmpTouchedIntegrationEvent event = new DmpTouchedIntegrationEvent();
event.setId(persist.getId());
event.setLabel(persist.getLabel());
event.setStatus(persist.getStatus());
event.setContacts(persist.getProperties().getContacts());
event.setDmpBlueprintValues(persist.getProperties().getDmpBlueprintValues());
event.setDescription(persist.getDescription());
event.setLanguage(persist.getLanguage());
event.setBlueprint(persist.getBlueprint());
event.setAccessType(persist.getAccessType());
event.setDescriptionTemplates(persist.getDescriptionTemplates());
return event;
}
}

View File

@ -1,35 +0,0 @@
package eu.eudat.integrationevent.outbox.dmptouched;
import eu.eudat.integrationevent.outbox.OutboxIntegrationEvent;
import eu.eudat.integrationevent.outbox.OutboxService;
import eu.eudat.integrationevent.outbox.tenantremoval.TenantRemovalIntegrationEventHandlerImpl;
import gr.cite.tools.logging.LoggerService;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.config.ConfigurableBeanFactory;
import org.springframework.context.annotation.Scope;
import org.springframework.stereotype.Component;
import java.util.UUID;
@Component
@Scope(value = ConfigurableBeanFactory.SCOPE_PROTOTYPE)
public class DmpTouchedIntegrationEventHandlerImpl implements DmpTouchedIntegrationEventHandler {
private static final LoggerService logger = new LoggerService(LoggerFactory.getLogger(DmpTouchedIntegrationEventHandlerImpl.class));
private final OutboxService outboxService;
public DmpTouchedIntegrationEventHandlerImpl(OutboxService outboxService) {
this.outboxService = outboxService;
}
@Override
public void handle(DmpTouchedIntegrationEvent event) {
OutboxIntegrationEvent message = new OutboxIntegrationEvent();
message.setMessageId(UUID.randomUUID());
message.setType(OutboxIntegrationEvent.DMP_TOUCH);
message.setEvent(event);
this.outboxService.publish(message);
}
}

View File

@ -24,7 +24,6 @@ import eu.eudat.event.DescriptionTouchedEvent;
import eu.eudat.event.EventBroker;
import eu.eudat.integrationevent.outbox.annotationentityremoval.AnnotationEntityRemovalIntegrationEventHandler;
import eu.eudat.integrationevent.outbox.annotationentitytouch.AnnotationEntityTouchedIntegrationEventHandler;
import eu.eudat.integrationevent.outbox.descriptiontouched.DescriptionTouchedIntegrationEventHandler;
import eu.eudat.integrationevent.outbox.notification.NotifyIntegrationEvent;
import eu.eudat.integrationevent.outbox.notification.NotifyIntegrationEventHandler;
import eu.eudat.model.*;
@ -99,7 +98,6 @@ public class DescriptionServiceImpl implements DescriptionService {
private final ValidatorFactory validatorFactory;
private final StorageFileProperties storageFileConfig;
private final StorageFileService storageFileService;
private final DescriptionTouchedIntegrationEventHandler descriptionTouchedIntegrationEventHandler;
private final AuthorizationContentResolver authorizationContentResolver;
private final AnnotationEntityTouchedIntegrationEventHandler annotationEntityTouchedIntegrationEventHandler;
private final AnnotationEntityRemovalIntegrationEventHandler annotationEntityRemovalIntegrationEventHandler;
@ -117,7 +115,7 @@ public class DescriptionServiceImpl implements DescriptionService {
QueryFactory queryFactory,
JsonHandlingService jsonHandlingService,
UserScope userScope,
XmlHandlingService xmlHandlingService, NotifyIntegrationEventHandler eventHandler, NotificationProperties notificationProperties, FileTransformerService fileTransformerService, ElasticService elasticService, ValidatorFactory validatorFactory, StorageFileProperties storageFileConfig, StorageFileService storageFileService, DescriptionTouchedIntegrationEventHandler descriptionTouchedIntegrationEventHandler, AuthorizationContentResolver authorizationContentResolver, AnnotationEntityTouchedIntegrationEventHandler annotationEntityTouchedIntegrationEventHandler, AnnotationEntityRemovalIntegrationEventHandler annotationEntityRemovalIntegrationEventHandler) {
XmlHandlingService xmlHandlingService, NotifyIntegrationEventHandler eventHandler, NotificationProperties notificationProperties, FileTransformerService fileTransformerService, ElasticService elasticService, ValidatorFactory validatorFactory, StorageFileProperties storageFileConfig, StorageFileService storageFileService, AuthorizationContentResolver authorizationContentResolver, AnnotationEntityTouchedIntegrationEventHandler annotationEntityTouchedIntegrationEventHandler, AnnotationEntityRemovalIntegrationEventHandler annotationEntityRemovalIntegrationEventHandler) {
this.entityManager = entityManager;
this.authorizationService = authorizationService;
this.deleterFactory = deleterFactory;
@ -137,7 +135,6 @@ public class DescriptionServiceImpl implements DescriptionService {
this.validatorFactory = validatorFactory;
this.storageFileConfig = storageFileConfig;
this.storageFileService = storageFileService;
this.descriptionTouchedIntegrationEventHandler = descriptionTouchedIntegrationEventHandler;
this.authorizationContentResolver = authorizationContentResolver;
this.annotationEntityTouchedIntegrationEventHandler = annotationEntityTouchedIntegrationEventHandler;
this.annotationEntityRemovalIntegrationEventHandler = annotationEntityRemovalIntegrationEventHandler;
@ -234,8 +231,6 @@ public class DescriptionServiceImpl implements DescriptionService {
//this.deleteOldFilesAndAddNew(datasetWizardModel, userInfo); //TODO
this.eventBroker.emit(new DescriptionTouchedEvent(data.getId()));
this.descriptionTouchedIntegrationEventHandler.handle(DescriptionTouchedIntegrationEventHandler.buildEventFromPersistModel(model));
this.annotationEntityTouchedIntegrationEventHandler.handleDescription(data.getId());
this.elasticService.persistDescription(data);

View File

@ -26,7 +26,6 @@ import eu.eudat.event.DmpTouchedEvent;
import eu.eudat.event.EventBroker;
import eu.eudat.integrationevent.outbox.annotationentityremoval.AnnotationEntityRemovalIntegrationEventHandler;
import eu.eudat.integrationevent.outbox.annotationentitytouch.AnnotationEntityTouchedIntegrationEventHandler;
import eu.eudat.integrationevent.outbox.dmptouched.DmpTouchedIntegrationEventHandler;
import eu.eudat.integrationevent.outbox.notification.NotifyIntegrationEvent;
import eu.eudat.integrationevent.outbox.notification.NotifyIntegrationEventHandler;
import eu.eudat.model.*;
@ -122,7 +121,6 @@ public class DmpServiceImpl implements DmpService {
private final ElasticService elasticService;
private final DmpTouchedIntegrationEventHandler dmpTouchedIntegrationEventHandler;
private final AnnotationEntityTouchedIntegrationEventHandler annotationEntityTouchedIntegrationEventHandler;
private final AnnotationEntityRemovalIntegrationEventHandler annotationEntityRemovalIntegrationEventHandler;
@ -149,7 +147,6 @@ public class DmpServiceImpl implements DmpService {
FileTransformerService fileTransformerService,
ValidatorFactory validatorFactory,
ElasticService elasticService,
DmpTouchedIntegrationEventHandler dmpTouchedIntegrationEventHandler,
AnnotationEntityTouchedIntegrationEventHandler annotationEntityTouchedIntegrationEventHandler, AnnotationEntityRemovalIntegrationEventHandler annotationEntityRemovalIntegrationEventHandler, AuthorizationContentResolver authorizationContentResolver) {
this.entityManager = entityManager;
this.authorizationService = authorizationService;
@ -170,7 +167,6 @@ public class DmpServiceImpl implements DmpService {
this.actionConfirmationService = actionConfirmationService;
this.validatorFactory = validatorFactory;
this.elasticService = elasticService;
this.dmpTouchedIntegrationEventHandler = dmpTouchedIntegrationEventHandler;
this.annotationEntityTouchedIntegrationEventHandler = annotationEntityTouchedIntegrationEventHandler;
this.annotationEntityRemovalIntegrationEventHandler = annotationEntityRemovalIntegrationEventHandler;
this.authorizationContentResolver = authorizationContentResolver;
@ -203,8 +199,6 @@ public class DmpServiceImpl implements DmpService {
this.eventBroker.emit(new DmpTouchedEvent(data.getId()));
this.dmpTouchedIntegrationEventHandler.handle(DmpTouchedIntegrationEventHandler.buildEventFromPersistModel(model));
this.sendNotification(data);
this.assignUsers(data.getId(), this.inviteUserOrAssignUsers(data.getId(), model.getUsers(), false), null, false);