New event strategy (#380)
* Add notfication overview for remote events Signed-off-by: SirWayne <dennis.melzer@bosch-si.com> * Refactor css for notification button Signed-off-by: SirWayne <dennis.melzer@bosch-si.com> * Remove todo Signed-off-by: SirWayne <dennis.melzer@bosch-si.com> * - Style notfication button (css) - Add i18n message keys - Add switch slider for auto refresh event Signed-off-by: SirWayne <dennis.melzer@bosch-si.com> * Insert Label in MenuItem for displaying occurred events Signed-off-by: Melanie Retter <melanie.retter@bosch-si.com> * - Style notfication button (css) - Add i18n message keys - Add switch slider for auto refresh event - Insert Label in MenuItem for displaying occurred events Signed-off-by: SirWayne <dennis.melzer@bosch-si.com> * Solve merge conflicts and add menu item counter Signed-off-by: SirWayne <dennis.melzer@bosch-si.com> * CSS refactor Signed-off-by: Melanie Retter <melanie.retter@bosch-si.com> * Adapt JUnit test for events, because constructor is changed Signed-off-by: SirWayne <dennis.melzer@bosch-si.com> * Skip delete event Signed-off-by: SirWayne <dennis.melzer@bosch-si.com> * - Insert Id for notification menu - Enable push mechanism for target and ds tag and add notfications - Fix several typos Signed-off-by: SirWayne <dennis.melzer@bosch-si.com> * Add update ui events for tags and add different id's for menue item Signed-off-by: SirWayne <dennis.melzer@bosch-si.com> * Insert push for SoftwareModule Signed-off-by: Melanie Retter <melanie.retter@bosch-si.com> * Set button enablement Signed-off-by: SirWayne <dennis.melzer@bosch-si.com> * Add Software module update push event Add unit test software module push events Adapt test for software push event Signed-off-by: SirWayne <dennis.melzer@bosch-si.com> * Close window and set pop id Update the target table to set the new icon Signed-off-by: SirWayne <dennis.melzer@bosch-si.com> * - several code improvements - Correct license header Signed-off-by: Melanie Retter <melanie.retter@bosch-si.com> * Update vaadin version Rename the base entity and redefine constructors unread counter was not correct Signed-off-by: SirWayne <dennis.melzer@bosch-si.com> * Closebox of notificationButton is invisible: Insert height for HorizontalLayout of NotificationUnreadButton Signed-off-by: Melanie Retter <melanie.retter@bosch-si.com> * Add software modules to the new event types Signed-off-by: SirWayne <dennis.melzer@bosch-si.com> * Introduce animation in unreadNotificationButton Signed-off-by: Melanie Retter <melanie.retter@bosch-si.com> * Fix close on safari Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com> * Add publish events direct to the tag entities. Signed-off-by: SirWayne <dennis.melzer@bosch-si.com>
This commit is contained in:
committed by
Kai Zimmermann
parent
ccc23bf634
commit
2dec35915c
@@ -34,7 +34,8 @@ public class DistributionSetDeletedEvent extends RemoteIdEvent {
|
||||
* @param applicationId
|
||||
* the origin application id
|
||||
*/
|
||||
public DistributionSetDeletedEvent(final String tenant, final Long entityId, final String applicationId) {
|
||||
super(entityId, tenant, applicationId);
|
||||
public DistributionSetDeletedEvent(final String tenant, final Long entityId, final String entityClass,
|
||||
final String applicationId) {
|
||||
super(entityId, tenant, entityClass, applicationId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -31,11 +31,14 @@ public class DistributionSetTagDeletedEvent extends RemoteIdEvent {
|
||||
* the tenant
|
||||
* @param entityId
|
||||
* the entity id
|
||||
* @param entityClass
|
||||
* the entity class
|
||||
* @param applicationId
|
||||
* the origin application id
|
||||
*/
|
||||
|
||||
public DistributionSetTagDeletedEvent(final String tenant, final Long entityId, final String applicationId) {
|
||||
super(entityId, tenant, applicationId);
|
||||
public DistributionSetTagDeletedEvent(final String tenant, final Long entityId, final String entityClass,
|
||||
final String applicationId) {
|
||||
super(entityId, tenant, entityClass, applicationId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -18,6 +18,8 @@ public class RemoteIdEvent extends RemoteTenantAwareEvent {
|
||||
|
||||
private Long entityId;
|
||||
|
||||
private String entityClass;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
@@ -32,14 +34,25 @@ public class RemoteIdEvent extends RemoteTenantAwareEvent {
|
||||
* the entity Id
|
||||
* @param tenant
|
||||
* the tenant
|
||||
* @param entityClass
|
||||
* the entity class
|
||||
* @param applicationId
|
||||
* the origin application id
|
||||
*/
|
||||
protected RemoteIdEvent(final Long entityId, final String tenant, final String applicationId) {
|
||||
protected RemoteIdEvent(final Long entityId, final String tenant, final String entityClass,
|
||||
final String applicationId) {
|
||||
super(entityId, tenant, applicationId);
|
||||
this.entityClass = entityClass;
|
||||
this.entityId = entityId;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the entityClass
|
||||
*/
|
||||
public String getEntityClass() {
|
||||
return entityClass;
|
||||
}
|
||||
|
||||
public Long getEntityId() {
|
||||
return entityId;
|
||||
}
|
||||
|
||||
@@ -0,0 +1,45 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.event.remote;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
|
||||
/**
|
||||
*
|
||||
* Defines the remote event of deleting a {@link SoftwareModule}.
|
||||
*/
|
||||
public class SoftwareModuleDeletedEvent extends RemoteIdEvent {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public SoftwareModuleDeletedEvent() {
|
||||
// for serialization libs like jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor for json serialization.
|
||||
*
|
||||
* @param tenant
|
||||
* the tenant
|
||||
* @param entityId
|
||||
* the entity id
|
||||
* @param entityClass
|
||||
* the entity class
|
||||
* @param applicationId
|
||||
* the origin application id
|
||||
*/
|
||||
public SoftwareModuleDeletedEvent(final String tenant, final Long entityId, final String entityClass,
|
||||
final String applicationId) {
|
||||
super(entityId, tenant, entityClass, applicationId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -32,11 +32,14 @@ public class TargetDeletedEvent extends RemoteIdEvent {
|
||||
* the tenant
|
||||
* @param entityId
|
||||
* the entity id
|
||||
* @param entityClass
|
||||
* the entity class
|
||||
* @param applicationId
|
||||
* the origin application id
|
||||
*/
|
||||
public TargetDeletedEvent(final String tenant, final Long entityId, final String applicationId) {
|
||||
super(entityId, tenant, applicationId);
|
||||
public TargetDeletedEvent(final String tenant, final Long entityId, final String entityClass,
|
||||
final String applicationId) {
|
||||
super(entityId, tenant, entityClass, applicationId);
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
@@ -32,10 +32,13 @@ public class TargetTagDeletedEvent extends RemoteIdEvent {
|
||||
* the tenant
|
||||
* @param entityId
|
||||
* the entity id
|
||||
* @param entityClass
|
||||
* the entity class
|
||||
* @param applicationId
|
||||
* the origin application id
|
||||
*/
|
||||
public TargetTagDeletedEvent(final String tenant, final Long entityId, final String applicationId) {
|
||||
super(entityId, tenant, applicationId);
|
||||
public TargetTagDeletedEvent(final String tenant, final Long entityId, final String entityClass,
|
||||
final String applicationId) {
|
||||
super(entityId, tenant, entityClass, applicationId);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -30,8 +30,6 @@ public class RemoteEntityEvent<E extends TenantAwareBaseEntity> extends RemoteId
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
private String entityClass;
|
||||
|
||||
private transient E entity;
|
||||
|
||||
/**
|
||||
@@ -50,18 +48,10 @@ public class RemoteEntityEvent<E extends TenantAwareBaseEntity> extends RemoteId
|
||||
* the origin application id
|
||||
*/
|
||||
protected RemoteEntityEvent(final E baseEntity, final String applicationId) {
|
||||
super(baseEntity.getId(), baseEntity.getTenant(), applicationId);
|
||||
this.entityClass = baseEntity.getClass().getName();
|
||||
super(baseEntity.getId(), baseEntity.getTenant(), baseEntity.getClass().getName(), applicationId);
|
||||
this.entity = baseEntity;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return the entityClass
|
||||
*/
|
||||
public String getEntityClass() {
|
||||
return entityClass;
|
||||
}
|
||||
|
||||
@JsonIgnore
|
||||
public E getEntity() {
|
||||
if (entity == null) {
|
||||
@@ -73,7 +63,7 @@ public class RemoteEntityEvent<E extends TenantAwareBaseEntity> extends RemoteId
|
||||
@SuppressWarnings("unchecked")
|
||||
private E reloadEntityFromRepository() {
|
||||
try {
|
||||
final Class<E> clazz = (Class<E>) ClassUtils.getClass(entityClass);
|
||||
final Class<E> clazz = (Class<E>) ClassUtils.getClass(getEntityClass());
|
||||
return EventEntityManagerHolder.getInstance().getEventEntityManager().findEntity(getTenant(), getEntityId(),
|
||||
clazz);
|
||||
} catch (final ClassNotFoundException e) {
|
||||
|
||||
@@ -0,0 +1,39 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.event.remote.entity;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
|
||||
/**
|
||||
* Defines the remote event of creating a new {@link SoftwareModule}.
|
||||
*
|
||||
*/
|
||||
public class SoftwareModuleCreatedEvent extends RemoteEntityEvent<SoftwareModule> {
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public SoftwareModuleCreatedEvent() {
|
||||
// for serialization libs like jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param baseEntity
|
||||
* the software module
|
||||
* @param applicationId
|
||||
* the origin application id
|
||||
*/
|
||||
public SoftwareModuleCreatedEvent(final SoftwareModule baseEntity, final String applicationId) {
|
||||
super(baseEntity, applicationId);
|
||||
}
|
||||
|
||||
}
|
||||
@@ -0,0 +1,40 @@
|
||||
/**
|
||||
* Copyright (c) 2015 Bosch Software Innovations GmbH and others.
|
||||
*
|
||||
* All rights reserved. This program and the accompanying materials
|
||||
* are made available under the terms of the Eclipse Public License v1.0
|
||||
* which accompanies this distribution, and is available at
|
||||
* http://www.eclipse.org/legal/epl-v10.html
|
||||
*/
|
||||
package org.eclipse.hawkbit.repository.event.remote.entity;
|
||||
|
||||
import org.eclipse.hawkbit.repository.model.SoftwareModule;
|
||||
|
||||
/**
|
||||
* Defines the remote event for updating a {@link SoftwareModule}.
|
||||
*
|
||||
*/
|
||||
public class SoftwareModuleUpdatedEvent extends RemoteEntityEvent<SoftwareModule> {
|
||||
|
||||
private static final long serialVersionUID = 1L;
|
||||
|
||||
/**
|
||||
* Default constructor.
|
||||
*/
|
||||
public SoftwareModuleUpdatedEvent() {
|
||||
// for serialization libs like jackson
|
||||
}
|
||||
|
||||
/**
|
||||
* Constructor.
|
||||
*
|
||||
* @param baseEntity
|
||||
* the software module
|
||||
* @param applicationId
|
||||
* the origin application id
|
||||
*/
|
||||
public SoftwareModuleUpdatedEvent(final SoftwareModule baseEntity, final String applicationId) {
|
||||
super(baseEntity, applicationId);
|
||||
}
|
||||
|
||||
}
|
||||
Reference in New Issue
Block a user