Skip to content

Package: PackageMetrics$Constants

PackageMetrics$Constants

nameinstructionbranchcomplexitylinemethod
PackageMetrics.Constants()
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.deploy;
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: * Package {@link DeviceMetrics}.
20: * <p>
21: * For documentation follow Kura MQTT namespace: https://eclipse.github.io/kura/ref/mqtt-namespace.html#deploy-v2
22: *
23: * @since 1.0.0
24: */
25: public enum PackageMetrics implements DeviceAppMetrics {
26:
27: /**
28: * Application identifier.
29: *
30: * @since 1.0.0
31: */
32: APP_ID("DEPLOY"),
33:
34: /**
35: * Application version.
36: *
37: * @since 1.0.0
38: */
39: APP_VERSION("V2"),
40:
41: //
42: // Commons metrics
43: /**
44: * Operation identifier metric name.
45: *
46: * @since 1.0.0
47: */
48: APP_METRIC_PACKAGE_OPERATION_ID("job.id"),
49:
50: /**
51: * Device reboot metric name.
52: *
53: * @since 1.0.0
54: */
55: APP_METRIC_PACKAGE_REBOOT("dp.reboot"),
56:
57: /**
58: * Reboot delay metric name.
59: *
60: * @since 1.0.0
61: */
62: APP_METRIC_PACKAGE_REBOOT_DELAY("dp.reboot.delay"),
63:
64: //
65: // Download Exec
66:
67: /**
68: * Download package uri metric name.
69: *
70: * @since 1.0.0
71: */
72: APP_METRIC_PACKAGE_DOWNLOAD_PACKAGE_URI("dp.uri"),
73:
74: /**
75: * Download package name metric name.
76: *
77: * @since 1.0.0
78: */
79: APP_METRIC_PACKAGE_DOWNLOAD_PACKAGE_NAME(Constants.DP_NAME),
80:
81: /**
82: * Download package version metric name.
83: *
84: * @since 1.0.0
85: */
86: APP_METRIC_PACKAGE_DOWNLOAD_PACKAGE_VERSION(Constants.DP_VERSION),
87:
88: /**
89: * Download package HTTP basic auth usename metric name.
90: *
91: * @since 1.1.0
92: */
93: APP_METRIC_PACKAGE_DOWNLOAD_USERNAME("dp.download.username"),
94:
95: /**
96: * Download package HTTP basic auth password metric name.
97: *
98: * @since 1.1.0
99: */
100: APP_METRIC_PACKAGE_DOWNLOAD_PASSWORD("dp.download.password"),
101:
102: /**
103: * Dowload package file hash metric name.
104: *
105: * @since 1.1.0
106: */
107: APP_METRIC_PACKAGE_DOWNLOAD_HASH("dp.download.hash"),
108:
109: /**
110: * Download package protocol metric name.
111: *
112: * @since 1.0.0
113: */
114: APP_METRIC_PACKAGE_DOWNLOAD_PROTOCOL("dp.download.protocol"),
115:
116: /**
117: * Download package install metric name.
118: *
119: * @since 1.0.0
120: */
121: APP_METRIC_PACKAGE_DOWNLOAD_INSTALL("dp.install"),
122:
123: /**
124: * Download package install .sh metric name.
125: *
126: * @since 1.1.0
127: */
128: APP_METRIC_PACKAGE_DOWNLOAD_INSTALL_SYSTEM_UPDATE("dp.install.system.update"),
129:
130: /**
131: * Download package installer verifier metric name.
132: *
133: * @since 1.1.0
134: */
135: APP_METRIC_PACKAGE_DOWNLOAD_INSTALL_VERIFIER_URI("dp.install.verifier.uri"),
136:
137: /**
138: * Download package download force metric name.
139: *
140: * @since 1.2.0
141: */
142: APP_METRIC_PACKAGE_DOWNLOAD_FORCE("dp.download.force"),
143:
144: /**
145: * Download package download block size metric name.
146: *
147: * @since 1.1.0
148: */
149: APP_METRIC_PACKAGE_DOWNLOAD_BLOCK_SIZE("dp.download.block.size"),
150:
151: /**
152: * Download package download block delay metric name.
153: *
154: * @since 1.1.0
155: */
156: APP_METRIC_PACKAGE_DOWNLOAD_BLOCK_DELAY("dp.download.block.delay"),
157:
158: /**
159: * Download package download block timeout metric name.
160: *
161: * @since 1.1.0
162: */
163: APP_METRIC_PACKAGE_DOWNLOAD_TIMEOUT("dp.download.timeout"),
164:
165: /**
166: * Download package notify block size metric name.
167: *
168: * @since 1.1.0
169: */
170: APP_METRIC_PACKAGE_DOWNLOAD_NOTIFY_BLOCK_SIZE("dp.download.notify.block.size"),
171:
172: //
173: // Download Get
174:
175: /**
176: * Download get download size metric name.
177: *
178: * @since 1.0.0
179: */
180: APP_METRIC_PACKAGE_DOWNLOAD_SIZE("dp.download.size"),
181:
182: /**
183: * Download get download status metric name.
184: *
185: * @since 1.0.0
186: */
187: APP_METRIC_PACKAGE_DOWNLOAD_STATUS("dp.download.status"),
188:
189: /**
190: * Download get download progress metric name.
191: *
192: * @since 1.0.0
193: */
194: APP_METRIC_PACKAGE_DOWNLOAD_PROGRESS("dp.download.progress"),
195:
196: //
197: // Install Exec
198:
199: /**
200: * Install package name metric name.
201: *
202: * @since 1.0.0
203: */
204: APP_METRIC_PACKAGE_INSTALL_PACKAGE_NAME(Constants.DP_NAME),
205:
206: /**
207: * Install package version metric name.
208: *
209: * @since 1.0.0
210: */
211: APP_METRIC_PACKAGE_INSTALL_PACKAGE_VERSION(Constants.DP_VERSION),
212:
213: /**
214: * Install package system update metric name.
215: *
216: * @since 1.0.0
217: */
218: APP_METRIC_PACKAGE_INSTALL_SYS_UPDATE("dp.install.system.update"),
219:
220: //
221: // Request exec uninstall
222:
223: /**
224: * Uninstall package name metric name.
225: *
226: * @since 1.0.0
227: */
228: APP_METRIC_PACKAGE_UNINSTALL_PACKAGE_NAME(Constants.DP_NAME),
229:
230: /**
231: * Uninstall package version metric name.
232: *
233: * @since 1.0.0
234: */
235: APP_METRIC_PACKAGE_UNINSTALL_PACKAGE_VERSION(Constants.DP_VERSION);
236:
237: /**
238: * The name of the metric.
239: *
240: * @since 1.0.0
241: */
242: private final String name;
243:
244: /**
245: * Constructor.
246: *
247: * @param name The name of the metric.
248: * @since 1.0.0
249: */
250: PackageMetrics(String name) {
251: this.name = name;
252: }
253:
254: /**
255: * Gets the value property associated to this specific enumeration key.
256: *
257: * @return the value property associated to this specific enumeration key.
258: * @since 1.0.0
259: * @deprecated Since 1.2.0. Renamed to {@link #getName()}.
260: */
261: @Deprecated
262: public String getValue() {
263: return getName();
264: }
265:
266: @Override
267: public String getName() {
268: return name;
269: }
270:
271: @Override
272: public String toString() {
273: return getName();
274: }
275:
276: protected static class Constants {
277: protected static final String DP_NAME = "dp.name";
278: protected static final String DP_VERSION = "dp.version";
279: }
280:
281: }