-
Notifications
You must be signed in to change notification settings - Fork 161
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #4058 from Coduz/feat-dataTranslatorOptionalDevice…
…IdResolution ✨ [Messaging] Introduced configuration to optionally skip Device.id resolution for KapuaDataMessage
- Loading branch information
Showing
5 changed files
with
127 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
56 changes: 56 additions & 0 deletions
56
...ra/src/main/java/org/eclipse/kapua/translator/setting/TranslatorKapuaKuraSettingKeys.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,56 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024, 2022 Eurotech and/or its affiliates and others | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Eurotech - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.kapua.translator.setting; | ||
|
||
import org.eclipse.kapua.commons.setting.SettingKey; | ||
import org.eclipse.kapua.message.device.data.KapuaDataMessage; | ||
import org.eclipse.kapua.service.device.call.message.kura.KuraChannel; | ||
import org.eclipse.kapua.service.device.call.message.kura.data.KuraDataMessage; | ||
import org.eclipse.kapua.service.device.registry.Device; | ||
|
||
/** | ||
* {@link SettingKey}s for {@link TranslatorKapuaKuraSettings} | ||
* | ||
* @since 2.1.0 | ||
*/ | ||
public enum TranslatorKapuaKuraSettingKeys implements SettingKey { | ||
|
||
/** | ||
* Whether to resolve the {@link Device#getId()} from the {@link KuraChannel#getClientId()} when converting from {@link KuraDataMessage} to {@link KapuaDataMessage}. | ||
* | ||
* @since 2.1.0 | ||
*/ | ||
TRANSLATOR_KURA_KAPUA_DATA_DEVICE_ID_RESOLVE("translator.kura.kapua.data.deviceId.resolve"); | ||
|
||
/** | ||
* The key value of the {@link SettingKey}. | ||
* | ||
* @since 2.1.0 | ||
*/ | ||
private final String key; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @param key The key value of the {@link SettingKey}. | ||
* @since 2.1.0 | ||
*/ | ||
TranslatorKapuaKuraSettingKeys(String key) { | ||
this.key = key; | ||
} | ||
|
||
@Override | ||
public String key() { | ||
return key; | ||
} | ||
} |
40 changes: 40 additions & 0 deletions
40
.../kura/src/main/java/org/eclipse/kapua/translator/setting/TranslatorKapuaKuraSettings.java
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,40 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2024, 2022 Eurotech and/or its affiliates and others | ||
* | ||
* This program and the accompanying materials are made | ||
* available under the terms of the Eclipse Public License 2.0 | ||
* which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
* | ||
* SPDX-License-Identifier: EPL-2.0 | ||
* | ||
* Contributors: | ||
* Eurotech - initial API and implementation | ||
*******************************************************************************/ | ||
package org.eclipse.kapua.translator.setting; | ||
|
||
import org.eclipse.kapua.commons.setting.AbstractKapuaSetting; | ||
|
||
/** | ||
* {@link TranslatorKapuaKuraSettings} for {@code kapua-translator-kapua-kura} module. | ||
* | ||
* @see AbstractKapuaSetting | ||
* @since 2.1.0 | ||
*/ | ||
public class TranslatorKapuaKuraSettings extends AbstractKapuaSetting<TranslatorKapuaKuraSettingKeys> { | ||
|
||
/** | ||
* Setting filename. | ||
* | ||
* @since 2.1.0 | ||
*/ | ||
private static final String TRANSLATOR_KAPUA_KURA_SETTING_RESOURCE = "translator-kapua-kura-settings.properties"; | ||
|
||
/** | ||
* Constructor. | ||
* | ||
* @since 2.1.0 | ||
*/ | ||
public TranslatorKapuaKuraSettings() { | ||
super(TRANSLATOR_KAPUA_KURA_SETTING_RESOURCE); | ||
} | ||
} |
14 changes: 14 additions & 0 deletions
14
translator/kapua/kura/src/main/resources/translator-kapua-kura-settings.properties
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,14 @@ | ||
############################################################################### | ||
# Copyright (c) 2024, 2022 Eurotech and/or its affiliates and others | ||
# | ||
# This program and the accompanying materials are made | ||
# available under the terms of the Eclipse Public License 2.0 | ||
# which is available at https://www.eclipse.org/legal/epl-2.0/ | ||
# | ||
# SPDX-License-Identifier: EPL-2.0 | ||
# | ||
# Contributors: | ||
# Eurotech - initial API and implementation | ||
# | ||
############################################################################### | ||
translator.kura.kapua.data.deviceId.resolve=true |