Package: DeviceManagementOperationCreatorImpl
DeviceManagementOperationCreatorImpl
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
DeviceManagementOperationCreatorImpl(KapuaId) |
|
|
|
|
|
||||||||||||||||||||
getAction() |
|
|
|
|
|
||||||||||||||||||||
getAppId() |
|
|
|
|
|
||||||||||||||||||||
getDeviceId() |
|
|
|
|
|
||||||||||||||||||||
getInputProperties() |
|
|
|
|
|
||||||||||||||||||||
getOperationId() |
|
|
|
|
|
||||||||||||||||||||
getResource() |
|
|
|
|
|
||||||||||||||||||||
getStartedOn() |
|
|
|
|
|
||||||||||||||||||||
getStatus() |
|
|
|
|
|
||||||||||||||||||||
setAction(KapuaMethod) |
|
|
|
|
|
||||||||||||||||||||
setAppId(String) |
|
|
|
|
|
||||||||||||||||||||
setDeviceId(KapuaId) |
|
|
|
|
|
||||||||||||||||||||
setInputProperties(List) |
|
|
|
|
|
||||||||||||||||||||
setOperationId(KapuaId) |
|
|
|
|
|
||||||||||||||||||||
setResource(String) |
|
|
|
|
|
||||||||||||||||||||
setStartedOn(Date) |
|
|
|
|
|
||||||||||||||||||||
setStatus(NotifyStatus) |
|
|
|
|
|
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.internal;
14:
15: import org.eclipse.kapua.commons.model.AbstractKapuaEntityCreator;
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.message.KapuaMethod;
19: import org.eclipse.kapua.service.device.management.message.notification.NotifyStatus;
20: import org.eclipse.kapua.service.device.management.registry.operation.DeviceManagementOperation;
21: import org.eclipse.kapua.service.device.management.registry.operation.DeviceManagementOperationCreator;
22: import org.eclipse.kapua.service.device.management.registry.operation.DeviceManagementOperationProperty;
23:
24: import java.util.ArrayList;
25: import java.util.Date;
26: import java.util.List;
27:
28: public class DeviceManagementOperationCreatorImpl extends AbstractKapuaEntityCreator<DeviceManagementOperation> implements DeviceManagementOperationCreator {
29:
30: private Date startedOn;
31: private KapuaEid deviceId;
32: private KapuaEid operationId;
33: private String appId;
34: private KapuaMethod action;
35: private String resource;
36: private NotifyStatus status;
37: private List<DeviceManagementOperationProperty> inputProperties;
38:
39: public DeviceManagementOperationCreatorImpl(KapuaId scopeId) {
40: super(scopeId);
41: }
42:
43: @Override
44: public Date getStartedOn() {
45: return startedOn;
46: }
47:
48: @Override
49: public void setStartedOn(Date startedOn) {
50: this.startedOn = startedOn;
51: }
52:
53: @Override
54: public KapuaEid getDeviceId() {
55: return deviceId;
56: }
57:
58: @Override
59: public void setDeviceId(KapuaId deviceId) {
60: this.deviceId = KapuaEid.parseKapuaId(deviceId);
61: }
62:
63: @Override
64: public KapuaEid getOperationId() {
65: return operationId;
66: }
67:
68: @Override
69: public void setOperationId(KapuaId operationId) {
70: this.operationId = KapuaEid.parseKapuaId(operationId);
71: }
72:
73: @Override
74: public String getAppId() {
75: return appId;
76: }
77:
78: @Override
79: public void setAppId(String appId) {
80: this.appId = appId;
81: }
82:
83: @Override
84: public KapuaMethod getAction() {
85: return action.normalizeAction();
86: }
87:
88: @Override
89: public void setAction(KapuaMethod action) {
90: this.action = action.normalizeAction();
91: }
92:
93: @Override
94: public String getResource() {
95: return resource;
96: }
97:
98: @Override
99: public void setResource(String resource) {
100: this.resource = resource;
101: }
102:
103: @Override
104: public NotifyStatus getStatus() {
105: return status;
106: }
107:
108: @Override
109: public void setStatus(NotifyStatus status) {
110: this.status = status;
111: }
112:
113: @Override
114: public List<DeviceManagementOperationProperty> getInputProperties() {
115:• if (inputProperties == null) {
116: inputProperties = new ArrayList<>();
117: }
118:
119: return inputProperties;
120: }
121:
122: @Override
123: public void setInputProperties(List<DeviceManagementOperationProperty> inputProperties) {
124: this.inputProperties = inputProperties;
125: }
126: }