Package: JsonDatastoreMessage
JsonDatastoreMessage
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
JsonDatastoreMessage() |
|
|
|
|
|
||||||||||||||||||||
JsonDatastoreMessage(DatastoreMessage) |
|
|
|
|
|
||||||||||||||||||||
getDatastoreId() |
|
|
|
|
|
||||||||||||||||||||
getTimestamp() |
|
|
|
|
|
||||||||||||||||||||
setDatastoreId(StorableId) |
|
|
|
|
|
||||||||||||||||||||
setTimestamp(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.service.datastore.model.DatastoreMessage;
16: import org.eclipse.kapua.service.storable.model.Storable;
17: import org.eclipse.kapua.service.storable.model.id.StorableId;
18: import org.eclipse.kapua.service.storable.model.id.StorableIdXmlAdapter;
19:
20: import javax.xml.bind.annotation.XmlAccessType;
21: import javax.xml.bind.annotation.XmlAccessorType;
22: import javax.xml.bind.annotation.XmlElement;
23: import javax.xml.bind.annotation.XmlRootElement;
24: import javax.xml.bind.annotation.adapters.XmlJavaTypeAdapter;
25: import java.util.Date;
26:
27: @XmlRootElement(name = "message")
28: @XmlAccessorType(XmlAccessType.PROPERTY)
29: public class JsonDatastoreMessage extends JsonKapuaDataMessage implements Storable {
30:
31: private StorableId datastoreId;
32:
33: private Date timestamp;
34:
35: public JsonDatastoreMessage() {
36: super();
37: }
38:
39: public JsonDatastoreMessage(DatastoreMessage datastoreMessage) {
40: super();
41:
42: setId(datastoreMessage.getId());
43: setDatastoreId(datastoreMessage.getDatastoreId());
44: setTimestamp(datastoreMessage.getTimestamp());
45:
46: setScopeId(datastoreMessage.getScopeId());
47: setDeviceId(datastoreMessage.getDeviceId());
48: setClientId(datastoreMessage.getClientId());
49:
50: setReceivedOn(datastoreMessage.getReceivedOn());
51: setSentOn(datastoreMessage.getSentOn());
52: setCapturedOn(datastoreMessage.getCapturedOn());
53:
54: setPosition(datastoreMessage.getPosition());
55: setChannel(datastoreMessage.getChannel());
56: setPayload(datastoreMessage.getPayload());
57: }
58:
59: @XmlElement(name = "datastoreId")
60: @XmlJavaTypeAdapter(StorableIdXmlAdapter.class)
61: public StorableId getDatastoreId() {
62: return datastoreId;
63: }
64:
65: public void setDatastoreId(StorableId datastoreId) {
66: this.datastoreId = datastoreId;
67: }
68:
69: @XmlElement(name = "timestamp")
70: public Date getTimestamp() {
71: return timestamp;
72: }
73:
74: public void setTimestamp(Date timestamp) {
75: this.timestamp = timestamp;
76: }
77: }