Feature dmf target delete aware (#474)

* Implemented new function to create and send a thing created message if a
delete event is published

- added mock and integration tests 

Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>

* Switched target address form URI to String and fixed test

Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>

* Refactoring and removed TODOs

Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>

* Fixed javadoc and description

Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>

* Used Target from API instead from JpaTarget 

Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>

* Refactoring after review

Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>

* Small refactoring - fixed typos

Signed-off-by: Jonathan Philip Knoblauch <JonathanPhilip.Knoblauch@bosch-si.com>

* Resolve Merge conflicts

Signed-off-by: Melanie Retter <melanie.retter@bosch-si.com>
This commit is contained in:
Jonathan Knoblauch
2017-04-25 16:38:18 +02:00
committed by Michael Hirsch
parent a19364c635
commit 574fda1101
11 changed files with 222 additions and 51 deletions

View File

@@ -16,7 +16,9 @@ import org.eclipse.hawkbit.repository.model.Target;
*/
public class TargetDeletedEvent extends RemoteIdEvent {
private static final long serialVersionUID = 1L;
private static final long serialVersionUID = 2L;
private String controllerId;
private String targetAddress;
/**
* Default constructor.
@@ -26,20 +28,33 @@ public class TargetDeletedEvent extends RemoteIdEvent {
}
/**
* Constructor for json serialization.
*
*
* @param tenant
* the tenant
* @param entityId
* the entity id
* @param controllerId
* the controllerId of the target
* @param targetAddress
* the target address
* @param entityClass
* the entity class
* @param applicationId
* the origin application id
*/
public TargetDeletedEvent(final String tenant, final Long entityId, final String entityClass,
final String applicationId) {
public TargetDeletedEvent(final String tenant, final Long entityId, final String controllerId,
final String targetAddress, final String entityClass, final String applicationId) {
super(entityId, tenant, entityClass, applicationId);
this.controllerId = controllerId;
this.targetAddress = targetAddress;
}
public String getControllerId() {
return controllerId;
}
public String getTargetAddress() {
return targetAddress;
}
}