Skip to content

Package: Metadata

Metadata

nameinstructionbranchcomplexitylinemethod
Metadata(String, String, String, String)
M: 21 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 7 C: 0
0%
M: 1 C: 0
0%
getChannelRegistryIndexName()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getClientRegistryIndexName()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getDataIndexName()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getMessageMappingsCache()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getMetricRegistryIndexName()
M: 3 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) 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.datastore.internal.schema;
14:
15: import org.eclipse.kapua.service.datastore.internal.mediator.Metric;
16:
17: import java.util.HashMap;
18: import java.util.Map;
19:
20: /**
21: * Metadata object
22: *
23: * @since 1.0.0
24: */
25: public class Metadata {
26:
27: // Info fields does not change within the same account name
28: private final String dataIndexName;
29: private final String channelRegistryIndexName;
30: private final String clientRegistryIndexName;
31: private final String metricRegistryIndexName;
32: //
33:
34: // Custom mappings can only increase within the same account
35: // No removal of existing cached mappings or changes in the
36: // existing mappings.
37: private final Map<String, Metric> messageMappingsCache;
38: //
39:
40: /**
41: * Get the mappings cache
42: *
43: * @return
44: * @since 1.0.0
45: */
46: public Map<String, Metric> getMessageMappingsCache() {
47: return messageMappingsCache;
48: }
49:
50: /**
51: * Constructor.
52: *
53: * @since 1.0.0
54: */
55: public Metadata(String dataIndexName, String channelRegistryIndexName, String clientRegistryIndexName, String metricRegistryIndexName) {
56: this.messageMappingsCache = new HashMap<>(100);
57: this.dataIndexName = dataIndexName;
58: this.channelRegistryIndexName = channelRegistryIndexName;
59: this.clientRegistryIndexName = clientRegistryIndexName;
60: this.metricRegistryIndexName = metricRegistryIndexName;
61: }
62:
63: /**
64: * Get the Elasticsearch data index name
65: *
66: * @return
67: * @since 1.0.0
68: */
69: public String getDataIndexName() {
70: return dataIndexName;
71: }
72:
73: /**
74: * Get the Kapua channel index name
75: *
76: * @return
77: * @since 1.4.0
78: */
79: public String getChannelRegistryIndexName() {
80: return channelRegistryIndexName;
81: }
82:
83: /**
84: * Get the Kapua client index name
85: *
86: * @return
87: * @since 1.4.0
88: */
89: public String getClientRegistryIndexName() {
90: return clientRegistryIndexName;
91: }
92:
93: /**
94: * Get the Kapua metric index name
95: *
96: * @return
97: * @since 1.4.0
98: */
99: public String getMetricRegistryIndexName() {
100: return metricRegistryIndexName;
101: }
102: }