Package: JsonKapuaDataMessage
JsonKapuaDataMessage
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
JsonKapuaDataMessage() |
|
|
|
|
|
||||||||||||||||||||
JsonKapuaDataMessage(KapuaDataMessage) |
|
|
|
|
|
||||||||||||||||||||
getCapturedOn() |
|
|
|
|
|
||||||||||||||||||||
getChannel() |
|
|
|
|
|
||||||||||||||||||||
getClientId() |
|
|
|
|
|
||||||||||||||||||||
getDeviceId() |
|
|
|
|
|
||||||||||||||||||||
getId() |
|
|
|
|
|
||||||||||||||||||||
getPayload() |
|
|
|
|
|
||||||||||||||||||||
getPosition() |
|
|
|
|
|
||||||||||||||||||||
getReceivedOn() |
|
|
|
|
|
||||||||||||||||||||
getScopeId() |
|
|
|
|
|
||||||||||||||||||||
getSentOn() |
|
|
|
|
|
||||||||||||||||||||
setCapturedOn(Date) |
|
|
|
|
|
||||||||||||||||||||
setChannel(KapuaDataChannel) |
|
|
|
|
|
||||||||||||||||||||
setClientId(String) |
|
|
|
|
|
||||||||||||||||||||
setDeviceId(KapuaId) |
|
|
|
|
|
||||||||||||||||||||
setId(UUID) |
|
|
|
|
|
||||||||||||||||||||
setPayload(JsonKapuaPayload) |
|
|
|
|
|
||||||||||||||||||||
setPayload(KapuaPayload) |
|
|
|
|
|
||||||||||||||||||||
setPosition(KapuaPosition) |
|
|
|
|
|
||||||||||||||||||||
setReceivedOn(Date) |
|
|
|
|
|
||||||||||||||||||||
setScopeId(KapuaId) |
|
|
|
|
|
||||||||||||||||||||
setSentOn(Date) |
|
|
|
|
|
Coverage
1: /*******************************************************************************
2: * Copyright (c) 2018, 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.app.api.core.model.data;
14:
15: import org.eclipse.kapua.app.api.core.model.message.JsonKapuaPayload;
16: import org.eclipse.kapua.message.KapuaPayload;
17: import org.eclipse.kapua.message.KapuaPosition;
18: import org.eclipse.kapua.message.device.data.KapuaDataChannel;
19: import org.eclipse.kapua.message.device.data.KapuaDataMessage;
20: import org.eclipse.kapua.model.id.KapuaId;
21: import org.eclipse.kapua.model.id.KapuaIdAdapter;
22:
23: import javax.xml.bind.annotation.XmlElement;
24: import javax.xml.bind.annotation.XmlTransient;
25: import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
26: import java.util.Date;
27: import java.util.UUID;
28:
29: public class JsonKapuaDataMessage {
30:
31: private UUID id;
32:
33: private KapuaId scopeId;
34: private KapuaId deviceId;
35: private String clientId;
36:
37: private Date receivedOn;
38: private Date sentOn;
39: private Date capturedOn;
40:
41: private KapuaPosition position;
42: private KapuaDataChannel channel;
43: private JsonKapuaPayload payload;
44:
45: public JsonKapuaDataMessage() {
46: }
47:
48: public JsonKapuaDataMessage(KapuaDataMessage kapuaDataMessage) {
49: setId(kapuaDataMessage.getId());
50:
51: setScopeId(kapuaDataMessage.getScopeId());
52: setDeviceId(kapuaDataMessage.getDeviceId());
53: setClientId(kapuaDataMessage.getClientId());
54:
55: setReceivedOn(kapuaDataMessage.getReceivedOn());
56: setSentOn(kapuaDataMessage.getSentOn());
57: setCapturedOn(kapuaDataMessage.getCapturedOn());
58:
59: setPosition(kapuaDataMessage.getPosition());
60: setChannel(kapuaDataMessage.getChannel());
61: setPayload(kapuaDataMessage.getPayload());
62: }
63:
64: @XmlElement(name = "id")
65: public UUID getId() {
66: return id;
67: }
68:
69: public void setId(UUID id) {
70: this.id = id;
71: }
72:
73: @XmlElement(name = "scopeId")
74: @XmlJavaTypeAdapter(KapuaIdAdapter.class)
75: public KapuaId getScopeId() {
76: return scopeId;
77: }
78:
79: public void setScopeId(KapuaId scopeId) {
80: this.scopeId = scopeId;
81: }
82:
83: @XmlElement(name = "deviceId")
84: @XmlJavaTypeAdapter(KapuaIdAdapter.class)
85: public KapuaId getDeviceId() {
86: return deviceId;
87: }
88:
89: public void setDeviceId(KapuaId deviceId) {
90: this.deviceId = deviceId;
91: }
92:
93: @XmlElement(name = "clientId")
94: public String getClientId() {
95: return clientId;
96: }
97:
98: public void setClientId(String clientId) {
99: this.clientId = clientId;
100: }
101:
102: @XmlElement(name = "receivedOn")
103: public Date getReceivedOn() {
104: return receivedOn;
105: }
106:
107: public void setReceivedOn(Date receivedOn) {
108: this.receivedOn = receivedOn;
109: }
110:
111: @XmlElement(name = "sentOn")
112: public Date getSentOn() {
113: return sentOn;
114: }
115:
116: public void setSentOn(Date sentOn) {
117: this.sentOn = sentOn;
118: }
119:
120: @XmlElement(name = "capturedOn")
121: public Date getCapturedOn() {
122: return capturedOn;
123: }
124:
125: public void setCapturedOn(Date capturedOn) {
126: this.capturedOn = capturedOn;
127: }
128:
129: @XmlElement(name = "position")
130: public KapuaPosition getPosition() {
131: return position;
132: }
133:
134: public void setPosition(KapuaPosition position) {
135: this.position = position;
136: }
137:
138: @XmlElement(name = "channel")
139: public KapuaDataChannel getChannel() {
140: return channel;
141: }
142:
143: public void setChannel(KapuaDataChannel channel) {
144: this.channel = channel;
145: }
146:
147: @XmlElement(name = "payload")
148: public JsonKapuaPayload getPayload() {
149: return payload;
150: }
151:
152: public void setPayload(JsonKapuaPayload payload) {
153: this.payload = payload;
154: }
155:
156: @XmlTransient
157: public void setPayload(KapuaPayload payload) {
158: setPayload(new JsonKapuaPayload(payload));
159: }
160: }