Skip to content

Package: Device

Device

nameinstructionbranchcomplexitylinemethod
getType()
M: 2 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.registry;
14:
15: import org.eclipse.kapua.model.KapuaUpdatableEntity;
16: import org.eclipse.kapua.model.id.KapuaId;
17: import org.eclipse.kapua.model.id.KapuaIdAdapter;
18: import org.eclipse.kapua.service.authorization.group.Group;
19: import org.eclipse.kapua.service.device.registry.connection.DeviceConnection;
20: import org.eclipse.kapua.service.device.registry.event.DeviceEvent;
21:
22: import javax.xml.bind.annotation.XmlAccessType;
23: import javax.xml.bind.annotation.XmlAccessorType;
24: import javax.xml.bind.annotation.XmlElement;
25: import javax.xml.bind.annotation.XmlElementWrapper;
26: import javax.xml.bind.annotation.XmlRootElement;
27: import javax.xml.bind.annotation.XmlType;
28: import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
29: import java.util.List;
30: import java.util.Set;
31:
32: /**
33: * {@link Device} is an object representing a device or gateway connected to the Kapua platform.<br>
34: * The {@link Device} object contains several attributes regarding the Device itself and its software configuration.<br>
35: * {@link Device} contains also references to {@link DeviceConnection} and the last {@link DeviceEvent}.
36: *
37: * @since 1.0.0
38: */
39: @XmlRootElement(name = "device")
40: @XmlAccessorType(XmlAccessType.PROPERTY)
41: @XmlType(propOrder = {
42: "groupId",
43: "clientId",
44: "connectionId",
45: "connection",
46: "status",
47: "displayName",
48: "lastEventId",
49: "lastEvent",
50: "serialNumber",
51: "modelId",
52: "modelName",
53: "imei",
54: "imsi",
55: "iccid",
56: "biosVersion",
57: "firmwareVersion",
58: "osVersion",
59: "jvmVersion",
60: "osgiFrameworkVersion",
61: "applicationFrameworkVersion",
62: "connectionInterface",
63: "connectionIp",
64: "applicationIdentifiers",
65: "acceptEncoding",
66: "customAttribute1",
67: "customAttribute2",
68: "customAttribute3",
69: "customAttribute4",
70: "customAttribute5",
71: "extendedProperties",
72: "tagIds"
73: }, factoryClass = DeviceXmlRegistry.class, factoryMethod = "newDevice")
74: public interface Device extends KapuaUpdatableEntity {
75:
76: String TYPE = "device";
77:
78: @Override
79: default String getType() {
80: return TYPE;
81: }
82:
83: /**
84: * Gets the set of Tag id assigned to this entity.
85: *
86: * @return The set Tag id assigned to this entity.
87: * @since 1.0.0
88: */
89: @XmlElementWrapper(name = "tagIds")
90: @XmlElement(name = "tagId")
91: @XmlJavaTypeAdapter(KapuaIdAdapter.class)
92: Set<KapuaId> getTagIds();
93:
94: /**
95: * Sets the set of Tag id of this entity.
96: *
97: * @param tagIds The set Tag id to assign.
98: * @since 1.0.0
99: */
100: void setTagIds(Set<KapuaId> tagIds);
101:
102: /**
103: * Gets the {@link Group#getId()}.
104: *
105: * @return The {@link Group#getId()}.
106: * @since 1.0.0
107: */
108: @XmlElement(name = "groupId")
109: @XmlJavaTypeAdapter(KapuaIdAdapter.class)
110: KapuaId getGroupId();
111:
112: /**
113: * Sets the {@link Group#getId()}.
114: *
115: * @param groupId The {@link Group#getId()}.
116: * @since 1.0.0
117: */
118: void setGroupId(KapuaId groupId);
119:
120: /**
121: * Gets the client identifier.
122: *
123: * @return The client identifier.
124: * @since 1.0.0
125: */
126: @XmlElement(name = "clientId")
127: String getClientId();
128:
129: /**
130: * Sets the client identifier.
131: *
132: * @param clientId The client identifier.
133: * @since 1.0.0
134: */
135: void setClientId(String clientId);
136:
137: /**
138: * Gets the {@link DeviceConnection#getId()}.
139: *
140: * @return The {@link DeviceConnection#getId()}.
141: * @since 1.0.0
142: */
143: @XmlElement(name = "connectionId")
144: @XmlJavaTypeAdapter(KapuaIdAdapter.class)
145: KapuaId getConnectionId();
146:
147: /**
148: * Sets the {@link DeviceConnection#getId()}.
149: *
150: * @param connectionId The {@link DeviceConnection#getId()}.
151: * @since 1.0.0
152: */
153: void setConnectionId(KapuaId connectionId);
154:
155: /**
156: * Gets the {@link DeviceConnection}.
157: *
158: * @return The {@link DeviceConnection}.
159: * @since 1.0.0
160: */
161: @XmlElement(name = "connection")
162: DeviceConnection getConnection();
163:
164: /**
165: * Gets the {@link DeviceStatus}.
166: *
167: * @return The {@link DeviceStatus}.
168: * @since 1.0.0
169: */
170: @XmlElement(name = "status")
171: DeviceStatus getStatus();
172:
173: /**
174: * Sets the {@link DeviceStatus}.
175: *
176: * @param status The {@link DeviceStatus}.
177: * @since 1.0.0
178: */
179: void setStatus(DeviceStatus status);
180:
181: /**
182: * Gets the display name.
183: *
184: * @return The display name.
185: * @since 1.0.0
186: */
187: @XmlElement(name = "displayName")
188: String getDisplayName();
189:
190: /**
191: * Sets the display name.
192: *
193: * @param diplayName The display name.
194: * @since 1.0.0
195: */
196: void setDisplayName(String diplayName);
197:
198: /**
199: * Gets the last {@link DeviceEvent#getId()}.
200: *
201: * @return The last {@link DeviceEvent#getId()}.
202: * @since 1.0.0
203: */
204: @XmlElement(name = "lastEventId")
205: @XmlJavaTypeAdapter(KapuaIdAdapter.class)
206: KapuaId getLastEventId();
207:
208: /**
209: * Sets the last {@link DeviceEvent#getId()}.
210: *
211: * @param lastEventId The last {@link DeviceEvent#getId()}.
212: * @since 1.0.0
213: */
214: void setLastEventId(KapuaId lastEventId);
215:
216: /**
217: * Gets the last {@link DeviceEvent}.
218: *
219: * @return The last {@link DeviceEvent}.
220: * @since 1.0.0
221: */
222: @XmlElement(name = "lastEvent")
223: DeviceEvent getLastEvent();
224:
225: /**
226: * Gets the serial number.
227: *
228: * @return The serial number.
229: * @since 1.0.0
230: */
231: @XmlElement(name = "serialNumber")
232: String getSerialNumber();
233:
234: /**
235: * Sets the serial number.
236: *
237: * @param serialNumber The serial number.
238: * @since 1.0.0
239: */
240: void setSerialNumber(String serialNumber);
241:
242: /**
243: * Gets the model identifier.
244: *
245: * @return The model identifier.
246: * @since 1.0.0
247: */
248: @XmlElement(name = "modelId")
249: String getModelId();
250:
251: /**
252: * Sets the model identifier.
253: *
254: * @param modelId The model identifier.
255: * @since 1.0.0
256: */
257: void setModelId(String modelId);
258:
259: /**
260: * Gets the model name.
261: *
262: * @return The model name.
263: * @since 1.0.0
264: */
265: @XmlElement(name = "modelName")
266: String getModelName();
267:
268: /**
269: * Sets the model name.
270: *
271: * @param modelName The model name.
272: * @since 1.0.0
273: */
274: void setModelName(String modelName);
275:
276: /**
277: * Gets the modem imei.
278: *
279: * @return The modem imei.
280: * @since 1.0.0
281: */
282: @XmlElement(name = "imei")
283: String getImei();
284:
285: /**
286: * Sets the modem imei.
287: *
288: * @param imei The modem imei.
289: * @since 1.0.0
290: */
291: void setImei(String imei);
292:
293: /**
294: * Gets the modem imsi.
295: *
296: * @return The modem imsi.
297: * @since 1.0.0
298: */
299: @XmlElement(name = "imsi")
300: String getImsi();
301:
302: /**
303: * Sets the modem imsi.
304: *
305: * @param imsi The modem imsi.
306: * @since 1.0.0
307: */
308: void setImsi(String imsi);
309:
310: /**
311: * Gets the modem iccid.
312: *
313: * @return The modem iccid.
314: * @since 1.0.0
315: */
316: @XmlElement(name = "iccid")
317: String getIccid();
318:
319: /**
320: * Sets the modem iccid.
321: *
322: * @param iccid The modem iccid.
323: * @since 1.0.0
324: */
325: void setIccid(String iccid);
326:
327: /**
328: * Gets the bios version.
329: *
330: * @return The bios version.
331: * @since 1.0.0
332: */
333: @XmlElement(name = "biosVersion")
334: String getBiosVersion();
335:
336: /**
337: * Sets the bios version.
338: *
339: * @param biosVersion The bios version.
340: * @since 1.0.0
341: */
342: void setBiosVersion(String biosVersion);
343:
344: /**
345: * Gets the firmware version.
346: *
347: * @return The firmware version.
348: * @since 1.0.0
349: */
350: @XmlElement(name = "firmwareVersion")
351: String getFirmwareVersion();
352:
353: /**
354: * Sets the firmware version.
355: *
356: * @param firmwareVersion The firmware version.
357: * @since 1.0.0
358: */
359: void setFirmwareVersion(String firmwareVersion);
360:
361: /**
362: * Gets the OS version.
363: *
364: * @return The OS version.
365: * @since 1.0.0
366: */
367: @XmlElement(name = "osVersion")
368: String getOsVersion();
369:
370: /**
371: * Sets the OS version.
372: *
373: * @param osVersion The OS version.
374: * @since 1.0.0
375: */
376: void setOsVersion(String osVersion);
377:
378: /**
379: * Gets the JVM version.
380: *
381: * @return The JVM version.
382: * @since 1.0.0
383: */
384: @XmlElement(name = "jvmVersion")
385: String getJvmVersion();
386:
387: /**
388: * Sets the JVM version.
389: *
390: * @param jvmVersion The JVM version.
391: * @since 1.0.0
392: */
393: void setJvmVersion(String jvmVersion);
394:
395: /**
396: * Gets the OSGi framework version.
397: *
398: * @return The OSGi framework version.
399: * @since 1.0.0
400: */
401: @XmlElement(name = "osgiFrameworkVersion")
402: String getOsgiFrameworkVersion();
403:
404: /**
405: * Sets the OSGi framework version.
406: *
407: * @param osgiFrameworkVersion The OSGi framework version.
408: * @since 1.0.0
409: */
410: void setOsgiFrameworkVersion(String osgiFrameworkVersion);
411:
412: /**
413: * Gets the application framework version.
414: *
415: * @return The application framework version.
416: * @since 1.0.0
417: */
418: @XmlElement(name = "applicationFrameworkVersion")
419: String getApplicationFrameworkVersion();
420:
421: /**
422: * Sets the application framework version.
423: *
424: * @param appFrameworkVersion The application framework version.
425: * @since 1.0.0
426: */
427: void setApplicationFrameworkVersion(String appFrameworkVersion);
428:
429: /**
430: * Gets the device network interfaces name.
431: *
432: * @return The device network interfaces name.
433: * @since 1.0.0
434: */
435: @XmlElement(name = "connectionInterface")
436: String getConnectionInterface();
437:
438: /**
439: * Sets the device network interfaces name.
440: *
441: * @param connectionInterface The device network interfaces name.
442: * @since 1.0.0
443: */
444: void setConnectionInterface(String connectionInterface);
445:
446: /**
447: * Gets the device network interfaces IP.
448: *
449: * @return The device network interfaces IP.
450: * @since 1.0.0
451: */
452: @XmlElement(name = "connectionIp")
453: String getConnectionIp();
454:
455: /**
456: * Sets the device network interfaces IP.
457: *
458: * @param connectionIp The device network interfaces IP.
459: * @since 1.0.0
460: */
461: void setConnectionIp(String connectionIp);
462:
463: /**
464: * Gets the application identifiers supported.
465: *
466: * @return The application identifiers supported.
467: * @since 1.0.0
468: */
469: @XmlElement(name = "applicationIdentifiers")
470: String getApplicationIdentifiers();
471:
472: /**
473: * Sets the application identifiers supported.
474: *
475: * @param applicationIdentifiers The application identifiers supported.
476: * @since 1.0.0
477: */
478: void setApplicationIdentifiers(String applicationIdentifiers);
479:
480: /**
481: * Gets the accept encodings.
482: *
483: * @return The accept encodings.
484: * @since 1.0.0
485: */
486: @XmlElement(name = "acceptEncoding")
487: String getAcceptEncoding();
488:
489: /**
490: * Sets the accept encodings.
491: *
492: * @param acceptEncoding The accept encodings.
493: * @since 1.0.0
494: */
495: void setAcceptEncoding(String acceptEncoding);
496:
497: /**
498: * Gets the custom attribute 1.
499: *
500: * @return The custom attribute 1.
501: * @since 1.0.0
502: */
503: @XmlElement(name = "customAttribute1")
504: String getCustomAttribute1();
505:
506: /**
507: * Sets the custom attribute 1.
508: *
509: * @param customAttribute1 The custom attribute 1.
510: * @since 1.0.0
511: */
512: void setCustomAttribute1(String customAttribute1);
513:
514: /**
515: * Gets the custom attribute 2.
516: *
517: * @return The custom attribute 2.
518: * @since 1.0.0
519: */
520: @XmlElement(name = "customAttribute2")
521: String getCustomAttribute2();
522:
523: /**
524: * Sets the custom attribute 2.
525: *
526: * @param customAttribute2 The custom attribute 2.
527: * @since 1.0.0
528: */
529: void setCustomAttribute2(String customAttribute2);
530:
531: /**
532: * Gets the custom attribute 3.
533: *
534: * @return The custom attribute 3.
535: * @since 1.0.0
536: */
537: @XmlElement(name = "customAttribute3")
538: String getCustomAttribute3();
539:
540: /**
541: * Sets the custom attribute 3.
542: *
543: * @param customAttribute3 The custom attribute 3.
544: * @since 1.0.0
545: */
546: void setCustomAttribute3(String customAttribute3);
547:
548: /**
549: * Gets the custom attribute 4.
550: *
551: * @return The custom attribute 4.
552: * @since 1.0.0
553: */
554: @XmlElement(name = "customAttribute4")
555: String getCustomAttribute4();
556:
557: /**
558: * Sets the custom attribute 4.
559: *
560: * @param customAttribute4 The custom attribute 4.
561: * @since 1.0.0
562: */
563: void setCustomAttribute4(String customAttribute4);
564:
565: /**
566: * Gets the custom attribute 5.
567: *
568: * @return The custom attribute 5.
569: * @since 1.0.0
570: */
571: @XmlElement(name = "customAttribute5")
572: String getCustomAttribute5();
573:
574: /**
575: * Sets the custom attribute 5.
576: *
577: * @param customAttribute5 The custom attribute 5.
578: * @since 1.0.0
579: */
580: void setCustomAttribute5(String customAttribute5);
581:
582: /**
583: * Gets the {@link DeviceExtendedProperty} {@link List}.
584: *
585: * @return The {@link DeviceExtendedProperty} {@link List}.
586: * @since 1.5.0
587: */
588: @XmlElement(name = "extendedProperties")
589: List<DeviceExtendedProperty> getExtendedProperties();
590:
591: /**
592: * Add a {@link DeviceExtendedProperty} to the {@link List}.
593: *
594: * @param extendedProperty The {@link DeviceExtendedProperty} to add.
595: * @since 1.5.0
596: */
597: void addExtendedProperty(DeviceExtendedProperty extendedProperty);
598:
599: /**
600: * Sets the {@link DeviceExtendedProperty} {@link List}.
601: *
602: * @param extendedProperties The {@link DeviceExtendedProperty} {@link List}.
603: * @since 1.5.0
604: */
605: void setExtendedProperties(List<DeviceExtendedProperty> extendedProperties);
606: }