Skip to content

Package: KapuaConfigurableService

KapuaConfigurableService

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2016, 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.config;
14:
15: import org.eclipse.kapua.KapuaException;
16: import org.eclipse.kapua.model.config.metatype.KapuaTocd;
17: import org.eclipse.kapua.model.id.KapuaId;
18: import org.eclipse.kapua.service.KapuaService;
19:
20: import java.util.Map;
21:
22: /**
23: * Configurable {@link KapuaService} definition.
24: * <p>
25: * Identifies a {@link KapuaService} with per-scope configurations
26: *
27: * @since 1.0.0
28: */
29: public interface KapuaConfigurableService {
30:
31: /**
32: * Gets the {@link KapuaTocd} for the given scope {@link KapuaId}.
33: *
34: * @param scopeId The scope {@link KapuaId}.
35: * @return The {@link KapuaTocd} for the given scope {@link KapuaId}.
36: * @throws KapuaException
37: * @since 1.0.0
38: */
39: KapuaTocd getConfigMetadata(KapuaId scopeId) throws KapuaException;
40:
41: /**
42: * Gets the {@link Map} properties values for the given scope {@link KapuaId}.
43: *
44: * @param scopeId The scope {@link KapuaId}.
45: * @return The {@link Map} properties values for the given scope {@link KapuaId}.
46: * @throws KapuaException
47: * @since 1.0.0
48: */
49: Map<String, Object> getConfigValues(KapuaId scopeId) throws KapuaException;
50:
51: /**
52: * Updates the {@link Map} properties values for the given scope {@link KapuaId}.
53: *
54: * @param scopeId The scope {@link KapuaId}.
55: * @param values The {@link Map} properties values to update
56: * @throws KapuaException
57: * @since 1.0.0
58: */
59: void setConfigValues(KapuaId scopeId, KapuaId parentId, Map<String, Object> values) throws KapuaException;
60:
61: }