Complete API for action cancelation. (#643)

* Complete API for action cancelation.

Signed-off-by: kaizimmerm <kai.zimmermann@bosch-si.com>

* Fix content bug
This commit is contained in:
Kai Zimmermann
2018-03-01 14:43:10 +01:00
committed by GitHub
parent f7c3687ed2
commit 246936a929
6 changed files with 62 additions and 17 deletions

View File

@@ -23,6 +23,7 @@ import org.eclipse.hawkbit.api.URLPlaceholder.SoftwareData;
import org.eclipse.hawkbit.dmf.amqp.api.EventTopic;
import org.eclipse.hawkbit.dmf.amqp.api.MessageHeaderKey;
import org.eclipse.hawkbit.dmf.amqp.api.MessageType;
import org.eclipse.hawkbit.dmf.json.model.DmfActionRequest;
import org.eclipse.hawkbit.dmf.json.model.DmfArtifact;
import org.eclipse.hawkbit.dmf.json.model.DmfArtifactHash;
import org.eclipse.hawkbit.dmf.json.model.DmfDownloadAndUpdateRequest;
@@ -241,7 +242,11 @@ public class AmqpMessageDispatcherService extends BaseAmqpService {
if (!IpUtil.isAmqpUri(address)) {
return;
}
final Message message = getMessageConverter().toMessage(actionId,
final DmfActionRequest actionRequest = new DmfActionRequest();
actionRequest.setActionId(actionId);
final Message message = getMessageConverter().toMessage(actionRequest,
createConnectorMessagePropertiesEvent(tenant, controllerId, EventTopic.CANCEL_DOWNLOAD));
amqpSenderService.sendMessage(message, address);