Merge pull request #304 from bsinno/fix_dmf_api

Fix DMF api usage by simulator
This commit is contained in:
Michael Hirsch
2016-09-30 09:14:35 +02:00
committed by GitHub
3 changed files with 17 additions and 4 deletions

View File

@@ -206,7 +206,7 @@ public class SpSenderService extends SenderService {
headers.put(MessageHeaderKey.TENANT, cacheValue.getTenant()); headers.put(MessageHeaderKey.TENANT, cacheValue.getTenant());
headers.put(MessageHeaderKey.TOPIC, EventTopic.UPDATE_ACTION_STATUS.name()); headers.put(MessageHeaderKey.TOPIC, EventTopic.UPDATE_ACTION_STATUS.name());
headers.put(MessageHeaderKey.CONTENT_TYPE, MessageProperties.CONTENT_TYPE_JSON); headers.put(MessageHeaderKey.CONTENT_TYPE, MessageProperties.CONTENT_TYPE_JSON);
actionUpdateStatus.getMessage().addAll(updateResultMessages); actionUpdateStatus.addMessage(updateResultMessages);
actionUpdateStatus.setActionId(cacheValue.getActionId()); actionUpdateStatus.setActionId(cacheValue.getActionId());
return convertMessage(actionUpdateStatus, messageProperties); return convertMessage(actionUpdateStatus, messageProperties);
} }

View File

@@ -9,6 +9,7 @@
package org.eclipse.hawkbit.dmf.json.model; package org.eclipse.hawkbit.dmf.json.model;
import java.util.ArrayList; import java.util.ArrayList;
import java.util.Collection;
import java.util.Collections; import java.util.Collections;
import java.util.List; import java.util.List;
@@ -72,4 +73,17 @@ public class ActionUpdateStatus {
return this.message.add(message); return this.message.add(message);
} }
public boolean addMessage(final Collection<String> messages) {
if (messages == null || messages.isEmpty()) {
return false;
}
if (this.message == null) {
this.message = new ArrayList<>(messages);
return true;
}
return this.message.addAll(messages);
}
} }

View File

@@ -400,9 +400,8 @@
<profile> <profile>
<id>nexus_staging</id> <id>nexus_staging</id>
<activation> <activation>
<activeByDefault>true</activeByDefault>
<property> <property>
<name>useNexusStaging</name> <name>!skipNexusStaging</name>
</property> </property>
</activation> </activation>
<build> <build>
@@ -415,7 +414,7 @@
as part of building the module. --> as part of building the module. -->
<groupId>org.sonatype.plugins</groupId> <groupId>org.sonatype.plugins</groupId>
<artifactId>nexus-staging-maven-plugin</artifactId> <artifactId>nexus-staging-maven-plugin</artifactId>
<version>1.6.5</version> <version>1.6.7</version>
<extensions>true</extensions> <extensions>true</extensions>
<configuration> <configuration>
<serverId>ossrh</serverId> <serverId>ossrh</serverId>