Remove EventAwareEntity dependency on DescriptorEvent (#2031)
Signed-off-by: Avgustin Marinov <Avgustin.Marinov@bosch.com>
This commit is contained in:
@@ -24,7 +24,7 @@ public class EntityPropertyChangeListener extends DescriptorEventAdapter {
|
||||
public void postDelete(final DescriptorEvent event) {
|
||||
final Object object = event.getObject();
|
||||
if (isEventAwareEntity(object)) {
|
||||
doNotifiy(() -> ((EventAwareEntity) object).fireDeleteEvent(event));
|
||||
doNotify(() -> ((EventAwareEntity) object).fireDeleteEvent());
|
||||
}
|
||||
}
|
||||
|
||||
@@ -32,26 +32,23 @@ public class EntityPropertyChangeListener extends DescriptorEventAdapter {
|
||||
public void postInsert(final DescriptorEvent event) {
|
||||
final Object object = event.getObject();
|
||||
if (isEventAwareEntity(object)) {
|
||||
doNotifiy(() -> ((EventAwareEntity) object).fireCreateEvent(event));
|
||||
doNotify(() -> ((EventAwareEntity) object).fireCreateEvent());
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void postUpdate(final DescriptorEvent event) {
|
||||
|
||||
final Object object = event.getObject();
|
||||
if (isEventAwareEntity(object)
|
||||
&& isFireUpdate((EventAwareEntity) object, (UpdateObjectQuery) event.getQuery())) {
|
||||
doNotifiy(() -> ((EventAwareEntity) object).fireUpdateEvent(event));
|
||||
if (isEventAwareEntity(object) && isFireUpdate((EventAwareEntity) object, (UpdateObjectQuery) event.getQuery())) {
|
||||
doNotify(() -> ((EventAwareEntity) object).fireUpdateEvent());
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
private static boolean isEventAwareEntity(final Object object) {
|
||||
return object instanceof EventAwareEntity;
|
||||
}
|
||||
|
||||
private static void doNotifiy(final Runnable runnable) {
|
||||
private static void doNotify(final Runnable runnable) {
|
||||
AfterTransactionCommitExecutorHolder.getInstance().getAfterCommit().afterCommit(runnable);
|
||||
}
|
||||
|
||||
@@ -59,5 +56,4 @@ public class EntityPropertyChangeListener extends DescriptorEventAdapter {
|
||||
return entity.getUpdateIgnoreFields().isEmpty() || query.getObjectChangeSet().getChangedAttributeNames()
|
||||
.stream().anyMatch(field -> !entity.getUpdateIgnoreFields().contains(field));
|
||||
}
|
||||
|
||||
}
|
||||
}
|
||||
@@ -12,8 +12,6 @@ package org.eclipse.hawkbit.repository.jpa.model;
|
||||
import java.util.Collections;
|
||||
import java.util.List;
|
||||
|
||||
import org.eclipse.persistence.descriptors.DescriptorEvent;
|
||||
|
||||
/**
|
||||
* Interfaces which can be implemented by entities to be called when the entity
|
||||
* should fire an event because the entity has been created, updated or deleted.
|
||||
@@ -22,28 +20,21 @@ public interface EventAwareEntity {
|
||||
|
||||
/**
|
||||
* Fired for the Entity creation.
|
||||
*
|
||||
* @param descriptorEvent
|
||||
*/
|
||||
void fireCreateEvent(DescriptorEvent descriptorEvent);
|
||||
void fireCreateEvent();
|
||||
|
||||
/**
|
||||
* Fired for the Entity updation.
|
||||
*
|
||||
* @param descriptorEvent
|
||||
* Fired for the Entity update.
|
||||
*/
|
||||
void fireUpdateEvent(DescriptorEvent descriptorEvent);
|
||||
void fireUpdateEvent();
|
||||
|
||||
/**
|
||||
* Fired for the Entity deletion.
|
||||
*
|
||||
* @param descriptorEvent
|
||||
*/
|
||||
void fireDeleteEvent(DescriptorEvent descriptorEvent);
|
||||
void fireDeleteEvent();
|
||||
|
||||
/**
|
||||
* @return list of entity fields that if the only changed fields prevents
|
||||
* {@link #fireUpdateEvent(DescriptorEvent)} call.
|
||||
* @return list of entity fields that if the only changed fields prevents {@link #fireUpdateEvent()} call.
|
||||
*/
|
||||
default List<String> getUpdateIgnoreFields() {
|
||||
return Collections.emptyList();
|
||||
|
||||
@@ -45,11 +45,9 @@ import org.eclipse.hawkbit.repository.model.Rollout;
|
||||
import org.eclipse.hawkbit.repository.model.RolloutGroup;
|
||||
import org.eclipse.hawkbit.repository.model.Target;
|
||||
import org.eclipse.hawkbit.repository.model.helper.EventPublisherHolder;
|
||||
import org.eclipse.persistence.annotations.CascadeOnDelete;
|
||||
import org.eclipse.persistence.annotations.ConversionValue;
|
||||
import org.eclipse.persistence.annotations.Convert;
|
||||
import org.eclipse.persistence.annotations.ObjectTypeConverter;
|
||||
import org.eclipse.persistence.descriptors.DescriptorEvent;
|
||||
|
||||
/**
|
||||
* JPA implementation of {@link Action}.
|
||||
@@ -372,7 +370,7 @@ public class JpaAction extends AbstractJpaTenantAwareBaseEntity implements Actio
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireCreateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireCreateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher()
|
||||
.publishEvent(new ActionCreatedEvent(this, BaseEntity.getIdOrNull(target),
|
||||
BaseEntity.getIdOrNull(rollout), BaseEntity.getIdOrNull(rolloutGroup),
|
||||
@@ -380,7 +378,7 @@ public class JpaAction extends AbstractJpaTenantAwareBaseEntity implements Actio
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireUpdateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireUpdateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher()
|
||||
.publishEvent(new ActionUpdatedEvent(this, BaseEntity.getIdOrNull(target),
|
||||
BaseEntity.getIdOrNull(rollout), BaseEntity.getIdOrNull(rolloutGroup),
|
||||
@@ -388,7 +386,7 @@ public class JpaAction extends AbstractJpaTenantAwareBaseEntity implements Actio
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireDeleteEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireDeleteEvent() {
|
||||
// there is no action deletion
|
||||
}
|
||||
|
||||
|
||||
@@ -16,7 +16,6 @@ import java.util.HashSet;
|
||||
import java.util.List;
|
||||
import java.util.Optional;
|
||||
import java.util.Set;
|
||||
import java.util.stream.Collectors;
|
||||
|
||||
import jakarta.persistence.CascadeType;
|
||||
import jakarta.persistence.Column;
|
||||
@@ -52,10 +51,6 @@ import org.eclipse.hawkbit.repository.model.DistributionSetTag;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetType;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.helper.EventPublisherHolder;
|
||||
import org.eclipse.persistence.descriptors.DescriptorEvent;
|
||||
import org.eclipse.persistence.queries.UpdateObjectQuery;
|
||||
import org.eclipse.persistence.sessions.changesets.DirectToFieldChangeRecord;
|
||||
import org.eclipse.persistence.sessions.changesets.ObjectChangeSet;
|
||||
import org.springframework.context.ApplicationEvent;
|
||||
|
||||
/**
|
||||
@@ -273,24 +268,24 @@ public class JpaDistributionSet extends AbstractJpaNamedVersionedEntity implemen
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireCreateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireCreateEvent() {
|
||||
publishEventWithEventPublisher(
|
||||
new DistributionSetCreatedEvent(this, EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireUpdateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireUpdateEvent() {
|
||||
publishEventWithEventPublisher(
|
||||
new DistributionSetUpdatedEvent(this, EventPublisherHolder.getInstance().getApplicationId(), complete));
|
||||
|
||||
if (isSoftDeleted(descriptorEvent)) {
|
||||
if (deleted) {
|
||||
publishEventWithEventPublisher(new DistributionSetDeletedEvent(getTenant(), getId(), getClass(),
|
||||
EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireDeleteEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireDeleteEvent() {
|
||||
publishEventWithEventPublisher(new DistributionSetDeletedEvent(getTenant(), getId(), getClass(),
|
||||
EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
@@ -299,16 +294,6 @@ public class JpaDistributionSet extends AbstractJpaNamedVersionedEntity implemen
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(event);
|
||||
}
|
||||
|
||||
private static boolean isSoftDeleted(final DescriptorEvent event) {
|
||||
final ObjectChangeSet changeSet = ((UpdateObjectQuery) event.getQuery()).getObjectChangeSet();
|
||||
final List<DirectToFieldChangeRecord> changes = changeSet.getChanges().stream()
|
||||
.filter(DirectToFieldChangeRecord.class::isInstance).map(DirectToFieldChangeRecord.class::cast)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return changes.stream().anyMatch(changeRecord -> DELETED_PROPERTY.equals(changeRecord.getAttribute())
|
||||
&& Boolean.parseBoolean(changeRecord.getNewValue().toString()));
|
||||
}
|
||||
|
||||
private void checkTypeCompatability(final SoftwareModule softwareModule) {
|
||||
// we cannot allow that modules are added without a type defined
|
||||
if (type == null) {
|
||||
|
||||
@@ -11,7 +11,6 @@ package org.eclipse.hawkbit.repository.jpa.model;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
import jakarta.persistence.CascadeType;
|
||||
import jakarta.persistence.Entity;
|
||||
import jakarta.persistence.FetchType;
|
||||
import jakarta.persistence.Index;
|
||||
@@ -25,7 +24,6 @@ import org.eclipse.hawkbit.repository.event.remote.entity.DistributionSetTagUpda
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.DistributionSetTag;
|
||||
import org.eclipse.hawkbit.repository.model.helper.EventPublisherHolder;
|
||||
import org.eclipse.persistence.descriptors.DescriptorEvent;
|
||||
|
||||
/**
|
||||
* A {@link DistributionSetTag} is used to describe DistributionSet attributes
|
||||
@@ -62,19 +60,19 @@ public class JpaDistributionSetTag extends JpaTag implements DistributionSetTag,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireCreateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireCreateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(
|
||||
new DistributionSetTagCreatedEvent(this, EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireUpdateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireUpdateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(
|
||||
new DistributionSetTagUpdatedEvent(this, EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireDeleteEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireDeleteEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(new DistributionSetTagDeletedEvent(
|
||||
getTenant(), getId(), getClass(), EventPublisherHolder.getInstance().getApplicationId()));
|
||||
|
||||
|
||||
@@ -36,8 +36,6 @@ import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
|
||||
import org.eclipse.hawkbit.repository.model.TargetType;
|
||||
import org.eclipse.hawkbit.repository.model.helper.EventPublisherHolder;
|
||||
import org.eclipse.persistence.annotations.CascadeOnDelete;
|
||||
import org.eclipse.persistence.descriptors.DescriptorEvent;
|
||||
import org.springframework.util.CollectionUtils;
|
||||
|
||||
/**
|
||||
@@ -178,19 +176,19 @@ public class JpaDistributionSetType extends AbstractJpaTypeEntity implements Dis
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireCreateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireCreateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(
|
||||
new DistributionSetTypeCreatedEvent(this, EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireUpdateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireUpdateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(
|
||||
new DistributionSetTypeUpdatedEvent(this, EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireDeleteEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireDeleteEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(new DistributionSetTypeDeletedEvent(
|
||||
getTenant(), getId(), getClass(), EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@@ -45,10 +45,6 @@ import org.eclipse.hawkbit.repository.model.helper.EventPublisherHolder;
|
||||
import org.eclipse.persistence.annotations.ConversionValue;
|
||||
import org.eclipse.persistence.annotations.Convert;
|
||||
import org.eclipse.persistence.annotations.ObjectTypeConverter;
|
||||
import org.eclipse.persistence.descriptors.DescriptorEvent;
|
||||
import org.eclipse.persistence.queries.UpdateObjectQuery;
|
||||
import org.eclipse.persistence.sessions.changesets.DirectToFieldChangeRecord;
|
||||
import org.eclipse.persistence.sessions.changesets.ObjectChangeSet;
|
||||
|
||||
/**
|
||||
* JPA implementation of a {@link Rollout}.
|
||||
@@ -176,24 +172,24 @@ public class JpaRollout extends AbstractJpaNamedEntity implements Rollout, Event
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireCreateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireCreateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher()
|
||||
.publishEvent(new RolloutCreatedEvent(this, EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireUpdateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireUpdateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher()
|
||||
.publishEvent(new RolloutUpdatedEvent(this, EventPublisherHolder.getInstance().getApplicationId()));
|
||||
|
||||
if (isSoftDeleted(descriptorEvent)) {
|
||||
if (deleted) {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(new RolloutDeletedEvent(getTenant(),
|
||||
getId(), getClass(), EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireDeleteEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireDeleteEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(new RolloutDeletedEvent(getTenant(),
|
||||
getId(), getClass(), EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
@@ -334,14 +330,4 @@ public class JpaRollout extends AbstractJpaNamedEntity implements Rollout, Event
|
||||
public void setDeleted(final boolean deleted) {
|
||||
this.deleted = deleted;
|
||||
}
|
||||
|
||||
private static boolean isSoftDeleted(final DescriptorEvent event) {
|
||||
final ObjectChangeSet changeSet = ((UpdateObjectQuery) event.getQuery()).getObjectChangeSet();
|
||||
final List<DirectToFieldChangeRecord> changes = changeSet.getChanges().stream()
|
||||
.filter(DirectToFieldChangeRecord.class::isInstance).map(DirectToFieldChangeRecord.class::cast)
|
||||
.collect(Collectors.toList());
|
||||
|
||||
return changes.stream().anyMatch(changeRecord -> DELETED_PROPERTY.equals(changeRecord.getAttribute())
|
||||
&& Boolean.parseBoolean(changeRecord.getNewValue().toString()));
|
||||
}
|
||||
}
|
||||
}
|
||||
@@ -39,7 +39,6 @@ import org.eclipse.hawkbit.repository.model.helper.EventPublisherHolder;
|
||||
import org.eclipse.persistence.annotations.ConversionValue;
|
||||
import org.eclipse.persistence.annotations.Convert;
|
||||
import org.eclipse.persistence.annotations.ObjectTypeConverter;
|
||||
import org.eclipse.persistence.descriptors.DescriptorEvent;
|
||||
|
||||
/**
|
||||
* JPA entity definition of persisting a group of an rollout.
|
||||
@@ -196,18 +195,18 @@ public class JpaRolloutGroup extends AbstractJpaNamedEntity implements RolloutGr
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireCreateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireCreateEvent() {
|
||||
// there is no RolloutGroup created event
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireUpdateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireUpdateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(
|
||||
new RolloutGroupUpdatedEvent(this, getRollout().getId(), EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireDeleteEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireDeleteEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(
|
||||
new RolloutGroupDeletedEvent(getTenant(), getId(), getClass(), EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@@ -46,10 +46,6 @@ import org.eclipse.hawkbit.repository.model.DistributionSet;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
|
||||
import org.eclipse.hawkbit.repository.model.helper.EventPublisherHolder;
|
||||
import org.eclipse.persistence.descriptors.DescriptorEvent;
|
||||
import org.eclipse.persistence.queries.UpdateObjectQuery;
|
||||
import org.eclipse.persistence.sessions.changesets.DirectToFieldChangeRecord;
|
||||
import org.eclipse.persistence.sessions.changesets.ObjectChangeSet;
|
||||
|
||||
/**
|
||||
* Base Software Module that is supported by OS level provisioning mechanism on
|
||||
@@ -193,35 +189,25 @@ public class JpaSoftwareModule extends AbstractJpaNamedVersionedEntity implement
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireCreateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireCreateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(
|
||||
new SoftwareModuleCreatedEvent(this, EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireUpdateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireUpdateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(
|
||||
new SoftwareModuleUpdatedEvent(this, EventPublisherHolder.getInstance().getApplicationId()));
|
||||
|
||||
if (isSoftDeleted(descriptorEvent)) {
|
||||
if (deleted) {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(new SoftwareModuleDeletedEvent(
|
||||
getTenant(), getId(), getClass(), EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireDeleteEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireDeleteEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(new SoftwareModuleDeletedEvent(getTenant(),
|
||||
getId(), getClass(), EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
private static boolean isSoftDeleted(final DescriptorEvent event) {
|
||||
final ObjectChangeSet changeSet = ((UpdateObjectQuery) event.getQuery()).getObjectChangeSet();
|
||||
final List<DirectToFieldChangeRecord> changes = changeSet.getChanges().stream()
|
||||
.filter(DirectToFieldChangeRecord.class::isInstance).map(DirectToFieldChangeRecord.class::cast)
|
||||
.toList();
|
||||
|
||||
return changes.stream().anyMatch(changeRecord -> DELETED_PROPERTY.equals(changeRecord.getAttribute())
|
||||
&& Boolean.parseBoolean(changeRecord.getNewValue().toString()));
|
||||
}
|
||||
}
|
||||
@@ -23,7 +23,6 @@ import org.eclipse.hawkbit.repository.event.remote.entity.SoftwareModuleTypeCrea
|
||||
import org.eclipse.hawkbit.repository.event.remote.entity.SoftwareModuleTypeUpdatedEvent;
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModuleType;
|
||||
import org.eclipse.hawkbit.repository.model.helper.EventPublisherHolder;
|
||||
import org.eclipse.persistence.descriptors.DescriptorEvent;
|
||||
|
||||
/**
|
||||
* Type of a software modules.
|
||||
@@ -108,19 +107,19 @@ public class JpaSoftwareModuleType extends AbstractJpaTypeEntity implements Soft
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireCreateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireCreateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(
|
||||
new SoftwareModuleTypeCreatedEvent(this, EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireUpdateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireUpdateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(
|
||||
new SoftwareModuleTypeUpdatedEvent(this, EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireDeleteEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireDeleteEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(new SoftwareModuleTypeDeletedEvent(
|
||||
getTenant(), getId(), getClass(), EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@@ -64,7 +64,6 @@ import org.eclipse.hawkbit.security.SystemSecurityContext;
|
||||
import org.eclipse.persistence.annotations.ConversionValue;
|
||||
import org.eclipse.persistence.annotations.Convert;
|
||||
import org.eclipse.persistence.annotations.ObjectTypeConverter;
|
||||
import org.eclipse.persistence.descriptors.DescriptorEvent;
|
||||
|
||||
/**
|
||||
* JPA implementation of {@link Target}.
|
||||
@@ -468,19 +467,19 @@ public class JpaTarget extends AbstractJpaNamedEntity implements Target, EventAw
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireCreateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireCreateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher()
|
||||
.publishEvent(new TargetCreatedEvent(this, EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireUpdateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireUpdateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher()
|
||||
.publishEvent(new TargetUpdatedEvent(this, EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireDeleteEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireDeleteEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher()
|
||||
.publishEvent(new TargetDeletedEvent(getTenant(), getId(), getControllerId(), address,
|
||||
getClass(), EventPublisherHolder.getInstance().getApplicationId()));
|
||||
|
||||
@@ -35,7 +35,6 @@ import org.eclipse.hawkbit.repository.model.helper.EventPublisherHolder;
|
||||
import org.eclipse.persistence.annotations.ConversionValue;
|
||||
import org.eclipse.persistence.annotations.Convert;
|
||||
import org.eclipse.persistence.annotations.ObjectTypeConverter;
|
||||
import org.eclipse.persistence.descriptors.DescriptorEvent;
|
||||
|
||||
/**
|
||||
* Stored target filter.
|
||||
@@ -182,19 +181,19 @@ public class JpaTargetFilterQuery extends AbstractJpaTenantAwareBaseEntity
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireCreateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireCreateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(
|
||||
new TargetFilterQueryCreatedEvent(this, EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireUpdateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireUpdateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(
|
||||
new TargetFilterQueryUpdatedEvent(this, EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireDeleteEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireDeleteEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(new TargetFilterQueryDeletedEvent(
|
||||
getTenant(), getId(), getClass(), EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@@ -23,7 +23,6 @@ import org.eclipse.hawkbit.repository.event.remote.entity.TargetTagCreatedEvent;
|
||||
import org.eclipse.hawkbit.repository.event.remote.entity.TargetTagUpdatedEvent;
|
||||
import org.eclipse.hawkbit.repository.model.TargetTag;
|
||||
import org.eclipse.hawkbit.repository.model.helper.EventPublisherHolder;
|
||||
import org.eclipse.persistence.descriptors.DescriptorEvent;
|
||||
|
||||
/**
|
||||
* A {@link TargetTag} is used to describe Target attributes and use them also for filtering the target list.
|
||||
@@ -44,19 +43,19 @@ public class JpaTargetTag extends JpaTag implements TargetTag, EventAwareEntity
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireCreateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireCreateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher()
|
||||
.publishEvent(new TargetTagCreatedEvent(this, EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireUpdateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireUpdateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher()
|
||||
.publishEvent(new TargetTagUpdatedEvent(this, EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireDeleteEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireDeleteEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(new TargetTagDeletedEvent(getTenant(),
|
||||
getId(), getClass(), EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@@ -33,7 +33,6 @@ import org.eclipse.hawkbit.repository.model.DistributionSetType;
|
||||
import org.eclipse.hawkbit.repository.model.Target;
|
||||
import org.eclipse.hawkbit.repository.model.TargetType;
|
||||
import org.eclipse.hawkbit.repository.model.helper.EventPublisherHolder;
|
||||
import org.eclipse.persistence.descriptors.DescriptorEvent;
|
||||
|
||||
/**
|
||||
* A target type defines which distribution set types can or have to be
|
||||
@@ -112,19 +111,19 @@ public class JpaTargetType extends AbstractJpaTypeEntity implements TargetType,
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireCreateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireCreateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(
|
||||
new TargetTypeCreatedEvent(this, EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireUpdateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireUpdateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(
|
||||
new TargetTypeUpdatedEvent(this, EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireDeleteEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireDeleteEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(new TargetTypeDeletedEvent(
|
||||
getTenant(), getId(), getClass(), EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@@ -22,7 +22,6 @@ import org.eclipse.hawkbit.repository.event.remote.entity.TenantConfigurationCre
|
||||
import org.eclipse.hawkbit.repository.event.remote.entity.TenantConfigurationUpdatedEvent;
|
||||
import org.eclipse.hawkbit.repository.model.TenantConfiguration;
|
||||
import org.eclipse.hawkbit.repository.model.helper.EventPublisherHolder;
|
||||
import org.eclipse.persistence.descriptors.DescriptorEvent;
|
||||
|
||||
/**
|
||||
* A JPA entity which stores the tenant specific configuration.
|
||||
@@ -85,19 +84,19 @@ public class JpaTenantConfiguration extends AbstractJpaTenantAwareBaseEntity
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireCreateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireCreateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(
|
||||
new TenantConfigurationCreatedEvent(this, EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireUpdateEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireUpdateEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher().publishEvent(
|
||||
new TenantConfigurationUpdatedEvent(this, EventPublisherHolder.getInstance().getApplicationId()));
|
||||
}
|
||||
|
||||
@Override
|
||||
public void fireDeleteEvent(final DescriptorEvent descriptorEvent) {
|
||||
public void fireDeleteEvent() {
|
||||
EventPublisherHolder.getInstance().getEventPublisher()
|
||||
.publishEvent(new TenantConfigurationDeletedEvent(getTenant(), getId(), getKey(), getValue(),
|
||||
getClass(), EventPublisherHolder.getInstance().getApplicationId()));
|
||||
|
||||
Reference in New Issue
Block a user