Skip to content

Commit

Permalink
Merge pull request #4190 from Coduz/feat-allowEmptyAppAndMethod
Browse files Browse the repository at this point in the history
✨ [Device Management] Allowed for empty AppId and method
  • Loading branch information
Coduz authored Feb 7, 2025
2 parents 9bc72b9 + ca885b6 commit 004b364
Showing 1 changed file with 9 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@
*******************************************************************************/
package org.eclipse.kapua.translator.kura.mqtt;

import com.google.common.base.Strings;
import com.google.inject.Inject;
import org.eclipse.kapua.service.device.call.message.kura.KuraPayload;
import org.eclipse.kapua.service.device.call.message.kura.app.request.KuraRequestChannel;
Expand Down Expand Up @@ -85,8 +86,14 @@ public MqttTopic translate(KuraRequestChannel kuraRequestChannel) throws Invalid

topicTokens.add(kuraRequestChannel.getScope());
topicTokens.add(kuraRequestChannel.getClientId());
topicTokens.add(kuraRequestChannel.getAppId());
topicTokens.add(kuraRequestChannel.getMethod().name());

if (!Strings.isNullOrEmpty(kuraRequestChannel.getAppId())) {
topicTokens.add(kuraRequestChannel.getAppId());
}

if (kuraRequestChannel.getMethod() != null) {
topicTokens.add(kuraRequestChannel.getMethod().name());
}

Collections.addAll(topicTokens, kuraRequestChannel.getResources());

Expand Down

0 comments on commit 004b364

Please sign in to comment.