Skip to content

Package: DeviceEvent

DeviceEvent

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.event;
14:
15: import org.eclipse.kapua.message.KapuaPosition;
16: import org.eclipse.kapua.model.KapuaEntity;
17: import org.eclipse.kapua.model.id.KapuaId;
18: import org.eclipse.kapua.model.id.KapuaIdAdapter;
19: import org.eclipse.kapua.model.xml.DateXmlAdapter;
20: import org.eclipse.kapua.service.device.management.message.KapuaMethod;
21: import org.eclipse.kapua.service.device.management.message.response.KapuaResponseCode;
22:
23: import javax.xml.bind.annotation.XmlAccessType;
24: import javax.xml.bind.annotation.XmlAccessorType;
25: import javax.xml.bind.annotation.XmlElement;
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.Date;
30:
31: /**
32: * {@link DeviceEvent} entity definition.
33: *
34: * @since 1.0.0
35: */
36: @XmlRootElement(name = "deviceEvent")
37: @XmlAccessorType(XmlAccessType.PROPERTY)
38: @XmlType(propOrder = { //
39: "deviceId", //
40: "sentOn", //
41: "receivedOn", //
42: "position", //
43: "resource", //
44: "action", //
45: "responseCode", //
46: "eventMessage" //
47: }, //
48: factoryClass = DeviceEventXmlRegistry.class, //
49: factoryMethod = "newDeviceEvent")
50: public interface DeviceEvent extends KapuaEntity {
51:
52: String TYPE = "deviceEvent";
53:
54: @Override
55: default String getType() {
56: return TYPE;
57: }
58:
59: /**
60: * Get the device identifier
61: *
62: * @return The device identifier.
63: * @since 1.0.0
64: */
65: @XmlElement(name = "deviceId")
66: @XmlJavaTypeAdapter(KapuaIdAdapter.class)
67: KapuaId getDeviceId();
68:
69: /**
70: * Set the device identifier
71: *
72: * @param deviceId
73: * @since 1.0.0
74: */
75: void setDeviceId(KapuaId deviceId);
76:
77: /**
78: * Get the sent on date
79: *
80: * @return
81: * @since 1.0.0
82: */
83: @XmlElement(name = "sentOn")
84: @XmlJavaTypeAdapter(DateXmlAdapter.class)
85: Date getSentOn();
86:
87: /**
88: * Set the sent on date
89: *
90: * @param sentOn
91: * @since 1.0.0
92: */
93: void setSentOn(Date sentOn);
94:
95: /**
96: * Get the received on date
97: *
98: * @return
99: * @since 1.0.0
100: */
101: @XmlElement(name = "receivedOn")
102: @XmlJavaTypeAdapter(DateXmlAdapter.class)
103: Date getReceivedOn();
104:
105: /**
106: * Set the received on date
107: *
108: * @param receivedOn
109: * @since 1.0.0
110: */
111: void setReceivedOn(Date receivedOn);
112:
113: /**
114: * Get the device position
115: *
116: * @return
117: * @since 1.0.0
118: */
119: @XmlElement(name = "position")
120: KapuaPosition getPosition();
121:
122: /**
123: * Set the device position
124: *
125: * @param position
126: * @since 1.0.0
127: */
128: void setPosition(KapuaPosition position);
129:
130: /**
131: * Get resource
132: *
133: * @return
134: * @since 1.0.0
135: */
136: @XmlElement(name = "resource")
137: String getResource();
138:
139: /**
140: * Set resource
141: *
142: * @param resource
143: */
144: void setResource(String resource);
145:
146: /**
147: * Get action
148: *
149: * @return
150: * @since 1.0.0
151: */
152: @XmlElement(name = "action")
153: KapuaMethod getAction();
154:
155: /**
156: * Set action
157: *
158: * @param action
159: * @since 1.0.0
160: */
161: void setAction(KapuaMethod action);
162:
163: /**
164: * Get response code
165: *
166: * @return
167: * @since 1.0.0
168: */
169: @XmlElement(name = "responseCode")
170: KapuaResponseCode getResponseCode();
171:
172: /**
173: * Set the response code
174: *
175: * @param responseCode
176: * @since 1.0.0
177: */
178: void setResponseCode(KapuaResponseCode responseCode);
179:
180: /**
181: * Get event message
182: *
183: * @return
184: * @since 1.0.0
185: */
186: @XmlElement(name = "eventMessage")
187: String getEventMessage();
188:
189: /**
190: * Set the event message
191: *
192: * @param eventMessage
193: * @since 1.0.0
194: */
195: void setEventMessage(String eventMessage);
196:
197: }