Skip to content

Package: KuraDisconnectPayload

KuraDisconnectPayload

nameinstructionbranchcomplexitylinemethod
KuraDisconnectPayload()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
getDisplayName()
M: 6 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 1 C: 0
0%
M: 1 C: 0
0%
getUptime()
M: 6 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.device.call.message.kura.lifecycle;
14:
15: import org.eclipse.kapua.service.device.call.message.lifecycle.DeviceLifecyclePayload;
16: import org.eclipse.kapua.service.device.registry.Device;
17:
18: /**
19: * {@link DeviceLifecyclePayload} {@link org.eclipse.kapua.service.device.call.kura.Kura} implementation.
20: *
21: * @see KuraDisconnectMessage
22: * @since 1.0.0
23: */
24: public class KuraDisconnectPayload extends AbstractKuraLifecyclePayload implements DeviceLifecyclePayload {
25:
26: /**
27: * Uptime metric name.
28: *
29: * @since 1.0.0
30: */
31: private static final String UPTIME = "uptime";
32:
33: /**
34: * {@link Device} display name metric name.
35: *
36: * @since 1.0.0
37: */
38: private static final String DISPLAY_NAME = "display_name";
39:
40: /**
41: * Constructor.
42: *
43: * @since 1.0.0
44: */
45: public KuraDisconnectPayload() {
46: super();
47: }
48:
49: /**
50: * Gets the {@link Device} uptime.
51: *
52: * @return The {@link Device} uptime.
53: * @since 1.0.0
54: */
55: public String getUptime() {
56: return (String) getMetrics().get(UPTIME);
57: }
58:
59: /**
60: * Gets the {@link Device} display name.
61: *
62: * @return The {@link Device} display name.
63: * @since 1.0.0
64: */
65: public String getDisplayName() {
66: return (String) getMetrics().get(DISPLAY_NAME);
67: }
68: }