Package: JobStepFactoryImpl
JobStepFactoryImpl
name | instruction | branch | complexity | line | method | ||||||||||||||||||||
---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
JobStepFactoryImpl() |
|
|
|
|
|
||||||||||||||||||||
clone(JobStep) |
|
|
|
|
|
||||||||||||||||||||
newCreator(KapuaId) |
|
|
|
|
|
||||||||||||||||||||
newEntity(KapuaId) |
|
|
|
|
|
||||||||||||||||||||
newListResult() |
|
|
|
|
|
||||||||||||||||||||
newQuery(KapuaId) |
|
|
|
|
|
||||||||||||||||||||
newStepProperty(String, String, String) |
|
|
|
|
|
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.job.step.internal;
14:
15: import org.eclipse.kapua.KapuaEntityCloneException;
16: import org.eclipse.kapua.locator.KapuaProvider;
17: import org.eclipse.kapua.model.id.KapuaId;
18: import org.eclipse.kapua.service.job.step.JobStep;
19: import org.eclipse.kapua.service.job.step.JobStepCreator;
20: import org.eclipse.kapua.service.job.step.JobStepFactory;
21: import org.eclipse.kapua.service.job.step.JobStepListResult;
22: import org.eclipse.kapua.service.job.step.JobStepQuery;
23: import org.eclipse.kapua.service.job.step.definition.JobStepProperty;
24: import org.eclipse.kapua.service.job.step.definition.internal.JobStepPropertyImpl;
25:
26: /**
27: * {@link JobStepFactory} implementation.
28: *
29: * @since 1.0.0
30: */
31: @KapuaProvider
32: public class JobStepFactoryImpl implements JobStepFactory {
33:
34: @Override
35: public JobStep newEntity(KapuaId scopeId) {
36: return new JobStepImpl(scopeId);
37: }
38:
39: @Override
40: public JobStepCreator newCreator(KapuaId scopeId) {
41: return new JobStepCreatorImpl(scopeId);
42: }
43:
44: @Override
45: public JobStepQuery newQuery(KapuaId scopeId) {
46: return new JobStepQueryImpl(scopeId);
47: }
48:
49: @Override
50: public JobStepListResult newListResult() {
51: return new JobStepListResultImpl();
52: }
53:
54: @Override
55: public JobStepProperty newStepProperty(String name, String propertyType, String propertyValue) {
56: return new JobStepPropertyImpl(name, propertyType, propertyValue, null);
57: }
58:
59: @Override
60: public JobStep clone(JobStep jobStep) {
61: try {
62: return new JobStepImpl(jobStep);
63: } catch (Exception e) {
64: throw new KapuaEntityCloneException(e, JobStep.TYPE, jobStep);
65: }
66: }
67: }