Skip to content

Package: ByDeviceAppManagementSettingsService

ByDeviceAppManagementSettingsService

nameinstructionbranchcomplexitylinemethod
isApplicationEnabled(KapuaId, KapuaId)
M: 2 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2022 Eurotech and/or its affiliates and others
3: *
4: * This program and the accompanying materials are made
5: * available under the terms of the Eclipse Public License 2.0
6: * which is available at https://www.eclipse.org/legal/epl-2.0/
7: *
8: * SPDX-License-Identifier: EPL-2.0
9: *
10: * Contributors:
11: * Eurotech - initial API and implementation
12: *******************************************************************************/
13: package org.eclipse.kapua.service.device.management.app.settings;
14:
15: import org.eclipse.kapua.KapuaException;
16: import org.eclipse.kapua.model.id.KapuaId;
17: import org.eclipse.kapua.service.device.registry.Device;
18:
19: /**
20: * {@link ByDeviceAppManagementSettingsService} definition.
21: * <p>
22: * To be used when a Device Management Application has by-device settings.
23: *
24: * @param <C> The {@link ByDeviceAppManagementSettings} type.
25: * @since 2.0.0
26: */
27: public interface ByDeviceAppManagementSettingsService<C extends ByDeviceAppManagementSettings> {
28:
29: /**
30: * Gets the {@link ByDeviceAppManagementSettings} for the given {@link Device}.
31: *
32: * @param scopeId The {@link Device#getScopeId()}.
33: * @param deviceId The {@link Device#getId()}
34: * @return The {@link ByDeviceAppManagementSettings} of the {@link Device}.
35: * @throws KapuaException
36: * @since 2.0.0
37: */
38: C getApplicationSettings(KapuaId scopeId, KapuaId deviceId) throws KapuaException;
39:
40: /**
41: * Sets the {@link ByDeviceAppManagementSettings} for the given {@link Device}.
42: *
43: * @param scopeId The {@link Device#getScopeId()}.
44: * @param deviceId The {@link Device#getId()}
45: * @param deviceApplicationSettings The {@link ByDeviceAppManagementSettings} of the {@link Device}.
46: * @throws KapuaException
47: * @since 2.0.0
48: */
49: void setApplicationSettings(KapuaId scopeId, KapuaId deviceId, C deviceApplicationSettings) throws KapuaException;
50:
51: /**
52: * Whether the {@link Device} application is enabled for the given {@link Device} or not.
53: * <p>
54: * Default implementation returns always {@code true}
55: *
56: * @param scopeId The {@link Device#getScopeId()}.
57: * @param deviceId The {@link Device#getId()}
58: * @return {@code true} if application is enabled, {@code false} otherwise.
59: * @throws KapuaException
60: */
61: default boolean isApplicationEnabled(KapuaId scopeId, KapuaId deviceId) throws KapuaException {
62: return true;
63: }
64: }