Skip to content

Package: CommandMetrics

CommandMetrics

nameinstructionbranchcomplexitylinemethod
CommandMetrics(String, int, String)
M: 8 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getName()
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%
getValue()
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%
static {...}
M: 158 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 15 C: 0
0%
M: 1 C: 0
0%
toString()
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.device.call.kura.model.command;
14:
15: import org.eclipse.kapua.service.device.call.message.DeviceMetrics;
16: import org.eclipse.kapua.service.device.call.message.app.DeviceAppMetrics;
17:
18: /**
19: * Command {@link DeviceMetrics}.
20: *
21: * @since 1.0.0
22: */
23: public enum CommandMetrics implements DeviceAppMetrics {
24:
25: /**
26: * Application identifier.
27: *
28: * @since 1.0.0
29: */
30: APP_ID("CMD"),
31:
32: /**
33: * Application version.
34: *
35: * @since 1.0.0
36: */
37: APP_VERSION("V1"),
38:
39: // Request
40:
41: /**
42: * Command metric name.
43: *
44: * @since 1.0.0
45: */
46: APP_METRIC_CMD("command.command"),
47:
48: /**
49: * Arguments metric name.
50: *
51: * @since 1.0.0
52: */
53: APP_METRIC_ARG("command.argument"),
54:
55: /**
56: * Environment metric name.
57: *
58: * @since 1.0.0
59: */
60: APP_METRIC_ENVP("command.environment.pair"),
61:
62: /**
63: * Working directory metric name.
64: *
65: * @since 1.0.0
66: */
67: APP_METRIC_DIR("command.working.directory"),
68:
69: /**
70: * Standard input metric name.
71: *
72: * @since 1.0.0
73: */
74: APP_METRIC_STDIN("command.stdin"),
75:
76: /**
77: * Command timeout metric name.
78: *
79: * @since 1.0.0
80: */
81: APP_METRIC_TOUT("command.timeout"),
82:
83: /**
84: * Asynchronous running metric name.
85: *
86: * @since 1.0.0
87: */
88: APP_METRIC_ASYNC("command.run.async"),
89:
90: /**
91: * Password metric name.
92: *
93: * @since 1.0.0
94: */
95: APP_METRIC_PASSWORD("command.password"),
96:
97: // Response
98: /**
99: * Standard error metric name.
100: *
101: * @since 1.0.0
102: */
103: APP_METRIC_STDERR("command.stderr"),
104:
105: /**
106: * Standard output metric name.
107: *
108: * @since 1.0.0
109: */
110: APP_METRIC_STDOUT("command.stdout"),
111:
112: /**
113: * Command exit code metric name.
114: *
115: * @since 1.0.0
116: */
117: APP_METRIC_EXIT_CODE("command.exit.code"),
118:
119: /**
120: * Command timed out flag metric name.
121: *
122: * @since 1.0.0
123: */
124: APP_METRIC_TIMED_OUT("command.timedout"),
125: ;
126:
127: /**
128: * The name of the metric.
129: *
130: * @since 1.0.0
131: */
132: private final String name;
133:
134: /**
135: * Constructor.
136: *
137: * @param name The name of the metric.
138: * @since 1.0.0
139: */
140: CommandMetrics(String name) {
141: this.name = name;
142: }
143:
144: /**
145: * Gets the value property associated to this specific enumeration key.
146: *
147: * @return the value property associated to this specific enumeration key.
148: * @since 1.0.0
149: * @deprecated Since 1.2.0. Renamed to {@link #getName()}.
150: */
151: @Deprecated
152: public String getValue() {
153: return getName();
154: }
155:
156: @Override
157: public String getName() {
158: return name;
159: }
160:
161: @Override
162: public String toString() {
163: return getName();
164: }
165: }