forked from eclipse/kapua
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
1ddca6c
commit 6ec87ef
Showing
15 changed files
with
328 additions
and
0 deletions.
There are no files selected for viewing
26 changes: 26 additions & 0 deletions
26
.../kapua/service/device/management/configuration/DeviceComponentConfigurationFactories.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,26 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2025 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.service.device.management.configuration; | ||
|
||
import javax.xml.bind.annotation.XmlAccessType; | ||
import javax.xml.bind.annotation.XmlAccessorType; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
import javax.xml.bind.annotation.XmlType; | ||
|
||
|
||
@XmlRootElement(name = "configurationFactories") | ||
@XmlAccessorType(XmlAccessType.PROPERTY) | ||
@XmlType(factoryClass = DeviceConfigurationXmlRegistry.class, factoryMethod = "newComponentConfigurationFactories") | ||
public interface DeviceComponentConfigurationFactories { | ||
|
||
} |
25 changes: 25 additions & 0 deletions
25
...se/kapua/service/device/management/configuration/DeviceComponentConfigurationFactory.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,25 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2025 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.service.device.management.configuration; | ||
|
||
import javax.xml.bind.annotation.XmlAccessType; | ||
import javax.xml.bind.annotation.XmlAccessorType; | ||
import javax.xml.bind.annotation.XmlRootElement; | ||
import javax.xml.bind.annotation.XmlType; | ||
|
||
@XmlRootElement(name = "configurationFactory") | ||
@XmlAccessorType(XmlAccessType.PROPERTY) | ||
@XmlType(factoryClass = DeviceConfigurationXmlRegistry.class, factoryMethod = "newComponentConfigurationFactory") | ||
public interface DeviceComponentConfigurationFactory { | ||
|
||
} |
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
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
19 changes: 19 additions & 0 deletions
19
...e/device/management/configuration/internal/DeviceComponentConfigurationFactoriesImpl.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,19 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2025 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.service.device.management.configuration.internal; | ||
|
||
import org.eclipse.kapua.service.device.management.configuration.DeviceComponentConfigurationFactories; | ||
|
||
public class DeviceComponentConfigurationFactoriesImpl implements DeviceComponentConfigurationFactories { | ||
|
||
} |
19 changes: 19 additions & 0 deletions
19
...ice/device/management/configuration/internal/DeviceComponentConfigurationFactoryImpl.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,19 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2025 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.service.device.management.configuration.internal; | ||
|
||
import org.eclipse.kapua.service.device.management.configuration.DeviceComponentConfigurationFactory; | ||
|
||
public class DeviceComponentConfigurationFactoryImpl implements DeviceComponentConfigurationFactory { | ||
|
||
} |
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
31 changes: 31 additions & 0 deletions
31
...evice/management/configuration/message/internal/ConfigurationFactoriesRequestMessage.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,31 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2025 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 | ||
* Red Hat Inc | ||
*******************************************************************************/ | ||
package org.eclipse.kapua.service.device.management.configuration.message.internal; | ||
|
||
import org.eclipse.kapua.message.internal.KapuaMessageImpl; | ||
import org.eclipse.kapua.service.device.management.message.request.KapuaRequestMessage; | ||
|
||
public class ConfigurationFactoriesRequestMessage extends KapuaMessageImpl<ConfigurationRequestChannel, ConfigurationFactoriesRequestPayload> | ||
implements KapuaRequestMessage<ConfigurationRequestChannel, ConfigurationFactoriesRequestPayload> { | ||
|
||
@Override | ||
public Class<ConfigurationFactoriesRequestMessage> getRequestClass() { | ||
return ConfigurationFactoriesRequestMessage.class; | ||
} | ||
|
||
@Override | ||
public Class<ConfigurationFactoriesResponseMessage> getResponseClass() { | ||
return ConfigurationFactoriesResponseMessage.class; | ||
} | ||
} |
21 changes: 21 additions & 0 deletions
21
...evice/management/configuration/message/internal/ConfigurationFactoriesRequestPayload.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,21 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2025 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.service.device.management.configuration.message.internal; | ||
|
||
import org.eclipse.kapua.message.internal.KapuaPayloadImpl; | ||
import org.eclipse.kapua.service.device.management.message.request.KapuaRequestPayload; | ||
|
||
public class ConfigurationFactoriesRequestPayload extends KapuaPayloadImpl implements KapuaRequestPayload { | ||
|
||
private static final long serialVersionUID = 1400605735748313538L; | ||
} |
23 changes: 23 additions & 0 deletions
23
...vice/management/configuration/message/internal/ConfigurationFactoriesResponseMessage.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,23 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2025 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 | ||
* Red Hat Inc | ||
*******************************************************************************/ | ||
package org.eclipse.kapua.service.device.management.configuration.message.internal; | ||
|
||
import org.eclipse.kapua.service.device.management.commons.message.response.KapuaResponseMessageImpl; | ||
import org.eclipse.kapua.service.device.management.message.response.KapuaResponseMessage; | ||
|
||
public class ConfigurationFactoriesResponseMessage extends KapuaResponseMessageImpl<ConfigurationResponseChannel, ConfigurationFactoriesResponsePayload> | ||
implements KapuaResponseMessage<ConfigurationResponseChannel, ConfigurationFactoriesResponsePayload> { | ||
|
||
private static final long serialVersionUID = -211188083735456147L; | ||
} |
32 changes: 32 additions & 0 deletions
32
...vice/management/configuration/message/internal/ConfigurationFactoriesResponsePayload.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,32 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2025 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 | ||
* Red Hat Inc | ||
*******************************************************************************/ | ||
package org.eclipse.kapua.service.device.management.configuration.message.internal; | ||
|
||
import org.eclipse.kapua.service.device.management.commons.message.response.KapuaResponsePayloadImpl; | ||
import org.eclipse.kapua.service.device.management.configuration.DeviceComponentConfigurationFactories; | ||
import org.eclipse.kapua.service.device.management.message.response.KapuaResponsePayload; | ||
|
||
public class ConfigurationFactoriesResponsePayload extends KapuaResponsePayloadImpl implements KapuaResponsePayload { | ||
|
||
private final DeviceComponentConfigurationFactories factories; | ||
|
||
public ConfigurationFactoriesResponsePayload(DeviceComponentConfigurationFactories factories) { | ||
this.factories = factories; | ||
} | ||
|
||
public DeviceComponentConfigurationFactories get() { | ||
return factories; | ||
} | ||
|
||
} |
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
58 changes: 58 additions & 0 deletions
58
...org/eclipse/kapua/translator/kapua/kura/TranslatorAppConfigurationFactoriesKapuaKura.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,58 @@ | ||
/******************************************************************************* | ||
* Copyright (c) 2025 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 | ||
* Red Hat Inc | ||
*******************************************************************************/ | ||
package org.eclipse.kapua.translator.kapua.kura; | ||
|
||
import org.eclipse.kapua.service.device.call.kura.model.configuration.ConfigurationMetrics; | ||
import org.eclipse.kapua.service.device.call.message.kura.app.request.KuraRequestChannel; | ||
import org.eclipse.kapua.service.device.call.message.kura.app.request.KuraRequestMessage; | ||
import org.eclipse.kapua.service.device.call.message.kura.app.request.KuraRequestPayload; | ||
import org.eclipse.kapua.service.device.management.configuration.message.internal.ConfigurationFactoriesRequestMessage; | ||
import org.eclipse.kapua.service.device.management.configuration.message.internal.ConfigurationFactoriesRequestPayload; | ||
import org.eclipse.kapua.service.device.management.configuration.message.internal.ConfigurationRequestChannel; | ||
import org.eclipse.kapua.translator.exception.InvalidChannelException; | ||
import org.eclipse.kapua.translator.exception.InvalidPayloadException; | ||
|
||
public class TranslatorAppConfigurationFactoriesKapuaKura extends AbstractTranslatorKapuaKura<ConfigurationRequestChannel, ConfigurationFactoriesRequestPayload, ConfigurationFactoriesRequestMessage> { | ||
|
||
@Override | ||
protected KuraRequestChannel translateChannel(ConfigurationRequestChannel kapuaChannel) throws InvalidChannelException { | ||
try { | ||
KuraRequestChannel channel = TranslatorKapuaKuraUtils.buildBaseRequestChannel(ConfigurationMetrics.APP_ID, ConfigurationMetrics.APP_VERSION_2, kapuaChannel.getMethod()); | ||
channel.setResources(new String[]{"factoryComponents"}); | ||
return channel; | ||
} catch (Exception e) { | ||
throw new InvalidChannelException(e, kapuaChannel); | ||
} | ||
} | ||
|
||
@Override | ||
protected KuraRequestPayload translatePayload(ConfigurationFactoriesRequestPayload kapuaPayload) throws InvalidPayloadException { | ||
try { | ||
// Return Kura Payload | ||
return new KuraRequestPayload(); | ||
} catch (Exception e) { | ||
throw new InvalidPayloadException(e, kapuaPayload); | ||
} | ||
} | ||
|
||
@Override | ||
public Class<ConfigurationFactoriesRequestMessage> getClassFrom() { | ||
return ConfigurationFactoriesRequestMessage.class; | ||
} | ||
|
||
@Override | ||
public Class<KuraRequestMessage> getClassTo() { | ||
return KuraRequestMessage.class; | ||
} | ||
} |