Skip to content

Package: ManagementOperationNotificationImpl

ManagementOperationNotificationImpl

nameinstructionbranchcomplexitylinemethod
ManagementOperationNotificationImpl()
M: 3 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
ManagementOperationNotificationImpl(KapuaId)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
ManagementOperationNotificationImpl(ManagementOperationNotification)
M: 28 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 8 C: 0
0%
M: 1 C: 0
0%
getMessage()
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%
getOperationId()
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%
getProgress()
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%
getResource()
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%
getSentOn()
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%
getStatus()
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%
setMessage(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setOperationId(KapuaId)
M: 5 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setProgress(Integer)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setResource(String)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setSentOn(Date)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%
setStatus(DeviceManagementOperationStatus)
M: 4 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 2 C: 0
0%
M: 1 C: 0
0%

Coverage

1: /*******************************************************************************
2: * Copyright (c) 2017, 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.management.registry.operation.notification.internal;
14:
15: import org.eclipse.kapua.commons.model.AbstractKapuaEntity;
16: import org.eclipse.kapua.commons.model.id.KapuaEid;
17: import org.eclipse.kapua.model.id.KapuaId;
18: import org.eclipse.kapua.service.device.management.registry.operation.DeviceManagementOperationStatus;
19: import org.eclipse.kapua.service.device.management.registry.operation.notification.ManagementOperationNotification;
20:
21: import javax.persistence.AttributeOverride;
22: import javax.persistence.AttributeOverrides;
23: import javax.persistence.Basic;
24: import javax.persistence.Column;
25: import javax.persistence.Embedded;
26: import javax.persistence.Entity;
27: import javax.persistence.EnumType;
28: import javax.persistence.Enumerated;
29: import javax.persistence.Table;
30: import javax.persistence.Temporal;
31: import javax.persistence.TemporalType;
32: import java.util.Date;
33:
34: @Entity(name = "DeviceManagementOperationNotification")
35: @Table(name = "dvcm_device_management_operation_notification")
36: public class ManagementOperationNotificationImpl extends AbstractKapuaEntity implements ManagementOperationNotification {
37:
38: @Embedded
39: @AttributeOverrides({
40: @AttributeOverride(name = "eid", column = @Column(name = "operation_id", nullable = false, updatable = false))
41: })
42: private KapuaEid operationId;
43:
44: @Temporal(TemporalType.TIMESTAMP)
45: @Column(name = "sent_on", nullable = false, updatable = false)
46: private Date sentOn;
47:
48: @Enumerated(EnumType.STRING)
49: @Column(name = "status", nullable = false, updatable = false)
50: private DeviceManagementOperationStatus status;
51:
52: @Basic
53: @Column(name = "resource", nullable = false, updatable = false)
54: private String resource;
55:
56: @Basic
57: @Column(name = "progress", nullable = false, updatable = false)
58: private Integer progress;
59:
60: @Basic
61: @Column(name = "message", nullable = true, updatable = false)
62: private String message;
63:
64: /**
65: * Constructor.
66: *
67: * @since 1.0.0
68: */
69: public ManagementOperationNotificationImpl() {
70: super();
71: }
72:
73: /**
74: * Constructor.
75: *
76: * @param scopeId The scope {@link KapuaId}.
77: * @since 1.0.0
78: */
79: public ManagementOperationNotificationImpl(KapuaId scopeId) {
80: super(scopeId);
81: }
82:
83: /**
84: * Clone constructor.
85: *
86: * @param managementOperationNotification The {@link ManagementOperationNotification} to clone.
87: * @since 1.1.0
88: */
89: public ManagementOperationNotificationImpl(ManagementOperationNotification managementOperationNotification) {
90: super(managementOperationNotification);
91:
92: setOperationId(managementOperationNotification.getOperationId());
93: setSentOn(managementOperationNotification.getSentOn());
94: setStatus(managementOperationNotification.getStatus());
95: setResource(managementOperationNotification.getResource());
96: setProgress(managementOperationNotification.getProgress());
97: setMessage(managementOperationNotification.getMessage());
98: }
99:
100: @Override
101: public KapuaId getOperationId() {
102: return operationId;
103: }
104:
105: @Override
106: public void setOperationId(KapuaId operationId) {
107: this.operationId = KapuaEid.parseKapuaId(operationId);
108: }
109:
110: @Override
111: public Date getSentOn() {
112: return sentOn;
113: }
114:
115: @Override
116: public void setSentOn(Date sentOn) {
117: this.sentOn = sentOn;
118: }
119:
120: @Override
121: public DeviceManagementOperationStatus getStatus() {
122: return status;
123: }
124:
125: @Override
126: public void setStatus(DeviceManagementOperationStatus status) {
127: this.status = status;
128: }
129:
130: @Override
131: public String getResource() {
132: return resource;
133: }
134:
135: @Override
136: public void setResource(String resource) {
137: this.resource = resource;
138: }
139:
140: @Override
141: public Integer getProgress() {
142: return progress;
143: }
144:
145: @Override
146: public void setProgress(Integer progress) {
147: this.progress = progress;
148: }
149:
150: @Override
151: public String getMessage() {
152: return message;
153: }
154:
155: @Override
156: public void setMessage(String message) {
157: this.message = message;
158: }
159: }