Skip to content

Package: DeviceCommandExecStepDefinition

DeviceCommandExecStepDefinition

nameinstructionbranchcomplexitylinemethod
DeviceCommandExecStepDefinition()
M: 13 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 3 C: 0
0%
M: 1 C: 0
0%
getDescription()
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%
getName()
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%
getProcessorName()
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%
getStepProperties()
M: 30 C: 0
0%
M: 0 C: 0
100%
M: 1 C: 0
0%
M: 5 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.command.job.definition;
14:
15: import org.eclipse.kapua.job.engine.commons.step.definition.AbstractTargetJobStepDefinition;
16: import org.eclipse.kapua.locator.KapuaLocator;
17: import org.eclipse.kapua.service.device.management.command.DeviceCommandInput;
18: import org.eclipse.kapua.service.device.management.command.job.DeviceCommandExecTargetProcessor;
19: import org.eclipse.kapua.service.job.step.definition.JobStepDefinition;
20: import org.eclipse.kapua.service.job.step.definition.JobStepDefinitionFactory;
21: import org.eclipse.kapua.service.job.step.definition.JobStepProperty;
22:
23: import java.util.Arrays;
24: import java.util.List;
25:
26: public class DeviceCommandExecStepDefinition extends AbstractTargetJobStepDefinition implements JobStepDefinition {
27:
28: private static final long serialVersionUID = -4994045121586264564L;
29:
30: private final KapuaLocator locator = KapuaLocator.getInstance();
31: private final JobStepDefinitionFactory jobStepDefinitionFactory = locator.getFactory(JobStepDefinitionFactory.class);
32:
33: @Override
34: public String getName() {
35: return "Command Execution";
36: }
37:
38: @Override
39: public String getDescription() {
40: return "Execution of a command using the Device Command Management Service";
41: }
42:
43: @Override
44: public String getProcessorName() {
45: return DeviceCommandExecTargetProcessor.class.getName();
46: }
47:
48: @Override
49: public List<JobStepProperty> getStepProperties() {
50:
51: JobStepProperty propertyCommandInput = jobStepDefinitionFactory.newStepProperty(
52: DeviceCommandExecPropertyKeys.COMMAND_INPUT,
53: DeviceCommandInput.class.getName(),
54: null,
55: null);
56:
57: JobStepProperty propertyTimeout = jobStepDefinitionFactory.newStepProperty(
58: DeviceCommandExecPropertyKeys.TIMEOUT,
59: Long.class.getName(),
60: "30000",
61: null);
62:
63: return Arrays.asList(propertyCommandInput, propertyTimeout);
64: }
65: }